-
Notifications
You must be signed in to change notification settings - Fork 206
Make nf-core branding optional to help users create non-nf-core pipelines that can still leverage nf-core standards. #1551
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
Conversation
≈# Please enter the commit message for your changes. Lines starting
This comment was marked as outdated.
This comment was marked as outdated.
Just to add some more comments - this is already a really great start. What would be great to have here is to be able to select certain bits of the template and leave others out, e.g. the CI part is tied to Github Actions whereas people might have to run CI for their "nf-core harmonized" pipelines internally on their own CI. So would be great to pass some parameters that configure this sort of behaviour. I'm thinking of a YAML file maybe that configures this or something similar: - prefix: my_company
- skip_ci: yes
- skip_github_badges: yes
- skip_ignomes: yes
- ... |
Agreed, a more fine-grained logic / config for this would be nice. Could maybe have an argument to pass a YAML config file like this and go with interactive prompts otherwise. The config could also include other fields that we already have: name: mypipeline
author: me
prefix: my_company
skip:
- ci
- github_badges
- ignomes Then the prompts could start with a simple y/n and then go more fine grained after that.. eg: ? Do you want to customise which parts of the template are used? [y/N] y
? Pipeline prefix: nf-core
? Skip GitHub CI workflows? [y/N] n |
Note that this is a general idea, doesn't have to be a requirement for this specific PR necessarily. Could be taken in a subsequent PR. |
I've added the functionality suggested in the comments here. So you can now either configure the pipeline creation with a yaml file by passing the filename to the name: cool-pipe
author: me
prefix: cool-pipes-company
skip:
- ci
- github_badges
- igenomes
- nf_core_configs will create a pipeline called To allow the commands to run without prompts, I've also added a This is just a first implementation, so it would be great with some feedback on how we want to customise the template further. In particular, I'm uncertain if we need to remove anything in the |
All features should be implemented now, and all tests are passing, so this PR should be ready to merge soon! It would be great though if people could try it out, to see if I've missed any nf-core branding or if anything seems to be broken |
Forgot to mention this earlier, I've added an extra option for excluding nf-core/configs - I'll add it to the example in the comment above. |
Nice! I'll give it another try tomorrow when I'm in the office. |
Hi!
Also, It'd be cool if the png generation could be edited to include the new prefix, but I think that's something to take up with the website team |
I believe this is also stated in the current docs (predating this feature). I've never used linting in the pipelines I modified for this reason. On this topic, I'd argue that if it is fixable, it might be better to have that in a separate PR (this one is quite large already)? |
Of course, I totally agree! But I would argue to also remove that part from the CI tests then. I think the goal here is to provide a minimal amount of friction to boost the standard adoption. All of this can be handled in subsequent PR's of course. For now, we can just skip the CI during template generation. |
I think that we should be careful not to confuse two separate issues here: identity of the pipeline and usage of nf-core/tools. I don't think that there's any need to rename Specific linting tests can disabled by this config so what I discussed with @ErikDanielsson was for these template flags to disable the relevant specific tests. Then the remainder of the linting should still run (and pass). No need to edit the linting code itself I think (or very much, anyway). I think logo generation is out of scope - if it's not an nf-core pipeline there should be no branding, even with a different prefix. So just no image at all. Agree on removing the awstest action workflows 👍🏻 Phil |
What I meant is that lint:
files_exist:
- CODE_OF_CONDUCT.md
- assets/nf-core-preprocessing_logo_light.png
- docs/images/nf-core-preprocessing_logo_light.png
- docs/images/nf-core-preprocessing_logo_dark.png |
Those fields are added to make linting pass -- the linting tests are named with an nf-core prefix. We could update the linting test to use the custom prefix as well, but since it does not make sense for |
The AWS tests are now removed by default when run with a custom prefix. Linting should pass now also, no matter which sections of the template are skipped. |
Awesome, thanks for the great work! |
I'm a bit confused - yes that's intentional. Those lines in the YAML config are there to disable the lint tests that check for their presence. |
Ah, it seems I misunderstood that part! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Started a review this morning but never finished. Dumping my comments now before they get lost forever.
I'll try to get back to have a play with this and review, but may not have time now. Feel free to merge if it feels ready and @mirpedrol is happy 👍🏻
Co-authored-by: Phil Ewels <phil@seqera.io>
Co-authored-by: Phil Ewels <phil@seqera.io>
Co-authored-by: Phil Ewels <phil@seqera.io>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great!
I just made a small comment and the CHANGELOG should also be updated :)
force=False, | ||
outdir=None, | ||
template_yaml_path=None, | ||
plain=False, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I might be missing something, but don't we want to make plain True by default?
I see this will change the meaning of the flag, and if you answer "No" to the prompt about customization a default template is generated, so I am also fine with leave it as it is, but just thinking that the most common usage of the command nf-core create
will be to generate nf-core pipelines.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You've got a point, but on the other hand, prompting by default showcases the functionality better. I think that since the default option is to not customize the template, it is easy enough to create a nf-core pipeline.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn't really matter, but semantically I would usually use None
for "no default" and prompt only if set to that.
Only really matters if people use the function in custom Python scripts.
nf_core/create.py
Outdated
|
||
# The schema is not guaranteed to follow Prettier standards | ||
# so we run prettier on the schema file | ||
subprocess.run(["prettier", "--write", schema_path], stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This fails with FileNotFoundError: [Errno 2] No such file or directory: 'prettier' when prettier is not installed, so we could add a better error message as discussed with @ErikDanielsson
This is an incomplete PR - just to bring the discussion in #1548 into focus around real code changes.
I expect that there will be more rounds of commits steered by community discussion.
At the moment, changes include:
--prefix
parameter fornf-core create
where the prefix replacesnf-core
in templates.self.branded
instance variable to thePipelineCreate
class to be used as a handy boolean switch in jinja templates.branded == True
=> nf-core branding,branded == False
=> don't assume nf-core branding.branded
branded
branded
main.nf
e.g.workflow NFCORE_RNASEQ
toworkflow CUSTOMPREFIX_RNASEQ
PR checklist
CHANGELOG.md
is updateddocs
is updated