Skip to content

test: pin hybrid chaining when the hardcoded parent is not the head - #49

Merged
mergify[bot] merged 1 commit into
mainfrom
devs/jd/pin-hybrid-tests/pin-hybrid-chaining-hardcoded-parent-head--20e5d314
Aug 13, 2026
Merged

test: pin hybrid chaining when the hardcoded parent is not the head#49
mergify[bot] merged 1 commit into
mainfrom
devs/jd/pin-hybrid-tests/pin-hybrid-chaining-hardcoded-parent-head--20e5d314

Conversation

@jd

@jd jd commented Aug 13, 2026

Copy link
Copy Markdown
Member

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

Claude-Session-Id: 934c0f4e-8a8c-425a-826e-ed4ae67d6d2d

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
Copilot AI lite review requested due to automatic review settings August 13, 2026 12:38
@mergify
mergify Bot deployed to Mergify Merge Protections August 13, 2026 12:38 Active
@mergify
mergify Bot requested a review from a team August 13, 2026 12:39
@mergify

mergify Bot commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Merge Protections

🟢 All 6 merge protections satisfied — ready to merge.

Show 6 satisfied protections

🟢 🤖 Continuous Integration

  • all of:
    • check-success=all-greens

🟢 👀 Review Requirements

  • any of:
    • #approved-reviews-by>=1
    • author = dependabot[bot]
    • author = mergify-ci-bot

🟢 Enforce conventional commit

Make sure that we follow https://www.conventionalcommits.org/en/v1.0.0/

  • title ~= ^(fix|feat|internal|docs|style|refactor|perf|test|build|ci|chore|revert|ui)(?:\(.+\))?!?:

🟢 🔎 Reviews

  • #changes-requested-reviews-by = 0
  • #review-requested = 0
  • #review-threads-unresolved = 0

🟢 📕 PR description

  • body ~= (?ms:.{48,})

🟢 🚦 Auto-queue

When all merge protections are satisfied, this pull request will be queued automatically.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_order produces 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
jd marked this pull request as ready for review August 13, 2026 13:01
@mergify

mergify Bot commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Merge Queue Status

  • Entered queue2026-08-13 15:13 UTC · Rule: default · triggered by merge protections
  • Checks skipped · PR is already up-to-date
  • Merged2026-08-13 15:13 UTC · at a7111f0b1dd769ac23595c521947a8399964c120 · squash

This pull request spent 23 seconds in the queue, including 5 seconds running CI.

Required conditions to merge

@mergify
mergify Bot merged commit 398f15a into main Aug 13, 2026
9 checks passed
@mergify
mergify Bot deleted the devs/jd/pin-hybrid-tests/pin-hybrid-chaining-hardcoded-parent-head--20e5d314 branch August 13, 2026 15:13
@mergify mergify Bot added queued and removed queued labels Aug 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants