Skip to content

fix(basket): allow self-hosted ingestion without hosted billing - #805

Merged
izadoesdev merged 1 commit into
stagingfrom
codex/selfhost-ingestion-billing
Sep 17, 2026
Merged

izadoesdev merged 1 commit into
stagingfrom
codex/selfhost-ingestion-billing

Conversation

@izadoesdev

@izadoesdev izadoesdev commented Sep 15, 2026

Copy link
Copy Markdown
Member

Summary

Self-hosted browser events and server /track requests failed with 503 because their shared quota check required an Autumn billing key. Skip that hosted billing check when SELFHOST=true, so both ingestion paths can use the existing direct ClickHouse delivery path.

Hosted behavior is preserved: with SELFHOST unset or false, the existing quota enforcement and billing failure responses remain unchanged. The fix adds four production lines and a regression case to the existing suite.

Validation

  • Independent review completed.
  • Regression test failed before the fix and passed afterward.
  • All 492 Basket tests passed on current staging.
  • Root lint and all 33 typecheck tasks passed.

Companion self-hosting setup work: #804. This PR branches directly from staging and has no dependency on another feature branch.


Summary by cubic

Self-hosted browser events and server /track requests no longer return 503 when hosted billing is unavailable: with SELFHOST=true, ingestion skips the Autumn quota check and uses direct ClickHouse delivery. Hosted deployments retain the existing quota enforcement and billing error behavior, with regression coverage added for the self-hosted path.

Written for commit a23574f. Summary will update on new commits.

Review in cubic

@vercel

vercel Bot commented Sep 15, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated
databuddy-status Ready Ready Preview Sep 16, 2026 8:14pm UTC
2 Skipped Deployments
Project Deployment Actions Updated
dashboard Skipped Skipped Sep 16, 2026 8:14pm UTC
documentation Skipped Skipped Sep 16, 2026 8:14pm UTC

@coderabbitai

coderabbitai Bot commented Sep 15, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Advanced

Run ID: 265aacf2-1a69-4810-b939-bd24080935e4

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@izadoesdev
izadoesdev force-pushed the codex/selfhost-ingestion-billing branch from 149e1c0 to a23574f Compare September 16, 2026 20:13
@vercel
vercel Bot temporarily deployed to Preview – documentation September 16, 2026 20:13 Inactive
@vercel
vercel Bot temporarily deployed to Preview – dashboard September 16, 2026 20:13 Inactive
@unkey-deploy

unkey-deploy Bot commented Sep 16, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Unkey Deploy

Name Status Preview Inspect Updated (UTC)
links (preview) Ready Visit Preview Inspect Sep 16, 2026 8:14pm

@greptile-apps

greptile-apps Bot commented Sep 17, 2026

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

The PR appears safe to merge because the bypass affects only the intended self-hosted event-ingestion callers and hosted billing behavior remains intact.

Summary

The PR allows self-hosted Basket ingestion to operate without hosted Autumn billing configuration while preserving existing hosted quota behavior.

  • Short-circuits the Autumn usage check when SELFHOST=true.
  • Covers the self-hosted bypass with a regression test.
  • Leaves hosted quota enforcement and billing error handling unchanged.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[Basket ingestion request] --> B[checkAutumnUsage]
    B --> C{SELFHOST enabled?}
    C -->|Yes| D[Allow ingestion without Autumn]
    C -->|No| E[Check Autumn quota and record usage]
    E --> F{Quota available?}
    F -->|Yes| G[Allow ingestion]
    F -->|No or billing unavailable| H[Return existing billing error]
Loading

Reviews (1) · Last reviewed commit: "fix(basket): skip hosted billing for sel..."

@izadoesdev
izadoesdev merged commit 9f058cb into staging Sep 17, 2026
20 checks passed
@izadoesdev
izadoesdev deleted the codex/selfhost-ingestion-billing branch September 17, 2026 06:59
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