-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Atlantis API fails to execute for GitHub projects #5143
Comments
Hey there, @lukaspj! 👋 I'm here to help you with any bugs, questions, or contributions while you wait for a human maintainer. Let's squash those bugs together! The issue you're encountering with the Atlantis API failing due to a 422 Validation Error is because the To resolve this, ensure that the You may need to modify the way the |
I have been considering solutions for this. Either we implement logic for looking up the SHA for the submitted REF or we change the API to ask for both a SHA and a REF. I prefer being explicit about the SHA when doing the request, what do you think about that? |
Hi, Even we are facing the same issue with the atlantis plan api requests. Can some one please let us know when this PR will get merged and when is the next release scheduled. We are waiting for this fix to be released in order to use it in our project. |
It is true that this pr is just a step on the road because validation will fail if you don't have a PR that you can reference. After this change we put this on the back burner until we have time to get a more thorough understanding of the Atlantis codebase and how to wrangle this functionality out of Atlantis. Specifically, what we are trying to achieve is a reconciliation loop using Atlantis as the backbone. |
Community Note
Overview of the Issue
When using Atlantis API we saw symptoms similar to this previous issue: #4194
We also have a pre-plan workflow but we are running v0.31.0 and we can confirm that our pre-plan workflow is run. So we investigated the logs and found errors like this:
Similar to the error messages reported by #4194 and we found that this must be because the API Controller constructs a Command context where it uses the ref for most things:
https://github.com/runatlantis/atlantis/blob/main/server/controllers/api_controller.go#L242
But you can't actually pass the ref when running UpdateStatus,
you have to pass a SHA, so setting
HeadCommit: request.Ref
does not work, at least not for GitHub Commit Statuses.Reproduction Steps
We are unsure which reproduction steps is really necessary to reproduce, to us it seem like this error happens when using the API for any GitHub projects.
Logs
Logs
Environment details
Additional Context
The text was updated successfully, but these errors were encountered: