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

don't update modules_json if module is not updated #2323

Merged
merged 3 commits into from
Jun 22, 2023

Conversation

mirpedrol
Copy link
Member

Close #2014

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

@mirpedrol
Copy link
Member Author

Hi @ewels, I opened this PR to fix #2014, here I remove the piece of code which updates the modules_json object when we don't update the module but only show the differences or write them on a file.

The bug in this issue was happening because when we preview differences for all modules, we can choose to not update a module, but the modules_json object is updated anyway, if we do update another module, when we dump the changes in modules_json to the file the previous changes are also duped.

I remember I tried to remove this piece of code a while ago, and you told me it wasn't a good idea, but I can't see a case where we would want to update modules_json if the module is not updated. Am I missing something? Or is this a remnant from old code and can be safely removed?

@codecov
Copy link

codecov bot commented Jun 14, 2023

Codecov Report

Merging #2323 (fbe8155) into dev (37c3d06) will decrease coverage by 0.02%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##              dev    #2323      +/-   ##
==========================================
- Coverage   72.86%   72.84%   -0.02%     
==========================================
  Files          78       78              
  Lines        8774     8773       -1     
==========================================
- Hits         6393     6391       -2     
- Misses       2381     2382       +1     
Impacted Files Coverage Δ
nf_core/components/update.py 80.98% <ø> (-0.05%) ⬇️

... and 1 file with indirect coverage changes

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.

Did we change something in the update function that it now writes a file or why does this solve the problem?

@mirpedrol
Copy link
Member Author

I think this bug has always been there, but we only see it if we update all modules, decide not to update one of them, and then continue updating the rest. Because we will change the sha value for the not updated one and write it to the file while updating the others afterwards.

@mirpedrol mirpedrol requested a review from mashehu June 22, 2023 09:02
@mirpedrol mirpedrol merged commit 4f32c07 into nf-core:dev Jun 22, 2023
15 checks passed
@mirpedrol mirpedrol deleted the fix-update branch June 22, 2023 11:21
This pull request was closed.
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.

2 participants