Skip to content

Bug 2038147#2660

Merged
dklawren merged 1 commit into
masterfrom
2038147
Jul 7, 2026
Merged

Bug 2038147#2660
dklawren merged 1 commit into
masterfrom
2038147

Conversation

@dklawren

@dklawren dklawren commented Jul 7, 2026

Copy link
Copy Markdown
Collaborator

Carrying over r+ from private pull request
https://bugzilla.mozilla.org/show_bug.cgi?id=2038147

Copilot AI review requested due to automatic review settings July 7, 2026 20:38

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_product to 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.t that 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)',
@dklawren dklawren merged commit 7353e8c into master Jul 7, 2026
9 checks passed
@dklawren dklawren deleted the 2038147 branch July 7, 2026 20:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants