fix(ci): run the format check on docs-only PRs and migrate against the direct endpoint - #5168
Conversation
…e direct endpoint
|
Here's a visual recap of what changed: Open the full interactive recap |
…igration URL test
There was a problem hiding this comment.
Builder reviewed your changes — looks good ✅
Review Details
Incremental Code Review Summary
The latest commit addresses both findings from the previous review: the non-full lint workflow now includes .md/.mdx files in the formatter input, and scripts/netlify-migration-url.test.ts is included in the Netlify workflow test command. The existing docs-only scope behavior, Neon pooler normalization, connection-string precedence, and requested-context handling remain coherent. Two independent review agents found no new confirmed issues, and the focused tests and formatting checks were reported passing.
Risk remains standard because this changes CI gating and deployment migration endpoint selection, but the updated implementation is appropriately scoped and has regression coverage. The two prior review threads were resolved after verifying their fixes.
🧪 Browser testing: Skipped — PR only modifies backend/config/docs/tests, no UI impact

Two independent CI/deploy fixes for failures seen on 2026-09-15/16. Both are boundary fixes with tests that fail without them.
1. Docs-only PRs skipped
Lint & format, so unformatted docs reached mainclassifyChangedPathsforced every check tofalsewhen a change set was docs-only. Butfmt:checkrunsoxfmt --check .over the whole tree, including.md/.mdx, so docs are exactly what a docs-only PR can still break. Unformatted docs landed on main three times on 09-15 (#3903, #4999, #5075) and turned the required Lint & format check red on every unrelated open PR until someone noticed and fixed main (#5106, #5135, #5141).Fix: keep the docs-only short-circuit, but leave
linton. Two existing assertions encoded the old "docs-only selects nothing" contract and are updated to "selects lint only".Red/Green (
git apply -Rof only theci-change-scope.tshunk):✖ keeps the format check on for a docs-only change set, 3 failures.2. Beta release migrations could run against a pooled endpoint and fail read-only
netlify-migration-url.tsreturned the firstpostgres…URL it found and never rejected a pooled host. Neon's PgBouncer runs in transaction mode, so a pooled session can land read-only and reject DDL withcannot execute UPDATE/CREATE TABLE in a read-only transaction. The workflow's three retries reuse the same URL, so they fail identically. Overnight this hit calendar, mail and clips in separate publishes, each failingRun the beta release migration against production.Fix: strip the Neon
-poolerhost segment from whatever URL is selected, using the same rule and rationale asgetMigrationDatabaseUrl()inpackages/core/src/db/client.ts. Addsscripts/netlify-migration-url.test.ts(the file had no tests) and atest:netlify-migration-urlscript.Red/Green (
git apply -Rof only thenetlify-migration-url.tshunk):✖ returns the direct endpoint when Netlify only exposes a pooled URL.Verification
node --test scripts/ci-change-scope.test.ts: 15/15.node --test scripts/netlify-migration-url.test.ts: 4/4.oxfmt --checkclean on all changed files..oxlintrc.jsonlistsscripts/**underignorePatterns.🤖 Generated with Claude Code