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

Allow nf-core download -r to download commits #2906

Draft
wants to merge 3 commits into
base: dev
Choose a base branch
from

Conversation

fellen31
Copy link

@fellen31 fellen31 commented Apr 4, 2024

Mimic the behaviour of nextflow run -r and allow selected commit(s) to be downloaded.

https://nfcore.slack.com/archives/CE5LG7WMB/p1712143905189639

Not sure about the effect it will have on Tower downloads.

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

@mashehu
Copy link
Contributor

mashehu commented Apr 4, 2024

@nf-core-bot fix linting

@fellen31
Copy link
Author

fellen31 commented Apr 4, 2024

@nf-core-bot fix linting

Comment on lines +1013 to +1016
# Get commit information from github api
commit_response = gh_api.safe_get(f"https://api.github.com/repos/{pipeline}/commits?sha={branch['name']}")
for commit in commit_response.json():
wf_commits.append(commit["sha"])
Copy link
Member

Choose a reason for hiding this comment

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

I am a bit scared of this - is it really getting every single commit from a repo? In some repos that could be a huge response.

I wonder if we move this into a separate function call and only do it if we need to - that is, once we're sure that the user is passing a commit and is not going to use a branch or a tag?

I suspect that the number of people wanting exact commits to be a tiny proportion, so I don't want to slow down / risk crashes for the majority.

@edmundmiller edmundmiller added the download nf-core download label Jun 13, 2024
@ewels ewels added the awaiting-changes Needs changes after a review. Remove label when ready to be reviewed again. label Jun 17, 2024
@ewels
Copy link
Member

ewels commented Jun 17, 2024

On hold until further notice. Nearly complete in case anyone wants to pick it up.

Suggestion is to guess the URL for the supplied commit (if it looks like a hash - is the right length and characters) and try it, see if we get a 404 or not. That way we don't need to fetch the commit history for the repo.

Copy link
Contributor

This PR has been tagged as awaiting-changes or awaiting-feedback by an nf-core contributor. Remove stale label or add a comment if it is still useful.

@github-actions github-actions bot added the Stale label Jul 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting-changes Needs changes after a review. Remove label when ready to be reviewed again. download nf-core download Stale
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants