Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 13 additions & 5 deletions .github/scripts/review-checklist.js
Original file line number Diff line number Diff line change
Expand Up @@ -157,17 +157,25 @@ function chooseReviewers(touchedAreas, {

// Builds the markdown checklist comment body (pure, no I/O).
function buildBody(touchedAreas, approvedUsers, confirmedRequested) {
// Reviewers manually assigned who are not CODEOWNERS for any touched area.
// Used as a fallback for areas that have no CODEOWNER assigned — their
// approval also counts as sign-off for that area.
const allAreaOwners = new Set(touchedAreas.flatMap(a => a.owners));
const nonOwnerReviewers = [...confirmedRequested].filter(o => !allAreaOwners.has(o));

const rowData = touchedAreas.map(area => {
const approver = area.owners.find(o => approvedUsers.has(o));
const ownerReviewers = area.owners.filter(o => confirmedRequested.has(o));
// If no CODEOWNER is assigned for this area, fall back to non-CODEOWNER
// reviewers so manually-assigned people are shown and their approval counts.
const effectiveReviewers = ownerReviewers.length > 0 ? ownerReviewers : nonOwnerReviewers;
const approver = effectiveReviewers.find(o => approvedUsers.has(o));
const signedOff = !!approver;
const box = signedOff ? 'x' : ' ';
const tick = signedOff ? ' ✅' : '';
// Signed off: show who approved. Pending: show all confirmed-requested reviewers
// (may be > 1 if a reviewer was manually added alongside the load-balanced pick).
const requested = area.owners.filter(o => confirmedRequested.has(o));
// Signed off: show who approved. Pending: show all effective reviewers.
const mention = approver
? ` — @${approver}`
: requested.length > 0 ? ` — ${requested.map(o => `@${o}`).join(', ')}` : '';
: effectiveReviewers.length > 0 ? ` — ${effectiveReviewers.map(o => `@${o}`).join(', ')}` : '';
return { text: `- [${box}] **${area.label}**${tick}${mention}`, signedOff };
});

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/review-checklist.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ on:
# Safe: checkout has no ref: override so the base branch (develop) is always
# used — the fork's code is never checked out or executed.
pull_request_target:
types: [opened, synchronize, reopened]
types: [opened, synchronize, reopened, review_requested, review_request_removed]
branches: [develop]
workflow_run:
workflows: ["Review Checklist (gather)"]
Expand Down
Loading