fix(distribution): let the version pins survive a change of quoting - #1208
Merged
Merged
Conversation
TrueNAS started writing tag: "0.17.0@sha256:..." where it had written the tag bare, the pattern did not allow the quote, and the channel reported UNKNOWN on every run instead of a version. It went unmeasured for weeks, and nothing was going to catch it: strictFailures only covers local_file channels on every_release, so a remote pin that measures nothing fails nothing. Five more pins read a field whose spelling the upstream owner can change the same way. Two are the same shape as the one that broke. One is the mirror image: caprover-official required a single quote, so it went blind the moment that template was written with double quotes or none, and the template was edited this week. YunoHost additionally required a ~ynhN suffix, so a packaging change would have blinded it too. Homebrew spelled the gap as one literal space while every other pattern used \s, so a formatter run that made it two would have been enough. Each pattern now accepts every spelling its own format allows. Five read the value bare, single-quoted or double-quoted. Homebrew keeps the quote mandatory, because version 0.17.0 is not valid Ruby and accepting it would only widen the pattern towards matching something that is not the version; what it gained is any whitespace before the quote. Only truenas-scale was actually broken. The other five read the same versions before and after, so for them this is hardening rather than repair: helm 0.17.0, homebrew 0.17.0, yunohost 0.17.0, caprover-official 0.16.2 and kubero 0.9.27, the last two being the real drift they were already reporting. Two tests come with it, both reading the shipped inventory rather than a fixture, because extractPin was always capable and the patterns were not. One asserts each of the six reads every spelling its format allows; the other pins the digest case, where the capture has to stop before the @. Both fail against the patterns this replaces.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.



TrueNAS started writing the image tag as
tag: "0.17.0@sha256:..."where it had written it bare. The pattern inchannels.yamldid not allow the quote, sotruenas-scalereported UNKNOWN on every run instead of a version, and it had been unmeasured for weeks before anyone looked. The catalog is in fact on 0.17.0, so nothing was wrong except our ability to see it.Nothing was going to catch that.
strictFailuresonly coverslocal_filechannels onsla: every_release, which is one channel out of forty, so a remote pin that measures nothing fails nothing. The weekly report prints an UNKNOWN row into a job summary and stops there: no warning annotation, no non-zero exit, no count.Five more pins read a field whose spelling the upstream owner can change the same way:
kuberoandtruenas-scaleshare the shape that broke. Kubero writes the tag bare today, so it kept working by luck.caprover-officialis the mirror image: it required a single quote, so it would have gone blind the moment that template was written with double quotes or none. That template was edited upstream this week.yunohostrequired a~ynhNsuffix as well as a double quote, so a packaging-only change to the suffix would have blinded it.homebrewspelled the gap as one literal space while every other pattern used\s, so a formatter run that made it two would have been enough.helmassumed a double quote aroundappVersion. It is the one channel--strictprotects, so it would have been caught, but there is no reason for it to be the exception.Each pattern now accepts every spelling its own format allows. Five read the value bare, single-quoted or double-quoted. Homebrew keeps the quote mandatory, because
version 0.17.0is not valid Ruby and accepting it would only widen the pattern towards matching something that is not the version; what it gained is any whitespace before the quote.Only
truenas-scalewas actually broken. The other five read the same versions before and after, so for them this is hardening rather than repair: helm 0.17.0, homebrew 0.17.0, yunohost 0.17.0, caprover-official 0.16.2 and kubero 0.9.27, the last two being the real drift they were already reporting.Two tests come with it. Both read the shipped inventory rather than a fixture, which is the point:
extractPinwas always capable of reading a quoted value, and the patterns were not, so a fixture test would have passed throughout. One asserts each of the six reads every spelling its format allows, including the whitespace variants for Homebrew. The other pins the digest case, where the capture has to stop before the@and must not wander into thecontainer_utils_imagetag two lines below. Both fail against the patterns this replaces.Checked locally:
format,lint,typecheck,distribution:matrix --check,channels:showcase:check,readme:check,security:checkall clean, the five suites that readchannels.yamlpass, andGITHUB_TOKEN=... bun run distribution:checkreports zero UNKNOWN withtruenas-scaleatOK 0.17.0.One thing this does not fix. The reason a blind channel can sit unnoticed is that
--strictignores every remote pin, and the weekly workflow does not pass--strictanyway. Making "I could not measure this" fail something is a change in what CI is allowed to block on, so it is not in here.