CI: reach each run's PostgreSQL by a name of its own; move brotli past PYSEC-2026-4322 #1040

Merged
tiagoagueda merged 3 commits from ci-postgres-own-host into main 2026-10-23 15:44:36 +00:00
Owner

Two things fail on main and on every pull request, and neither is the change being proposed. They come in one pull request so that main turns green in one run. Supersedes #1039.

1. PostgreSQL tests: each run reaches its own server

On this runner every job joins the shared forgejo network. Every run's PostgreSQL service was called db, so when two runs overlapped (the push run and the pull-request run of one commit, or two pull requests), Docker's DNS answered db with either server. A test created test_postulo on one server, and pg_dump, psql or the teardown looked for it on the other: FATAL: database "test_postulo" does not exist. This failed #1038 and #1039.

  • The service gets a second network name, made of the run id and attempt: --network-alias db-${{ github.run_id }}-${{ github.run_attempt }}.
  • The job's PG_HOST holds that name, and the four connection strings use it.

2. Security audit: brotli

pip-audit --strict reports PYSEC-2026-4322 against brotli 1.2.0, fixed in 1.2.1: uv lock --upgrade-package brotli, nothing else moves.

Tests

  • zizmor (the workflow lint CI runs): no findings.
  • tests/test_image_build.py, tests/test_release_tools.py, tests/test_security_audit.py: 103 passed.
  • The audit over the new lock: no known vulnerabilities.
  • This run's own PostgreSQL job is the real check that the runner accepts the alias.

🤖 Generated with Claude Code

Two things fail on `main` and on every pull request, and neither is the change being proposed. They come in one pull request so that `main` turns green in one run. Supersedes #1039. ## 1. PostgreSQL tests: each run reaches its own server On this runner every job joins the shared `forgejo` network. Every run's PostgreSQL service was called `db`, so when two runs overlapped (the push run and the pull-request run of one commit, or two pull requests), Docker's DNS answered `db` with either server. A test created `test_postulo` on one server, and `pg_dump`, `psql` or the teardown looked for it on the other: `FATAL: database "test_postulo" does not exist`. This failed #1038 and #1039. - The service gets a second network name, made of the run id and attempt: `--network-alias db-${{ github.run_id }}-${{ github.run_attempt }}`. - The job's `PG_HOST` holds that name, and the four connection strings use it. ## 2. Security audit: brotli `pip-audit --strict` reports PYSEC-2026-4322 against brotli 1.2.0, fixed in 1.2.1: `uv lock --upgrade-package brotli`, nothing else moves. ## Tests - `zizmor` (the workflow lint CI runs): no findings. - `tests/test_image_build.py`, `tests/test_release_tools.py`, `tests/test_security_audit.py`: 103 passed. - The audit over the new lock: no known vulnerabilities. - This run's own PostgreSQL job is the real check that the runner accepts the alias. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
The runner puts every job on one shared network, so two runs' db services answered to the
same name: a test created its database on one server and pg_dump looked for it on the other
("database test_postulo does not exist"). The service gets an alias made of the run id and
attempt, and the job connects to that.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Move brotli to 1.2.1, past PYSEC-2026-4322
Some checks failed
CI / Unit tests and coverage (Python 3.14) (pull_request) Successful in 12m45s
CI / Checks: lint, migrations, catalogues, settings, built files (pull_request) Successful in 2m33s
CI / Database tests on PostgreSQL (pull_request) Failing after 1m13s
CI / Security audit (pull_request) Successful in 53s
CI / Browser tests (Chromium) (pull_request) Has been cancelled
03b2fa1b85
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Find this run's PostgreSQL server by a password of its own
All checks were successful
CI / Unit tests and coverage (Python 3.14) (pull_request) Successful in 12m38s
CI / Checks: lint, migrations, catalogues, settings, built files (pull_request) Successful in 2m37s
CI / Database tests on PostgreSQL (pull_request) Successful in 3m24s
CI / Security audit (pull_request) Successful in 52s
CI / Browser tests (Chromium) (pull_request) Successful in 29m31s
5205e8dab4
The runner drops a service's --network-alias, so the run-unique name never
resolved and the job failed at its first connection. Each run's server now
has a password unique to the run, and a step keeps the one address behind
`db` that accepts it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
tiagoagueda deleted branch ci-postgres-own-host 2026-10-23 15:44:36 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
Postulo/postulo!1040
No description provided.