Alias web release/assisted-update wire types to the server definitions - #863
Merged
Merged
Conversation
The release SSE stream types (ReleaseJob, ReleaseProgress, ReleaseStreamEvent, phase unions) and the assisted-update cluster (AssistedUpdateState, AssistedUpdateMetadata, UpdateMigrationManifest, check types) were maintained as ~150 lines of hand-copied definitions in apps/web/src/hooks/use-release-stream.ts, and had already drifted: the web copy of AssistedUpdateState was missing the token field the server actually sends, and typed phase/notes/requiredChecks more loosely than the wire. The wire types now live in a new leaf module apps/server/src/server/release-wire.ts (release-runtime.ts re-exports them, so server importers are untouched), and web imports them type-only, re-exporting under the names web consumers already use. The leaf module is required because release-runtime.ts imports generated/runtime-assets.js, which only exists after prepare:runtime-assets runs — web type checking doesn't run that. release-info.ts now takes ReleaseProgress from the wire module so web can reach ReleaseChannel without traversing release-runtime.ts. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
What
Consolidates the last of the server<->web wire-type trio (jobs #856, templates #860): the release SSE stream types and the assisted-update cluster.
apps/server/src/server/release-wire.tsholds the wire types (ReleaseJob,ReleaseProgress,ReleaseStreamEvent,RELEASE_VERSION_TYPES, phase unions).release-runtime.tsre-exports them, so server importers are untouched.apps/web/src/hooks/use-release-stream.tsdrops ~150 lines of hand-copied type definitions andimport types the server definitions instead (release-wire, assisted-update-store, release-metadata, release-checks, update-migrations, update-migrations-evaluator, release-info), re-exporting under the exact names web consumers already use — zero importer changes, zero runtime change (esbuild erases type-only imports;finalize:webproves it).release-info.tsnow importsReleaseProgressfrom the wire module instead ofrelease-runtime.ts.Why the leaf module
release-runtime.tsimportsgenerated/runtime-assets.js, which only exists afterprepare:runtime-assetsruns — the server check runs it, web's does not. A direct web import would makecheck:webfail on a fresh checkout. The leaf-module-plus-re-export shape is the same one used in #844/#849.Why it qualifies as tech debt
The web copies had already drifted from the wire: web's
AssistedUpdateStatewas missing thetokenfield the server actually broadcasts, typedphase/notesagainst the too-broadReleasePhaseunion, andAssistedUpdateMetadata.requiredCheckslost the server'sReadonlyArray. One definition ends the drift.Validation
pnpm run checkgreen (all packages)pnpm run finalize:webgreenpnpm run testgreen (2366 server / 541 web / 60 misc)pnpm run test:e2egreen (175 passed)Observation (not in scope)
The release SSE stream broadcasts the full
AssistedUpdateStateincludingtoken(the nonce the assisted-update agent uses to authenticate phase POSTs) to all connected release-stream clients. The typing change just makes this visible; worth a separate look at whether the stream should redact it.Queued next
Top of backlog: consolidate the three duplicated git helpers (
resolveRepoRoot/resolveCurrentBranch/normalizePath) inapps/server/src/shared/.🤖 Generated with Claude Code