refactor(spaces): adopt @heroku/types 4.6.0 and remove redundant space casts - #3884
Merged
michaelmalave merged 3 commits intoAug 25, 2026
Merged
Conversation
Assert the migrated 3.sdk --json wire shape: generation as a string plus the
:v3_sdk serializer's generation_object ({id, name}). The fixture attaches
generation_object via a cast (the hyperschema doesn't declare it) so a
regression to the old object-only generation shape fails the test.
Ref: W-23943907 (eablack #3881 review #5)
Fixes the spell-check CI failure on PR #3884: the new comment in info.unit.test.ts uses the domain term "hyperschema", which the project dictionary didn't yet contain.
… casts Bump @heroku/types ^4.1.0 -> ^4.6.0 (declares space kpi_url and topology formations). Remove the redundant 'as SpaceCreateOpts) as Required<Space>' cast and now-unused imports in spaces:create. Retain and document the spaces:topology 'as SpaceTopology' cast (generated type is intentionally looser than the local render view-type). Add a spaces:create test asserting --kpi-url is forwarded in the request body. W-23943907
michaelmalave
deleted the
worker/2026-08-21-heroku-types-spaces-cast-fixes-task-2
branch
August 25, 2026 23:06
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
Adopt
@heroku/types@4.6.0in thespacescommands and remove the type casts it makes redundant, and pin the migratedspaces:info --jsonwire shape with regression tests. Follow-up to the review of #3881 (points #5/#6) — the cast removal is the payoff now that the types package declares spacekpi_urland topologyformations.@heroku/typesfrom^4.1.0to^4.6.0(adds space Createkpi_urland topologyformations).as SpaceCreateOpts) as Required<Space>cast and the now-unusedSpaceCreateOpts/Spaceimports inspaces:create.spaces:topologyas SpaceTopologycast — the generated type is intentionally looser (domains?: unknown[], optional fields) than the local render view-type, so this narrows at the boundary.spaces:createtest asserting--kpi-urlis forwarded in the request body.spaces:info --jsonshape (generationas string +generation_object) with a regression test.hyperschemato the cspell dictionary.Type of Change
Verification
Passing CI suffices — the change is compile-time-only (cast removal) plus a dependency bump and a test. CI's
build(tsc) validates that the removed casts were redundant, and thetestmatrix covers the new--kpi-urlforwarding test and thespaces:info --jsonshape pin.Additional Context
The
spaces:topologycast is intentionally kept: the generatedSpaceTopologyis looser than the tight shaperender()consumes (domains: string[], required nested fields), so the cast narrows at the boundary rather than scattering optional-guards throughrender(). It's documented inline and can be dropped once the hyperschema tightens those fields.Related Work
W-23943907