Skip to content

refactor(spaces): adopt @heroku/types 4.6.0 and remove redundant space casts - #3884

Merged
michaelmalave merged 3 commits into
v12.0.0from
worker/2026-08-21-heroku-types-spaces-cast-fixes-task-2
Aug 25, 2026
Merged

refactor(spaces): adopt @heroku/types 4.6.0 and remove redundant space casts#3884
michaelmalave merged 3 commits into
v12.0.0from
worker/2026-08-21-heroku-types-spaces-cast-fixes-task-2

Conversation

@michaelmalave

@michaelmalave michaelmalave commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

Summary

Adopt @heroku/types@4.6.0 in the spaces commands and remove the type casts it makes redundant, and pin the migrated spaces:info --json wire 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 space kpi_url and topology formations.

  • Bump @heroku/types from ^4.1.0 to ^4.6.0 (adds space Create kpi_url and topology formations).
  • Remove the redundant as SpaceCreateOpts) as Required<Space> cast and the now-unused SpaceCreateOpts/Space imports in spaces:create.
  • Retain and document the spaces:topology as SpaceTopology cast — the generated type is intentionally looser (domains?: unknown[], optional fields) than the local render view-type, so this narrows at the boundary.
  • Add a spaces:create test asserting --kpi-url is forwarded in the request body.
  • Pin the spaces:info --json shape (generation as string + generation_object) with a regression test.
  • Add hyperschema to the cspell dictionary.

Type of Change

  • fix: Bug fix or issue (patch semvar update)
  • feat: Introduces a new feature to the codebase (minor semvar update)
  • perf: Performance improvement
  • docs: Documentation only changes
  • tests: Adding missing tests or correcting existing tests
  • refactor: Restructures existing code without changing user-facing behavior
  • chore: Code cleanup tasks, dependency updates, or other changes

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 the test matrix covers the new --kpi-url forwarding test and the spaces:info --json shape pin.

Additional Context

The spaces:topology cast is intentionally kept: the generated SpaceTopology is looser than the tight shape render() consumes (domains: string[], required nested fields), so the cast narrows at the boundary rather than scattering optional-guards through render(). It's documented inline and can be dropped once the hyperschema tightens those fields.

Related Work

W-23943907

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)
@michaelmalave
michaelmalave requested a review from a team as a code owner August 21, 2026 22:45
@michaelmalave
michaelmalave deployed to AcceptanceTests August 21, 2026 22:45 — with GitHub Actions Active
@michaelmalave
michaelmalave deployed to AcceptanceTests August 21, 2026 22:45 — with GitHub Actions Active
@michaelmalave
michaelmalave deployed to AcceptanceTests August 21, 2026 22:45 — with GitHub Actions Active
@michaelmalave
michaelmalave deployed to AcceptanceTests August 21, 2026 22:45 — with GitHub Actions Active
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.
@michaelmalave
michaelmalave deployed to AcceptanceTests August 21, 2026 23:13 — with GitHub Actions Active
@michaelmalave
michaelmalave deployed to AcceptanceTests August 21, 2026 23:13 — with GitHub Actions Active
@michaelmalave
michaelmalave deployed to AcceptanceTests August 21, 2026 23:13 — with GitHub Actions Active
@michaelmalave
michaelmalave deployed to AcceptanceTests August 21, 2026 23:13 — with GitHub Actions Active
… 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
michaelmalave deployed to AcceptanceTests August 25, 2026 22:29 — with GitHub Actions Active
@michaelmalave
michaelmalave deployed to AcceptanceTests August 25, 2026 22:29 — with GitHub Actions Active
@michaelmalave
michaelmalave deployed to AcceptanceTests August 25, 2026 22:29 — with GitHub Actions Active
@michaelmalave
michaelmalave deployed to AcceptanceTests August 25, 2026 22:29 — with GitHub Actions Active
@michaelmalave michaelmalave changed the title test(spaces): pin spaces:info --json generation_object shape refactor(spaces): adopt @heroku/types 4.6.0 and remove redundant space casts Aug 25, 2026

@tlowrimore-heroku tlowrimore-heroku left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@michaelmalave
michaelmalave merged commit d002a7f into v12.0.0 Aug 25, 2026
22 checks passed
@michaelmalave
michaelmalave deleted the worker/2026-08-21-heroku-types-spaces-cast-fixes-task-2 branch August 25, 2026 23:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants