Skip to content

Fix MRTarget equality to compare branch values - #3175

Open
rgetz wants to merge 1 commit into
packit:mainfrom
rgetz:rgetz-fix-MRTarget
Open

Fix MRTarget equality to compare branch values#3175
rgetz wants to merge 1 commit into
packit:mainfrom
rgetz:rgetz-fix-MRTarget

Conversation

@rgetz

@rgetz rgetz commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

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.

@rgetz
rgetz requested a review from a team as a code owner August 26, 2026 23:42
@rgetz
rgetz requested review from nforro and removed request for a team August 26, 2026 23:42
@centosinfra-prod-github-app

Copy link
Copy Markdown
Contributor

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
rgetz force-pushed the rgetz-fix-MRTarget branch from 9e04f44 to 38af0cc Compare August 26, 2026 23:47
@centosinfra-prod-github-app

Copy link
Copy Markdown
Contributor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

2 participants