Skip to content

feat(dev): seed heimdall instance checkpoints for billing tests#6415

Merged
Flo4604 merged 4 commits into
mainfrom
seed-heimdall-checkpoints
Jun 12, 2026
Merged

feat(dev): seed heimdall instance checkpoints for billing tests#6415
Flo4604 merged 4 commits into
mainfrom
seed-heimdall-checkpoints

Conversation

@Flo4604

@Flo4604 Flo4604 commented Jun 10, 2026

Copy link
Copy Markdown
Member

What

Adds unkey dev seed checkpoints, which seeds a dense, billable instance_checkpoints_v1 series for an existing workspace/project/app/environment so the full Deploy billing pipeline (ClickHouse aggregation -> Stripe meter push, dashboard usage charts) can be exercised end to end without running real workloads.

Heimdall bills from cumulative counters integrated over consecutive checkpoint pairs and drops pairs more than ~2 minutes apart, so the seeder emits one checkpoint per tick across the requested window and prints the expected billable totals for cross-checking against the billing query.

Supporting changes

  • pkg/prompt: new SelectOrdered arrow-key menu that preserves option order (the map-based Select renders in random map order). Both Select and MultiSelect now paginate: menus taller than the terminal scroll a fixed window that follows the cursor, with dim "N more" overflow markers. No new dependencies.
  • The seeder resolves project/app/environment via the arrow-key picker when flags are omitted

Verification

  • bazel test //pkg/prompt:prompt_test //pkg/logger:logger_test //cmd/dev/seed/checkpoints:checkpoints_test pass; generator tests assert the emitted series produces the same billable totals as the billing math.
  • Full mise run build and mise run fmt are green.
  • Ran the CLI under a pty to confirm the pretty handler output and terminal restore.

@Flo4604

Flo4604 commented Jun 10, 2026

Copy link
Copy Markdown
Member Author

This stack of pull requests is managed by jj-ryu.

@vercel

vercel Bot commented Jun 10, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
dashboard Ready Ready Preview, Comment Jun 11, 2026 4:30pm
design Ready Ready Preview, Comment Jun 11, 2026 4:30pm

Request Review

@Flo4604 Flo4604 force-pushed the seed-heimdall-checkpoints branch from e3cb26d to b28bd9d Compare June 10, 2026 16:33
@Flo4604 Flo4604 force-pushed the feat/meter-query branch from 41aa7df to 3612763 Compare June 10, 2026 16:40
@Flo4604 Flo4604 force-pushed the seed-heimdall-checkpoints branch from b28bd9d to da69564 Compare June 10, 2026 16:40
@Flo4604 Flo4604 force-pushed the seed-heimdall-checkpoints branch from da69564 to 446bde6 Compare June 10, 2026 16:53
@Flo4604 Flo4604 force-pushed the seed-heimdall-checkpoints branch from 446bde6 to 472e267 Compare June 10, 2026 18:51
@Flo4604 Flo4604 force-pushed the seed-heimdall-checkpoints branch from 472e267 to aa6aab6 Compare June 10, 2026 18:53
@Flo4604 Flo4604 changed the base branch from feat/meter-query to logger-pretty-handler June 10, 2026 18:53
Flo4604 added 4 commits June 11, 2026 18:28
…27.dahlia)

Sits at the bottom of the deploy-billing stack so every change above it is
written and tested against one SDK/API version. Full breaking-change audit in
ENG-2895; this change migrates the code that exists on main:

- API version pins -> 2026-05-27.dahlia (lib/stripe.ts, webhook route).
- New lib/stripe/invoiceCompat.ts: dual-shape readers for invoice
  subscription / payment intent / line price / line proration and the
  per-item subscription period (basil reshaped all of these). Webhook payload
  shapes follow the ENDPOINT's pinned API version, not the SDK's, so the
  helpers accept both shapes; after deploy, bump the webhook endpoint to
  2026-05-27.dahlia in Stripe, then the legacy halves can be removed.
- paymentUtils reads all go through the compat helpers.
- isAutomatedBillingRenewal compares only fields present in
  previous_attributes: basil+ endpoints report renewals as per-item
  current_period_* diffs, which the old comparison misread as plan changes.
- createSubscription pins billing_mode classic (clover defaults new
  subscriptions to flexible, which itemizes prorations differently).
- handleStripeError: v22 exports error classes as values, not types.

Stack changes above this one carry their own dahlia-isms: subscribeDeploy
billing_mode pin and price.product reads (deploy-subscribe-flows),
invoices.createPreview (deploy-project-gate), credit grants (ENG-2870).

ENG-2895
Base automatically changed from logger-pretty-handler to main June 12, 2026 16:40
@Flo4604 Flo4604 added this pull request to the merge queue Jun 12, 2026
Merged via the queue into main with commit 94a8fd0 Jun 12, 2026
15 checks passed
@Flo4604 Flo4604 deleted the seed-heimdall-checkpoints branch June 12, 2026 16:50
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.

3 participants