Skip to content

Warn Users When a Local Regal Binary for Development Isn't Found#449

Merged
anderseknert merged 2 commits into
open-policy-agent:mainfrom
SeanLedford:s_ledford/flag-bad-binary-configuration
May 29, 2026
Merged

Warn Users When a Local Regal Binary for Development Isn't Found#449
anderseknert merged 2 commits into
open-policy-agent:mainfrom
SeanLedford:s_ledford/flag-bad-binary-configuration

Conversation

@SeanLedford
Copy link
Copy Markdown
Contributor

Recently we ran into an issue where a development regal binary path was checked into source control for Regal, and there was no warning that our configuration had changed! So we were falling through to the regal version on $PATH without knowing why.

These changes add a simple warning if the configured binary path in opa.dependency_paths.regal doesn't exist, whether it be a typo, or an unintended commit (oops!)

Here's a screenshot of the new language server output and warning:

Screenshot 2026-05-27 at 3 16 07 PM

Copy link
Copy Markdown
Member

@anderseknert anderseknert left a comment

Choose a reason for hiding this comment

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

Excellent, thanks! Probably just missed something but dropped a question about it :)

Comment thread src/extension.ts
checkMissingBinaries();

// warn if the configured opa.dependency_paths.opa points to a non-existent file
const opaBinaryInfo = resolveBinary(OPA_CONFIG, "opa");
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Should this not be done for the Regal binary too?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yep, the binary was already being resolved on Regal startup though, so it didn't show up in the diff: https://github.com/open-policy-agent/vscode-opa/pull/449/changes#diff-1944111a462efb504e2d39ee24a9cb532c03164ada37caada104fecc06d874bdL156

So I just needed to add the OPA binary resolution here so I could know when to send the warning.

Add language server output and an IDE warning message when that flag is set

Signed-off-by: seanledford <s_ledford@apple.com>
… language server activation functions. This allows us to also warn for OPA binaries that aren't found at language server startup

Signed-off-by: seanledford <s_ledford@apple.com>
@anderseknert anderseknert force-pushed the s_ledford/flag-bad-binary-configuration branch from 9fcaf62 to 8d5d446 Compare May 29, 2026 11:24
@anderseknert anderseknert merged commit 247590d into open-policy-agent:main May 29, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants