+
Skip to content

Conversation

nh13
Copy link
Member

@nh13 nh13 commented Jun 5, 2025

Tools like picard, fgbio, and samtools all have sub-commands. It is onerous to have to update them all individually using nf-core modules bump-version. This change allows the module name to update to have a trailing forward slash, which will be interpreted as specifying that all subcommands should be updated. E.g. nf-core modules bump-version samtools/

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

Tools like picard, fgbio, and samtools all have sub-commands.  It is
onerous to have to update them all individually using nf-core modules
bump-version.  This change allows the module name to update to have a
trailing forward slash, which will be interpreted as specifying that all
subcommands should be updated.  E.g. nf-core modules bump-version
samtools/

This comment was marked as outdated.

@mashehu mashehu changed the base branch from main to dev June 6, 2025 05:59
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.

Thanks for the PR.

Could you please also add a unit test for this?

@nh13 nh13 force-pushed the feat/bump-versions-for-sub-modules branch from 2753566 to 2052819 Compare June 7, 2025 00:51
@nh13 nh13 force-pushed the feat/bump-versions-for-sub-modules branch from 2052819 to a5b9730 Compare June 7, 2025 01:00
module: Union[str, None] = None,
all_modules: bool = False,
show_uptodate: bool = False,
_dryrun: bool = False,
Copy link
Member Author

Choose a reason for hiding this comment

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

adding dryrun was much easier to mock and test, so I went this route.

Copy link
Contributor

Choose a reason for hiding this comment

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

good idea in general. I added it as a parameter

@nh13 nh13 requested a review from mashehu June 8, 2025 20:08
@nh13 nh13 enabled auto-merge June 8, 2025 20:11
Copy link

codecov bot commented Jun 8, 2025

Codecov Report

❌ Patch coverage is 81.25000% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 77.32%. Comparing base (2dfcb1e) to head (9a4f113).
⚠️ Report is 13 commits behind head on dev.

Files with missing lines Patch % Lines
nf_core/__main__.py 66.66% 1 Missing ⚠️
nf_core/commands_modules.py 50.00% 1 Missing ⚠️
nf_core/modules/bump_versions.py 90.90% 1 Missing ⚠️

☔ 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.

@nh13
Copy link
Member Author

nh13 commented Jun 8, 2025

@mashehu thank-you for the review, I've added a test and improved a few others while I'm there.

@mashehu
Copy link
Contributor

mashehu commented Jun 16, 2025

hinking about it:
I think a better command syntax would be simple to check if the input is a parent directory to sub-commands instead of requiring a / at the end

@nh13
Copy link
Member Author

nh13 commented Jun 16, 2025

@mashehu that makes sense, but is difficult in the current state of implementation where we have a list of component names to filter against, not directories. An alternative would be to check for an exact matching component name, and if not found, append a / and check for the prefix.

Copy link
Contributor

mashehu commented Jul 7, 2025

I tried to implement the more general matching approach, could you have a look @nh13 ?

Copy link
Member Author

@nh13 nh13 left a comment

Choose a reason for hiding this comment

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

@mashehu lgtm, with the one caveat that the API has changed for bump_versions in case we want to follow semver

…s-for-sub-modules

# Conflicts:
#	nf_core/__main__.py
@mashehu mashehu disabled auto-merge July 28, 2025 12:39
@mashehu
Copy link
Contributor

mashehu commented Jul 28, 2025

@nf-core-bot changelog

@mashehu mashehu enabled auto-merge (rebase) July 28, 2025 12:41
auto-merge was automatically disabled July 28, 2025 12:49

Rebase failed

@mashehu mashehu merged commit 7af69f1 into dev Jul 28, 2025
102 checks passed
@mashehu mashehu deleted the feat/bump-versions-for-sub-modules branch July 28, 2025 13:42
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

点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载