-
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: update FileWorkspace logic to use pull request refs only when PR number is specified #4851
base: main
Are you sure you want to change the base?
fix: update FileWorkspace logic to use pull request refs only when PR number is specified #4851
Conversation
…logic around prNumber=0. - Updating mergeToBaseBranch to only look for PR refs if GitHub app is enabled _and_ the plan/apply includes a PR number, which can optionally be 0.
…included in the API call. When checking out a branch directly without a PR number, HEAD should be fine vs HEAD^2.
… plan. This eliminates the following error in Atlantis server: 422 Validation Failed [{Resource:Status Field:sha Code:custom Message:sha must be a 40 character SHA1}]
Thanks for this @marcus-rev. Can you add a unit test for this change, and confirm in the PR description that you have tested this in your own local environment. |
This issue is stale because it has been open for 1 month with no activity. Remove stale label or comment or this will be closed in 1 month. |
@marcus-rev do you have time to add some tests? Thanks. |
This issue is stale because it has been open for 1 month with no activity. Remove stale label or comment or this will be closed in 1 month. |
what
pull/{pr.number}/head
if there is indeed a pull request number specified as part of the plan/apply.failed to build command: running git fetch origin pull/0/head:: fatal: couldn't find remote ref pull/0/head
main
for instance, this leads to 128 errors from git:why
/api/plan
throws 500 error when using GitHub App #4850/api/plan
and/api/apply
can optionally omit thePR
parameter. Therefore, we should check to see if it's0
before pivoting to a pull request based reference checkout.tests
references
https://github.com/runatlantis/atlantis/blob/6fe0303279839faadb76e94de94d7c250876b336/runatlantis.io/docs/api-endpoints.md#post-apiplan
Should close #4850