fix(infra): scope the DAO API DB image and cover its entrypoint in CI - #2105
Open
brunod-e wants to merge 2 commits into
Open
fix(infra): scope the DAO API DB image and cover its entrypoint in CI#2105brunod-e wants to merge 2 commits into
brunod-e wants to merge 2 commits into
Conversation
Railway watches the entire repo when watchPatterns is unset, so once the 17 Postgres services are pointed at this config, every merge to dev would rebuild and restart the whole database fleet at the same time. Restarting a stateless service on an unrelated commit is cheap; doing it to 17 production databases is not. Nothing outside infra/dao-api-db can change what these services run, so the pattern is the image's own directory, identical for every DB service. Deliberately no [environments.pr.deploy] NOOP, unlike the other services: the DAO APIs are not NOOP'd in PR environments, so they need their database to actually be serving there. A NOOP'd database is a broken preview, not a saved dollar.
The entrypoint already ships assertions for the four fleet tiers, both clamp boundaries and both fallback paths, and the PR that introduced it cites them as verification — but nothing runs them. A wrong derivation mis-provisions every DAO database at once, and the memory tiers it keys off are set in the Railway UI, so the repo gives no other signal that the table drifted from the fleet. Two seconds of bash, no dependencies, no paths filter: the job is cheaper than deciding whether it needed to run.
brunod-e
requested review from
LeonardoVieira1630,
PedroBinotto,
alextnetto and
pikonha
as code owners
August 5, 2026 17:37
|
The latest updates on your projects. Learn more about Vercel for GitHub.
1 Skipped Deployment
|
|
🚅 Deployed to the anticapture-pr-2105 environment in anticapture-infra
|
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.
Targets
chore/dao-api-db-image, notdev— this is the two mechanical items from my review on #2099, so they can land without you re-deriving them. The two findings that need your judgement (thepostgres-exporterdependency and themax_connectionsfloor vs the API's three pools) are deliberately not touched here.1.
watchPatternson the DB imageRailway watches the whole repo when
watchPatternsis unset. Once the 17 Postgres services are pointed atdao-api-db.railway.toml, every merge todevwould rebuild and restart the entire database fleet on commits that cannot affect them. Scoped toinfra/dao-api-db/**, which is the only directory that changes what these services run.Correcting myself from the review: I also flagged the missing
[environments.pr.deploy]NOOP block there, on the grounds that every other repo-backed service carries one. That was wrong and I did not implement it. The DAO APIs are not NOOP'd in PR environments, so they need a live database to serve against — NOOPing the DB would break every preview rather than save anything.postgres-exportercan carry the NOOP because it is only a scraper. The absence is correct; onlywatchPatternswas missing.2. The self-test runs in CI
entrypoint.dao-api-db.shships assertions for the four fleet tiers, both clamp boundaries and both fallback paths, and #2099 cites them as verification — but nothing executes them. A wrong derivation mis-provisions every DAO database simultaneously, and the tiers it keys off live in the Railway UI, so the repo has no other way to notice the table drifting from the fleet.New
dao-api-db-entrypointjob intests.yaml: checkout, thenbash infra/dao-api-db/entrypoint.dao-api-db.sh --self-test. No pnpm install, no paths filter — running it unconditionally is cheaper than deciding whether it needed to run.Verified
bash infra/dao-api-db/entrypoint.dao-api-db.sh --self-test→self-test OK, exit 0, from the repo root exactly as the job invokes ittests.yamlparses; the job resolves toruns-on: ubuntu-latestwith the two expected stepsdao-api-db.railway.tomlstill parses withbuild.watchPatternsas a listyellow-windows-swim.mdon the base branch — infra and CI only, no workspace package changes