Skip to content

Conversation

@philipaconrad
Copy link
Member

@philipaconrad philipaconrad commented Jul 31, 2025

What changed?

This PR moves an accidental package-level definition of the opa parse CLI subcommand to a local variable inside the initParse function, similar to how we do command initialization for all other OPA CLI subcommands.

Before this change, it was possible to see panics from the package variable cobra.Command in parse.go having some of its flags redefined. This fix makes it possible for make generate-cli-docs to run without error again.

How to test?

This commit moves an accidental package-level definition of the `opa
parse` CLI subcommand to a local variable inside the `initParse`
function, similar to how we do command initialization for all other OPA
CLI subcommands.

Before this change, it was possible to see panics from the package
variable `cobra.Command` having some of its flags redefined. This fix
makes it possible for `make generate-cli-docs` to run without error
again.

Signed-off-by: Philip Conrad <[email protected]>
@philipaconrad philipaconrad force-pushed the philip/fix-opa-parse branch from 3065850 to c788762 Compare July 31, 2025 19:17
@netlify
Copy link

netlify bot commented Jul 31, 2025

Deploy Preview for openpolicyagent ready!

Name Link
🔨 Latest commit 3065850
🔍 Latest deploy log https://app.netlify.com/projects/openpolicyagent/deploys/688bc0e3075f250008d29d50
😎 Deploy Preview https://deploy-preview-7813--openpolicyagent.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@philipaconrad
Copy link
Member Author

ℹ️ Rebasing through the Github Web UI, then will merge...

@philipaconrad philipaconrad enabled auto-merge (squash) July 31, 2025 19:19
@netlify
Copy link

netlify bot commented Jul 31, 2025

Deploy Preview for openpolicyagent ready!

Name Link
🔨 Latest commit c788762
🔍 Latest deploy log https://app.netlify.com/projects/openpolicyagent/deploys/688bc15631ffa8000874943f
😎 Deploy Preview https://deploy-preview-7813--openpolicyagent.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@philipaconrad philipaconrad merged commit 47e2b74 into open-policy-agent:main Jul 31, 2025
31 checks passed
philipaconrad added a commit that referenced this pull request Jul 31, 2025
This commit moves an accidental package-level definition of the `opa
parse` CLI subcommand to a local variable inside the `initParse`
function, similar to how we do command initialization for all other OPA
CLI subcommands.

Before this change, it was possible to see panics from the package
variable `cobra.Command` in `parse.go` having some of its flags redefined.
This fix makes it possible for `make generate-cli-docs` to run without
error again.

Signed-off-by: Philip Conrad <[email protected]>
(cherry picked from commit 47e2b74)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants