Conversation
There was a problem hiding this comment.
Pull request overview
Adds core logic and a dedicated test to ensure that when a restricted bug is moved (via set_all(), covering the REST API path) or cloned across products, and some of its existing security groups are dropped as invalid in the target product, the target product’s default security group is added to preserve restriction “to the best of our ability” (Bug 2038147 and related).
Changes:
- Update
Bugzilla::Bug::_set_productto add the target product’s default security group when product move drops any existing groups. - Refactor clone logic to reuse a shared helper
_target_security_group_when_dropping. - Add a new test
t/bmo/product-move-security-groups.tthat verifies security-group preservation behavior across product moves (including non-default security groups and public bugs).
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
t/bmo/product-move-security-groups.t |
New regression test covering product moves of secured and public bugs, validating default security group preservation. |
Bugzilla/Bug.pm |
Adds group-preservation logic during product moves and factors shared logic into a helper reused by clone behavior. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+60
to
+62
| 'INSERT IGNORE INTO group_control_map | ||
| (group_id, product_id, entry, membercontrol, othercontrol, canedit) | ||
| VALUES (?, ?, 0, 1, 0, 0)', |
Comment on lines
+65
to
+67
| 'INSERT IGNORE INTO group_control_map | ||
| (group_id, product_id, entry, membercontrol, othercontrol, canedit) | ||
| VALUES (?, ?, 0, 1, 0, 0)', |
Comment on lines
+158
to
+160
| 'INSERT IGNORE INTO group_control_map | ||
| (group_id, product_id, entry, membercontrol, othercontrol, canedit) | ||
| VALUES (?, ?, 0, 1, 0, 0)', |
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.
Carrying over r+ from private pull request
https://bugzilla.mozilla.org/show_bug.cgi?id=2038147