Skip to content

fix: production-readiness blockers — Polar prod fallback, CI gate, base-image pinning#38

Draft
cooper (czxtm) wants to merge 1 commit into
mainfrom
claude/peaceful-volta-DJMmq
Draft

fix: production-readiness blockers — Polar prod fallback, CI gate, base-image pinning#38
cooper (czxtm) wants to merge 1 commit into
mainfrom
claude/peaceful-volta-DJMmq

Conversation

@czxtm
Copy link
Copy Markdown
Member

@czxtm cooper (czxtm) commented Jun 3, 2026

Production-readiness blockers

From this session's production-readiness audit. The hosted E2E smoke harness already landed in #37; this PR fixes the three prod blockers surfaced by the audit.

1. 🔴 Polar silently fell back to sandbox in production

packages/auth/src/lib/polar-products.ts returned process.env.POLAR_*_PRODUCTION ?? SANDBOX_* for production. If a prod env var was missing (or STACKPANEL_DEPLOY_ENV/NODE_ENV was unset), real users would get sandbox products and checkouts would not charge real cards — with no error.

  • Now fails fast in production when the prod IDs are unconfigured.
  • Adds a strict flag (default true); planForProduct() (webhook inverse-lookup, which walks all envs) calls it with strict:false so it still resolves ids outside a prod runtime.

2. 🔴 No build/test/typecheck gate on PRs

ci.yml (om ci) and test-fixtures.yml have their push/pull_request triggers commented out (CodeQL + preview deploys run, but nothing compiles/tests the code).

  • Adds .github/workflows/ci-checks.yml: a lightweight PR gate running vp check + vp test via setup-vp (the repo's documented Vite+ CI integration), kept separate from the heavy Nix om ci (which stays workflow_dispatch-only).

3. 🔴 Container base images not pinned

nix/stackpanel/lib/containers.nix: node/alpine/distroless/nginx carried placeholder digests (sha256:latest, etc.) + lib.fakeSha256; only bun (the prod runtime) is pinned.

  • pullBaseImage now refuses to build from an unpinned base image with a clear, actionable error instead of a cryptic fakeSha256 mismatch, and documents pinning via nix-prefetch-docker.

Validation & caveats

  • Polar change typechecks clean in isolation (strict).
  • ⚠️ containers.nix was not nix eval-validated — this sandbox has no Nix. Standard assert lib.assertMsg idiom; please confirm in a Nix env.
  • The new ci-checks.yml runs on this PR — it may surface pre-existing check/test failures (that's the point of adding the gate).
  • Fully pinning the remaining base-image digests needs nix-prefetch-docker (Nix tooling) and is left as a follow-up with instructions in-code.

https://claude.ai/code/session_01TMCMpDmbLomRBZbg3FpvMV


Generated by Claude Code


View with Codesmith Autofix with Codesmith
Need help on this PR? Tag /codesmith with what you need. Autofix is disabled.

…e-image pinning)

- auth: fail-fast in production when Polar product IDs are unconfigured instead
  of silently serving sandbox products (which would not charge real cards). Adds
  a `strict` flag so the webhook inverse-lookup still resolves ids across envs.
- ci: add a lightweight PR gate (vp check + vp test via setup-vp), kept separate
  from the heavy Nix `om ci` workflow which stays workflow_dispatch-only.
- nix(containers): refuse to build from an unpinned base image (still
  lib.fakeSha256) with a clear, actionable error instead of a cryptic hash
  mismatch; document pinning via nix-prefetch-docker.

https://claude.ai/code/session_01TMCMpDmbLomRBZbg3FpvMV
Comment on lines +18 to +35
name: check & test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Set up Vite+ toolchain
uses: voidzero-dev/setup-vp@v1
with:
cache: true

- name: Install dependencies
run: vp install

- name: Format, lint, and typecheck
run: vp check

- name: Run tests
run: vp test
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 3, 2026

Preview deployed to pr-38https://pr-38.stackpanel.com

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 3, 2026

Docs preview deployed to pr-38

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