-
Notifications
You must be signed in to change notification settings - Fork 103
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
Error loading policy from <org>/.github #405
Comments
Sorry you're hitting this error. If you click on the "Details" link, it should show an expanded error with more context about exactly what failed. If you can share that, it should help explain what is happening. It would also help to know which version of GitHub Enterprise you are using. As far as I know, the default policy functionality works as described in our environment, so your environment might be exposing a case we did not account for. |
the error under details doesn't appear to be super-helpful:
I don't see anything useful in the policy-bot logs but perhaps enabling debug logging will yield something |
actually looking further back in the logs I see:
|
Having attempted to reproduce, I think this was just a transient problem with the GitHub API timing out. It's unfortunate that when this occurs, this results in failed policy-bot checks in repositories that previously ignored it, but this seems like the safest failure mode. |
The default behavior is problematic when the repository does not have any policy file. We have policy install on our organization but not every repository used it. When we have a timeout from github, it generates a failed status check. Is it possible to reopen this issue and find a fix to avoid blocking people's PR ? Is this a normal behavior for repositories without any policy files ? |
@NargiT I've created #506 to describe the issue where Policy Bot posts unexpected statuses due to GitHub errors. Unless the status is a required check, it should not block people's PRs, but I understand that seeing a failed status can be confusing and could cause problems for other tools that read statuses. |
After updating policy-bot from 1.23.2 to 1.24.0 I started seeing failing checks in repositories that previously ignored
policy-bot
.For context, our deployment connects to GitHub Enterprise and is enabled on all repositories in our organization. However, only one repository actually has a
.policy.yml
file. There is no default / shared policy file (no.github
repository in the organization) and so policy-bot was previously just ignored.What I see after upgrading is a failing check for all repositories in the organization that do not define a
.policy.yml
file and an error:For example:
My expectation is that the behaviour would be as described at in the README:
However, looking through the code at https://github.com/palantir/policy-bot/blob/develop/server/server.go#L139 and https://github.com/palantir/policy-bot/blob/develop/server/handler/base.go#L83-L88, it seems like it will always attempt to load a shared policy from the default location, contradicting the documentation?
The text was updated successfully, but these errors were encountered: