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

Dump template yml to file in pipeline repo after creation #2189

Merged
merged 6 commits into from
Mar 27, 2023

Conversation

awgymer
Copy link
Contributor

@awgymer awgymer commented Feb 22, 2023

Adds feature to solve #2143

The template yaml is now required to properly lint/sync custom pipelines. Currently if it's initially retrieved from CLI inputs when running nf-core create it does not get saved to file anywhere.

This PR dumps the template yaml used to create the pipeline into a pipeline_template.yml file in the new repo.

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 Feb 22, 2023

Codecov Report

Merging #2189 (326e600) into dev (e3b3ed3) will increase coverage by 0.38%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##              dev    #2189      +/-   ##
==========================================
+ Coverage   71.53%   71.92%   +0.38%     
==========================================
  Files          77       77              
  Lines        8369     8373       +4     
==========================================
+ Hits         5987     6022      +35     
+ Misses       2382     2351      -31     
Impacted Files Coverage Δ
nf_core/create.py 75.65% <100.00%> (+10.63%) ⬆️

... and 2 files with indirect coverage changes

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

@awgymer awgymer requested a review from mashehu February 22, 2023 13:38
Copy link
Contributor

@mashehu mashehu left a comment

Choose a reason for hiding this comment

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

Would be nice to also have a test for this.

log.debug("Dumping pipeline template yml to file")
if self.template_yaml:
with open(self.outdir / "pipeline_template.yml", "w") as fh:
yaml.safe_dump(self.template_yaml, fh)
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
yaml.safe_dump(self.template_yaml, fh)
yaml.safe_dump(self.template_yaml, fh)
run_prettier_on_file(fh.name)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

So this should only trigger when a template_yml is either supplied (which perhaps is silly) or someone customises something on the CLI.

Currently there are no tests which mock passing information in via the CLI prompts that I'm aware of. Happy to try adding them but not sure if it's best done as a unit-test or as part of one of the fuller tests defined in the GH actions?

@awgymer awgymer requested a review from mashehu March 27, 2023 09:59
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.

LGTM :)

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.

3 participants