-
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: use base branch from base repo instead of fork #4048
Merged
Merged
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
fix mergeAgain function for when the PR is created from a fork
GenPage
approved these changes
Dec 13, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for catching this.
/cherry-pick release-0.27 |
gcp-cherry-pick-bot bot
pushed a commit
that referenced
this pull request
Dec 13, 2023
fix mergeAgain function for when the PR is created from a fork
nitrocode
changed the title
fix: update working_dir.go
fix: use base branch from base repo instead of fork
Dec 18, 2023
lukemassa
pushed a commit
that referenced
this pull request
Dec 20, 2023
fix mergeAgain function for when the PR is created from a fork
lukemassa
pushed a commit
that referenced
this pull request
Dec 20, 2023
fix mergeAgain function for when the PR is created from a fork
lukemassa
pushed a commit
that referenced
this pull request
Dec 20, 2023
fix mergeAgain function for when the PR is created from a fork Co-authored-by: Alan Bover <[email protected]>
ijames-gc
pushed a commit
to gocardless/atlantis
that referenced
this pull request
Feb 13, 2024
fix mergeAgain function for when the PR is created from a fork
ijames-gc
pushed a commit
to gocardless/atlantis
that referenced
this pull request
Feb 13, 2024
fix mergeAgain function for when the PR is created from a fork
1 task
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
fix mergeAgain function for when the PR is created from a fork
what
Fixes #4034. When the PR is generated from a fork, mergeAgain function is incorrectly merging against baseBranch from the fork repository, instead of baseBranch from baseRepository.
why
mergeAgain() is called because merge strategy is enabled, and the workdir is not up to date with the last changes on the upstream repository base branch (origin) (https://github.com/alanbover/atlantis/blob/main/server/events/working_dir.go#L132)
Hence, mergeAgain() replicates the state from forceClone() https://github.com/alanbover/atlantis/blob/main/server/events/working_dir.go#L263. But note that head remote is added in a later step https://github.com/alanbover/atlantis/blob/main/server/events/working_dir.go#L272, hence the right place to clone from is origin.
tests
I have tested the changes building this locally, and it indeed fixes the problem
references