Skip to content

Make the CODEOWNERS reviewer-explanation section collapsible - #20

Merged
martinlocklear merged 1 commit into
mainfrom
martinlocklear/cursor/collapsible-reviewer-explanation
Jul 20, 2026
Merged

martinlocklear merged 1 commit into
mainfrom
martinlocklear/cursor/collapsible-reviewer-explanation

Conversation

@martinlocklear

Copy link
Copy Markdown
Contributor

Human note - written by Martin, verbatim, not AI-generated:

We're starting to have a lot of information all pushed to first order retrievability in these PRs. Let's push it down to second order retrievability (a single click) so the information is discoverable but not clutter


[authored by Cursor]

Summary

  • Keep the [!IMPORTANT] reviewer-explanation callout visible (headline, team count, provenance) and move the per-team file/pattern breakdown into a default-collapsed <details> block.
  • Applies to both publish targets (the sticky comment and the optional PR-body region). The DOMAIN_REVIEW_REASONS markers, comment/body plumbing, and the edit-only-on-change idempotency guard are unchanged; this is a rendering-only change.

Motivation

These PRs now carry a lot of always-visible automated output. This pushes the verbose file/pattern breakdown one click down so it stays discoverable without cluttering the PR. The callout has to stay outside the collapsed region because GitHub does not render alert callouts inside <details> (they degrade to plain blockquotes).

Background: Collapsible reviewer explanation plan

Test plan

  • ruff check .github/scripts and ruff format --check .github/scripts pass
  • pytest .github/scripts/test_pr_labeler.py — 117 passing
  • CI checks green

Keep the [!IMPORTANT] callout (headline, team count, provenance) visible and
move the per-team file/pattern breakdown into a default-collapsed <details>
block, so the detail is one click away instead of always-on clutter. The
callout stays outside the <details> because GitHub does not render alert
callouts nested inside one; they degrade to a plain blockquote.

Rendering-only: the DOMAIN_REVIEW_REASONS markers, comment and body publish
paths, and the edit-only-on-change idempotency guard are unchanged. Update and
extend the render tests for the plain non-blockquoted breakdown lines, the new
callout wording, the default-collapsed details block, and team-count and verb
agreement.

[authored by Cursor]

Co-authored-by: Cursor <cursoragent@cursor.com>
@martinlocklear

Copy link
Copy Markdown
Contributor Author

[authored by Cursor]

Conversation summary

This PR originated from a request to reduce clutter in the automated PR sections by pushing the reviewer-explanation detail (which teams CODEOWNERS requested and why) from always-visible ("first order") to one-click-away ("second order").

Plan doc: Collapsible reviewer explanation

Key decisions

  • Callout stays visible, breakdown collapses. The purple [!IMPORTANT] callout (headline, team count, and the "maintained automatically" provenance) remains first-order; the per-team file/pattern list moves into a default-collapsed <details>.
  • Callout kept outside the collapsed region. GitHub does not render alert callouts inside <details> (they degrade to plain blockquotes), so the callout sits as a top-level sibling above the <details> rather than inside it.
  • Rendering-only. The DOMAIN_REVIEW_REASONS markers, comment/body publish paths, and the edit-only-on-change idempotency guard are untouched, so both publish targets keep working with no churn.

Alternatives considered

  • Single <details>, drop the alert (thog-style). Fully collapses everything under one summary but loses the purple callout that distinguishes this section from Bugbot's note.
  • Collapse only the file lists, keep team names visible. Most information at a glance, but the busiest markup; not chosen, for simplicity.

@martinlocklear

Copy link
Copy Markdown
Contributor Author

[authored by Cursor]

Example render

Here is how the new collapsible reviewer-explanation section renders (comment variant, on a sample PR touching three teams' files). The [!IMPORTANT] callout stays visible; the per-team file/pattern breakdown is one click away.

Important

Why these teams were requested for review
3 teams own some of the files changed here, per CODEOWNERS. Expand for the files that matched.
Maintained automatically by the PR labeler.

Which teams and files (3)
  • scanning - scan engine, job control, reverification
    • pkg/engine/reverify.go (matched /pkg/engine/)
    • pkg/engine/scan.go (matched /pkg/engine/)
  • integrations - sources, detectors, and analyzers
    • pkg/sources/github/github.go (matched /pkg/sources/)
  • eng-leads - engineering leads; default reviewers for files no domain team owns
    • Makefile (matched *)

@martinlocklear
martinlocklear marked this pull request as ready for review July 8, 2026 21:04
@martinlocklear
martinlocklear requested a review from a team July 8, 2026 21:04

@sysread sysread 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.

Lovely. Thank you.

@martinlocklear
martinlocklear merged commit 5225760 into main Jul 20, 2026
4 checks passed
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