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

Add support for generic git remotes #1641

Merged
merged 58 commits into from
Jun 21, 2022
Merged

Conversation

ErikDanielsson
Copy link
Contributor

@ErikDanielsson ErikDanielsson commented Jun 20, 2022

Until now, we have used the GitHub API to work with remote modules repositories. As is outlined in #1626, this limits the possible git remotes to GitHub. In this PR I have rewritten how we handle git remotes in the modules commands to work with any remote that works with command line git. This works by cloning the remote repositories into the .nfcore directory. When running modules command, we run git pull on all repositories that are affected by the command.

Outline of changes

  • To support any git remote the --github-repository option is changed to --git-remote, and the argument should be a valid git URL.
  • Added --no-pull flag to nf-core modules. This allows the user to run a modules command without pulling the remote repository.
  • The structure of the modules.json file is changed to keep track of the git URL. Hence, I have update the pipeline template. The new structure is as follows
{
    "name": "some name"
    "homePage": "https://some_page.com"
    "repos": {
        "path/in/git/remote": {
             "git_url": "git@git_provider.com:path/in/git/remote.git",
             "modules": {
                 "very-nice-module": {
                     "git_sha": "some hex"
                 },
                 ...
             }
         },
         ...
     }
}

PR checklist

  • This comment contains a description of changes (with reason)
  • CHANGELOG.md is updated
  • If you've fixed a bug or added code that should be tested, add tests!
  • Documentation in docs is updated

@codecov
Copy link

codecov bot commented Jun 20, 2022

Codecov Report

Merging #1641 (c558fd3) into dev (67fae3b) will increase coverage by 0.45%.
The diff coverage is 48.76%.

@@            Coverage Diff             @@
##              dev    #1641      +/-   ##
==========================================
+ Coverage   64.39%   64.84%   +0.45%     
==========================================
  Files          54       54              
  Lines        6299     6270      -29     
==========================================
+ Hits         4056     4066      +10     
+ Misses       2243     2204      -39     
Impacted Files Coverage Δ
nf_core/modules/module_test.py 48.27% <ø> (ø)
nf_core/modules/test_yml_builder.py 48.62% <ø> (+0.22%) ⬆️
nf_core/modules/update.py 7.81% <0.00%> (+0.06%) ⬆️
nf_core/__main__.py 51.68% <14.81%> (+0.90%) ⬆️
nf_core/modules/module_utils.py 34.40% <25.00%> (-3.20%) ⬇️
nf_core/modules/info.py 20.58% <28.57%> (+1.49%) ⬆️
nf_core/modules/modules_command.py 52.53% <29.16%> (-5.68%) ⬇️
nf_core/lint/modules_json.py 78.26% <50.00%> (-6.74%) ⬇️
nf_core/modules/modules_repo.py 75.33% <74.30%> (+1.46%) ⬆️
nf_core/modules/lint/module_changes.py 87.50% <75.00%> (+11.50%) ⬆️
... and 8 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 67fae3b...c558fd3. Read the comment docs.

nf_core/utils.py Outdated Show resolved Hide resolved
README.md Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Show resolved Hide resolved
nf_core/__main__.py Outdated Show resolved Hide resolved
nf_core/__main__.py Outdated Show resolved Hide resolved
@ewels
Copy link
Member

ewels commented Jun 21, 2022

Clone progress bar: use percentage for progress, more colour on the left and a rich URL to make it a clickable link for the remote.

Copy link
Member

@ewels ewels left a comment

Choose a reason for hiding this comment

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

LGTM 🦜

@ewels ewels merged commit 806e0ff into nf-core:dev Jun 21, 2022
@ErikDanielsson ErikDanielsson mentioned this pull request Jun 21, 2022
4 tasks
@ErikDanielsson ErikDanielsson deleted the get-generic-git branch July 26, 2022 07:38
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.

2 participants