Repository navigation
Conversation
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Automations to automatically generate PRs for you. |
…iable at it, never orphan it
…nup, cleanup matches only our branches
…py; flag Postgres URLs in .env files
This branch was successfully 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.
The first piece of the "simulated world" (PRD §0): the app under test gets its own throwaway copy of the database, not a shared staging database.
prescale run http://localhost:3000 --app "npm run build && npm start" --db neon --db-parent stagingWith
--db neononrun,investigateorci, PreScale:read_writecompute and waits for Neon's operations to finish--app) withDATABASE_URL, or--db-env VAR, set to the copy's connection URLprescale-…branch to remove by hand.Why: journeys that write (sign-ups, carts, orders) change the copy, never staging. The load runs on the copy's own compute, never the parent's. Neon's own guide describes this exact use ("load tested it with k6 on the branch's own compute").
Safety rules, in code:
--db-parentis required. The default branch is often production, so PreScale never picks it.--dbrequires--app. Only an app PreScale starts can be pointed at the copy.Branchdataclass hides it fromrepr. Saved runs record onlyconfig.database: {provider, parent, database}, plus a warning that the copy's compute may be sized differently from production's.NEON_API_KEY/NEON_PROJECT_IDstops the run before the app starts.Neon API used (
console.neon.tech/api/v2, Bearer auth):GET /projects/{id}/branchesto find the parent by name or IDPOST /projects/{id}/brancheswith{branch: {parent_id, name}, endpoints: [{type: read_write}]}GET /projects/{id}/operations/{op}untilfinished;failed/error/cancelledraise, and the half-made branch is still deletedGET …/branches/{b}/databasesto pick the database: the only one, or--db-nameGET /projects/{id}/connection_urifor the URL, withpooledfrom--db-pooledDELETE /projects/{id}/branches/{b}Not in this slice:
expires_at), which is early-access only. Cleanup relies on the delete infinally.How it was verified
cli/tests/test_dbbranch.py, 10 new):--db-name;--db-pooledis passed--dbwithout--appor--db-parentis a usage errorprescale run --app <real python server> --db neon --db-parent staging --json, with the fake Neon.DATABASE_URL.config.databaseand the note.ruff check cli/src cli/tests: clean ·pytest cli/tests -q: 378 passed.Risk
Tier: risky. It calls an external API with a secret, creates and deletes cloud resources, and adds new public flags.
Public surface:
--db,--db-parent,--db-name,--db-env,--db-pooledNEON_API_KEY,NEON_PROJECT_IDconfig.database(additive)Nothing changes without
--db.Rollback: revert. Without
--db, behaviour is identical.Worst case: a
prescale-…branch is left behind if both the run and the delete fail. PreScale names it.Generated by Claude Code