refactor(onboard): extract live FSM slice runner helper#4530
Merged
Conversation
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>
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>
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>
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>
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>
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>
…' into stack/onboard-fsm-use-final-slice # Conflicts: # src/lib/onboard.ts
…e-sequence-slice # Conflicts: # src/lib/onboard/machine/flow-slices.test.ts # src/lib/onboard/machine/flow-slices.ts
…slice' into stack/onboard-fsm-final-sequence-slice
…-slice' into stack/onboard-fsm-use-initial-slice
…ice' into stack/onboard-fsm-use-core-slice # Conflicts: # src/lib/onboard.ts
…' into stack/onboard-fsm-use-final-slice # Conflicts: # src/lib/onboard.ts
…e' into stack/onboard-fsm-live-slice-helper
…al-sequence-slice # Conflicts: # src/lib/onboard/machine/flow-slices.test.ts # src/lib/onboard/machine/flow-slices.ts
…-slice' into stack/onboard-fsm-use-initial-slice
…ice' into stack/onboard-fsm-use-core-slice
…' into stack/onboard-fsm-use-final-slice
…e' into stack/onboard-fsm-live-slice-helper
…ice' into stack/onboard-fsm-use-core-slice
…' into stack/onboard-fsm-use-final-slice
…e' into stack/onboard-fsm-live-slice-helper
Signed-off-by: Carlos Villela <cvillela@nvidia.com>
Contributor
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 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.
Inline comments:
In `@src/lib/onboard/machine/live-flow-slice.ts`:
- Around line 70-73: The current logic treats any non-resume state not in
runWhenState as compatible and calls runSlice, which incorrectly runs repair
phases for sessions that are still before the slice entry; change the guard so
compatibility fallback only happens for resume or states that are already
at/after the slice entry. Concretely: add a predicate (e.g., isBeforeEntry or
isAtOrAfterEntry) that inspects current.machine.state versus the slice entry
ordering, then replace the condition with something like "if (!resume &&
isBeforeEntry(current.machine.state)) { return /* do not run compatibility */ }
else if (!runWhenState.includes(current.machine.state)) { return runSlice({
context, runtime, phases }) }" so runSlice is only invoked for resume or
ahead/at-entry states; reference current.machine.state, resume, runWhenState,
and runSlice when making the change.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: 2fa3273e-eaaf-4b3f-a34d-cb5a47887a7d
📒 Files selected for processing (5)
src/lib/onboard/machine/core-flow-phases.tssrc/lib/onboard/machine/final-flow-phases.tssrc/lib/onboard/machine/initial-flow-phases.tssrc/lib/onboard/machine/live-flow-slice.test.tssrc/lib/onboard/machine/live-flow-slice.ts
Signed-off-by: Carlos Villela <cvillela@nvidia.com>
Contributor
Selective E2E Results — ✅ All requested jobs passedRun: 27250016360
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Extract the common live FSM slice execution policy into a reusable helper. The helper runs the strict slice path only for fresh matching entry states and falls back to compatibility execution for resume/ahead-state flows.
Changes
runLiveOnboardFlowSlice()for strict-versus-compatibility slice execution.Type of Change
Verification
npx prek run --all-filespassesnpm testpassesnpm run docsbuilds without warnings (doc changes only)Signed-off-by: Carlos Villela cvillela@nvidia.com
Summary by CodeRabbit
Refactor
Tests