Repository navigation
fix(ci): query only active E2E runs - #6683
Conversation
Signed-off-by: Carlos Villela <[email protected]>
📝 WalkthroughWalkthrough
ChangesActive workflow run cancellation
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant cancelPrGate
participant GitHubActionsAPI
participant GitHubCancelAPI
cancelPrGate->>GitHubActionsAPI: Query each active status and page
GitHubActionsAPI-->>cancelPrGate: Return workflow runs
cancelPrGate->>GitHubCancelAPI: Cancel deduplicated eligible run ids
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
Code Coverage OverviewLanguages: TypeScript TypeScript / code-coverage/pluginThe overall coverage remains at 96%, unchanged from the TypeScript / code-coverage/cliThe overall coverage in the Show a code coverage summary of the most impacted files.
Updated |
E2E Advisor RecommendationRequired E2E: None Full advisor summaryE2E Recommendation AdvisorBase: Required E2E
Optional E2E
New E2E recommendations
|
Signed-off-by: Carlos Villela <[email protected]>
PR Review Advisor (Nemotron Ultra) — No blocking findingsMerge posture: No blocking advisor findings Action checklist
Test follow-ups to resolve or justifyIf these cover changed behavior, prefer adding them in this PR; otherwise state why existing coverage is enough or link the follow-up.
This is an automated, non-binding review; it still expects maintainers and agents to respond to each required or warning item. Treat suggestions as current-PR improvements when they touch changed code; defer only with maintainer rationale or a linked follow-up. A human maintainer must make the final merge decision. |
PR Review Advisor — No blocking findingsMerge posture: No blocking advisor findings Action checklist
Test follow-ups to resolve or justifyIf these cover changed behavior, prefer adding them in this PR; otherwise state why existing coverage is enough or link the follow-up.
This is an automated, non-binding review; it still expects maintainers and agents to respond to each required or warning item. Treat suggestions as current-PR improvements when they touch changed code; defer only with maintainer rationale or a linked follow-up. A human maintainer must make the final merge decision. |
|
Addressed the initial Verification after the change:
|
|
Expected bootstrap behavior for this fix: the current-head That job is triggered by The failure is the defect this PR fixes and is not useful to rerun. After merge, the |
|
The remaining
That bridge was intentionally marked for deletion after #6670's planner-based workflow landed on |
Signed-off-by: Carlos Villela <[email protected]>
|
Folded the approved post-#6670 cleanup into
Verification:
This directly resolves the inherited |
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
test/e2e/support/e2e-workflow.test.ts (1)
673-674: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick winRetain a migration check for the removed inventory CLI.
This deletion removes the only shown coverage that exercised
workflow-inventory.mts. Add an explicit check that the superseded entry point is absent or unreachable; the new reader assertion only proves the replacement path works.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@test/e2e/support/e2e-workflow.test.ts` around lines 673 - 674, Retain explicit migration coverage for the removed workflow-inventory CLI by adding a test alongside the malformed metadata case that verifies workflow-inventory.mts is absent or unreachable. Keep the existing replacement reader assertion, but ensure the test also confirms the superseded entry point cannot be invoked.Source: Path instructions
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Outside diff comments:
In `@test/e2e/support/e2e-workflow.test.ts`:
- Around line 673-674: Retain explicit migration coverage for the removed
workflow-inventory CLI by adding a test alongside the malformed metadata case
that verifies workflow-inventory.mts is absent or unreachable. Keep the existing
replacement reader assertion, but ensure the test also confirms the superseded
entry point cannot be invoked.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: a8a460d5-eb47-4cee-ab11-2ca40feb4c2d
📒 Files selected for processing (2)
test/e2e/support/e2e-workflow.test.tstools/e2e/workflow-inventory.mts
💤 Files with no reviewable changes (1)
- tools/e2e/workflow-inventory.mts
|
Reviewed CodeRabbit’s minor suggestion to add a migration test asserting that |
<!-- markdownlint-disable MD041 --> ## Summary Prevents `cancel-superseded` from failing once completed E2E workflow history exceeds GitHub's 1,000-result search cap. The controller now lists only non-terminal runs, retains fail-closed pagination, and cancels each matching run at most once. It also removes the temporary base-workflow inventory bridge after NVIDIA#6670 landed on `main`. ## Changes - Query the five documented non-terminal workflow-run statuses instead of traversing all historical `workflow_dispatch` runs. - Paginate and validate every status-specific result set before issuing cancellations, retaining the 1,000-result completeness guard per status. - Deduplicate run IDs observed across status transitions and keep completed runs excluded. - Reproduce the escaped completed-history failure and cover multi-page active results, forward status transitions, and no partial cancellation when an active-status search reaches its limit. - Delete the obsolete `workflow-inventory.mts --shell` compatibility CLI and exercise malformed workflow metadata directly through the production inventory reader. ## Type of Change - [x] Code change (feature, bug fix, or refactor) - [ ] Code change with doc updates - [ ] Doc only (prose changes, no code sample modifications) - [ ] Doc only (includes code sample changes) ## Quality Gates <!-- Check exactly one tests line and one docs line. Check other lines when applicable. Add every requested justification or approval reference. --> - [x] Tests added or updated for changed behavior - [ ] Existing tests cover changed behavior — justification: - [ ] Tests not applicable — justification: - [ ] Docs updated for user-facing behavior changes - [x] Docs not applicable — justification: the documented PR cancellation contract is unchanged, and the deleted temporary CLI had no documented or tracked consumer; final documentation-writer audits confirmed no user-facing update is needed. - [x] Sensitive paths changed (security, policy, credentials, preflight, onboarding, inference, runner, sandbox, or messaging) - [x] Sensitive-path review completed or maintainer-approved waiver recorded — reviewer/approval link/justification: independent controller and cleanup reviews confirmed fixed status constants, PR-title and run-ID validation, benign completion races, validation before cancellation, and no remaining consumer of the deleted bridge. - [ ] Non-success, skipped, or missing CI check accepted by maintainer — check name, approval link, and follow-up issue: ## Verification <!-- Check each applicable item only when supported by the requested evidence. Run targeted tests once per relevant change set and rerun after later edits or hook autofixes that can affect the tested behavior. Do not rerun hook-covered checks. --> - [x] PR description includes the DCO sign-off declaration and every commit appears as `Verified` in GitHub - [x] Normal `pre-commit`, `commit-msg`, and `pre-push` hooks passed, or `npm run check:diff` passed when hooks were skipped or unavailable - [x] Targeted behavior tests pass for the current change set, or tests are marked not applicable above — controller integration (1 file, 20 tests); focused E2E workflow boundary (1 file, 17 tests); full `e2e-support` project (115 files, 926 tests) - [ ] Applicable broad gate passed — `npm test` for broad runtime/test-harness changes; `npm run check` for repo-wide validation/coverage changes — command/result: - [x] Quality Gates section completed with required justifications or waivers - [x] No secrets, API keys, or credentials committed - [ ] `npm run docs` builds without warnings (doc changes only) - [ ] Doc pages follow the [style guide](https://github.com/NVIDIA/NemoClaw/blob/main/docs/CONTRIBUTING.md) (doc changes only) - [ ] New doc pages include SPDX header and frontmatter (new pages only) --- <!-- DCO sign-off is required in this PR description, and every commit must appear as Verified in GitHub. Run: git config user.name && git config user.email --> Signed-off-by: Carlos Villela <[email protected]> <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **Bug Fixes** - Improved pull request gate cancellation to target only eligible “active” workflow runs across multiple run states, avoiding queued or unrelated runs. - Refined pagination handling for active-run discovery and ensured cancellation happens only when the correct run becomes eligible. - Deduplicates discovered runs before issuing any cancellations. - **Tests** - Expanded end-to-end coverage to verify the exact sequence of active-status pagination queries and the cancellation/rejection behavior at page limits. - **Chores** - Removed the `workflow-inventory` CLI used by end-to-end tests, switching validation to direct assertions. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Signed-off-by: Carlos Villela <[email protected]>
Summary
Prevents
cancel-supersededfrom failing once completed E2E workflow history exceeds GitHub's 1,000-result search cap. The controller now lists only non-terminal runs, retains fail-closed pagination, and cancels each matching run at most once. It also removes the temporary base-workflow inventory bridge after #6670 landed onmain.Changes
workflow_dispatchruns.workflow-inventory.mts --shellcompatibility CLI and exercise malformed workflow metadata directly through the production inventory reader.Type of Change
Quality Gates
Verification
Verifiedin GitHubpre-commit,commit-msg, andpre-pushhooks passed, ornpm run check:diffpassed when hooks were skipped or unavailablee2e-supportproject (115 files, 926 tests)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 [email protected]
Summary by CodeRabbit
Bug Fixes
Tests
Chores
workflow-inventoryCLI used by end-to-end tests, switching validation to direct assertions.