Commit c1f0191
authored
Fix MRTarget equality to compare branch values (#3175)
Fix MRTarget equality to compare branch values
As described in #3173
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.
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 MRTarget equality 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.
Reviewed-by: Alžběta Kučerová2 files changed
Lines changed: 9 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
90 | 90 | | |
91 | 91 | | |
92 | 92 | | |
93 | | - | |
| 93 | + | |
94 | 94 | | |
95 | 95 | | |
96 | 96 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
83 | 83 | | |
84 | 84 | | |
85 | 85 | | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
86 | 94 | | |
87 | 95 | | |
88 | 96 | | |
| |||
0 commit comments