ci: a mongo image with an oplog, so CI can run the HA tests at all - #6
Merged
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this is
quay.io/seamware/mongo-rs—mongo:8.0with one thing changed, the command: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.shprobesisMaster.setName, and on a standaloneha_cache_sync.testleaves 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.0since 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.mdsays 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--replSetcannot be appended tomongo:8.0from a workflow — and the job container hasmongoshbut nomongodof 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 onemongoshcall 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
isMasterthen reportssetNamers0— 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.quay.io/seamware/mongo-rsdoes not exist. The robotseamware+coraine_cihas Write oncoraine,coraine-ciandcoraine-ci-nightlyonly, so the first push will 403 until:seamware+coraine_ciis granted Write on it.Merging before that gives a red
CI base imagerun.🤖 Generated with Claude Code
https://claude.ai/code/session_01TGatXwrHx1CreL49sCuS37