Fix RoG MR ID to differentiate builds within same merge request#376
Merged
Conversation
The RoG (GitLab MR) support was not properly differentiating different
builds within the same merge request. The ID string only contained the
MR number but not the specific build task ID, making it impossible to
track different builds/respins of the same MR.
Changes:
- Add RoG case to ArtifactJob.short_id to return build_target instead
of compose.id (checked before compose to take precedence)
- Add RoG case to newa_id() to append "(task {build_task_id})" when
partial=False, similar to how erratum events append builds list
- Add comprehensive test coverage (12 tests) for RoG ID generation
This enables proper tracking of different builds within the same MR,
correct filename generation, and proper Jira issue matching for RoG
respins. Old issues are now correctly closed when on_respin: close.
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Reviewer's GuideAdds RoG-specific identification for ArtifactJobs and Jira NEWA IDs so that builds within the same GitLab MR are distinguished by build target and build task ID, and introduces comprehensive tests for RoG ID behavior. File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- In
IssueHandler.newa_id, the ROG branch always appends(task {self.artifact_job.rog.build_task_id}); consider guarding against missing or emptybuild_task_idto avoid emitting(task None)or(task )in the ID. - The RoG tests construct very similar
RoG,Event, andArtifactJobinstances repeatedly; consider extracting a small factory/helper or shared fixture to reduce duplication and make future changes to the RoG structure easier.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- In `IssueHandler.newa_id`, the ROG branch always appends `(task {self.artifact_job.rog.build_task_id})`; consider guarding against missing or empty `build_task_id` to avoid emitting `(task None)` or `(task )` in the ID.
- The RoG tests construct very similar `RoG`, `Event`, and `ArtifactJob` instances repeatedly; consider extracting a small factory/helper or shared fixture to reduce duplication and make future changes to the RoG structure easier.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
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.
The RoG (GitLab MR) support was not properly differentiating different builds within the same merge request. The ID string only contained the MR number but not the specific build task ID, making it impossible to track different builds/respins of the same MR.
Changes:
This enables proper tracking of different builds within the same MR, correct filename generation, and proper Jira issue matching for RoG respins. Old issues are now correctly closed when on_respin: close.
Summary by Sourcery
Differentiate RoG GitLab merge request builds by incorporating build target and build task ID into artifact and Jira identifiers.
New Features:
Tests: