Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Command to validate policy.yml #862

Open
reegnz opened this issue Oct 15, 2024 · 0 comments
Open

Command to validate policy.yml #862

reegnz opened this issue Oct 15, 2024 · 0 comments

Comments

@reegnz
Copy link

reegnz commented Oct 15, 2024

Today one can only validate .policy.yml by running a policy-bot service, and allowing whoever needs to validate to invoke the /api/validate HTTP endpoint. But the network path isn't necessarily available from every host that wants to validate the config.

Policy-bot should provide a basic cli command to validate a .policy.yml. Eg.: policy-bot validate .policy.yml. This way validation can be done fully offline (eg. no network path necessary to a policy-bot service instance).

Alternatives considered

I've considered running policy-bot locally in a github action as a service container. But I cannot just launch the container because on startup it requires a valid github app configuration, Which is overkill and hurts reuse if I want to just use it for config validation.

I also considered declaring a schema for the .policy.yml and use json schema validation. But that doesn't validate the regexes for validity.

A simple cli command to validate config would be easier on the end-users.

Context

I'm building a github action to validate .policy.yml. I don't want my action to have to call out to a policy-bot service to perform validation, as it makes the action more complex. I don't want my github action runners to have a clear network path to the policy-bot service if it's not absolutely necessary.

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

No branches or pull requests

1 participant