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

Fix bug when updating modules from old version in old folder structure #1908

Merged
merged 8 commits into from
Oct 11, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
### General

- Fix error in tagging GitPod docker images during releases
- Fix bug when updating modules from old version in old folder structure
- Don't remove local copy of modules repo, only update it with fetch ([#1881](https://github.com/nf-core/tools/pull/1881))
- Add subworkflow commands create-test-yml, create and install ([#1897](https://github.com/nf-core/tools/pull/1897))
- Update subworkflows install so it installs also imported modules and subworkflows ([#1904](https://github.com/nf-core/tools/pull/1904))
Expand Down
13 changes: 11 additions & 2 deletions nf_core/modules/modules_repo.py
Original file line number Diff line number Diff line change
Expand Up @@ -430,8 +430,17 @@ def get_module_git_log(self, module_name, depth=None, since="2021-07-07T00:00:00
"""
self.checkout_branch()
module_path = os.path.join("modules", self.repo_path, module_name)
commits = self.repo.iter_commits(max_count=depth, paths=module_path)
commits = ({"git_sha": commit.hexsha, "trunc_message": commit.message.partition("\n")[0]} for commit in commits)
commits_new = self.repo.iter_commits(max_count=depth, paths=module_path)
commits_new = [
{"git_sha": commit.hexsha, "trunc_message": commit.message.partition("\n")[0]} for commit in commits_new
]
# Grab commits also from previous modules structure
module_path = os.path.join("modules", module_name)
commits_old = self.repo.iter_commits(max_count=depth, paths=module_path)
commits_old = [
{"git_sha": commit.hexsha, "trunc_message": commit.message.partition("\n")[0]} for commit in commits_old
]
commits = iter(commits_new + commits_old)
return commits

def get_subworkflow_git_log(self, subworkflow_name, depth=None, since="2021-07-07T00:00:00Z"):
Expand Down