Skip to content

Disable @-mentions in approval workflow comments#4965

Merged
simonfaltum merged 2 commits intomainfrom
simonfaltum/disable-approval-mentions
Apr 14, 2026
Merged

Disable @-mentions in approval workflow comments#4965
simonfaltum merged 2 commits intomainfrom
simonfaltum/disable-approval-mentions

Conversation

@simonfaltum
Copy link
Copy Markdown
Member

@simonfaltum simonfaltum commented Apr 14, 2026

Why

The approval workflow comments currently @-mention everyone it suggests as a reviewer. This generates a lot of notification noise, especially on PRs that touch multiple ownership areas. The comments are useful for showing who should review, but the pings are disruptive.

Changes

Before: approval comments used @username for all suggested reviewers, eligible owners, and maintainers, triggering GitHub notifications for each.

Now: all mentions are wrapped in backticks (`@username`), so they render as inline code on GitHub. This preserves the familiar @ prefix for readability but prevents GitHub from treating them as mentions that trigger notifications.

All hardcoded @ mentions in the comment templates are now routed through a single fmtLogin helper controlled by the existing MENTION_REVIEWERS flag.

Example comment (cross-domain PR)

Approval status: pending

/cmd/pipelines/ - approved by @jefferycheng1

Files: cmd/pipelines/foo.go

/bundle/ - needs approval

Files: bundle/config.go
Eligible: @bundleowner1, @bundleowner2, @bundleowner3

Any maintainer (@maintainer1, @maintainer2, @maintainer3) can approve all areas.
See OWNERS for ownership rules.

Test plan

  • All 20 existing unit tests pass
  • Ran a verification script against 5 scenarios (single domain, cross-domain partial approval, wildcard-only, team-owned paths, three domains mixed) confirming zero bare @-mentions in generated comments

Reviewer suggestions are useful but the @-mentions generate too many
notifications. This changes the workflow to show plain usernames instead,
so the comment still indicates who should review without pinging them.

Co-authored-by: Isaac
Instead of removing the @ prefix entirely, wrap mentions in backticks
so they render as inline code on GitHub. This keeps the familiar
@username format visible but prevents notification spam.

Co-authored-by: Isaac
@simonfaltum simonfaltum enabled auto-merge April 14, 2026 11:02
@simonfaltum simonfaltum added this pull request to the merge queue Apr 14, 2026
Merged via the queue into main with commit 4f98409 Apr 14, 2026
24 checks passed
@simonfaltum simonfaltum deleted the simonfaltum/disable-approval-mentions branch April 14, 2026 11:43
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.

3 participants