+
Skip to content

Fix subworkflows update command to work for non-nf-core repos #2103

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

Merged
merged 2 commits into from
Dec 7, 2022

Conversation

awgymer
Copy link
Contributor

@awgymer awgymer commented Dec 7, 2022

Fixes #2101

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

@awgymer
Copy link
Contributor Author

awgymer commented Dec 7, 2022

@fmalmeida Any chance you can pull this code and see if it fixes your issue?

(gh pr checkout 2103 if you have the github cli installed and this repo checked out.)

@ewels ewels added this to the 2.7 milestone Dec 7, 2022
@codecov
Copy link

codecov bot commented Dec 7, 2022

Codecov Report

Merging #2103 (6451429) into dev (c8f5ab1) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##              dev    #2103   +/-   ##
=======================================
  Coverage   67.97%   67.97%           
=======================================
  Files          43       43           
  Lines        5633     5633           
=======================================
  Hits         3829     3829           
  Misses       1804     1804           
Impacted Files Coverage Δ
nf_core/components/update.py 81.51% <ø> (ø)

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 review from mashehu and mirpedrol December 7, 2022 14:03
@fmalmeida
Copy link

Hi,
I will check if I am able to try it.

Comment on lines +365 to +366
component if directory == self.modules_repo.repo_path else f"{directory}/{component}"
for directory, component in components
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
component if directory == self.modules_repo.repo_path else f"{directory}/{component}"
for directory, component in components
component for _, component in components

I'm not sure how to test that right now, but I think we can directly remove the whole if/else. Actually, this was a comment on the original PR, but we decided to change it later.
This will have some problems if there are two modules with the same name, but TBH I think we will have many other problems if that happens, so we should handle it differently.
If a user provides the name of a module without specifying the directory, the first code will fail. Not sure if that was the case for this particular issue, but I would say everyone will expect it to work with only the tool name.

Copy link
Member

Choose a reason for hiding this comment

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

module or subworkflow 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.

I don't think this makes a difference unless we change how we initially get components right? (Which right now is passed a repo_url).

This is part of a wider change I would like to make (probably in 2.8) where other than install we shouldn't need to rely on the remote repo being passed to the command with --git-repo (we already made it that way for lint I think?)

I have some experimental work that returns displays the module/subwf choice with it's "org" too, but for now that still didn't fix underlying issues if two modules/subwf had the same name so I haven't progressed it

Copy link
Member

Choose a reason for hiding this comment

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

Makes sense, let's leave these big changes for 2.8 👍

@ewels ewels linked an issue Dec 7, 2022 that may be closed by this pull request
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.

Finally figure out how to test it with a subworkflow from gitlab
nf-core subworkflows -g https://gitlab.com/nf-core/modules-test.git --branch org-path update bam_stats_samtools

Looks good! 🙂

@mirpedrol mirpedrol merged commit f6ca2de into nf-core:dev Dec 7, 2022
@awgymer awgymer deleted the fix-update-subwf branch December 7, 2022 15:40
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.

nf-core subworkflows update not finding installed workflow
4 participants
点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载