-
Notifications
You must be signed in to change notification settings - Fork 2
BERTE-612: detect cross-branch contamination before merge #279
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
Merged
matthiasL-scality
merged 4 commits into
main
from
BERTE-612/check-source-branch-lineage
Aug 26, 2026
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
8a19a9c
BERTE-612: detect cross-branch contamination before merge
matthiasL-scality 3606a8d
BERTE-612: add bypass_source_branch_lineage + harden contamination check
matthiasL-scality 22ba968
fix: use git merge-base --all to cover criss-cross merge scenarios (B…
matthiasL-scality 97be606
style: fix E501 flake8 violations in BERTE-612 changes
matthiasL-scality File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,46 @@ | ||
| {% extends "message.md" %} | ||
|
|
||
| {% block title -%} | ||
| Foreign commits detected in source branch | ||
| {% endblock %} | ||
|
|
||
| {% block message %} | ||
| The source branch `{{ src_branch }}` shares history with the following | ||
| release line(s), which are not ancestors of `{{ dst_branch }}`: | ||
|
|
||
| {% for branch in foreign_branches %} | ||
| - `{{ branch }}` | ||
| {% endfor %} | ||
|
|
||
| This typically happens when the feature branch was accidentally based on | ||
| commits from a higher release line rather than directly on `{{ dst_branch }}`. | ||
| Common causes include: | ||
|
|
||
| - Rebasing on a Bert-E integration branch (e.g. a `w/` branch) instead of | ||
| directly on `{{ dst_branch }}` | ||
| - Branching from a higher development branch instead of `{{ dst_branch }}` | ||
| - Merging a higher development branch into the feature branch | ||
|
|
||
| **How to fix** | ||
|
|
||
| Create a new branch directly from `{{ dst_branch }}` and cherry-pick your | ||
| changes onto it: | ||
|
|
||
| ``` | ||
| git checkout -b <new-branch-name> origin/{{ dst_branch }} | ||
| git cherry-pick <your-commits> | ||
| ``` | ||
|
|
||
| Then open a new pull request from that branch. | ||
|
|
||
| **If this is a false positive** | ||
|
|
||
| If your branch is a legitimate backport and was previously merged into one | ||
| of the branches above before being extended with new commits, an | ||
| administrator can bypass this check with: | ||
|
|
||
| ``` | ||
| @bert-e bypass_source_branch_lineage | ||
| ``` | ||
|
|
||
| {% endblock %} |
This file contains hidden or 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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.