Skip to content

Show license plan in header for self-validating emulators - #283

Merged
anisaoshafi merged 2 commits into
mainfrom
show-plan-label-self-validating-emulators
Aug 4, 2026
Merged

Show license plan in header for self-validating emulators#283
anisaoshafi merged 2 commits into
mainfrom
show-plan-label-self-validating-emulators

Conversation

@gtsiolis

@gtsiolis gtsiolis commented Jun 4, 2026

Copy link
Copy Markdown
Member

Motivation

Starting the Azure or Snowflake emulator could leave the TUI header's plan label blank or show a stale cached label from another emulator.

These emulators validate their own licenses, so lstk deliberately skips its platform license flow and does not resolve an image version for them. The UI treated an empty resolved version only as "the emulator was already running" and reused the cached label, which is also empty on a fresh install.

Changes

  • Read the plan from the license activated by a self-validating emulator at <volume>/cache/license.json and render labels such as LocalStack Enterprise.
  • Re-resolve self-validating emulator labels after start without making another license API request or triggering a second activation.
  • Fall back to LocalStack when the activated license is unavailable or malformed, so the header is never blank.
  • Keep pinned Azure and Snowflake images out of lstk's platform-resolved-version path, matching their self-validating behavior.
  • Cover Azure and Snowflake, pinned tags, missing or malformed licenses, and the interactive PTY start flow.

Validation

  • make test (1,434 tests)
  • make test-integration RUN=TestStartCommandForAzureShowsPlanFromActivatedLicense
  • go vet ./internal/container ./internal/ui
  • Formatting and diff checks

Review: Human review is advisable to confirm that the activated license path and license_type format are stable contracts for both Azure and Snowflake images.

Co-Authored-By: Claude noreply@anthropic.com

@gtsiolis

gtsiolis commented Jun 4, 2026

Copy link
Copy Markdown
Member Author

Possibly related to #265. @anisaoshafi what do you think, is this useful?

@gtsiolis gtsiolis self-assigned this Jun 18, 2026
@gtsiolis
gtsiolis force-pushed the show-plan-label-self-validating-emulators branch 5 times, most recently from fb60939 to c2ce0d2 Compare July 7, 2026 07:09
@gtsiolis
gtsiolis force-pushed the show-plan-label-self-validating-emulators branch 3 times, most recently from 577daab to 4a195f7 Compare July 13, 2026 07:08
@gtsiolis
gtsiolis force-pushed the show-plan-label-self-validating-emulators branch 4 times, most recently from bd12b0f to a63f484 Compare July 22, 2026 07:07
@gtsiolis
gtsiolis force-pushed the show-plan-label-self-validating-emulators branch 2 times, most recently from c828f1e to 6ce5009 Compare July 28, 2026 07:11
gtsiolis and others added 2 commits August 4, 2026 13:41
Azure and Snowflake starts left the header plan label blank: lstk
deliberately skips the license API for self-validating emulators (no
catalog entry for their products), and run.go conflated "no resolved
version" with "already running", sending the (empty) cached label.

Resolve the label from the license the container activates into its
volume (cache/license.json) instead — no extra license API activation —
falling back to "LocalStack" when the file is unavailable.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
@gtsiolis
gtsiolis force-pushed the show-plan-label-self-validating-emulators branch from 6ce5009 to 5b605af Compare August 4, 2026 10:43
@gtsiolis gtsiolis added the docs: skip Pull request does not require documentation changes label Aug 4, 2026
@gtsiolis
gtsiolis marked this pull request as ready for review August 4, 2026 10:58
@gtsiolis
gtsiolis requested a review from a team as a code owner August 4, 2026 10:58

@anisaoshafi anisaoshafi left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks for this UX bug on self-validating emulators 💯

@anisaoshafi
anisaoshafi merged commit 320841c into main Aug 4, 2026
20 of 21 checks passed
@anisaoshafi
anisaoshafi deleted the show-plan-label-self-validating-emulators branch August 4, 2026 16:47

gtsiolis commented Aug 4, 2026

Copy link
Copy Markdown
Member Author

Thanks for merging, @anisaoshafi! 🏀


Generated by Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs: skip Pull request does not require documentation changes semver: patch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants