test: pin hybrid chaining when the hardcoded parent is not the head - #49
Merged
mergify[bot] merged 1 commit intoAug 13, 2026
Conversation
A hybrid whose ``down_revision`` points at a revision that is no longer the head is spliced in behind it, re-parenting the revisions in between. That keeps the chain linear and single-headed, which is the property this library exists to provide, but nothing pinned it -- so a future change could turn it into a fork without a test noticing. Two cases, both intended: * the parent was already stale when the file was written (an authoring error: the rule is to hardcode only onto the current head) * the parent was the head when the file was written, and another branch merged first (prevented upstream by the merge queue, which tests the branch against the rebased base) The second case is driven through real branches and real merge commits rather than a hand-written git order, so it also covers ``_get_git_commit_order`` producing the order that ``test_dynamic_inserted_before_hybrid_no_multiple_heads`` assumes. Both walk the reconstructed chain, so they fail loudly on a fork rather than only on a changed dict. Refs #47 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Change-Id: I20e5d314043a3d8da985e394c84d1008dfc82862 Claude-Session-Id: 934c0f4e-8a8c-425a-826e-ed4ae67d6d2d
Contributor
Merge Protections🟢 All 6 merge protections satisfied — ready to merge. Show 6 satisfied protections🟢 🤖 Continuous Integration
🟢 👀 Review Requirements
🟢 Enforce conventional commitMake sure that we follow https://www.conventionalcommits.org/en/v1.0.0/
🟢 🔎 Reviews
🟢 📕 PR description
🟢 🚦 Auto-queueWhen all merge protections are satisfied, this pull request will be queued automatically. |
There was a problem hiding this comment.
Pull request overview
Adds regression coverage to ensure hybrid migrations whose hardcoded down_revision is not the current head are still spliced into the chain in a way that preserves a single, linear head, and to pin the git-add ordering expectations that existing hybrid/dynamic tests rely on.
Changes:
- Add a test that exercises a hybrid hardcoding a stale parent and verifies chain re-parenting keeps a single head (no fork).
- Add an integration-style test using real branches/merge commits to verify
_get_git_commit_orderproduces the ordering assumed by the existing “dynamic inserted before hybrid” scenario. - Validate chain linearity by walking the reconstructed full chain and failing loudly on forks/cycles.
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
jd
marked this pull request as ready for review
August 13, 2026 13:01
AlexandreGaubert
approved these changes
Aug 13, 2026
Contributor
Merge Queue Status
This pull request spent 23 seconds in the queue, including 5 seconds running CI. Required conditions to merge
|
mergify
Bot
deleted the
devs/jd/pin-hybrid-tests/pin-hybrid-chaining-hardcoded-parent-head--20e5d314
branch
August 13, 2026 15:13
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.
A hybrid whose
down_revisionpoints at a revision that is no longerthe head is spliced in behind it, re-parenting the revisions in between.
That keeps the chain linear and single-headed, which is the property
this library exists to provide, but nothing pinned it -- so a future
change could turn it into a fork without a test noticing.
Two cases, both intended:
error: the rule is to hardcode only onto the current head)
merged first (prevented upstream by the merge queue, which tests the
branch against the rebased base)
The second case is driven through real branches and real merge commits
rather than a hand-written git order, so it also covers
_get_git_commit_orderproducing the order thattest_dynamic_inserted_before_hybrid_no_multiple_headsassumes.Both walk the reconstructed chain, so they fail loudly on a fork rather
than only on a changed dict.
Refs #47
Co-Authored-By: Claude Opus 5 (1M context) noreply@anthropic.com
Claude-Session-Id: 934c0f4e-8a8c-425a-826e-ed4ae67d6d2d