Pick up force-pushed branches in multi-revision repo strategy#7103
Open
Pick up force-pushed branches in multi-revision repo strategy#7103
Conversation
Signed-off-by: jorgee <jorge.ejarque@seqera.io>
✅ Deploy Preview for nextflow-docs-staging ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
ewels
reviewed
May 6, 2026
| final r = update.result | ||
| final detail = "${project} [revision: $revision]: ${update.localName} <- ${update.remoteName} => $r (old=${update.oldObjectId?.name()}, new=${update.newObjectId?.name()})" | ||
| if( r == RefUpdate.Result.FORCED ) { | ||
| log.warn "Non-fast-forward (force) update on $repoLabel for $detail" |
Member
There was a problem hiding this comment.
Nice! How about a slight rephrasing? Just so that folks who see this out of the blue are more likely to understand..
Suggested change
| log.warn "Non-fast-forward (force) update on $repoLabel for $detail" | |
| log.warn "Force-push detected on $repoLabel ($detail); resetting local copy to match remote" |
'cc wordsmith @christopher-hakkaart
Contributor
Author
There was a problem hiding this comment.
Suggestion looks fine to me
Contributor
Author
I think patch is possible. Changes are minor, located in one class and this feature has been released for the first time in 26.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.
Summary
+to the branchRefSpecs inrefSpecForName(...). After a remote force-push the local ref now moves to the new commit instead of being silently rejected as non-fast-forward. Tag and commit refspecs are unchanged.FetchResult.getTrackingRefUpdates()after every fetch via a newverifyFetchResulthelper, used by bothcheckBareRepo()andcreateSharedClone():NEW/FAST_FORWARD/NO_CHANGE→ debug logFORCED→ WARN with old → new SHAs (upstream history was rewritten)REJECTED,LOCK_FAILURE,IO_FAILURE,REJECTED_OTHER_REASON,REJECTED_MISSING_OBJECT) →AbortOperationException, so the failure is no longer silent.Fixes #7102
Test plan
verifyFetchResultpolicy:FORCEDdoes not throwAbortOperationExceptionwith the revision and repo label in the messagerefs/heads/mainto B. Exercises the+refspec and the WARN log path together — no GitHub credentials required.MultiRevisionRepositoryStrategyTeststill pass (should list commits,should create correct RefSpec for branches tags and commits).main, force-pushedmain, re-ran Nextflow — bare repo updated and WARN logged: