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

Components: Handle extended set of git path prefixes #2945

Merged
merged 5 commits into from
May 6, 2024

Conversation

robsyme
Copy link
Contributor

@robsyme robsyme commented May 1, 2024

As per the document linked in the function description, valid git URLs may begin with ssh:// (and ftp://). This PR extends the nf-core tool to clone module repositories that are of these forms.

Before this fix, running a command like

nf-core modules list remote \
  --git-remote ssh://git-codecommit.us-east-2.amazonaws.com/v1/repos/modules.git

would pass the string ssh://git-codecommit.us-east-2.amazonaws.com/v1/repos/modules.git to the repo_full_name_from_remote function which would return the repo full name /v1/repos/modules, which would be passed to the git clone subshell to invoke the command trying to git clone into the root of the filesystem, which is going to fail for almost all users:

git clone -v --progress -- \
  ssh://git-codecommit.us-east-2.amazonaws.com/v1/repos/modules.git \
  /v1/repos/modules

This amended function now returns the string v1/repos/modules instead, which should allow the repo to be cloned correctly because it is no longer an absolute path.

git clone -v --progress -- \
  ssh://git-codecommit.us-east-2.amazonaws.com/v1/repos/modules.git \
  v1/repos/modules

accomodate paths that begin with ssh:// ftp[s]://
etc.
@robsyme robsyme requested a review from mirpedrol May 1, 2024 18:18
Copy link

codecov bot commented May 1, 2024

Codecov Report

Attention: Patch coverage is 50.00000% with 3 lines in your changes are missing coverage. Please review.

Project coverage is 75.14%. Comparing base (1bde816) to head (32fda2c).
Report is 3 commits behind head on dev.

Files Patch % Lines
nf_core/modules/modules_utils.py 50.00% 3 Missing ⚠️
Additional details and impacted files

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@mirpedrol mirpedrol changed the title Handle extended set of git path prefixes Components: Handle extended set of git path prefixes May 3, 2024
@mirpedrol
Copy link
Member

@nf-core-bot changelog

Copy link
Member

@mirpedrol mirpedrol left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for the fix!

CHANGELOG.md Outdated Show resolved Hide resolved
@mirpedrol mirpedrol merged commit 2e7ba04 into dev May 6, 2024
35 checks passed
@mirpedrol mirpedrol deleted the handle-ssh-git-paths branch May 6, 2024 09:03
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.

3 participants