Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Add support for using input.yaml in Evaluate code lens #1269

Merged
merged 1 commit into from
Nov 18, 2024
Merged

Conversation

anderseknert
Copy link
Member

This addresses a request filed in the VS Code extension: open-policy-agent/vscode-opa#308

Sadly this doesn't yet work for the debug feature as OPA currently only will do JSON decoding in that path, so next step is to submit a fix for that there.

This addresses a request filed in the VS Code extension:
open-policy-agent/vscode-opa#308

Sadly this doesn't yet work for the debug feature as OPA currently
only will do JSON decoding in that path, so next step is to submit
a fix for that there.

Signed-off-by: Anders Eknert <anders@styra.com>
Copy link
Member

@charlieegan3 charlieegan3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@@ -70,20 +68,15 @@ func (p *Policy) Run(
inputContext["path_separator"] = string(os.PathSeparator)

workspacePath := uri.ToPath(opts.ClientIdentifier, opts.RootURI)
inputDotJSONPath, inputDotJSONReader := rio.FindInput(

inputDotJSONPath, inputDotJSONContent := rio.FindInput(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if it's worth saving some future confusion with the names here.

Suggested change
inputDotJSONPath, inputDotJSONContent := rio.FindInput(
inputDocumentFilePath, inputDocumentFileContent := rio.FindInput(

@anderseknert anderseknert merged commit acd22f7 into main Nov 18, 2024
5 checks passed
@anderseknert anderseknert deleted the input-yaml branch November 18, 2024 16:54
charlieegan3 pushed a commit to charlieegan3/regal that referenced this pull request Jan 6, 2025
This addresses a request filed in the VS Code extension:
open-policy-agent/vscode-opa#308

Sadly this doesn't yet work for the debug feature as OPA currently
only will do JSON decoding in that path, so next step is to submit
a fix for that there.

Signed-off-by: Anders Eknert <anders@styra.com>
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants