Skip to content

fix: walk only first-parent history to preserve on-main migration order#24

Merged
mergify[bot] merged 1 commit into
mainfrom
devs/kozlek/fix/first-parent-ordering/walk-only-first-parent-history-preserve-main--6f9c8a00
May 4, 2026
Merged

fix: walk only first-parent history to preserve on-main migration order#24
mergify[bot] merged 1 commit into
mainfrom
devs/kozlek/fix/first-parent-ordering/walk-only-first-parent-history-preserve-main--6f9c8a00

Conversation

@kozlek

@kozlek kozlek commented May 4, 2026

Copy link
Copy Markdown
Contributor

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.

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
@mergify

mergify Bot commented May 4, 2026

Copy link
Copy Markdown
Contributor

Merge Protections

Your pull request matches the following merge protections and will not be merged until they are valid.

🟢 🤖 Continuous Integration

Wonderful, this rule succeeded.
  • all of:
    • check-success=all-greens

🟢 👀 Review Requirements

Wonderful, this rule succeeded.
  • any of:
    • #approved-reviews-by>=1
    • author = dependabot[bot]
    • author = mergify-ci-bot

🟢 Enforce conventional commit

Wonderful, this rule succeeded.

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

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

🟢 🔎 Reviews

Wonderful, this rule succeeded.
  • #changes-requested-reviews-by = 0
  • #review-requested = 0
  • #review-threads-unresolved = 0

🟢 📕 PR description

Wonderful, this rule succeeded.
  • body ~= (?ms:.{48,})

@mergify
mergify Bot deployed to Mergify Merge Protections May 4, 2026 14:55 Active
@mergify
mergify Bot requested a review from a team May 4, 2026 14:55
@kozlek
kozlek marked this pull request as ready for review May 4, 2026 14:58
@mergify

mergify Bot commented May 4, 2026

Copy link
Copy Markdown
Contributor

Merge Queue Status

  • Entered queue2026-05-04 15:04 UTC · Rule: default
  • Checks skipped · PR is already up-to-date
  • Merged2026-05-04 15:04 UTC · at 9608610a7347c45d5eccdb8287b78c9478a9498e · squash

This pull request spent 14 seconds in the queue, including 2 seconds running CI.

Required conditions to merge

@mergify mergify Bot added the queued label May 4, 2026
@mergify
mergify Bot merged commit 82693aa into main May 4, 2026
8 checks passed
@mergify
mergify Bot deleted the devs/kozlek/fix/first-parent-ordering/walk-only-first-parent-history-preserve-main--6f9c8a00 branch May 4, 2026 15:04
@mergify mergify Bot removed the queued label May 4, 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.

2 participants