feat(dev): seed heimdall instance checkpoints for billing tests#6415
Merged
Conversation
This was referenced Jun 10, 2026
Member
Author
This stack of pull requests is managed by jj-ryu. |
e3cb26d to
b28bd9d
Compare
41aa7df to
3612763
Compare
b28bd9d to
da69564
Compare
da69564 to
446bde6
Compare
446bde6 to
472e267
Compare
472e267 to
aa6aab6
Compare
This was referenced Jun 10, 2026
aa6aab6 to
853590f
Compare
d7279a2 to
c8707eb
Compare
853590f to
b2b5373
Compare
This was referenced Jun 11, 2026
c8707eb to
77b58ae
Compare
b2b5373 to
f5778e4
Compare
77b58ae to
83c2e1c
Compare
f5778e4 to
b358505
Compare
…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
83c2e1c to
f420be9
Compare
b358505 to
e9152cc
Compare
ogzhanolguncu
approved these changes
Jun 12, 2026
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.
What
Adds
unkey dev seed checkpoints, which seeds a dense, billableinstance_checkpoints_v1series 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: newSelectOrderedarrow-key menu that preserves option order (the map-basedSelectrenders in random map order). BothSelectandMultiSelectnow paginate: menus taller than the terminal scroll a fixed window that follows the cursor, with dim "N more" overflow markers. No new dependencies.Verification
bazel test //pkg/prompt:prompt_test //pkg/logger:logger_test //cmd/dev/seed/checkpoints:checkpoints_testpass; generator tests assert the emitted series produces the same billable totals as the billing math.mise run buildandmise run fmtare green.