refactor(onboard): consume handler FSM results compatibly#4454
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>
|
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. |
|
Warning Review limit reached
More reviews will be available in 91 minutes. Learn how PR review limits work. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (5)
📝 WalkthroughWalkthroughIntroduces a state machine runner that executes onboarding transitions through non-terminal states with handler dispatch and transition limits, adds runtime-boundary-level compatibility logic to coexist with legacy step helpers, extends event vocabulary for skip events, and integrates compatibility-aware result recording into the main onboarding orchestration. ChangesOnboarding state machine runner and compatibility bridge
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested labels
Suggested reviewers
🚥 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 unit tests (beta)
Comment |
E2E Advisor RecommendationRequired E2E: Dispatch hint: Auto-dispatched E2E: Full advisor summaryE2E Recommendation AdvisorBase: Required E2E
Optional E2E
New E2E recommendations
Dispatch hint
|
E2E Scenario Advisor RecommendationRequired scenario E2E: Dispatch required scenario E2E:
Full scenario advisor summaryE2E Scenario AdvisorBase: Required scenario E2E
Optional scenario E2E
Relevant changed files
|
PR Review AdvisorFindings: 2 needs attention, 2 worth checking, 0 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>
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>
Selective E2E Results — ✅ All requested jobs passedRun: 26979949639
|
Selective E2E Results — ✅ All requested jobs passedRun: 26980075595
|
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 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/runner.ts`:
- Around line 66-69: normalizeMaxTransitions currently passes NaN/Infinity
through Math.trunc which yields NaN and bypasses transition limits; update
normalizeMaxTransitions to treat non-finite values as absent by checking
Number.isFinite(value) (or isFinite) and returning DEFAULT_MAX_TRANSITIONS when
the check fails, otherwise return Math.max(1, Math.trunc(value)); reference
normalizeMaxTransitions and DEFAULT_MAX_TRANSITIONS when making the change.
In `@src/lib/onboard/runtime-boundary.ts`:
- Around line 10-15: The current assertSkippableTransitionResult rejects any
non-empty updates object even if all values are undefined; change the guard so
it treats only materialized updates as non-skippable by checking for at least
one defined value. In function assertSkippableTransitionResult
(OnboardStateResult), replace the Object.keys(result.updates).length === 0 check
with a check that inspects Object.values(result.updates) and returns early
unless values.some(v => v !== undefined); only throw the "Cannot skip onboarding
state result with context updates" error when there is at least one defined
(non-undefined) update value.
🪄 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: 0e5b25c3-1d9f-4a76-8aa2-b34c22e486ce
📒 Files selected for processing (8)
src/lib/onboard.tssrc/lib/onboard/machine/runner.test.tssrc/lib/onboard/machine/runner.tssrc/lib/onboard/machine/runtime.tssrc/lib/onboard/machine/transitions.test.tssrc/lib/onboard/machine/types.tssrc/lib/onboard/runtime-boundary.test.tssrc/lib/onboard/runtime-boundary.ts
Selective E2E Results — ✅ All requested jobs passedRun: 26988091343
|
Selective E2E Results — ✅ All requested jobs passedRun: 26988404011
|
Summary
Start consuming returned handler FSM results in the live onboarding sequence through a compatibility bridge. The bridge applies results when the runtime still needs the transition and treats already-advanced legacy step-helper state as a no-op.
Changes
recordStateResultWithStepCompatibility()to the runtime boundary.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
New Features
Tests