Skip to content

Keep cross-remote linked components on their own branch during update and install - #4646

Open
chenyangsu wants to merge 5 commits into
nf-core:devfrom
chenyangsu:fix/linked-component-branch
Open

chenyangsu wants to merge 5 commits into
nf-core:devfrom
chenyangsu:fix/linked-component-branch

Conversation

@chenyangsu

Copy link
Copy Markdown

Fixes #4296

When updating a subworkflow from a fork with --git-remote and --branch, ComponentUpdate and ComponentInstall pass self.branch to ModulesRepo for linked components on other remotes (such as nf-core/modules), raising LookupError when that branch does not exist upstream.

Fall back to self.branch only when a linked component shares self.current_remote.remote_url (matching the same-remote guard install.py already uses for self.sha), and preserve recorded cross-remote branches from modules.json in get_components_to_update. Happy to drop the modules.json branch lookup if you prefer using the remote default branch instead.

Testing: pytest tests/components/test_linked_component_branch.py -> 9 passed (5 failed before the fix); ruff check, ruff format --check, and mypy --follow-imports=silent pass.

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!

@chenyangsu
chenyangsu requested a review from a team as a code owner November 27, 2026 08:17

@mashehu mashehu left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thank you for your contribution.
Could you please do some small modifications?

Comment thread nf_core/components/install.py Resolved
@chenyangsu

Copy link
Copy Markdown
Author

Done: the branch choice is now one helper, get_linked_component_branch() in components_utils.py, used in install(), update() and manage_changes_in_linked_components(). The tests moved into tests/subworkflows/test_install.py and tests/subworkflows/test_update.py; happy to put them under tests/modules/ instead if you prefer.

@mashehu

mashehu commented Nov 30, 2026

Copy link
Copy Markdown
Member

please join the nf-core github org via slack to get the CI running.

@codecov

codecov Bot commented Dec 1, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 79.22%. Comparing base (4a4d5bd) to head (9e3536d).
⚠️ Report is 3 commits behind head on dev.

☔ View full report in Codecov by Harness.
📢 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.

This branch has not been deployed

No deployments
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