feat(checks): oci-incompatible-version, for a version that cannot be an OCI tag #22
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
actions/changelog!22
Loading…
Reference in a new issue
No description provided.
Delete branch "mikluko/octant/1725-oci-incompatible"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Octant: T1725, on map D1726. Stacked on #21 — merge that first.
Build metadata is valid Semantic Versioning and cannot be an OCI tag. The specification permits
1.2.3+build.1; the OCI tag grammar is[a-zA-Z0-9_][a-zA-Z0-9._-]{0,127}, which has no+. Git ref syntax does permit it, so such a version cuts a tag and is then not a name a registry takes.Why a check and not a parser rule
The parser accepts strict SemVer with no exceptions, so the accepted set stays the specification's. A version that will not survive the journey is a finding about that version, not a malformed document.
The explanation rides on the check, so the reason arrives attached to the refusal — in
-list-checksand in the generated README table — rather than in a paragraph a reader meets only by going looking.What it actually checks
The grammar, not the one case. The length bound is checked too: a pre-release run has no bound in SemVer and a tag stops at 128 characters. The finding names the character or the length at fault:
The first check whose subject is outside the document
The other seventeen are about the changelog or about the repository's tags. This one is about what a version can become somewhere else entirely, and the register's description says so rather than pretending otherwise. A repository that publishes no image or chart switches it off in
off:and it never fires again — there is a test for exactly that, because theerrordefault leans on it.The two consequences the ticket asked me to carry
One existing test changed:
TestLintBuildMetadataIsAReadableVersionasserted no findings at all for a build-metadata document. That was the coupling D1726 predicted —unreadable-versionis still silent on it, and this check is what now has the opinion, so the test asserts the pair rather than silence.Open, and yours:
errororwarning. Shipped aterrorper the ticket's own position, which inverts D1629's policy-defaults-to-off rule the same wayundated-entrydoes. The ticket says to decide it rather than default to it, so say the word and I will change it.Suite green,
vetandgofmtclean, README regenerated, document readsvalid=true. Eighteen checks.