-
-
Notifications
You must be signed in to change notification settings - Fork 134
feat(billing): dual Stripe EE/US account support #3283
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
riderx
wants to merge
43
commits into
main
Choose a base branch
from
cursor/dual-stripe-billing-account-cd44
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
43 commits
Select commit
Hold shift + click to select a range
72138f2
feat(billing): dual Stripe EE/US account support
cursoragent 4fa7597
fix(billing): resolve lint and typecheck for dual Stripe PR
cursoragent 6ff149c
fix(tests): update stripe-emulator mock for dual billing admin calls
cursoragent fc4ffce
fix(billing): address CodeRabbit dual Stripe review feedback
cursoragent 7efe3cd
fix(billing): default ee when admin client unavailable in tests
cursoragent 2ef6465
fix(billing): check Stripe configured before constructing client
cursoragent e66991a
chore(ci): retrigger backend shard 4 after 502 flake
cursoragent 0f42215
fix(billing): rebase on main and address CR/Cubic review items
cursoragent 1acea2e
fix(billing): clear CR/Cubic review items on dual Stripe PR
cursoragent e19c03e
chore(ci): retrigger plugin serial shard after 502 flake
cursoragent 7726df3
chore(ci): retrigger after 502 flakes on shard 1 and CLI
cursoragent 2f09210
chore(ci): retrigger after duplicate-run shard 3/4 502 flake
cursoragent d9e6f99
test(billing): restore STRIPE_SECRET_KEY in stripe-redirects afterEach
cursoragent 6c3deca
ci(test): warm /app before backend shards to avoid 502 flakes
cursoragent 6dbbb81
ci(test): retry Supabase start on SIGTERM flakes in plugin job
cursoragent 6730345
ci(test): retry Cloudflare Workers startup on slow CI runners
cursoragent e1f7ad0
fix(billing,test): cubic P1 guards and stabilize POST /apikey CI
cursoragent f22fb21
fix(billing): seed US plan ids and relax stripe org unit test coupling
cursoragent 58dcd29
fix(billing): sync dual-stripe types and relax emulator test assertion
cursoragent 06ada0b
fix(billing): skip audit logs for background counter updates regardle…
cursoragent 1bcdaff
fix(billing): address CodeRabbit review on HEAD 06ada0b
cursoragent 09bb211
fix(billing): allow hyphen/underscore in Stripe product id validation
cursoragent afa8a68
chore(ci): retrigger workflows after shard 6 startup flake
cursoragent 7432f49
fix(billing): account-scoped admin plan joins and checkout error prop…
cursoragent 78d8543
test(billing): mock dual-account plan lookup in stripe redirect tests
cursoragent ca25cd7
fix(billing): finish admin plan joins and checkout lookup test
cursoragent 5bfa225
fix(billing): address CodeRabbit review on ca25cd748
cursoragent 39ce0b4
fix(billing): allow host.docker.internal for Playwright Stripe emulator
cursoragent e0c747a
fix(ci): warm edge routes before Capgo CLI integration tests
cursoragent ff08e9f
fix(billing): address CodeRabbit credit lookup and config review items
cursoragent 2f7bc40
fix(stripe): propagate plan lookup errors instead of Solo fallback
cursoragent f3ed36b
test(apikeys): warm POST route before tracked warmup key
cursoragent 6171c57
fix(stripe): reject http API base URL for live credentials
cursoragent 1f58c37
merge(main): resolve conflicts and pick up request_actor_email_adress…
cursoragent f0b675c
fix(ci): restore Playwright Stripe emulator env and published CLI RPC
cursoragent 71c6460
fix(billing): use resolvePlanCreditProductId for credit top-up fallback
cursoragent f0a1021
fix(billing): resolvePlanCreditProductId in auto top-up Solo fallback
cursoragent 04da928
fix(db): re-stamp dual stripe migration after main merge
cursoragent 47bfaf3
test(updates): retry transient Kong 502 on POST /updates
cursoragent 2b4af89
fix(billing): use resolvePlanCreditProductId in credits Solo fallbacks
cursoragent fea0899
fix(db): re-stamp dual stripe migration to 20260923105200
cursoragent 89f407e
docs: remove fixed review tip rule (#3428)
WcaleNieWolny 08e4bd0
fix(billing): address CodeRabbit review on HEAD 89f407ea
cursoragent File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,57 @@ | ||
| #!/usr/bin/env bash | ||
|
|
||
| set -euo pipefail | ||
|
|
||
| max_attempts="${CLOUDFLARE_WORKERS_START_MAX_ATTEMPTS:-2}" | ||
| worker_port_offset="${CLOUDFLARE_WORKER_PORT_OFFSET:-0}" | ||
| log_path="${CLOUDFLARE_WORKERS_LOG_PATH:-${RUNNER_TEMP:-/tmp}/cloudflare-workers.log}" | ||
| wait_timeout_ms="${CLOUDFLARE_WORKERS_WAIT_TIMEOUT_MS:-180000}" | ||
| worker_pids=() | ||
|
|
||
| stop_worker_pid() { | ||
| local pid="$1" | ||
| if [[ -z "${pid}" ]]; then | ||
| return | ||
| fi | ||
| kill "${pid}" 2>/dev/null || true | ||
| pkill -P "${pid}" 2>/dev/null || true | ||
| } | ||
|
|
||
| stop_all_worker_pids() { | ||
| local pid | ||
| for pid in "${worker_pids[@]}"; do | ||
| stop_worker_pid "${pid}" | ||
| done | ||
| } | ||
|
|
||
| export BACKGROUND_SERVICE_NAME="${BACKGROUND_SERVICE_NAME:-Cloudflare Workers}" | ||
| export BACKGROUND_RUN_COMMAND="${BACKGROUND_RUN_COMMAND:-$'chmod +x scripts/start-cloudflare-workers.sh\nexec ./scripts/start-cloudflare-workers.sh'}" | ||
| export BACKGROUND_LOG_PATH="${log_path}" | ||
| export BACKGROUND_WAIT_TIMEOUT_MS="${wait_timeout_ms}" | ||
| export BACKGROUND_TAIL_LINES="${BACKGROUND_TAIL_LINES:-400}" | ||
| export BACKGROUND_WAIT_ON="http-get://127.0.0.1:$((8787 + worker_port_offset))/ok | ||
| http-get://127.0.0.1:$((8788 + worker_port_offset))/ok | ||
| http-get://127.0.0.1:$((8789 + worker_port_offset))/ok" | ||
|
|
||
| for attempt in $(seq 1 "${max_attempts}"); do | ||
| if bash .github/scripts/start-background-service.sh; then | ||
| exit 0 | ||
| else | ||
| exit_code=$? | ||
| if [[ -n "${GITHUB_OUTPUT:-}" ]] && [[ -f "${GITHUB_OUTPUT}" ]]; then | ||
| latest_pid="$(grep '^pid=' "${GITHUB_OUTPUT}" | tail -1 | cut -d= -f2- || true)" | ||
| if [[ -n "${latest_pid}" ]]; then | ||
| worker_pids+=("${latest_pid}") | ||
| stop_worker_pid "${latest_pid}" | ||
| fi | ||
| fi | ||
| echo "Cloudflare Workers failed to become ready with exit ${exit_code} (attempt ${attempt}/${max_attempts})" >&2 | ||
| if [ "${attempt}" -eq "${max_attempts}" ]; then | ||
| stop_all_worker_pids | ||
| exit "${exit_code}" | ||
| fi | ||
| sleep_seconds=$((attempt * 10)) | ||
| echo "Retrying Cloudflare Workers startup in ${sleep_seconds}s..." >&2 | ||
| sleep "${sleep_seconds}" | ||
| fi | ||
| done | ||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| #!/usr/bin/env bash | ||
|
|
||
| set -euo pipefail | ||
|
|
||
| max_attempts="${SUPABASE_START_MAX_ATTEMPTS:-3}" | ||
| exclude_services="${SUPABASE_START_EXCLUDE:-imgproxy,studio,mailpit,realtime,postgres-meta,supavisor,logflare,vector}" | ||
|
|
||
| for attempt in $(seq 1 "${max_attempts}"); do | ||
| bun scripts/supabase-worktree.ts stop --no-backup || true | ||
| if bun scripts/supabase-worktree.ts start -x "${exclude_services}"; then | ||
| exit 0 | ||
| else | ||
| exit_code=$? | ||
| echo "Supabase start failed with exit ${exit_code} (attempt ${attempt}/${max_attempts})" >&2 | ||
| if [ "${attempt}" -eq "${max_attempts}" ]; then | ||
| exit "${exit_code}" | ||
| fi | ||
| sleep_seconds=$((attempt * 5)) | ||
| echo "Retrying Supabase start in ${sleep_seconds}s..." >&2 | ||
| sleep "${sleep_seconds}" | ||
| fi | ||
| done |
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
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
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
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.