Repository navigation
fix(nodejs): check every sqlx version and read persons through the replica url - #130062
Conversation
…plica url sqlx versions are the timestamps in the migration file names, so a PR that merges late can add a version below the highest one, and sqlx migrate run still applies it. Checking only the highest version passed while such a migration was missing. persons_migrations had two cases (66b4dd0, 1333170). The manifest now lists every version per database, and the check reads them all in one query. Most ingestion apps get only PERSONS_READONLY_DATABASE_URL, so the persons check skipped on them. The CLI now falls back to the read-only URL. Replica lag can only make it wait longer. The env keys are typed against the Node config, so a rename there fails to compile instead of turning the check into a silent skip. The sqlx check stays in shadow mode. The first deploys show whether every production database recorded all versions before it can block.
|
😎 This pull request was merged. |
🤖 CI report✅ Trunk lane — non-backend lane (
|
| File | Comment lines | Added lines |
|---|---|---|
nodejs/src/schema-check/cli.ts |
2 | 15 |
nodejs/src/schema-check/manifest.ts |
2 | 11 |
This check does not block merging. It updates on every push and clears when the share drops.
|
Risk: No findings This PR hardens the Node deploy schema check: sqlx requirements now list every migration version instead of only the highest, manifest parsing rejects empty or malformed version lists, and the persons check falls back to the read-only database URL for ingestion apps. All database access stays parameterized and read-only, and no URLs or credentials reach the log output, so the change introduces no security risk. Sentinel reviewed |
There was a problem hiding this comment.
Approved.
Deployment tooling is risky territory, but current-head agent review and the author's STRONG familiarity provide assurance. No unresolved substantive concerns or other refusal grounds were found.
- Author wrote 100% of the modified lines and has 0 merged PRs in these paths (familiarity STRONG).
- PostHog Review (Standard) reviewed the current head: no findings.
Gate mechanics and policy version
| Gate | Result | |
|---|---|---|
| prerequisites | ✓ | all clear |
| deny-list | ✓ | no deny categories matched |
| size | ✓ | 65L, 5F substantive, 97L/7F incl. docs/generated/snapshots — within ceiling |
| tier | ✓ | T1-agent / T1c-medium (97L, 7F, single-area, fix) |
| stamphog 2.7.0 | .stamphog/policy.yml @ fc3f9de · reviewed head fc3f9de |
|
This pull request was merged into |
Problem
PERSONS_READONLY_DATABASE_URL.Changes
How did you test this code?
Agent-authored. Not run against a production database.
Test rationale: new rows in existing tables: a late lower version (passes under the old rule), a replica-only persons URL, an empty
versionslist.Release status
Docs update
🤖 Agent context
Autonomy: Human-driven (agent-assisted)
Agent: Claude Code, Opus 5.5 (
claude-opus-5-5)Skills:
/writing-tests,/writing-code-comments,/writing-pr-descriptions,/stacking-prsMore context for AI agents
resolveSqlxDatabaseUrlincli.ts,evaluateSqlxRowsincheck.ts.