[GH-ISSUE #1219] Propossal: Support colon (:) as name-value separator in build metadata #7684

Open
opened 2026-06-20 17:46:18 -05:00 by GiteaMirror · 0 comments
Owner

Originally created by @jcangas on GitHub (Jun 3, 2026).
Original GitHub issue: https://github.com/semver/semver/issues/1219

Build metadata (the + segment) is semantically opaque to version precedence, yet in practice it almost always encodes named attributes — branch names, commit identifiers, pipeline IDs, timestamps.

The current grammar only allows alphanumerics, -, and . as separators. This forces consumers into ad-hoc conventions that conflate the separator with the identifier:

Convention Problem
+sha-e0482cc7 - reads as a word boundary, not a label separator
+sha.e0482cc7 . implies two independent identifiers, not one labeled value
+shae0482cc7 No separator at all — label and value are visually fused

A dedicated : separator would make the intent unambiguous:

2.0.0+sha:e0482cc7
2.0.0+branch:main.sha:e0482cc7.build:42

This would also align SemVer with established metadata conventions in other standards (HTTP headers, MIME parameters, structured logging) where name:value is the canonical form.

Proposed grammar change (ABNF):

build-pair     = alphanumerics ":" alphanumerics
build-id       = alphanumerics / build-pair

Since build metadata is explicitly excluded from version precedence comparisons, this is a non-breaking addition.

Originally created by @jcangas on GitHub (Jun 3, 2026). Original GitHub issue: https://github.com/semver/semver/issues/1219 Build metadata (the `+` segment) is semantically opaque to version precedence, yet in practice it almost always encodes named attributes — branch names, commit identifiers, pipeline IDs, timestamps. The current grammar only allows alphanumerics, `-`, and `.` as separators. This forces consumers into ad-hoc conventions that conflate the separator with the identifier: | Convention | Problem | |---|---| | `+sha-e0482cc7` | `-` reads as a word boundary, not a label separator | | `+sha.e0482cc7` | `.` implies two independent identifiers, not one labeled value | | `+shae0482cc7` | No separator at all — label and value are visually fused | A dedicated `:` separator would make the intent unambiguous: ``` 2.0.0+sha:e0482cc7 2.0.0+branch:main.sha:e0482cc7.build:42 ``` This would also align SemVer with established metadata conventions in other standards (HTTP headers, MIME parameters, structured logging) where `name:value` is the canonical form. **Proposed grammar change** (ABNF): ``` build-pair = alphanumerics ":" alphanumerics build-id = alphanumerics / build-pair ``` Since build metadata is explicitly excluded from version precedence comparisons, this is a non-breaking addition.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/semver#7684