Enable specifying version for resource #1077
Draft
+702
−218
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
PR Summary
Allows specifying semver requirements via the
apiVersion
property. Uses the https://docs.rs/semver/latest/semver/struct.VersionReq.html syntax, some examples:1.1
1.1.*
*
>1.1.2
<=1.3.2
>1.1.2, <2.0.0
~1.1
^1.1
=1.1
This PR also allows for arbitrary strings for the version to support date format. However, if using this there is a warning that the version isn't semver and the requested version (via
apiVersion
) must be an exact match to the resource declared version.The version isn't passed to the resource, but resources can have multiple manifests if it implements multiple versions and decide for itself how to inform the resource the version being requested.
Note that if the version requirement is semver and doesn't start with a number, then an
=
operator is prefixed indicating exact version. Also, adapted resource versioning is NOT part of this PR and will come separately since this PR is already big enough.dsc resource list
will now show multiple versions of a resource anddsc resource
has a new--version
parameter.PR Context
Fix #543
Fix #942