preview: rename api.<host> -> api-aws.<host> - #101
Open
ddimaria wants to merge 2 commits into
Open
Conversation
Pairs with the quadratic repo rename (api -> api-aws in local/preview), which lets prod rename developer-api -> api without naming collisions.
QUADRATIC_API_URL_EXTERNAL is baked into the client at container start via replace_env_vars.sh, so it must move in lockstep with the Caddyfile route change.
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.
Why
In
quadratichq/quadratic, the public developer API is being renameddeveloper-api.quadratichq.com->api.quadratichq.comin production (a mgmt request). To avoid the "api" name meaning two different things across environments, the internal API is being aligned toapi-awseverywhere except prod/qa (which already useapi-aws.quadratichq.comandapi-pr-qa.quadratic-preview.comrespectively).The companion change in the quadratic repo updates:
docker-compose.ymllocal profile + container name ->api-awspreview-build-deploy-test.ymlverify step now hitshttps://api-aws.<branch>.quadratic-preview.com/healthThat verify step (and any preview client that talks to the internal API) will fail until this PR ships, because the preview Caddy proxy currently only knows about
api.<host>.What changed
docker/caddy/config/Caddyfile.aws-preview-- rename theapi.#HOST#site block toapi-aws.#HOST#. Same backend (host.docker.internal:8000), only the matching hostname changes..env.aws-preview--QUADRATIC_API_URL_EXTERNALfromhttps://api.#HOST#tohttps://api-aws.#HOST#. This value is injected into the client bundle at container start viareplace_env_vars.sh, so it has to move in lockstep with the Caddy route, otherwise the preview client browser keeps trying the old hostname and gets nothing.Caddyfile.aws(customer self-hosted) and.env.aws(same) are deliberately untouched -- customer-facing self-hosts keepapi.<host>.Rollout
This PR can be merged independently of the quadratic-repo PR. After merge:
api.<branch>until they are rebuilt (no auto-redeploy on this repo).If you want a zero-downtime cutover where both routes work, swap the Caddyfile change for an additional
api-aws.#HOST#block (keeping theapi.#HOST#block) and skip the .env change for now -- happy to redo if preferred.Test plan
verify_deployed_versionmatrix entryapi-awsreturns 200.VITE_QUADRATIC_API_URLsubstitution worked).