Masterminds / Masterminds/semver

Exact match on build metadata

Open
#271 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Go
Stars
1.4k
Forks
168
PR merge metrics
No merged PRs in 30d

Description

Currently, the "build metadata" part of the version is ignored by all constraints. This make it impossible, in tools like Helm, to specifiy an exact dependency to a single build, and leads to unpredictable behaviour or hackish workarounds.

It has already been said in #172 and #164 that, per spec:

Build metadata MUST be ignored when determining version precedence.

I think this statement ignores the very first sentence of SemVer chapter 11 (emphasis is mine):

Precedence refers to how versions are compared to each other when ordered.

When using an exact match constraint (e.g. =1.0.0-develop+cafebabe or !=), no ordering nor precedence resolution is expected. I want this exact version, and expect an error if it does not exist. If, and only if, I use an inequality or range operator, should precedence rules come into play, as several versions may match the query.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing how exact-match and inequality constraints compare versions in the Go semver package. Add focused coverage for exact and not-equal constraints containing build metadata, and verify that range and inequality behavior continues to follow precedence rules.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
tooling
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.