fix: Harden review-sync pipeline and resolve reviewer feedback#2262
Conversation
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 9 |
| Duplication | 0 |
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
3148f54 to
76aba36
Compare
76aba36 to
638c92e
Compare
WalkthroughAdds COMMUNITY_REVIEW label, caches collaborator permissions, refactors approval counting, detects CI failures to demote PRs, updates sync to require community label for human authors, improves error reporting via core.setFailed, and adds tests plus a test workflow. ChangesReview Queue Hardening
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. 📋 Issue PlannerBuilt with CodeRabbit's Coding Plans for faster development and fewer bugs. View plan used: ✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
There was a problem hiding this comment.
Actionable comments posted: 5
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: 43981541-3f67-4ac6-9071-89febccb1036
📒 Files selected for processing (10)
.github/scripts/review-sync/helpers/constants.js.github/scripts/review-sync/helpers/labels.js.github/scripts/review-sync/helpers/permissions.js.github/scripts/review-sync/index.js.github/scripts/review-sync/package.json.github/scripts/review-sync/tests/test-labels.js.github/scripts/review-sync/tests/test-permissions.js.github/scripts/review-sync/tests/test-utils.js.github/workflows/review-sync.yml.github/workflows/test-review-sync.yml
Signed-off-by: darshit2308 <darshit2308@gmail.com>
638c92e to
34eb7b5
Compare
Signed-off-by: darshit2308 <darshit2308@gmail.com>
Signed-off-by: darshit2308 <darshit2308@gmail.com>
There was a problem hiding this comment.
Actionable comments posted: 4
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: 2cfb1a69-1317-4a0b-b870-54f3949637c7
📒 Files selected for processing (10)
.github/scripts/review-sync/helpers/constants.js.github/scripts/review-sync/helpers/labels.js.github/scripts/review-sync/helpers/permissions.js.github/scripts/review-sync/index.js.github/scripts/review-sync/package.json.github/scripts/review-sync/tests/test-labels.js.github/scripts/review-sync/tests/test-permissions.js.github/scripts/review-sync/tests/test-utils.js.github/workflows/review-sync.yml.github/workflows/test-review-sync.yml
|
you've not set up the pre commit hook |
Signed-off-by: darshit2308 <darshit2308@gmail.com>
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: ea71164e-029e-400c-8f72-6959fea9e6df
📒 Files selected for processing (1)
.github/scripts/review-sync/helpers/labels.js
…-ledger#2262) Signed-off-by: darshit2308 <darshit2308@gmail.com>
Description:
Harden the review-sync infrastructure ahead of Phase 2 with 6 atomic fixes addressing API efficiency, error visibility, CI safety, test coverage, routing correctness, and community visibility.
permissions.jsto eliminate redundant API callscore.setFailed()inindex.jswhen error count > 0 to surface broken syncshasCIFailures(), failing checks override all approvals and demote PRs back toqueue:junior-committertest-review-sync.ymlworkflow to runnpm teston review-sync changescoreApprovals(write + maintain + admin) so maintainers inherently satisfy the core requirementopen to community reviewlabel on all open PRsqueue:committersinstead ofqueue:maintainersto prevent duplicate maintainer reviews when a maintainer jumps in before triageRelated issue(s): #2229
Fixes #2260
Notes for reviewer:
Live-tested on fork (
darshit2308/hiero-sdk-python) for API connectivity and permissions:dry_run: true): Correctly logs intended label changes without modifying statedry_run: false): Successfully creates and applies labels to PRs via API (View Test Run)Logic Edge-Cases Proven via Automated Tests:
4. Early maintainer routing: When a maintainer approves before triage, the test suite verifies the PR routes to
queue:committers(notqueue:maintainers) to call a committer, preventing wasted maintainer bandwidth.5. CI rollback: Test suite verifies
ciFailing=trueoverrides all approvals ->queue:junior-committer.Key files changed:
.github/scripts/review-sync/helpers/permissions.js --> permission cache + coreApprovals
.github/scripts/review-sync/helpers/labels.js --> determineLabel routing + CI rollback
.github/scripts/review-sync/helpers/constants.js --> community review label definition
.github/scripts/review-sync/helpers/ci.js --> hasCIFailures() helper
.github/scripts/review-sync/index.js --> core.setFailed() error handling
.github/scripts/review-sync/tests/* --> 33 unit tests
.github/workflows/review-sync.yml --> checks:read permission for CI API
.github/workflows/test-review-sync.yml --> [NEW] CI test workflow
Checklist