Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Identify default git branch when downloading pipelines (#3593) #5375

Merged
merged 3 commits into from
Oct 9, 2024

Conversation

tom-seqera
Copy link
Contributor

Uses the symbolic ref approach described here https://stackoverflow.com/a/44750379 to identify the default branch when downloading a pipeline repository.

jgit doesn't automatically create the symbolic ref, but does checkout the remote's default branch. This change creates the symbolic ref after cloning, and uses it when determining the default branch. This change does not attempt to retroactively create the symbolic ref on already downloaded local repos.

If the manifest specifices a defaultBranch, then that will override the symbolic ref. If neither defaultBranch nor symbolic ref is present, master will be used as a fallback.

Copy link

netlify bot commented Oct 7, 2024

Deploy Preview for nextflow-docs-staging canceled.

Name Link
🔨 Latest commit 6795ca9
🔍 Latest deploy log https://app.netlify.com/sites/nextflow-docs-staging/deploys/67067fb6bca3b500089746fa

@tom-seqera tom-seqera force-pushed the 3593-detect-default-git-branch branch from 90ba9ef to 1dc1add Compare October 7, 2024 10:00
Copy link
Member

@pditommaso pditommaso left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's add a test checking an ad-hoc test repo using a non-default branch

@tom-seqera tom-seqera force-pushed the 3593-detect-default-git-branch branch from 1dc1add to 9133992 Compare October 8, 2024 12:47
@tom-seqera tom-seqera requested a review from pditommaso October 8, 2024 12:48
@tom-seqera tom-seqera force-pushed the 3593-detect-default-git-branch branch from 9133992 to 1227f8e Compare October 8, 2024 15:24
@pditommaso
Copy link
Member

Could not resist to make this change 6795ca9. @tom-seqera would make sense to add a unit test for getRemoteBranch or it's too paranoic ?

@pditommaso pditommaso merged commit 4f74fc3 into master Oct 9, 2024
22 checks passed
@pditommaso pditommaso deleted the 3593-detect-default-git-branch branch October 9, 2024 13:37
@bentsherman bentsherman linked an issue Oct 9, 2024 that may be closed by this pull request
alberto-miranda pushed a commit to alberto-miranda/nextflow that referenced this pull request Nov 19, 2024
…io#3593) (nextflow-io#5375)


Signed-off-by: Tom Sellman <[email protected]>
Signed-off-by: Paolo Di Tommaso <[email protected]>
Co-authored-by: Paolo Di Tommaso <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Main branch not recognised when executing an online workflow
3 participants