Skip to content

Bug 2096772 - Automatically CC the confidential triage owner when a revision is added to a security bug - #2852

Open
dklawren wants to merge 1 commit into
mozilla:masterfrom
dklawren:2096772
Open

dklawren wants to merge 1 commit into
mozilla:masterfrom
dklawren:2096772

Conversation

@dklawren

@dklawren dklawren commented Dec 1, 2026

Copy link
Copy Markdown
Collaborator

Summary

Since 2065387, a component's triage owner can see private bugs in that component while they are a member of mozilla-employee-confidential, but they still can't see the bug's Phabricator revisions, because revision subscribers only come from the bug's reporter, assignee, QA contact and CC list.

This takes the simpler option from comment 0: when a revision is first attached to a private bug, the feed daemon adds the component's triage owner to the bug's CC list if they are enabled and in mozilla-employee-confidential. The existing CC → subscriber sync then gives them access to the revision, and later CC changes keep flowing through the Push connector as before.

Changes

  • extensions/PhabBugz/lib/Util.pm:
    • New get_revision_attachment($bug, $revision), the existing "attachment for D123" lookup pulled out of create_revision_attachment. set_bug_assignee now uses it too instead of its own copy.
    • New cc_triage_owner($bug), which adds the triage owner to the CC list when the bug has groups and the owner is enabled and in mozilla-employee-confidential. A failing add_cc (e.g. strict isolation) is logged instead of failing the whole story.
  • extensions/PhabBugz/lib/Feed.pm: in the private-bug branch of process_revision_change, call cc_triage_owner before the subscriber list is built, only when the bug has no attachment for the revision yet.

"First attached" is based on the attachment rather than the story's $is_new flag, so it also covers revisions that get a bug ID after creation, revisions whose create story was skipped because the author couldn't see the bug yet, and revisions moved to another private bug. A triage owner who removes themselves from the CC list isn't added back on later updates.

Not covered, as agreed in the bug: the CC isn't updated when a component's triage owner changes, a bug moves component, or someone joins or leaves mozilla-employee-confidential.

Test plan

  • test_bmo extensions/PhabBugz/t/bmo/ passes (14 files, 681 tests). The not ok ... # TODO lines are existing known failures.
  • New cases in extensions/PhabBugz/t/bmo/feed-stories.t:
    • Confidential triage owner on a private bug is CC'd and set as a revision subscriber
    • After removing themselves from CC, a later story for the same revision doesn't re-add them
    • Triage owner outside mozilla-employee-confidential is not CC'd
    • Triage owner is not CC'd on a public bug

References

…evision is added to a security bug

Bug 2065387 lets a component's triage owner see private bugs in that
component while they are in mozilla-employee-confidential, but they could
not see the bug's Phabricator revisions. When a revision is first attached
to a private bug, add the triage owner to the CC list (if they are enabled
and in mozilla-employee-confidential) so the existing subscriber sync gives
them access to the revision.

"First attached" is decided by whether the bug already has an attachment
for the revision rather than by the "created" story, so revisions that get
a bug id later, or are moved to another bug, are covered too, and a triage
owner who removes themselves from the CC list is not added back.
Copilot AI balanced review requested due to automatic review settings December 1, 2026 22:20
@dklawren dklawren self-assigned this Dec 1, 2026

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.

🟢 Approval recommended

No active review issues were identified for the change extending revision access to eligible confidential triage owners on private bugs.

No open issues 🎉

What changed in this PR

This PR extends PhabBugz’s existing CC-to-subscriber sync so eligible confidential triage owners gain access to revisions first attached to private bugs.

Changes:

  • Adds the enabled, confidential triage owner to CC before revision subscribers are synchronized, without re-adding them on later updates to the same revision.
  • Extracts a shared revision-attachment lookup used by attachment creation and assignee handling.
  • Adds tests for subscription, CC removal persistence, and exclusion of non-confidential owners and public bugs.
File Description
extensions/​PhabBugz/​t/​bmo/​feed-stories.t Tests triage-owner CC and subscription behavior and eligibility restrictions.
extensions/​PhabBugz/​lib/​Util.pm Adds the guarded triage-owner CC helper and shared attachment lookup.
extensions/​PhabBugz/​lib/​Feed.pm Calls the CC helper before subscriber synchronization when the revision has no existing attachment.

Review effort: Balanced

@dklawren
dklawren requested a review from cgsheeh December 1, 2026 22:56

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants