Fix MRTarget equality to compare branch values - #3175
Conversation
|
❌ pre-commit FAILURE in 1m 53s |
9e04f44 to
38af0cc
Compare
|
✔️ pre-commit SUCCESS in 1m 56s |
38af0cc to
af40dad
Compare
|
Build succeeded. ✔️ pre-commit SUCCESS in 1m 57s |
betulependule
left a comment
There was a problem hiding this comment.
Looks good to me, thank you 🙏
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>
af40dad to
96c04fb
Compare
|
Build succeeded. ✔️ pre-commit SUCCESS in 1m 55s |
|
Build succeeded (gate pipeline). ✔️ pre-commit SUCCESS in 1m 53s |
c1f0191
into
packit:main
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.