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

Configure the default module repository, branch, and path from environment variables. #3481

Merged

Conversation

edanielson-ginkgo
Copy link

@edanielson-ginkgo edanielson-ginkgo commented Mar 5, 2025

Add the ability to configure the default modules repo, branch, and name as environment variables.

Context:
Within our org, we're looking to build an nf-core-style module repository in Gitlab - this is possible with the command line flags, but it's a hassle to set --git-branch every time we run a module command.

This PR adds the ability to set NF_CORE_MODULES_NAME, NF_CORE_MODULES_REMOTE, and NF_CORE_MODULES_DEFAULT_BRANCH as environment variables, defaulting to the existing constants for those values if the variables are not set.

I took a quick look for other similar constants, but didn't see any, nor did I find an existing config file or object - if I missed something, let me know and I'll be happy to update this.

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

Copy link

codecov bot commented Mar 6, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 76.50%. Comparing base (67146de) to head (b221780).
Report is 23 commits behind head on dev.

Additional details and impacted files

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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, thanks!

We should also update the documentation here

@edanielson-ginkgo
Copy link
Author

Thanks! Looks like docs for that are here:
https://github.com/nf-core/website/blob/main/sites/docs/src/content/docs/nf-core-tools/custom_remotes.md
I'm happy to contribute verbiage, but what's the preferred flow for that? Doesn't look like there's a dev branch or similar concept on that repo.

@edanielson-ginkgo edanielson-ginkgo merged commit f7207a5 into nf-core:dev Mar 6, 2025
94 checks passed
@mashehu
Copy link
Contributor

mashehu commented Mar 7, 2025

Sorry just saw this PR now. We use click for our CLI, which automatically conversats environment variables to parameters, eg. NFCORE_GIT_BRANCH in your case https://click.palletsprojects.com/en/stable/options/

@edanielson-ginkgo
Copy link
Author

Oh, interesting - can you point me to that in the code? The docs on Click suggest that's an option you can set, but it doesn't seem to be working for me by default - IOW, setting NFCORE_GIT_REMOTE (to match the --git-remote flag) doesn't affect the CLI's behavior.

I'm happy to open a new PR to switch to defaulting the behavior on Click, if that's the preferred method.

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.

4 participants