feat(core): report abandoned, revisited and resumed orchestrated migrate runs and their dispense ordinals - #36989
feat(core): report abandoned, revisited and resumed orchestrated migrate runs and their dispense ordinals#36989leosvelperez wants to merge 2 commits into
Conversation
✅ Deploy Preview for nx-dev ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for nx-docs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
View your CI Pipeline Execution ↗ for commit bb56465
☁️ Nx Cloud last updated this comment at |
✅ Deploy Preview for nx-dev ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for nx-docs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
3cede9d to
c79a9de
Compare
c79a9de to
cae1a71
Compare
…ate runs and their dispense ordinals An orchestrated migrate run spans many short-lived nx processes driven by an agent that can stop calling nx at any point. Nothing ran at the end to say the run was abandoned, so abandonment only showed up as a missing migrate_orchestrator_complete. The classic loop never had this gap: one process emits both its start and its end. A run id dimension was the original plan and was dropped: the GA property has no BigQuery export, so an undeclared parameter is unreadable, and GA advises against declaring unique ids as dimensions (past ~500 distinct values a day they collapse into an "(other)" row). The signals below need no new dimension and no Rust change. - migrate_orchestrator_abandoned: the spawn-path parent reads run.json after the agent exits; a run still active at that point is reported with the same tallies complete carries (applied, skipped, dispense count) plus the agent id. Exact per-run abandonment for user-initiated runs. - migrate_orchestrator_existing_run: every existing-run report, whether init printed it for the agent or handed it to the master session. On the master path it precedes the resume when the user continues; on the agent path it is the only trace of a revisit. - migrate_orchestrator_resume: every resume reports the same tallies, which the start watermark hid until now. The state cannot tell a crashed session from a re-invocation, so both count. A bare --run-id reconcile is not a resume: nothing in run state marks the first call after a lost session. - migrate_orchestrator_step_dispensed: once per durable dispense transition, carrying the run-wide dispense ordinal on task_count. Counting it per ordinal is the survival curve for agent-initiated runs, which have no parent process to observe them. - migrate_orchestrator_dispense gains the same ordinal. It repeats on every reconcile until the step moves, so it feeds the action mix per position, not the curve. runTallies() in state-machine.ts derives the event tallies from tallySteps() so the completion event and the new events agree with the completion summary on one step classification; adopted steps count as completed. Classic single-process events are unchanged.
cae1a71 to
bb56465
Compare
…ate runs and their dispense ordinals [Self-Healing CI Rerun]
There was a problem hiding this comment.
Nx Cloud has identified a flaky task in your failed CI:
🔂 Since the failure was identified as flaky, we triggered a CI rerun by adding an empty commit to this branch.
🔔 Heads up, your workspace has pending recommendations ↗ to auto-apply fixes for similar failures.
🎓 Learn more about Self-Healing CI on nx.dev
Current Behavior
This only applies to orchestrated migrate runs, behind
NX_MIGRATE_ORCHESTRATOR.An orchestrated run is many short nx calls driven by an agent. The agent can stop calling nx at any point. Nothing runs at the end to say so. In analytics an abandoned run only shows up as a start event with no completion event. The classic loop never had this gap, because one process sends both its start and its end.
When a session continues an existing run, or finds one and reports it, analytics sees nothing either. The start event is sent once per run, so a restarted session leaves no trace.
Expected Behavior
Analytics can tell how orchestrated runs end and how far they got. Every event below carries the run's tallies: applied, skipped, and steps handed out.
Related Issue(s)
NXC-4818
Implementation Notes
migrate_orchestrator_step_dispensedfires once per durable step handout and is the curve.runTallies()instate-machine.tsderives the event tallies fromtallySteps(), so the completion summary, the completion event and the new events share one step classification. Adopted steps count as applied.--run-idis not a resume: nothing in run state marks the first call after a lost session.