feat(e2e): split CI env vars into staging/production secrets; manual prod opt-in #200
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/pms-271-e2e-staging-prod-secrets"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Splits the Playwright E2E suite's CI configuration into per-environment Forgejo Actions secrets and adds a manual production opt-in. Closes PMS-271.
Previously the suite held one flat set of
E2E_*secrets, so CI could only ever target a single deployment. Forgejo has no GitHub-style environments, so the secret names themselves must encode the environment.Changes
E2E_STAGING_*/E2E_PRODUCTION_*pairs. The jobenv:block maps the selected environment onto the plainE2E_*names per var via${{ inputs.environment == 'production' && secrets.E2E_PRODUCTION_<NAME> || secrets.E2E_STAGING_<NAME> }}. Because the mapping lands on the plain names,e2e/lib/env.ts,e2e/scripts/wait-for-deploy.mjs, ande2e/scripts/health-check.mjsare unchanged, and local.envstill uses the plain names.workflow_dispatchgains anenvironmentchoice input (stagingdefault /production). Automaticpush/pull_requestruns resolve to staging (emptyinputscontext); production runs only on a human dispatch that selects it, since the suite is write-heavy and shares one rate-limited account.wait-for-deploy.mjs) runs onpushand on a staging dispatch; the reachability check (health-check.mjs) runs onpull_requestand on a production dispatch. A production dispatch does NOT run the SHA-polling gate (the dispatched commit is unlikely to be what prod serves, so it would time out).e2e/README.mdande2e/.env.exampleexplain the prefixed-secret convention, the per-run mapping, the unchanged plain local.env, production-is-manual-dispatch-only, and a per-secret rotation-source record.Operator follow-up (not covered by this code change)
E2E_STAGING_<NAME>/E2E_PRODUCTION_<NAME>secret pairs in the Forgejo Actions secret store (migrate current values into the staging set, then populate production).E2E_*secrets once the workflow is cut over, so a stale value cannot silently win.Verification
python3 -c "import yaml; yaml.safe_load(open('.forgejo/workflows/e2e.yml'))"parses clean..forgejo/workflows/e2e.yml,e2e/README.md,e2e/.env.example; the suite code and gate scripts are untouched.