Skip to content

ci: a mongo image with an oplog, so CI can run the HA tests at all - #6

Merged
kzangeli merged 1 commit into
mainfrom
ci/mongo-replica-set-image
Sep 2, 2026
Merged

ci: a mongo image with an oplog, so CI can run the HA tests at all#6
kzangeli merged 1 commit into
mainfrom
ci/mongo-replica-set-image

Conversation

@kzangeli

@kzangeli kzangeli commented Sep 2, 2026

Copy link
Copy Markdown
Collaborator

What this is

quay.io/seamware/mongo-rsmongo:8.0 with one thing changed, the command:

CMD ["mongod", "--replSet", "rs0", "--bind_ip_all"]

Why

The HA cache sync (--high-availability mongo) rides on a mongo change stream, and a change stream reads the oplog — which a standalone mongod does not have. coraine's harness knows this and detects it: corTestParams.sh probes isMaster.setName, and on a standalone ha_cache_sync.test leaves the run set.

Silently. Nothing in a CI log says the HA paths went unexercised, and every CI job has run a standalone mongo:8.0 since the workflows existed. Measured against today's coverage run, that is 108 lines and 10 functions of coraine that CI has never entered — which the nightly's published figure has been reporting as untested code rather than as an environment nobody stood up. doc/coverage.md says so in as many words; it was describing our own CI.

Why it needs an image

A GitHub Actions services: block passes docker-create options but not a command, so --replSet cannot be appended to mongo:8.0 from a workflow — and the job container has mongosh but no mongod of its own to start instead.

One member, because this is not a test of replication: it is the smallest thing that has an oplog.

What it deliberately does not do

Initiate the set. The member host has to be the name the clients use, and the image cannot know it — so rs.initiate() is one mongosh call in the consumer, beside the wait-for-database it already does. That half lands in the coraine PR.

Tagging

Same immutable <date>-<sha> as the other two, from the same run, so adopting a set of images stays one bump.

The verify step asserts the property consumers actually depend on: it comes up, it initiates, and isMaster then reports setName rs0 — the very probe the harness makes. Like the existing verify step, it is skipped on a PR, so this PR proves the Dockerfile builds and nothing more.

⚠️ Before merging

quay.io/seamware/mongo-rs does not exist. The robot seamware+coraine_ci has Write on coraine, coraine-ci and coraine-ci-nightly only, so the first push will 403 until:

  1. the repo is created and made public (a service container is pulled anonymously), and
  2. seamware+coraine_ci is granted Write on it.

Merging before that gives a red CI base image run.

🤖 Generated with Claude Code

https://claude.ai/code/session_01TGatXwrHx1CreL49sCuS37

The HA cache sync rides on a mongo CHANGE STREAM, and a change stream reads
the oplog - which a standalone mongod does not have. coraine's harness knows
that and detects it: corTestParams.sh probes isMaster.setName and, on a
standalone, ha_cache_sync.test simply leaves the run set.

Silently. Nothing in a CI log says the HA paths went unexercised, and every CI
job has run a standalone mongo:8.0 since the workflows existed. So 108 lines
and 10 functions of coraine were never entered in CI - and the nightly's
published coverage figure reported them as untested CODE rather than as an
environment nobody had stood up. doc/coverage.md said exactly that, in as many
words, and it was describing our own CI rather than the broker.

The fix cannot live in a workflow: a `services:` block passes docker-create
OPTIONS but not a COMMAND, so --replSet cannot be appended to mongo:8.0 from
there, and the job container has mongosh but no mongod of its own to start
instead. Hence an image whose whole content is the command line.

One member, because this is not a test of replication - it is the smallest
thing that has an oplog. The set is NOT initiated here: the member host has to
be the name the clients use, and the image cannot know it. That is one mongosh
call in the consumer, next to the wait-for-database it already does.

Published on the same immutable <date>-<sha> tag as the other two, from the
same run, so adopting a set of images stays one bump. The verify step asserts
the property consumers actually depend on - it comes up, it initiates, and
isMaster then reports setName rs0, which is the very probe the harness makes.

⚠️ quay.io/seamware/mongo-rs does not exist yet: the first push creates it, and
it has to be made PUBLIC like the other two, or the service container cannot
be pulled.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TGatXwrHx1CreL49sCuS37
@kzangeli
kzangeli merged commit c1b6cba into main Sep 2, 2026
1 check passed
@kzangeli
kzangeli deleted the ci/mongo-replica-set-image branch September 2, 2026 10:29
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