-
Notifications
You must be signed in to change notification settings - Fork 192
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
nf-core download: Ability to add custom tags to revisions in downloaded pipelines #2938
nf-core download: Ability to add custom tags to revisions in downloaded pipelines #2938
Conversation
Interesting...adding tags depends on a successfully configured git user:
nf-core download already deletes superfluous tags...which apparently is no problem. |
afcacf1
to
014962f
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, but I will let @mashehu have another look before approving :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Almost there, would just like to discuss alternatives to -a
before giving 👍🏻
CHANGELOG.md
Outdated
- Better error message when GITHUB_TOKEN exists but is wrong/outdated | ||
- New `-a` / `--additional-tag` argument to add custom tags during a pipeline download ([#2938](https://github.com/nf-core/tools/pull/2938)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tbh not a big fan to use -a
for something other then --all
🙂 how about just going for --tag
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 for --tag
. I'm not too fussed about always providing short-form flags for every option. I think it's fine to have only long-form for the more unusual ones like this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Notwithstanding, it is so forthcoming of Seqera to rename their web application just to free up the -t
short-form flag for the future 😝...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nf_core/download.py
Outdated
# "Private" method to add the additional custom tags to the repository. | ||
def __add_additional_tags(self) -> None: | ||
if self.additional_tags: | ||
self.ensure_git_user_config(f"nf-core download v{nf_core.__version__}", "core@nf-co.re") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
are we sure we want to use the nf-core-bot as the default user? I would prefer an error I think
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It doesn't need to be the nf-core bot
we are using here as default, but an error for that reason is not a real option in my opinion.
After all, the downloaded bare repositories are pretty ephemeral and one would need to configure git
properly to avoid. Admittedly, it is just two git commands that need to be run once and then never again, but I for example use nf-core download
exclusively on Rackham, so I have Singularity available. But I am not doing development work on Rackham, so I haven't set up git there properly. The same goes for the func user that we use to prepare the deployments.
Lastly, mind that it was actually the failing CI that prompted me to include this, so if we switch back to error out, we first have to adapt our Pytest CI 🫣.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree with @MatthiasZepper on this one - this git action of adding a tag isn't really meaningful as a development step. This is purely an action to make running the pipeline easier, where the user behind the action is not visible. So I don't think that it matters what the account is, so I would prefer not to error.
That being said, I don't think that it needs to be a real account either? So maybe we can set it to automated@tag.com
or some other fake email..?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I have changed the default e-mail address. I presumed, it was a sinkhole / do not reply address, but apparently not.
9135e84
to
4b0fe7b
Compare
5e35492
to
5e640b7
Compare
nf_core/download.py
Outdated
# "Private" method to add the additional custom tags to the repository. | ||
def __add_additional_tags(self) -> None: | ||
if self.additional_tags: | ||
self.ensure_git_user_config(f"nf-core download v{nf_core.__version__}", "core@nf-co.re") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
self.ensure_git_user_config(f"nf-core download v{nf_core.__version__}", "core@nf-co.re") | |
self.ensure_git_user_config(f"nf-core download v{nf_core.__version__}", "test@example.com") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the suggestion! I had at the same time googled a bit about suitable sinkhole addresses, and now settled on dev-null@example.com. Ultimately, I could not find any information on behalf of ICANN / IETF that one may indeed use any e-mail of that reserved domain for anything else than documentation.
…kflow class. ToDo for WorkflowRepo class.
…po class in 'nf-core download'.
…nt of 'nf-core download'.
…s, but may also affect normal usage.
Co-authored-by: Matthias Hörtenhuber <mashehu@users.noreply.github.com>
5c3149b
to
0b8e4ad
Compare
Co-authored-by: Matthias Hörtenhuber <mashehu@users.noreply.github.com>
306264d
to
3277b7c
Compare
This PR introduces a
-a
/--additional-tag
argument tonf-core download --platform
. It must be followed by a string in a "key=value" format and can be provided multiple times. The left-hand side must refer to a valid branch, tag or commit SHA. The right-hand side must comply with the naming conventions for Git tags and may not yet exist in the repository.The new
-a
/--additional-tag
argument allows customizing the downloaded pipeline with additional tags that can be used to select particular revisions in the Seqera Platform interface.For example, an accredited facility may opt to tag particular revisions according to their structured release management process:
-a "3.12.0=testing" -a "3.9.0=validated"
so their staff can easily ensure that the correct version of the pipeline is run in production.I believe this feature will be useful for facilities and those who are setting up pipelines for others to run.
Additionaly, this PR also bumps the dev version from
2.13.2dev
to2.14dev
to comply with SemVer. Mind that other PRs already merged ondev
, e.g. #2853 by @ewels should have triggered this before because it deprecated the--tower
argument:PR checklist
CHANGELOG.md
is updateddocs
is updated