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

nextflow pull -r needs to be run twice to pull remote tag #4246

Closed
SamStudio8 opened this issue Aug 31, 2023 · 5 comments · Fixed by #4247
Closed

nextflow pull -r needs to be run twice to pull remote tag #4246

SamStudio8 opened this issue Aug 31, 2023 · 5 comments · Fixed by #4247

Comments

@SamStudio8
Copy link

SamStudio8 commented Aug 31, 2023

Bug report

Expected behavior

nextflow pull -r <tag> checks out a new tag from the remote repository.

Actual behavior

  • nextflow pull -r <tag> yields the following error: Cannot find revision <tag> -- Make sure that it exists in the remote repository
  • A second nextflow pull -r <tag> is successful

Steps to reproduce the problem

# Check out a known past tag
nextflow pull -r v1.0.0 epi2me-labs/wf-basecalling
LOCAL_PATH=$(nextflow info epi2me-labs/wf-basecalling | grep 'local path' | sed -nE 's, local path  : (.*),\1,p')
cd ${LOCAL_PATH}
# Nuke a known "future" tag
git tag -d v1.0.1
# Try and check it out with nextflow pull
nextflow pull -r v1.0.1 epi2me-labs/wf-basecalling
# check out again, successfully
nextflow pull -r v1.0.1 epi2me-labs/wf-basecalling

Environment

  • Nextflow version: 23.04.2
  • Java version: OpenJDK 64-Bit Server VM Homebrew (build 17.0.3+0, mixed mode, sharing)
  • Operating system: macOS
  • Bash version: zsh 5.8 (x86_64-apple-darwin21.0)

Additional context

Running Nextflow pull on an existing asset repo, triggers the following events:

When running the command a second time, the repository is successfully updated by the first git.checkout().setName(revision).

Some initial thoughts on how to work around this:

  • the repository should always be fetched before attempting the first git.checkout().setName(revision), or
  • after failing to track a branch in checkoutRemoteBranch, download could attempt to checkout the revision as a tag
@SamStudio8
Copy link
Author

Hey @bentsherman, thanks for the patch on this. Is there a plan to merge 4247?

@bentsherman
Copy link
Member

Just waiting for @pditommaso to approve

@SamStudio8
Copy link
Author

@pditommaso
cookies

@pditommaso
Copy link
Member

I was testing the associated PR, however I was not able to replicate the reported issue. This command works for me

» nextflow pull -r v1.0.1 epi2me-labs/wf-basecalling
Checking epi2me-labs/wf-basecalling ...
 downloaded from https://github.com/epi2me-labs/wf-basecalling.git - revision: 3047f23c74 [v1.0.1]

What am I missing?

@bentsherman
Copy link
Member

You have to delete the tag from the git repo to force git to pull a remote tag separate from the initial clone, like pulling a new release. See the "steps to reproduce the problem" in the OP

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants