From 6f92b9eaa646fd13588543c51806d5414c83b047 Mon Sep 17 00:00:00 2001 From: grok-reviewer-andresmgsl Date: Sat, 1 Aug 2026 21:38:26 +0000 Subject: [PATCH] test: drive the retired-default label recogniser (#144) Extract labels_are_a_retired_default and assert the four cases a grep pin cannot: pre-#144 matches, current default does not, custom --labels does not, near-miss does not. Addresses the remaining REQUEST_CHANGES on !146. Refs #144 --- commands/forgejo-runner-install.sh | 24 +++++++++++++++++------- test/cli.sh | 23 +++++++++++++++++++---- 2 files changed, 36 insertions(+), 11 deletions(-) diff --git a/commands/forgejo-runner-install.sh b/commands/forgejo-runner-install.sh index de5cb4d..d80d44a 100755 --- a/commands/forgejo-runner-install.sh +++ b/commands/forgejo-runner-install.sh @@ -43,6 +43,21 @@ die() { printf 'rig-forgejo-runner: ERROR: %s\n' "$1" >&2; exit "${2:-1}"; } # inert until matched, so boxes that never ask pay nothing. DEFAULT_LABELS='ubuntu-latest:docker://ghcr.io/catthehacker/ubuntu:act-22.04,ubuntu-latest-full:docker://ghcr.io/catthehacker/ubuntu:full-22.04,docker:docker://node:22-bookworm' +# labels_are_a_retired_default +# +# True when is a past DEFAULT_LABELS value rig has shipped — the +# only plain-converge case that should warn about re-registration (#144). +# Custom operator maps (drill's Leg 3, any --labels) must return false so a +# bare re-run stays quiet. One pattern per past default; add when the string +# changes. Extracted and driven by test/cli.sh — a grep pin alone cannot prove +# the match is exact. +labels_are_a_retired_default() { + case "${1:-}" in + 'ubuntu-latest:docker://ghcr.io/catthehacker/ubuntu:act-22.04,docker:docker://node:22-bookworm') return 0 ;; + *) return 1 ;; + esac +} + # fetch_and_verify_sha256