Skip to content

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

Merged
pditommaso merged 3 commits intomasterfrom
3593-detect-default-git-branch
Oct 9, 2024
Merged

Identify default git branch when downloading pipelines (#3593)#5375
pditommaso merged 3 commits intomasterfrom
3593-detect-default-git-branch

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.

@netlify
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
Signed-off-by: Tom Sellman <tom.sellman@seqera.io>
@tom-seqera tom-seqera force-pushed the 3593-detect-default-git-branch branch from 9133992 to 1227f8e Compare October 8, 2024 15:24
Signed-off-by: Paolo Di Tommaso <paolo.ditommaso@gmail.com>
@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 ?

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