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

Support patch file in nf-core modules update #1710

Merged
merged 5 commits into from
Aug 1, 2022

Conversation

ErikDanielsson
Copy link
Contributor

@ErikDanielsson ErikDanielsson commented Jul 28, 2022

Continuation from #1708 (merge that one first). This PR adds support for automatic application of patches created with nf-core modules patch. The command works by looking for the original lines of the current installation in the new version of the module. If they are found, it replaces them with the modified lines. If there is a conflict between the modifications by the patch file and the update, the new files are installed but the patch file is preserved so the user can apply it manually.

The new feature is tested using a special branch in the nf-core/modules-test repository on GitLab containing only the bismark/align module: patch-tester. The branch contains three commits in total: One containing the original version of the module, one where a change has been made that shouldn't affect the patch file created by the tests and one that should. The commands are tested by creating the patch file on the original version of the module, and then trying to update to the different versions.

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 Jul 28, 2022

Codecov Report

Merging #1710 (1418ce3) into dev (d070fc6) will increase coverage by 0.33%.
The diff coverage is 77.77%.

❗ Current head 1418ce3 differs from pull request most recent head 46f60d7. Consider uploading reports for the commit 46f60d7 to get more accurate results

@@            Coverage Diff             @@
##              dev    #1710      +/-   ##
==========================================
+ Coverage   68.25%   68.59%   +0.33%     
==========================================
  Files          57       58       +1     
  Lines        6744     6820      +76     
==========================================
+ Hits         4603     4678      +75     
- Misses       2141     2142       +1     
Impacted Files Coverage Δ
nf_core/utils.py 80.50% <33.33%> (-0.48%) ⬇️
nf_core/__main__.py 52.66% <45.45%> (-0.19%) ⬇️
nf_core/modules/modules_differ.py 84.69% <80.00%> (+12.97%) ⬆️
nf_core/modules/patch.py 81.48% <81.48%> (ø)
nf_core/modules/modules_json.py 64.42% <85.00%> (+1.28%) ⬆️
nf_core/modules/update.py 75.60% <88.88%> (+2.46%) ⬆️
nf_core/modules/__init__.py 100.00% <100.00%> (ø)
nf_core/modules/test_yml_builder.py 48.16% <0.00%> (-0.46%) ⬇️
nf_core/modules/modules_repo.py 82.16% <0.00%> (+0.63%) ⬆️
... and 1 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 d070fc6...46f60d7. Read the comment docs.

@ErikDanielsson ErikDanielsson changed the title Support update patch Support patch file in nf-core modules update Jul 28, 2022
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.

👍

@ErikDanielsson
Copy link
Contributor Author

Thanks for the review! I need to handle the merge conflict before merging though, its a pretty tricky one

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