fix(rebuild): clear stale policy presets from registry after rebuild#5856
fix(rebuild): clear stale policy presets from registry after rebuild#5856laitingsheng wants to merge 3 commits into
Conversation
Signed-off-by: Tinson Lai <tinsonl@nvidia.com>
|
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)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughMessaging channel preset pruning now uses all channel presets, sandbox rebuild writes restored policies back to the registry, and the stop/start flows verify per-channel preset state after rebuild. ChangesMessaging policy preset pruning and rebuild sync
Estimated review effort🎯 4 (Complex) | ⏱️ ~45 minutes Suggested labels
Suggested reviewers
Poem
🚥 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 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 47%. Coverage data for the branch is not yet available. Show a code coverage summary of the most covered files.
Updated |
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
|
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. |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
src/lib/actions/sandbox/rebuild.ts (1)
1137-1143: 🎯 Functional Correctness | 🔵 TrivialRun the stop/start E2E for this rebuild path.
This code is the persistence point for disabled-channel preset state after rebuild, so please run the recommended
channels-stop-start-e2ejob before merge. As per path instructions,src/lib/actions/sandbox/rebuild.ts"controls disabled channel resolution used during onboard and rebuild" and recommendschannels-stop-start-e2e.🤖 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 1137 - 1143, The rebuild persistence path in restore logic needs validation by running the disabled-channel end-to-end coverage before merge. After the changes around registry.updateSandbox and the restoredPresets handling in rebuild.ts, run the recommended channels-stop-start-e2e job to verify rebuild correctly preserves disabled-channel preset state and channel resolution behavior.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.
Nitpick comments:
In `@src/lib/actions/sandbox/rebuild.ts`:
- Around line 1137-1143: The rebuild persistence path in restore logic needs
validation by running the disabled-channel end-to-end coverage before merge.
After the changes around registry.updateSandbox and the restoredPresets handling
in rebuild.ts, run the recommended channels-stop-start-e2e job to verify rebuild
correctly preserves disabled-channel preset state and channel resolution
behavior.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: 38ed9bd5-f551-42da-9747-cc0f2fece1c1
📒 Files selected for processing (3)
src/lib/actions/sandbox/rebuild.tstest/e2e-scenario/live/channels-stop-start-helpers.tstest/e2e/test-channels-stop-start.sh
Signed-off-by: Tinson Lai <tinsonl@nvidia.com>
Signed-off-by: Tinson Lai <tinsonl@nvidia.com>
Summary
registry.policieswas append-only viaapplyPreset, so disabling a messaging channel and rebuilding left the disabled channel's preset stale in the registry even though the gateway state was correctly pruned. Reapply loop now records its effective output and Step 7 writes it back, sopolicy-listreflects the live applied set.Related Issue
Fixes #5847
Changes
rebuild.ts: hoistrestoredPresetsfrom the inner reapply block and foldpolicies: restoredPresetsinto the Step 7registry.updateSandboxcall so the registry always mirrors what was just reapplied to the gateway. EmptysavedPresetscorrectly clears stale entries.test/e2e-scenario/live/channels-stop-start-helpers.ts: assertpolicyPresetActive(channel) === falseafter stop+rebuild and=== trueafter start+rebuild — closes the assertion gap that allowed the regression to ship.test/e2e/test-channels-stop-start.sh: mirror the post-stop / post-start preset assertions in the legacy bash E2E.Type of Change
Quality Gates
Verification
Verifiedin GitHubnpx prek run --from-ref main --to-ref HEADpassesnpm testpasses (broad runtime changes only)npm run docsbuilds without warnings (doc changes only)Signed-off-by: Tinson Lai tinsonl@nvidia.com
Summary by CodeRabbit