Repository navigation
fix(sync): land a hotfix staging already holds instead of failing on its conflict (ENG-4379) - #82
Merged
mindsdb-devops merged 2 commits intoNov 17, 2026
Conversation
…its conflict (ENG-4379)
… staging's content only when main's clean changes are already there (ENG-4379)
mindsdb-devops
approved these changes
Nov 17, 2026
mindsdb-devops
deleted the
fix/eng-4379-sync-hotfix-already-on-staging
branch
November 17, 2026 06:15
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.
User story
As an engineer who ships a hotfix to production
I want my hotfix to reach staging on its own once it is on main
So that the next release merges cleanly and nobody gets paged about a fix staging already has
Why this matters
A hotfix lands on staging first and is then cherry-picked onto main. When staging has since edited a neighboring line,
git merge mainconflicts even though staging already holds the change, and the sync fails. On a squash-only staging nobody can land that merge by hand, so the branch stays red. cowork's sync failed this way on a one-line import.What happens today
sync-main-to-staging.ymlandrelease-unfreeze.ymlrungit merge --no-ff origin/main. Any conflict ends the step with git's own message, with no word on what staging lacks.What should happen
Both call
scripts/sync_staging.py. A clean merge is unchanged. On a conflict, it records the merge with-s ours, so staging's content stays andmainbecomes an ancestor ofstaging, only when two checks pass. First, every commit main gained since the merge base has an equal patch among the staging commits made since main last came in. Releases squash staging into main, so older staging commits are left out: one from releases ago can't vouch for a change staging has since undone. Second, main's changes that merge cleanly leave staging's tree as it is, which catches a change staging reverted. Otherwise the run fails, and its error names the conflicting files, the commits staging lacks and the files that differ. A landed merge names the held commits in its message.Test plan
mainandstagingin a local clone lands the merge with staging's tree unchanged and two parents.pytest tests/, actionlint andworkflow_graph.pypass.