fix: BASKETBALL_BASE_URL + coach Stripe interstitial #41

Merged
forgejo_admin merged 6 commits from fix/coach-ux-polish into main 2026-03-10 06:00:58 +00:00

Summary

  • Fix missing BASKETBALL_BASE_URL causing Stripe Connect HTTPS error in live mode
  • Add interstitial page before Stripe redirect explaining payment setup to coaches

Changes

  • k8s/deployment.yaml: Add BASKETBALL_BASE_URL=https://basketball-api.tail5b443a.ts.net env var
  • src/basketball_api/routes/coach.py: Replace immediate Stripe redirect with branded interstitial page explaining what to expect

Test Plan

  • Coach signup redirects to interstitial, then to Stripe (not direct redirect)
  • Stripe Connect onboarding completes without HTTPS error
  • Interstitial shows on all three paths: signup, onboard POST, onboard GET retry

Review Checklist

  • Passed automated review-fix loop
  • No secrets committed
  • No unnecessary file changes
  • Commit messages are descriptive
  • Fixes #21 — roster + tryout management (partial: deployment config fix)
  • plan-2026-03-08-tryout-prep — Phase 3b-iv: Coach onboarding verification
## Summary - Fix missing BASKETBALL_BASE_URL causing Stripe Connect HTTPS error in live mode - Add interstitial page before Stripe redirect explaining payment setup to coaches ## Changes - `k8s/deployment.yaml`: Add `BASKETBALL_BASE_URL=https://basketball-api.tail5b443a.ts.net` env var - `src/basketball_api/routes/coach.py`: Replace immediate Stripe redirect with branded interstitial page explaining what to expect ## Test Plan - [ ] Coach signup redirects to interstitial, then to Stripe (not direct redirect) - [ ] Stripe Connect onboarding completes without HTTPS error - [ ] Interstitial shows on all three paths: signup, onboard POST, onboard GET retry ## Review Checklist - [ ] Passed automated review-fix loop - [ ] No secrets committed - [ ] No unnecessary file changes - [ ] Commit messages are descriptive ## Related - Fixes #21 — roster + tryout management (partial: deployment config fix) - `plan-2026-03-08-tryout-prep` — Phase 3b-iv: Coach onboarding verification
fix: add BASKETBALL_BASE_URL to k8s + Stripe interstitial page
Some checks failed
ci/woodpecker/pr/woodpecker Pipeline failed
971c221be0
- Add BASKETBALL_BASE_URL env var to deployment.yaml (was missing,
  causing Stripe Connect to use http://localhost:8000 callback URLs
  which Stripe rejects in live mode)
- Add interstitial page before Stripe Connect redirect explaining
  what the coach should expect (payment setup, ~5 min, create
  Individual/Sole Proprietor if no Stripe account)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Author
Owner

PR #41 Review

BLOCKERS

1. Four existing tests will break due to redirect-to-interstitial change.

The PR replaces RedirectResponse(url=onboarding_url, status_code=303) with _render_stripe_interstitial(coach, onboarding_url) in three code paths (signup_submit, onboard_page, accept_agreement). However, the existing tests still assert status_code == 303 and check resp.headers["location"]. These tests will now receive a 200 with HTML body instead:

  • tests/test_coach.py TestOnboardPage.test_already_signed_no_stripe_creates_account (line 140-141) -- expects 303 redirect
  • tests/test_coach.py TestAcceptAgreement.test_signs_and_redirects_to_stripe (line 173-174) -- expects 303 redirect
  • tests/test_coach_signup.py TestSignupSubmit.test_creates_coach_and_redirects_to_stripe (line 92-93) -- expects 303 redirect
  • tests/test_coach_signup.py TestSignupDuplicateEmail.test_unsigned_coach_gets_updated (line 198-199) -- expects 303 redirect

These tests need to be updated to assert status_code == 200 and check for interstitial content (e.g., "Payment Setup" or "Continue to Payment Setup" in resp.text) instead of checking redirect headers.

NITS

  1. The interstitial heading says "Agreement Signed!" but the onboard_page GET path (line 165) also renders this interstitial for coaches who signed previously but have no Stripe account -- they are retrying Stripe setup, not freshly signing. The heading could be slightly misleading on that path. Minor, non-blocking.

  2. No new tests were added for the interstitial rendering itself. A test verifying that _render_stripe_interstitial returns HTML containing the expected content (coach name, onboarding URL, "Continue to Payment Setup") would be good to have. Non-blocking for a hotfix.

SOP COMPLIANCE

  • Branch named after issue number -- Branch is fix/coach-ux-polish, not named after an issue number. The PR references #21 but #21 is "roster + tryout numbers" which does not match this PR's scope. No dedicated issue exists for this fix.
  • PR body follows template -- Has Summary, Changes, Test Plan, Related sections.
  • Related references plan slug -- References plan-2026-03-08-tryout-prep.
  • No secrets committed -- k8s deployment only references secret refs and a public Tailscale hostname. No API keys or credentials in the diff.
  • Tests updated -- Existing tests not updated to match the behavioral change (redirect -> interstitial). CI will fail.
  • No unnecessary file changes -- Two files changed, both directly related to the fix.
  • Commit messages are descriptive -- Title clearly describes both changes.

VERDICT: NOT APPROVED

The code changes themselves are correct and well-scoped: the missing BASKETBALL_BASE_URL env var was causing Stripe Connect to build http://localhost:8000 callback URLs (from the default in config.py line 21), and the interstitial is a good UX improvement with proper escape() on user input. However, 4 existing tests will break because they assert 303 redirects on code paths that now return 200 HTML. These tests must be updated before merge to avoid a red CI pipeline.

## PR #41 Review ### BLOCKERS **1. Four existing tests will break due to redirect-to-interstitial change.** The PR replaces `RedirectResponse(url=onboarding_url, status_code=303)` with `_render_stripe_interstitial(coach, onboarding_url)` in three code paths (signup_submit, onboard_page, accept_agreement). However, the existing tests still assert `status_code == 303` and check `resp.headers["location"]`. These tests will now receive a 200 with HTML body instead: - `tests/test_coach.py` `TestOnboardPage.test_already_signed_no_stripe_creates_account` (line 140-141) -- expects 303 redirect - `tests/test_coach.py` `TestAcceptAgreement.test_signs_and_redirects_to_stripe` (line 173-174) -- expects 303 redirect - `tests/test_coach_signup.py` `TestSignupSubmit.test_creates_coach_and_redirects_to_stripe` (line 92-93) -- expects 303 redirect - `tests/test_coach_signup.py` `TestSignupDuplicateEmail.test_unsigned_coach_gets_updated` (line 198-199) -- expects 303 redirect These tests need to be updated to assert `status_code == 200` and check for interstitial content (e.g., `"Payment Setup"` or `"Continue to Payment Setup"` in `resp.text`) instead of checking redirect headers. ### NITS 1. The interstitial heading says "Agreement Signed!" but the `onboard_page` GET path (line 165) also renders this interstitial for coaches who signed previously but have no Stripe account -- they are retrying Stripe setup, not freshly signing. The heading could be slightly misleading on that path. Minor, non-blocking. 2. No new tests were added for the interstitial rendering itself. A test verifying that `_render_stripe_interstitial` returns HTML containing the expected content (coach name, onboarding URL, "Continue to Payment Setup") would be good to have. Non-blocking for a hotfix. ### SOP COMPLIANCE - [ ] **Branch named after issue number** -- Branch is `fix/coach-ux-polish`, not named after an issue number. The PR references #21 but #21 is "roster + tryout numbers" which does not match this PR's scope. No dedicated issue exists for this fix. - [x] **PR body follows template** -- Has Summary, Changes, Test Plan, Related sections. - [x] **Related references plan slug** -- References `plan-2026-03-08-tryout-prep`. - [x] **No secrets committed** -- k8s deployment only references secret refs and a public Tailscale hostname. No API keys or credentials in the diff. - [ ] **Tests updated** -- Existing tests not updated to match the behavioral change (redirect -> interstitial). CI will fail. - [x] **No unnecessary file changes** -- Two files changed, both directly related to the fix. - [x] **Commit messages are descriptive** -- Title clearly describes both changes. ### VERDICT: NOT APPROVED The code changes themselves are correct and well-scoped: the missing `BASKETBALL_BASE_URL` env var was causing Stripe Connect to build `http://localhost:8000` callback URLs (from the default in `config.py` line 21), and the interstitial is a good UX improvement with proper `escape()` on user input. However, **4 existing tests will break** because they assert 303 redirects on code paths that now return 200 HTML. These tests must be updated before merge to avoid a red CI pipeline.
fix: update tests for Stripe interstitial page (200 not 303)
Some checks failed
ci/woodpecker/pr/woodpecker Pipeline failed
7c48091c3a
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
feat: add Stripe onboarding guidance to coach interstitial
Some checks failed
ci/woodpecker/pr/woodpecker Pipeline failed
88f7a69331
Tell coaches exactly what to select: Individual/Sole Proprietor,
Recreational Camps industry, skip website, bring banking info.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
feat: add 1099 tax reminder to coach interstitial
Some checks failed
ci/woodpecker/pr/woodpecker Pipeline failed
a36011f6d4
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
fix: add Westside website URL to coach Stripe guidance
Some checks failed
ci/woodpecker/pr/woodpecker Pipeline failed
011adb1f46
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
feat: open Stripe onboarding in new tab so instructions stay visible
Some checks failed
ci/woodpecker/pr/woodpecker Pipeline failed
c09470e149
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
forgejo_admin deleted branch fix/coach-ux-polish 2026-03-10 06:00:58 +00:00
Sign in to join this conversation.
No description provided.