-
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
fix: Enforce explicitly setting SHA in API requests #5146
base: main
Are you sure you want to change the base?
Conversation
6f80b59
to
940222c
Compare
@lukaspj could you update the api docs too? Thanks. |
I certainly can, but I was unsure exactly how to handle the docs side of it, considering this is a breaking change as-is. Would you prefer me to make it default to the previous behaviour when no SHA is provided or make it required like it is now? |
That will be even better. the docs you will need to change https://www.runatlantis.io/docs/api-endpoints.html which is here in the repo https://github.com/runatlantis/atlantis/blob/main/runatlantis.io/docs/api-endpoints.md |
I updated it to be a heavy suggestion instead of a hard requirement, please let me know what you think. |
7f6e09b
to
e677273
Compare
e677273
to
3342140
Compare
Signed-off-by: Lukas Peter Aldershaab <[email protected]>
3342140
to
b6a422a
Compare
what
I propose adding the Commit SHA as a required field on API requests.
why
When running API Requests, we are currently only requiring the following fields:
However, this is not sufficient information as many operations rely on knowing the exact commit we are working on and not just the Ref, which is a moving target.
Furthermore, it's more reliable to explicitly state the SHA you want to perform actions on, otherwise you could get unexpected results as the pipeline you are currently working with locally might be pointing to a different version of the Ref than the one that Atlantis fetches.
tests
I would like guidance on how to appropriately testing this change as I'm fairly unfamiliar with the Atlantis codebase.
references
closes #5143