-
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
Open
marcus-rev
wants to merge
8
commits into
runatlantis:main
Choose a base branch
from
marcus-rev:fix-clone-for-github-app-no-pr-number
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
fix: update FileWorkspace logic to use pull request refs only when PR number is specified #4851
marcus-rev
wants to merge
8
commits into
runatlantis:main
from
marcus-rev:fix-clone-for-github-app-no-pr-number
+13
−6
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…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.
marcus-rev
requested review from
chenrui333,
lukemassa and
nitrocode
and removed request for
a team
August 16, 2024 19:50
…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. |
X-Guardian
added
waiting-on-response
Waiting for a response from the user
needs tests
Change requires tests
labels
Nov 2, 2024
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. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
go
Pull requests that update Go code
needs tests
Change requires tests
waiting-on-response
Waiting for a response from the user
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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