Skip to content

ci(postgres): run the encoding-migrate container test on every change to the roles it drives - #975

Open
dlf-dds wants to merge 1 commit into
mainfrom
ci/postgres-encoding-migrate-container-test
Open

dlf-dds wants to merge 1 commit into
mainfrom
ci/postgres-encoding-migrate-container-test

Conversation

@dlf-dds

@dlf-dds dlf-dds commented Nov 16, 2026

Copy link
Copy Markdown
Contributor

What

ops/ansible/roles/postgres-encoding-migrate/tests/run-test.sh is the functional test of the SQL_ASCII to UTF8 migration. On one Docker host, it builds a founder and a joiner wired with the real spock-mesh-peering role, a stopped peer, and a physical standby of the founder. It then migrates, resumes, re-runs, rolls back and migrates again with a repair, and postgres-streaming-replication rebuilds the standby with pg_basebackup. No workflow ran it. Only the parse-only tests/syntax-check.sh ran in CI, through ansible-syntax-check.yml.

  • New workflow .github/workflows/postgres-encoding-migrate.yml. It has one job on ubuntu-24.04, with a 45-minute timeout. It sets up Python 3.12, installs ansible-core==2.20.3 and requests, and installs the same collection ranges as ansible-syntax-check.yml. Then it runs run-test.sh with WORK under the runner's temp directory.

  • Why a hosted runner. The standby host runs with become, because the streaming role wipes and chowns the standby volume's directory on the Docker host. A hosted runner may do that.

  • The image is the postgres-spock fleet pin from ops/pins/fleet-pins.yaml, which the test reads by itself. The run covers the image a goatnet deploys. The pinned digest can be pulled without credentials.

  • Triggers. The workflow runs on a pull_request, or a push to main, that changes any of these:

    • ops/ansible/roles/postgres-encoding-migrate/**, which includes the test;
    • ops/ansible/roles/postgres-streaming-replication/**;
    • ops/ansible/roles/spock-mesh-peering/**, the role the migration's re-wire includes;
    • ops/ansible/postgres-encoding-migrate.yml;
    • ops/ansible/spock-mesh-wire.yml, which the fixture uses;
    • the workflow itself.

    It can also be started by workflow_dispatch.

  • Discipline. Actions are pinned by commit sha, as in the other workflows. Permissions are contents: read. The workflow has a concurrency group that never cancels a run on main. On failure, the run's *.log files are uploaded for 7 days.

  • Role README. It names the workflow beside run-test.sh.

  • Block-shaped

  • Non-block change: N/A.

Test plan

This pull request changes the workflow file and the role's README. The workflow runs on this pull request, and that run is the test.

Locally, each with its own exit code:

  • ops/ci/check-workflow-discipline.py: exit 0. With --self-test: exit 0.
  • ops/ci/check-ci-scripts-wired.py: exit 0. With --self-test: exit 0.
  • ops/ci/check-test-coverage-wired.py: exit 0. With --self-test: exit 0.
  • actionlint 1.7.7 with shellcheck on the new workflow: exit 0.
  • yamllint -c .yamllint.yml on the new workflow: exit 0. yamllint -d relaxed, as ci.yml runs it: exit 0, with three line-length warnings.
  • check-no-identity-spillage.sh, check-no-agent-references.sh on the changed files, check-doc-links.py: exit 0 each.

Not run:

  • run-test.sh itself. It becomes root for the standby, so it runs only on the CI runner. Its first run is this pull request's.
  • The test under ansible-core 2.21 or later.

Cross-repo coordination

  • Single-repo change: N/A.

Documentation

  • ops/ansible/roles/postgres-encoding-migrate/README.md names the workflow that runs run-test.sh.
  • No behaviour, data flow or topology changes, so no design document changes.

Checklist

  • Commits are signed and signed off.
  • PR title follows Conventional Commits.

Security-sensitive?

  • Not security-sensitive
  • Security-sensitive

Notes for reviewers

  • The runner is ubuntu-24.04, which is today's ubuntu-latest. A named version matches every other workflow here and keeps a runner image change from arriving unannounced.
  • The workflow does not install ops/ansible/requirements.yml whole. Its AWS collections are unused by these roles. The only collection module the roles call is community.docker.docker_container_exec.

… to the roles it drives

ops/ansible/roles/postgres-encoding-migrate/tests/run-test.sh migrates a
founder, a joiner and a physical standby on one Docker host, with a real
pg_basebackup rebuild of the standby, and no workflow ran it. The new
workflow runs it on a GitHub-hosted runner, which may become root as the
standby rebuild needs, against the postgres-spock fleet pin the test reads.

It runs on a pull request or a push to main that changes the migration role
or playbook, postgres-streaming-replication, spock-mesh-peering,
spock-mesh-wire.yml or the workflow itself. Actions are pinned by commit,
permissions are contents: read, and the run's logs are kept on failure.

Signed-off-by: dlf-dds <dene.farrell.gov@gmail.com>
@dlf-dds
dlf-dds requested a review from a team as a code owner November 16, 2026 06:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant