Skip to content

dashboard: env-aware deployments — real env + family grid#34

Merged
mastermanas805 merged 1 commit into
mainfrom
env-aware-deployments-2026-05-12
May 12, 2026
Merged

dashboard: env-aware deployments — real env + family grid#34
mastermanas805 merged 1 commit into
mainfrom
env-aware-deployments-2026-05-12

Conversation

@mastermanas805
Copy link
Copy Markdown
Member

Summary

Pairs with the agent-API workstream (InstaNode-dev/api#23) that ships env + parent_stack_id on the list endpoint and adds GET /api/v1/stacks/:slug/family.

  • listStacks now reads the real env from the API response. Stops hardcoding 'production' on every stack. Legacy rows without env still fall back so the UI stays back-compat.
  • NEW: fetchStackFamily(slug) — typed wrapper around the family endpoint. Returns a discriminated union ({ok:true,family} / {ok:false,reason:'upgrade_required'|'not_found'|'unknown'}) so the UI can branch on 402 / 404 / 500 without leaking APIError into page components.
  • DeployDetailPage gains an EnvironmentsGrid section above the Promote / Copy-vault PromptCards (Pro+ only). One card per env: env pill, status, URL, last-deploy timestamp. Non-root members get an inline "Promote → production" PromptCard so the agent prose stays adjacent to the source env.
  • Hobby / free tier path unchangedPromoteUpsell still renders, the grid is rendered above only for Pro+ teams (mirrors the server-side 402 contract).

Test plan

  • npx tsc --noEmit clean
  • npm test -- --run — 183/186 pass (3 pre-existing skips, no new skips)
  • 7 new api/index.test.ts cases — env field plumbed through listStacks, full fetchStackFamily coverage incl. 402/404/500/URL-encoding
  • 6 new DeployDetailPage.test.tsx cases — loading, multi-env render, single-env render, silent-failure modes, empty-family fallback
  • After merge: deploy + smoke against staging — verify Environments grid renders for Pro test team, PromoteUpsell still renders for hobby

🤖 Generated with Claude Code

Pairs with the agent-API workstream that lands env + parent_stack_id
on the list endpoint and adds GET /api/v1/stacks/:slug/family.

- listStacks now reads the real env from the API response. Stops
  hardcoding 'production' on every stack. Legacy stacks without env
  still fall back to 'production' so the UI is back-compat.
- NEW: fetchStackFamily(slug) — typed wrapper around the family
  endpoint. Returns a discriminated union so the UI can branch on
  upgrade_required (render PromoteUpsell), not_found, and unknown
  without leaking APIError into page components.
- DeployDetailPage gains an EnvironmentsGrid section above the
  Promote / Copy-vault PromptCards (Pro+ only). One card per env:
  env pill, status, URL, last-deploy timestamp. Non-root members get
  an inline "Promote <env> → production" PromptCard so the agent
  prose stays adjacent to the source env.
- Hobby / free tier path unchanged — the existing PromoteUpsell card
  still renders, the new grid is rendered above only for Pro+.

Tests:
  - 7 new api/index.test.ts cases (listStacks env, fetchStackFamily
    happy path + 402 + 404 + 500 + URL-encoding)
  - 6 new DeployDetailPage.test.tsx cases (loading, multi-env render,
    single-env render, upgrade_required + unknown silent failure,
    empty-family fallback)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@mastermanas805 mastermanas805 merged commit 2d11677 into main May 12, 2026
1 of 2 checks passed
@mastermanas805 mastermanas805 deleted the env-aware-deployments-2026-05-12 branch May 12, 2026 05:30
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.

1 participant