-
Notifications
You must be signed in to change notification settings - Fork 638
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
Use semver to pin only major/minor plugin versions #5435
base: master
Are you sure you want to change the base?
Conversation
✅ Deploy Preview for nextflow-docs-staging ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
Of particular relevance, this enables use of tilde ranges (~) to pin a major or minor version while allowing updates to minor or patch versions. Signed-off-by: Tom Sellman <[email protected]>
Signed-off-by: Tom Sellman <[email protected]>
This improves testability of the class by moving read of NXF_OFFLINE env var Signed-off-by: Tom Sellman <[email protected]>
(and tidy up the test setup a bit) Signed-off-by: Tom Sellman <[email protected]>
5be6e59
to
bed76b5
Compare
Signed-off-by: Ben Sherman <[email protected]>
At a first glance the changes make sense. Will need to try a manual test with some real plugins, ideally a published plugin with multiple major versions, and then review the code in more detail @tom-seqera do you feel good about this approach? I thought you said you had some concerns about the local plugin provider but now I don't remember |
It's been a little while, but I think I found that some of the p4fj code (or maybe our wrapper code around it?) seems to generally assume that plugin update versions for a given plugin ID are only defined in a single repository and might not work properly if you tried to enable both the local cache and remote index at the same time. It doesn't impact these specific changes because the code selects either the local cache or the remote index depending on the offline flag, but will likely be something we need to handle if/when we harmonise plugin loading or improve support for multiple plugin sources. |
Closes #4329
This makes two changes:
UpdateRepository
, allowing the same SemVer version constraint to be applied offline as well.The version range constraints are handled by the underlying SemVer library: https://github.com/zafarkhaja/jsemver?tab=readme-ov-file#range-expressions. Perhaps most usefully are tilde ranges (
~
), which allow pinning of the major or minor part of the version while automatically using any newer patch version. For example:~1.2
is equivalent to>=1.2.0 && <1.3.0
,~1.2.1
is equivalent to>=1.2.1 && <1.3.0
,~1
is equivalent to>=1.0.0 && <2.0.0
In offline mode, it will look for the latest already downloaded plugin version which matches the constraint.