feat(wsl-mover): report how a move's undo ends (#35322)

* feat(wsl-mover): report how a move's undo ends (wsl_move_undo)

* fix(wsl-mover): tell a thrown undo apart from a failed one; clamp its duration
This commit is contained in:
Neil
2026-10-28 13:58:17 -07:00
committed by GitHub
parent dd0c4cf35e
commit 203bf56dfd
8 changed files with 215 additions and 7 deletions
+6 -1
View File
@@ -112,7 +112,11 @@ import {
sshHostServerMoveSchema,
sshHostServerLegacyRelayBridgeSchema
} from './telemetry-ssh-host-server-event-schemas'
import { wslMoveOrchestratorSchema, wslMoveSchema } from './telemetry-wsl-move-event-schemas'
import {
wslMoveOrchestratorSchema,
wslMoveUndoSchema,
wslMoveSchema
} from './telemetry-wsl-move-event-schemas'
// Breaking payload changes require a new event name to keep historical rows distinguishable; optional additions are safe.
export const eventSchemas = {
@@ -228,6 +232,7 @@ export const eventSchemas = {
wsl_move: wslMoveSchema,
wsl_move_orchestrator: wslMoveOrchestratorSchema,
wsl_move_undo: wslMoveUndoSchema,
wsl_usage_snapshot: wslUsageSnapshotSchema
} as const
@@ -117,3 +117,26 @@ export const wslMoveOrchestratorSchema = z
attempt_bucket: z.enum(WSL_MOVE_ORCHESTRATOR_ATTEMPT_BUCKETS)
})
.strict()
/** How "use this project here again" ended; refusals keep the result's own reason. */
export const WSL_MOVE_UNDO_OUTCOME_VALUES = [
'released',
'not_moved',
'superseded',
'move_running',
'host_still_running',
'host_unreachable',
'unsaved_files',
'failed',
// The undo threw instead of returning a refusal.
'threw',
'other'
] as const
// Same enum-only rule as `wsl_move`: no distro, project or migration id leaves.
export const wslMoveUndoSchema = z
.object({
outcome: z.enum(WSL_MOVE_UNDO_OUTCOME_VALUES),
duration_bucket: z.enum(SSH_RUNTIME_DURATION_BUCKETS)
})
.strict()