refactor(rebuild): lower cognitive complexity ratchet to 186#5429
Conversation
Signed-off-by: Carlos Villela <cvillela@nvidia.com> (cherry picked from commit 41fcd6a)
Signed-off-by: Carlos Villela <cvillela@nvidia.com>
Signed-off-by: Carlos Villela <cvillela@nvidia.com>
Signed-off-by: Carlos Villela <cvillela@nvidia.com>
…t/244-rebuild-cognitive-complexity
…243-rebuild-confirm-cognitive-complexity
Signed-off-by: Carlos Villela <cvillela@nvidia.com>
Signed-off-by: Carlos Villela <cvillela@nvidia.com>
Signed-off-by: Carlos Villela <cvillela@nvidia.com>
Signed-off-by: Carlos Villela <cvillela@nvidia.com>
Signed-off-by: Carlos Villela <cvillela@nvidia.com>
|
Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually. Contributors can view more details about this message here. |
|
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)
📝 WalkthroughWalkthroughRefactors ChangesRebuild preflight & messaging-plan staging refactor
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested labels
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
E2E Advisor RecommendationRequired E2E: Dispatch hint: Full advisor summaryE2E Recommendation AdvisorBase: Required E2E
Optional E2E
New E2E recommendations
Dispatch hint
|
Vitest E2E Scenario RecommendationRequired Vitest E2E scenarios: Dispatch required Vitest E2E scenarios:
Full Vitest E2E advisor summaryVitest E2E Scenario AdvisorBase: Required Vitest E2E scenarios
Optional Vitest E2E scenarios
Relevant changed files
|
Code Coverage OverviewLanguages: TypeScript TypeScript / code-coverage/pluginThe overall coverage in the branch is 96%. Coverage data for the branch is not yet available. Show a code coverage summary of the most covered files.
TypeScript / code-coverage/cliThe overall coverage in the branch is 45%. Coverage data for the branch is not yet available. Show a code coverage summary of the most covered files.
Updated |
PR Review AdvisorFindings: 0 needs attention, 1 worth checking, 1 nice ideas Review findings🛠️ Needs attention
🔎 Worth checking
🌱 Nice ideas
Consider writing more tests for
Since last review detailsCurrent findings:
This is an automated advisory review. A human maintainer must make the final merge decision. |
Signed-off-by: Carlos Villela <cvillela@nvidia.com>
…t/244-rebuild-cognitive-complexity
…243-rebuild-confirm-cognitive-complexity
…ratchet/225-rebuild-single-agent-guard
…4-rebuild-registry-guard # Conflicts: # src/lib/actions/sandbox/rebuild.ts
…build-version-header # Conflicts: # src/lib/actions/sandbox/rebuild.ts
…build-credential-preflight # Conflicts: # src/lib/actions/sandbox/rebuild.ts
Signed-off-by: Carlos Villela <cvillela@nvidia.com>
…t/244-rebuild-cognitive-complexity
…243-rebuild-confirm-cognitive-complexity
…ratchet/225-rebuild-single-agent-guard
…build-version-header
…build-credential-preflight
…onfirm-cognitive-complexity # Conflicts: # biome.json # src/lib/actions/sandbox/rebuild.ts # test/rebuild-credential-preflight.test.ts
…ratchet/225-rebuild-single-agent-guard
…4-rebuild-registry-guard
…build-version-header
…build-credential-preflight
…ingle-agent-guard # Conflicts: # biome.json # src/lib/actions/sandbox/rebuild.ts
…4-rebuild-registry-guard
…build-version-header
…build-credential-preflight
…egistry-guard # Conflicts: # biome.json # src/lib/actions/sandbox/rebuild.ts
…build-version-header
…build-credential-preflight
…ersion-header # Conflicts: # biome.json
…build-credential-preflight
…redential-preflight # Conflicts: # biome.json # src/lib/actions/sandbox/rebuild.ts
There was a problem hiding this comment.
🧹 Nitpick comments (1)
src/lib/actions/sandbox/rebuild.ts (1)
623-629: Run the channels stop/start rebuild E2E for this Step 0 extraction.Given this path now stages messaging rebuild plans before destroy, it’s worth running the targeted lifecycle E2E to confirm disabled-channel persistence and restart reattachment behavior across rebuild.
gh workflow run nightly-e2e.yaml --ref <branch> -f jobs=channels-stop-start-e2eAs per coding guidelines, changes in
src/lib/actions/sandbox/rebuild.tsshould be validated withchannels-stop-start-e2efor stop/start lifecycle across rebuild.🤖 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 `@src/lib/actions/sandbox/rebuild.ts` around lines 623 - 629, Validate the messaging rebuild plan staging changes by running the channels-stop-start-e2e test. Execute the provided gh workflow command with the channels-stop-start-e2e job to confirm that disabled-channel persistence and restart reattachment behavior work correctly across the rebuild lifecycle when using the stageRebuildMessagingPlanOrBail function in the rebuild.ts file. This E2E validation is required per coding guidelines for changes affecting the sandbox rebuild and messaging plan staging logic.
🤖 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.
Nitpick comments:
In `@src/lib/actions/sandbox/rebuild.ts`:
- Around line 623-629: Validate the messaging rebuild plan staging changes by
running the channels-stop-start-e2e test. Execute the provided gh workflow
command with the channels-stop-start-e2e job to confirm that disabled-channel
persistence and restart reattachment behavior work correctly across the rebuild
lifecycle when using the stageRebuildMessagingPlanOrBail function in the
rebuild.ts file. This E2E validation is required per coding guidelines for
changes affecting the sandbox rebuild and messaging plan staging logic.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: 3eb27a9a-ab6f-4efb-880b-b432395f3a19
📒 Files selected for processing (4)
biome.jsonsrc/lib/actions/sandbox/rebuild-flow.test.tssrc/lib/actions/sandbox/rebuild.tstest/rebuild-credential-preflight.test.ts
Summary
Continue the stacked cognitive-complexity ratchet by lowering the threshold from 215 to 186. This extracts rebuild credential and messaging preflight handling out of the main rebuild flow.
Changes
complexity/noExcessiveCognitiveComplexityfrom215to186inbiome.json.preflightRebuildCredentials.stageRebuildMessagingPlanOrBail.Type of Change
Verification
npx @biomejs/biome lint --only=complexity/noExcessiveCognitiveComplexity --max-diagnostics=none .npm run typecheck:clinpx vitest run --project cli test/rebuild-credential-preflight.test.ts test/rebuild-stale-recovery.test.ts src/lib/actions/sandbox/rebuild-gateway-drift.test.tsGit hooks passed during commit and push, or
npx prek run --from-ref main --to-ref HEADpassesTargeted tests pass for changed behavior
Tests added or updated for new or changed behavior
Full
npm testpasses (broad runtime changes only)No secrets, API keys, or credentials committed
Docs updated for user-facing behavior changes
npm run docsbuilds without warnings (doc changes only)Doc pages follow the style guide (doc changes only)
New doc pages include SPDX header and frontmatter (new pages only)
Signed-off-by: Carlos Villela cvillela@nvidia.com
Summary by CodeRabbit
Release Notes
New Features
Bug Fixes
Tests
OPENAI_API_KEY, stale registered providers, and mismatched local session scenarios.Chores