refactor(ci): bootstrap maintainer approval helper - #8400
Conversation
Move PR #8168 retry and reconciliation logic into a dormant trusted helper with direct tests. Co-authored-by: Aaron Erickson <aerickson@nvidia.com> Signed-off-by: Carlos Villela <cvillela@nvidia.com>
…ner-approval-helper
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThe PR adds an injectable maintainer workflow-run approval helper. It validates live pull-request state, repository identity, commit identity, and permissions before approval. It adds bounded retries, timeouts, polling, reconciliation, and comprehensive Vitest coverage. ChangesMaintainer approval workflow
Estimated code review effort: 4 (Complex) | ~60 minutes Suggested labels: Suggested reviewers: Sequence Diagram(s)sequenceDiagram
participant WorkflowEvent
participant ApprovalHelper
participant GitHubAPI
participant WorkflowRun
WorkflowEvent->>ApprovalHelper: provide pull-request event
ApprovalHelper->>GitHubAPI: validate live PR and permissions
GitHubAPI-->>ApprovalHelper: return current PR state
ApprovalHelper->>GitHubAPI: list exact-head action_required runs
GitHubAPI-->>ApprovalHelper: return matching runs
ApprovalHelper->>GitHubAPI: revalidate state and permissions
ApprovalHelper->>WorkflowRun: submit approval
WorkflowRun-->>ApprovalHelper: return approval response
ApprovalHelper->>GitHubAPI: reconcile workflow-run state
GitHubAPI-->>ApprovalHelper: return updated run state
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
Code Coverage OverviewLanguages: TypeScript TypeScript / code-coverage/pluginThe overall coverage in commit 0d25e53 in the TypeScript / code-coverage/cliThe overall coverage in commit 0d25e53 in the Show a code coverage summary of the most impacted files.
Updated |
PR Review Advisor — No blocking findings reportedAdvisor assessment: No blocking advisor findings reported Model lanes
Second-opinion terminology and E2E selections are advisory. They do not change the primary assessment or E2E / PR Gate. 3 semantic terminology decisionsTerminology decisions are advisory. They affect the assessment only when a separate finding identifies concrete semantic impact.
E2E guidanceAdvisory only. E2E / PR Gate selects and runs jobs independently. Recommended E2E: None This automated review informs maintainers. Warnings and suggestions do not require a response. A maintainer decides whether to merge. |
Summary
Add the trusted, directly tested approval helper required before PR #8168 can remove its large inline program from the write-capable workflow. This first stage is dormant: the current workflow does not load the helper, so repository behavior does not change.
Related Issue
Prerequisite for #8168. Related to #7744.
Changes
tools/ci/approve-maintainer-pr-workflow-runs.mts.Co-authored-bytrailer using the source commit identity.mainrevision.Type of Change
Quality Gates
0d25e53b2with no findings. The helper validates exact PR, repository, author permission, head SHA, workflow-run identity, pagination, retry, timeout, and reconciliation state. It has no workflow consumer, permissions, checkout, secret access, dependency, or network path beyond the injected GitHub API client. Direct adversarial tests cover each fail-closed boundary.Documentation Writer Review
no-docs-neededDGX Station Hardware Evidence
Verification
Signed-off-by:line and every commit appears asVerifiedin GitHubpre-commit,commit-msg, andpre-pushhooks passed, ornpm run validate:prpassed after refreshingorigin/mainwhen hooks were skipped or unavailablenpx vitest run --project integration test/maintainer-pr-workflow-approval-helper.test.tspassed 28 tests after the current-main refresh.npm run typecheck:cli, Biome format/lint, repository checks, diff checks, and NUL-byte checks passed.npm testfor broad runtime/test-harness changes;npm run checkfor repo-wide validation/coverage changes — command/result:npm run docsbuilds without warnings (doc changes only)Signed-off-by: Carlos Villela cvillela@nvidia.com
Summary by CodeRabbit
New Features
Reliability Improvements