Repository navigation
[Feat] Add community-approved label for community code approvals - #1873
Conversation
|
Important Review skippedBot user detected. To trigger a single review, invoke the ⚙️ Run configurationConfiguration used: Repository: Zoo-Code-Org/Zoo-Code/.coderabbit.yaml Review profile: ASSERTIVE Plan: Advanced Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Review statusThis PR was opened by an automated account. A human maintainer must verify the change intent, provenance, and validation before merging. Current step: Required CI passed. Waiting for automated review of the latest commit. If automated review does not start, a maintainer must restart it. Review-state labels are managed by this workflow; do not edit them manually. |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Related GitHub Issue
Closes: #1872
Description
Adds the advisory
community-approvedlabel to the PR review-state workflow so maintainers can see which PRs in theawaiting-maintainerqueue already have a fresh community approval for the current head. The label is a priority signal only — it grants no merge authority, and required checks plus maintainer review are unchanged.Implementation notes:
label-pr-review-state.yml(description ≤ 100 chars) but kept outsidestateLabels; one sharedreconcileCommunityApproval(pr, decision)helper applies theadd/remove/preservedecision from every reconciliation branch.admin/maintain/writepermission (a permission 404 qualifies), whose latest decisive review is an approval on the current head. One eligible approval is enough; bot-authored PRs follow the same rule with no new CodeRabbit requirement.permissionFor. A lookup failure is unknown permission — it never counts as community eligibility; when it blocks maintainer classification the existing fail-closed behavior is kept, and a global failure that clears the queue also removes the label. A failed community label write only logs a warning — it never clears the queue label or fails the review gate.awaiting-maintainerrefetch now also compareslatestPrDetail.head.shawithpr.head.sha: a known head change removes the label even when other checks are uncertain; unknown mergeability alone (unchanged head, no known invalidation) preserves an existing label without adding one.converted_to_draftwas added to thepull_request_targettypes so draft conversions reconcile promptly.CONTRIBUTING.mdunder Review Process.Test Procedure
src/services/__tests__/pr-review-state-workflow.test.tsexecutes the embedded workflow script against deterministic GitHub API doubles. Added 25 focused tests covering: reviewer eligibility (ghost accounts, bots, author, maintainer permissions, permission 404), per-user permission failures (newpermissionErrorsharness option), freshness/dismissal/replacement with multiple reviewers, id-based selection vs array order, head change during reconciliation (newheadShaSequenceharness option), mergeability-unknown preservation, queue transitions and repeated runs, read-only fork review events, community change requests not routing toawaiting-author, invalidation beating uncertainty, advisory gate unchanged, and community label write failure not failing the gate.pnpm testat the repo root: all turbo tasks green.tsc --noEmitand ESLint (--max-warnings=0) on the touched test file are clean;eslint-suppressions.jsoncounts unchanged.Pre-Submission Checklist
Visual Snapshots
Not applicable — this change touches a GitHub Actions workflow, its test suite, and a CONTRIBUTING.md sentence; there is no user-facing UI.
Videos (interaction / animation only)
Not applicable.
Documentation Updates
CONTRIBUTING.md(Review Process). The Zoo-Code-Docs site does not document this internal review workflow, so no docs-repo PR is needed.Additional Notes
Out of scope per the issue: trusted event relay for faster fork updates, auto-merge, reviewer permission changes, reputation scores, reviewer-count requirements, commit-author exclusions, reviewer lists in the guide comment, and changes to branch protection, CODEOWNERS, publishing checks, or stale closure policy.
Get in Touch
Available on the project Discord for any reviewer questions.