fix: walk only first-parent history to preserve on-main migration order#24
Merged
Conversation
v6 dropped the `-- versions/` pathspec from `_get_git_commit_order()` so that migrations moved to a new directory keep their original add order. Without the pathspec, git also walks feature-branch ancestors that survive merge — so a migration whose feature commit is reachable from HEAD gets that early commit's date as its sequence, even when another migration was committed on main first. That broke the engine deploy in INC-1342: a migration whose feature branch was merged with `--no-ff` (Apr 30 feature commit, May 4 merge) was placed before a migration committed directly on main on May 4 11:50, inverting the on-main order and breaking the append-only check. Add `--first-parent` so the walk stays on the integration branch and never enters feature-branch ancestors. PR #22's directory-move scenario still works because the original add commits are on main's first-parent line (they were merged before the move). Verified end-to-end against the mergify monorepo: chain head extends correctly from the previous deploy. Change-Id: I6f9c8a0025ea50b9a3a599955b98a98fa280b6da
Contributor
Merge ProtectionsYour pull request matches the following merge protections and will not be merged until they are valid. 🟢 🤖 Continuous IntegrationWonderful, this rule succeeded.
🟢 👀 Review RequirementsWonderful, this rule succeeded.
🟢 Enforce conventional commitWonderful, this rule succeeded.Make sure that we follow https://www.conventionalcommits.org/en/v1.0.0/
🟢 🔎 ReviewsWonderful, this rule succeeded.
🟢 📕 PR descriptionWonderful, this rule succeeded.
|
remyduthu
approved these changes
May 4, 2026
Contributor
Merge Queue Status
This pull request spent 14 seconds in the queue, including 2 seconds running CI. Required conditions to merge
|
mergify
Bot
deleted the
devs/kozlek/fix/first-parent-ordering/walk-only-first-parent-history-preserve-main--6f9c8a00
branch
May 4, 2026 15:04
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.
v6 dropped the
-- versions/pathspec from_get_git_commit_order()sothat migrations moved to a new directory keep their original add order.
Without the pathspec, git also walks feature-branch ancestors that
survive merge — so a migration whose feature commit is reachable from
HEAD gets that early commit's date as its sequence, even when another
migration was committed on main first.
That broke the engine deploy in INC-1342: a migration whose feature
branch was merged with
--no-ff(Apr 30 feature commit, May 4 merge)was placed before a migration committed directly on main on May 4 11:50,
inverting the on-main order and breaking the append-only check.
Add
--first-parentso the walk stays on the integration branch andnever enters feature-branch ancestors. PR #22's directory-move scenario
still works because the original add commits are on main's first-parent
line (they were merged before the move). Verified end-to-end against the
mergify monorepo: chain head extends correctly from the previous deploy.