Fix MRTarget equality to compare branch values - #3175
Open
rgetz wants to merge 1 commit into
Open
Conversation
Contributor
|
❌ pre-commit FAILURE in 1m 53s |
MRTarget.__eq__() compared self.branch with itself instead of comparing it with other.branch, causing targets with the same repository but different branches to compare as equal. Correct the comparison and add a regression test verifying that gitlab_mr_targets_handled membership respects the configured branch. This ensures GitLab MR target matching does not incorrectly treat different branch patterns as the same target. Signed-off-by: Robin Getz <rgetz503@gmail.com>
rgetz
force-pushed
the
rgetz-fix-MRTarget
branch
from
August 26, 2026 23:47
9e04f44 to
38af0cc
Compare
Contributor
|
✔️ pre-commit SUCCESS in 1m 56s |
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
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.
As described in #3173
MRTarget.__eq__()comparedself.branchwith itself instead of comparing it withother.branch, causing targets with the same repository but different branches to compare as equal.Correct the comparison and add a regression test verifying that
gitlab_mr_targets_handledmembership respects the configured branch.This ensures GitLab MR target matching does not incorrectly treat different branch patterns as the same target.
The
MRTarget.__eq__()issue being corrected here has been present since the original implementation was introduced in 2021. It was noticed during a review of the code rather than as the result of a reported bug or observed production failure.This correction aligns
MRTargetequality with the behavior described by the original commit message: both the repository and branch are part of the target definition.No specific production issue or crash has been attributed to this issue.