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

Use semver to pin only major/minor plugin versions #5435

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

tom-seqera
Copy link
Contributor

Closes #4329

This makes two changes:

  1. Allows using SemVer version constraints to specify plugin versions
  2. Presents the directory of already downloaded plugins as an 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.

Copy link

netlify bot commented Oct 25, 2024

Deploy Preview for nextflow-docs-staging ready!

Name Link
🔨 Latest commit bed76b5
🔍 Latest deploy log https://app.netlify.com/sites/nextflow-docs-staging/deploys/672de67770d3590008b6ccf2
😎 Deploy Preview https://deploy-preview-5435--nextflow-docs-staging.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

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]>
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]>
@tom-seqera tom-seqera force-pushed the 4329-partial-pin-plugin-version branch from 5be6e59 to bed76b5 Compare November 8, 2024 10:22
@tom-seqera tom-seqera marked this pull request as ready for review November 8, 2024 11:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Plugins: Use any available cached version if NXF_OFFLINE is true
2 participants