Inexact operators for prerelease version constraints #1651
Labels
enhancement
New feature or request
pending-decision
This issue has not been accepted for implementation nor rejected. It's still open to discussion.
OpenTofu Version
Use Cases
I help to maintain modules that deploy across a large number of workspaces and want to integrate a tiered deployment strategy. That involves releasing alpha, beta, and release candidate releases of these modules alongside mainline releases.
I have a groups of workspaces that I'd like to pull in these different prerelease channels. Ideally, that would be accomplished by setting these workspaces to take in the module with something similar to
>= 1.0.0-beta.1
or~> 1.0-rc.1
. However, prerelease versions can currently only be selected by an exact version constraint.Attempted Solutions
On a module that has the versions:
1.0.1
,1.1.0-beta.1
,1.1.0-beta.2
,1.1.0-beta.3
,1.1.0-rc.1
available, setting the version constraint to an inexact operator such as>= 1.1.0-beta.1
results in the following:However, setting the version constraint to an exact operator such as
1.1.0-beta.1
pulls down the module version properly.I also attempted pulling down the latest prerelease module version separately and inserting it into the version constraint as a variable, which is also not supported. However, that's definitely out of scope for this issue.
Proposal
Hashicorp developers previously shot down a request for this in Terraform citing that "pre-release tags do not necessarily follow the normal semver order semantics" despite the fact that semver does have defined specs for prereleases. Additionally that "one usually does not desire any pre-releases to be included in a range of semantic versions" when there are a number of reasons for wanting to pull in the latest release or release range in a certain release channel.
My proposal is that OpenTofu support the full range of semver in version constraint strings on inexact operators i addition to the exact operators that are currently supported.
References
No response
The text was updated successfully, but these errors were encountered: