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 branch field to module entries in modules.json to record what branch a module comes from #1738

Merged
merged 17 commits into from
Aug 5, 2022

Conversation

ErikDanielsson
Copy link
Contributor

@ErikDanielsson ErikDanielsson commented Aug 5, 2022

As I reported in #1728, the commands that rely on version information in the modules.json fail if a module was installed from a branch other than the default branch. I've fixed this by adding branch information to the module entries in the modules.json. The updated modules.json looks something like this

{
    "name": "a/pipeline",
    "homePage": "https://a-pipeline.com",
    "repos": {
        "some/cool/repo": {
            "base_path": "modules",
            "git_url": "https://git-provider.com/some/cool/repo.git",
            "modules": {
                "first-modules": {
                    "git_sha": "<some sha>",
                    "branch": "main"
                },
                "second/module": {
                    "git_sha": "<another sha>",
                    "branch": "other-branch"
                }
            }
        }
    }
}

To add this feature I needed to refactor the check_up_to_date method in modules_json.py since it was to big and unruly to be modified directly.

The new feature is tested using a new branch-tester branch in the nf-core/modules-test repository on gitlab.

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

@ErikDanielsson ErikDanielsson linked an issue Aug 5, 2022 that may be closed by this pull request
@codecov
Copy link

codecov bot commented Aug 5, 2022

Codecov Report

Merging #1738 (7b72ecf) into dev (bc935ba) will increase coverage by 0.20%.
The diff coverage is 66.06%.

@@            Coverage Diff             @@
##              dev    #1738      +/-   ##
==========================================
+ Coverage   68.24%   68.44%   +0.20%     
==========================================
  Files          59       59              
  Lines        7075     7141      +66     
==========================================
+ Hits         4828     4888      +60     
- Misses       2247     2253       +6     
Impacted Files Coverage Δ
nf_core/__main__.py 52.66% <0.00%> (ø)
nf_core/modules/list.py 71.23% <ø> (ø)
nf_core/utils.py 80.77% <50.00%> (-0.32%) ⬇️
nf_core/lint/modules_json.py 76.66% <60.00%> (-4.11%) ⬇️
nf_core/modules/modules_json.py 72.05% <64.05%> (+6.22%) ⬆️
nf_core/modules/patch.py 80.70% <66.66%> (-0.78%) ⬇️
nf_core/modules/update.py 76.08% <69.04%> (-2.29%) ⬇️
nf_core/modules/modules_repo.py 82.38% <86.66%> (+0.39%) ⬆️
nf_core/modules/lint/module_changes.py 50.00% <0.00%> (-2.39%) ⬇️
nf_core/modules/lint/module_patch.py 10.66% <0.00%> (-2.33%) ⬇️
... and 6 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

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.

Looks good :)
Only a couple of minor comments.

nf_core/modules/update.py Outdated Show resolved Hide resolved
nf_core/modules/update.py Outdated Show resolved Hide resolved
@ErikDanielsson
Copy link
Contributor Author

Thanks for the review @mirpedrol!

@ErikDanielsson ErikDanielsson deleted the branch-modules-json branch August 7, 2022 20:28
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.

Record branch information in modules.json
3 participants