Repository navigation
Start configurable CI/CD policy and safer database releases - #114
Draft
agreenspan wants to merge 5 commits into
Draft
agreenspan wants to merge 5 commits into
agreenspan wants to merge 5 commits into
Conversation
Seeding ran unconditionally on every release, for both strategies. The email template and component seeds are non-prime and not createOnly, so each production deploy silently reverted every template edited through the admin UI. Now gated on database.seedOnRelease, written explicitly as false in cicd.config.ts rather than left to a schema default — seeding production should be visible in the config, not inherited. db:push:force used `[ ... ] && push || echo`, which printed its refusal and exited 0, so any `db:push:force && <next>` chain continued as though the push had succeeded. Now an if/else that exits 1. Verified with ENV=prod. restore.sh sources .env.local, which only sets the keys that file defines, so an ambient DATABASE_URL wins in a fresh clone or an inherited shell — and pg_restore --clean DROPs every object in the target. Refuses non-local targets, and refuses an unset URL rather than falling through. prisma.config.ts migrate.url() now reads MIGRATE_DATABASE_URL, falling back to DATABASE_URL, so schema changes can use the owning role while services run as a role that cannot drop or truncate. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
…itch; drop fixed-value policy keys - database.seedOnRelease defaults to true. The non-prime seeds carry system data production needs (3 cron jobs, 2 email components, 3 email templates); with seeding off a fresh deploy silently had none. Seed failure still stops the release. databaseReleaseCommands takes seeding explicitly. - database.strategy now decides schema behavior everywhere: setup.sh reads it (scripts/cicd/databaseStrategy.ts) instead of project.config launched, and scripts/checkLaunched.ts is gone. Launch requires a committed migration baseline and sets strategy=migrations before flipping launched, which now only records that launch ran. The schema-push/migrations mismatch error names the command that fixes it. - production.deploy, pullRequests.cleanupOnClose and checks were literal-only settings nothing read; they are invariants, documented as such. - zod range matches the rest of the repo (^4.3.6). - Merged origin/main (NODE_ENV test pin, CI rule fix). Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This branch has not been deployed
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Template deployment choices are currently scattered across init and provider settings, and Vercel's main-only configuration still permits unspecified branches. This draft starts a committed delivery policy and fixes the branch allowlist for web, admin and superadmin.
Implemented:
cicd.config.tswith automatic main deployment policy, independent PR/draft auto/manual settings, staging on/off, a nonnegative merge-approval count, and optional bot approvals.--section=cicdsettings. Init and shell environment selection use the same effective staging configuration.--accept-data-loss, refuses missing/conflicting migration history, and stops on schema/seed failures. No migration baseline or database mutation is performed by this PR.This is the first implementation slice, not a complete deployment system. Cloud deployment/teardown execution, resource reconciliation, remote approval enforcement and the DevOps dashboard remain pending in
docs/CICD-PROPOSAL.md. The planner explicitly reports plan-only output; changing policy does not claim to apply GitHub or cloud settings.Validation:
bun run check:cicd: passes (typecheck, 15 tests, 64 assertions).init:agent --section=cicdcommand: passes.CI/CD policy checks: passes on the PR head.bun run check: fails at three frontend tests (252 pass, 3 fail): signup verification rendering, logout rendering (React.act is not a function), and live-query subscription. These failures also reproduce running the UI suite separately.No merge or deployment is requested by this draft. No cloud resources or repository protection settings have been modified.