Reject empty min_release_age, self-age the e2e fixtures, run self-tests in CI
An empty min_release_age string now maps to unparseable rather than absent, so "min_release_age": "" fails validation instead of silently running with a zero-second quarantine. The end-to-end fixtures extend the checked-in pkgver (.90/.91) so the test keeps working at any future mise version. A Tests workflow runs bin/sync-upstream self-test and bin/omarchy-pkgs self-test on every PR in the Arch container, making the proof machine-checked instead of author-supplied. The README package metadata field list documents upstream and min_release_age.
This commit is contained in:
@@ -93,10 +93,14 @@ package_min_release_age_seconds() {
|
||||
echo 0
|
||||
return 0
|
||||
fi
|
||||
# A present-but-empty value maps to "unparseable", not to "absent": only a
|
||||
# missing key means no hold, so '"min_release_age": ""' cannot silently
|
||||
# disable the quarantine.
|
||||
raw=$(jq -r '
|
||||
if has("min_release_age") then
|
||||
.min_release_age | if type == "string" or type == "number" then tostring else "unparseable" end
|
||||
else "" end
|
||||
if has("min_release_age") | not then ""
|
||||
elif (.min_release_age | type) == "string" or (.min_release_age | type) == "number" then
|
||||
.min_release_age | tostring | if . == "" then "unparseable" else . end
|
||||
else "unparseable" end
|
||||
' "$metadata")
|
||||
if [[ -z "$raw" ]]; then
|
||||
echo 0
|
||||
|
||||
Reference in New Issue
Block a user