Repository navigation
The mixed-version gate builds N-1 from HEAD~1, the parent of the commit it checks - #691
Merged
Merged
Conversation
…it it checks On a pull request origin/<base_ref> is the target tip at job start, which can carry a migration the merge ref lacks; N-1 then sits at N+1's schema and keeps the workers lease. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>
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.
Changelog category (leave one):
Changelog entry (one or two sentences a user of Loom can read without the diff; the release pull request collects these into the release notes):
...
Why
On a pull request the mixed-version gate built N-1 from
origin/<base_ref>, the target branch's tip when the job starts, while N is the merge ref, made against the target branch as it was when the pull request event fired. When the run starts later than that (a fork pull request waits for a maintainer to approve its workflows) and the target branch has gained a migration in between, N-1 is not an ancestor of N: it carries a migration N lacks.The gate gives N+1 one no-op migration more than N, numbered after N's latest. That number is then the one the new migration on the target branch already holds, so N-1 is at N+1's schema version, does not see a newer build and keeps the
workers_supervisorlease. Two checks fail:one process of the newest build runs the workersandN-1 leaves the lease to N+1. Both failing runs fit this exactly:096097(#665 merged while the run waited)097098099(#678 merged while the run waited)099The lease hand-off itself is correct: N-1 rightly keeps a lease from a build that is not newer than it. The gate's base is wrong.
The fix passes
--base HEAD~1for every event. On a pull requestHEADis the merge commit andHEAD~1its first parent, the target branch the merge was made against, so N-1 is always N's parent, onmainand on arelease/X.Yline alike. On a push it is the previous commit, as before.Scope and risk
.github/workflows/ci.yml(the gate's--base) and the gate's row indocs/development/testing.md. The gate script and the lease code are unchanged. A pull request run now checks the upgrade from the base its merge ref was made on, not from a newer tip; the push run on the target branch after the merge checks the upgrade from the real previous commit.Compatibility, rollout and rollback
Tests
pytest tests/unit/test_ci_clickhouse_pin.py tests/unit/test_code_test_gate.py tests/unit/test_compose_workers_service.py tests/unit/test_help_docs.py tests/unit/test_public_copy.py tests/unit/test_doc_links.py tests/unit/test_mixed_version_gate.py tests/unit/test_agent_instructions.py: 532 passed.AI assistance in the code (leave one; writing this description with AI is fine):
AI-generated (an agent wrote most of the diff): Claude Code; the failing cases, the migration numbers at each merge ref's base and target tip, were checked.
I can explain every line of this diff and how it interacts with the rest of Loom.
Checklist
make format-check,make lint,make typecheckandmake test-unitpass; the integration suite passes if server behaviour changed.docs/reference/configuration.mdand thedocs/reference/tables (python scripts/codegen/docs_reference.py), the reach manifest,schemas/schema.sql(make schema-dump) and the Codex plugin copies (python3 scripts/codegen/agent_plugin_sync.py).main; no merged migration is edited.hooks/,lib/,bin/,skills/,.mcp.json, the Codexplugin-defaults.json) bumps both plugin manifests' version, and no other open PR uses that version.npm --prefix frontend run build) and its tests pass, iffrontend/changed.docs/describe the system as it now is, and this description names any operator steps and wire changes.tests/unit/test_public_copy.py).git commit -s), as CONTRIBUTING.md asks.🤖 Generated with Claude Code