Skip to content

fix(pull): fetch the splices a conflicted pull brings in - #493

Open
roschaefer wants to merge 6 commits into
mainfrom
fix/fetch-before-conflict-stop
Open

roschaefer wants to merge 6 commits into
mainfrom
fix/fetch-before-conflict-stop

Conversation

@roschaefer

@roschaefer roschaefer commented Nov 13, 2026 •

Copy link
Copy Markdown
Owner

A pull that stopped on a conflict hadn't yet fetched the splices the merge brings in: it fetches them after a merge, and the conflict ends the run first. Once the conflict was committed, status reported such a splice as never fetched, and push refused it until a git splice fetch.

The commit the pull brings in is there during the conflict: as CHERRY_PICK_HEAD, or with --rebase as the commit the monorepo's own commits are rebased onto. It has the .splice files of the splices below as the upstream has them. Before it stops, the pull now fetches what they name that isn't here yet: the upstream itself, the synced commit, or the pin. Which side's .splice stays is up to how the conflict is resolved, so a splice the resolution drops may have been fetched for nothing.

To go through the same fetch as everywhere else (checks on the .splice files, labels, pins, key cleanup, the fetch event for --exec and pauses), commands can now read a splice's .splice from a revision other than HEAD.

Which upstreams to fetch is decided the way prepare_splice_reload decides it after a clean merge, but written out again: that function compares with the .splice loaded before the merge, which a conflict stop doesn't have. Sharing one rule would be a follow-up.

Fixes #429.

#492 tried fetching the whole tree before the first merge instead. It cost about +440 lines, and the walk kept having to copy rules the merge already has (pins, inherited default branches, --upstream, --branch, copies of a splice inside itself). This takes about +120.

A pull that stopped on a conflict hadn't yet fetched the splices the
merge brings in: it fetches them after a merge, and the conflict ends
the run first. Once the conflict was committed, status reported such a
splice as never fetched, and push refused it until a 'git splice fetch'.

The commit the pull cherry-picks is there during the conflict, with the
.splice files of the splices below as the upstream has them. The pull
now fetches what they name before it stops.
@coderabbitai

coderabbitai Bot commented Nov 13, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 23 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 3fbeec36-98ec-41f2-9bba-bfe76132cc96
Commits

Reviewing files that changed from the base of the PR and between 4538e43 and 9c5b0b6.

Files selected for processing: 6

  • docs/09-scenarios/05-nested-splices/01-nested-splices/replaced-above.md
  • docs/09-scenarios/05-nested-splices/05-recursion/01-recursive-pull/README.md
  • docs/tests/nested.bats
  • src/fetch.rs
  • src/merge.rs
  • src/repo.rs
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

With --rebase the pull commit is made without a conflict; the conflict
comes while the monorepo's own commits are rebased onto it, so there is
no CHERRY_PICK_HEAD. The pull commit is the rebase's onto, and has the
.splice files below as the upstream has them.

A default-pin those files name is fetched too, tag or commit. A new
upstream whose fetch fails gives up the key it just got, as fetch does.
The fetch below a conflicted pull had its own fetch path: it read the
.splice files with a regex, skipped the checks fetch makes on them,
labelled several upstreams alike, and sent no fetch event for --exec and
pauses. Commands now read a splice's .splice from a chosen revision, so
the conflicted commit's files go through prepare_fetch, download and
finish as every other fetch does.
@roschaefer
roschaefer marked this pull request as ready for review November 13, 2026 19:49
…conflict

Review findings on the fetch below a conflicted pull:

- A failed fetch there wasn't in the run's "Failed:" list, and an error
  ended the run before its summary of what's still to pull.
- With rebase.backend=apply, the rebase's onto is in rebase-apply/, so
  nothing was fetched.
- The splices below forgot the upstream the conflicted splice was pulled
  from, e.g. --upstream's, whose default branch they follow.
- The glob pathspec also matched the conflicted splice itself, and
  folder names with glob characters; nested_splices lists them instead.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

A pull that stops on a conflict doesn't fetch a splice its upstream added

1 participant