Commit 4f98409
authored
Disable @-mentions in approval workflow comments (#4965)
## 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`
>
> <sub>Any maintainer (`@maintainer1`, `@maintainer2`, `@maintainer3`)
can approve all areas.
> See OWNERS for ownership rules.</sub>
## 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 comments1 parent 881c540 commit 4f98409
2 files changed
Lines changed: 14 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
96 | 96 | | |
97 | 97 | | |
98 | 98 | | |
99 | | - | |
| 99 | + | |
100 | 100 | | |
101 | 101 | | |
102 | 102 | | |
| |||
203 | 203 | | |
204 | 204 | | |
205 | 205 | | |
206 | | - | |
207 | 206 | | |
208 | | - | |
| 207 | + | |
209 | 208 | | |
210 | 209 | | |
211 | 210 | | |
| |||
221 | 220 | | |
222 | 221 | | |
223 | 222 | | |
224 | | - | |
225 | | - | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
226 | 229 | | |
227 | 230 | | |
228 | 231 | | |
| |||
267 | 270 | | |
268 | 271 | | |
269 | 272 | | |
270 | | - | |
| 273 | + | |
271 | 274 | | |
272 | 275 | | |
273 | 276 | | |
| |||
277 | 280 | | |
278 | 281 | | |
279 | 282 | | |
280 | | - | |
| 283 | + | |
281 | 284 | | |
282 | 285 | | |
283 | 286 | | |
284 | 287 | | |
285 | 288 | | |
286 | | - | |
| 289 | + | |
287 | 290 | | |
288 | 291 | | |
289 | 292 | | |
| |||
320 | 323 | | |
321 | 324 | | |
322 | 325 | | |
323 | | - | |
| 326 | + | |
324 | 327 | | |
325 | 328 | | |
326 | 329 | | |
| |||
349 | 352 | | |
350 | 353 | | |
351 | 354 | | |
352 | | - | |
| 355 | + | |
353 | 356 | | |
354 | 357 | | |
355 | 358 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
509 | 509 | | |
510 | 510 | | |
511 | 511 | | |
512 | | - | |
| 512 | + | |
513 | 513 | | |
514 | 514 | | |
515 | 515 | | |
0 commit comments