-
Notifications
You must be signed in to change notification settings - Fork 190
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
DSL2 Modules: Support .diff
files for minor changes
#1312
Comments
Maybe need a new Potential ideas:
So workflow would be:
Thoughts? |
Just an opinion: I find So you imagine one should run the command with the module being in dirty state? Then the command would generate the diff and create a patch file and reset the original module to the commit defined in the Then what happens on update? You force overwrite the module with the nf-core/modules version and re-apply that patch? In case of conflicts in applying the patch, they need to be handled manually and a new patch is generated when calling the command again? |
Agree, I think that the module modifications should be committed. We want the pipeline files to work out of the box as flat files wherever possible I think, to keep things simple. So yeah, the patch file is just to record changes to allow the linting and module updates to work.
Yes, exactly 👍🏻 When running the update it'll work exactly as it does currently - checking the local version passes linting, delete it, download the new copy, update In case of a merge, we need to bail with an error. Presumably we leave the vanilla version of the module from nf-core/modules in place but with a dirty git state. Then the user manually reapplies the changes and runs Need to make sure we don't end up with orphaned patch files is the only thing. So maybe we need to keep them in a canonical directory location so that we can lint that all of them are referenced in |
@ewels I see that diffing is also handled in the PR that you linked. How do you see the interaction between the |
The PR is for something completely different, hence the potential for confusion 😬 That PR shows a diff of what will be changed in a module when you update. Basically a preview of what will be done when you run the update command. So for example, differences between version 1.1 of a module and 1.2 of a module. It has nothing to do with local modifications of a module. Suggestions for how to make this distinction as clear as possible welcome! |
I see, thank you for the clarification. |
This is SO FREAKING COOL |
❤️ @ErikDanielsson this will be so great to use. Thanks a lot for making an implementation. 🎉 |
Whilst the central nf-core/modules repo of shared DSL2 modules is amazing, we may face occasions when pipelines need to have minor differences that should not be in the main modules repository. For example, nf-core/methylseq needs the genome index on a per-sample basis, which is not consistent with the rest of nf-core/modules.
At the moment, the only solution is to keep local copies of modules. This is undesirable, as it will lead to inevitable seperation creep between the local module and the central repository. Local modules can't be updated and fixes are less likely to be contributed back.
Instead of this, I propose that nf-core/tools supports the existence of
.diff
/.patch
files for modules, which allow pipelines to apply minor changes on top of centralised modules. This keeps the two in sync for updates, but allows minor variations.Like much of what we do, Bioconda has beaten us to this. For example, see the ISACC recipe:
meta.yaml
:patch-configure.diff
:So we could have a field in
modules.json
that points to one or more patch.diff
files in the pipeline repo. These patches would be applied when installing / updating modules, and taken into consideration when linting.For a concrete example with nf-core/methylseq, see ewels/nf-core-methylseq#2
nf-core modules install
nf-core modules update
nf-core modules lint
The text was updated successfully, but these errors were encountered: