From 62baeae197eadde1d71f28c73e54bb715f1f9524 Mon Sep 17 00:00:00 2001 From: Bruno D Date: Wed, 5 Aug 2026 14:36:01 -0300 Subject: [PATCH 1/2] fix(infra): scope the DAO API DB image to its own watch patterns 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. --- infra/dao-api-db/dao-api-db.railway.toml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/infra/dao-api-db/dao-api-db.railway.toml b/infra/dao-api-db/dao-api-db.railway.toml index 78182010b..f78347853 100644 --- a/infra/dao-api-db/dao-api-db.railway.toml +++ b/infra/dao-api-db/dao-api-db.railway.toml @@ -1,6 +1,11 @@ [build] builder = "DOCKERFILE" dockerfilePath = "infra/dao-api-db/Dockerfile.dao-api-db" +# Railway watches the whole repo when this is unset, so without it every merge to +# dev rebuilds and restarts all 17 Postgres services at once. Nothing outside the +# image's own directory can change what this service runs, and the image is shared +# by the whole fleet, so the pattern is the same for every DB service. +watchPatterns = ["infra/dao-api-db/**"] [deploy] # No healthcheckPath: Postgres speaks the wire protocol, not HTTP, so Railway's From 47539f675171fb7e06d2c2c92cb6c397ab39c67d Mon Sep 17 00:00:00 2001 From: Bruno D Date: Wed, 5 Aug 2026 14:36:08 -0300 Subject: [PATCH 2/2] ci: run the DAO API DB entrypoint self-test on every PR MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- .changeset/olive-pandas-guard.md | 6 ++++++ .github/workflows/tests.yaml | 18 ++++++++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 .changeset/olive-pandas-guard.md diff --git a/.changeset/olive-pandas-guard.md b/.changeset/olive-pandas-guard.md new file mode 100644 index 000000000..7cd1ce198 --- /dev/null +++ b/.changeset/olive-pandas-guard.md @@ -0,0 +1,6 @@ +--- +--- + +Scope the DAO API database image to its own watch patterns and cover its +entrypoint derivation with a CI self-test. Infra and CI only — no workspace +package changes. diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index a153b7f07..dae064d88 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -424,6 +424,24 @@ jobs: flags: api fail_ci_if_error: false + dao-api-db-entrypoint: + name: DAO API DB entrypoint self-test + if: ${{ !(startsWith(github.head_ref, 'changeset-release/') && github.actor == 'github-actions[bot]' && github.event.pull_request.user.login == 'github-actions[bot]' && github.event.pull_request.head.repo.full_name == github.repository) }} + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + # The entrypoint derives max_connections and effective_cache_size from the + # container's own cgroup limit, so a wrong derivation silently mis-provisions + # every DAO database at once — and the tiers it keys off are not visible from + # the repo. The script ships assertions for the four fleet tiers, both clamp + # boundaries and both fallback paths; this runs them on every PR instead of + # relying on someone remembering to. + - name: Run entrypoint self-test + run: bash infra/dao-api-db/entrypoint.dao-api-db.sh --self-test + # dashboard-e2e: # name: Dashboard E2E # needs: wait-for-gateful