fix: slim ubuntu-latest default; install shellcheck in ci.yml (#144) #146

Merged
andres merged 4 commits from build/144-default-labels-option-b into main 2026-08-01 23:23:41 +00:00
3 changed files with 37 additions and 21 deletions
Showing only changes of commit f0f17ad2ff - Show all commits

View file

@ -1,3 +1,8 @@
### Added
- Default Forgejo runner labels include opt-in `ubuntu-latest-full` for the GitHub-parity image (#144)
### Fixed
- Forgejo runners keep the slim `act-22.04` image for `ubuntu-latest` (full is ~54.5 GB and does not fit a box-class ci tenant); `ci.yml` installs `shellcheck` when missing, and the default map offers opt-in `ubuntu-latest-full` (#144)
- `ci.yml` installs `shellcheck` when the runner image lacks it, so Forgejo's slim `ubuntu-latest` can run `check` (#144)
- Plain `rig forgejo-runner install` warns when recorded labels are a retired rig default, without nagging custom `--labels` (#144)

View file

@ -425,21 +425,29 @@ if [ -e "$RUNNER_DIR/.runner" ]; then
#
# Two warn paths (#144):
# EXPLICIT --labels that differs → operator asked and it was not applied.
# Plain converge whose recorded labels differ from the current default →
# rig's default map moved (e.g. a new opt-in label). Without this warn the
# operator re-runs install, sees "already registered", and believes they
# have the new default while Forgejo still holds the old set.
# Custom --labels that match what was registered stay quiet. Jobs matching
# labels this runner already has are unaffected either way — re-register
# only to pick up labels that are missing from the recorded set.
# Plain converge whose recorded labels match a known *retired* default →
# rig's default map moved (e.g. added ubuntu-latest-full). Without this
# the operator re-runs install, sees "already registered", and believes
# they have the new default while Forgejo still holds the old set.
#
# Do NOT warn on every RECORDED != current default: that fires forever for
# any runner the operator deliberately gave custom --labels (drill's Leg 3
# registers drill:docker://node:22-bookworm). The old LABELS_EXPLICIT-only
# gate existed to avoid that noise; retired-default matching keeps the
# silence for intentional maps and still catches silent drift off a past
# rig default. Re-register only to pick up labels the old set never had —
# nothing matching the recorded set is broken by the map change alone.
if [ -r "$RUNNER_DIR/.rig-labels" ]; then
RECORDED="$(cat "$RUNNER_DIR/.rig-labels")"
if [ "$RECORDED" != "$LABELS" ]; then
if [ "$LABELS_EXPLICIT" -eq 1 ]; then
warn "--labels was not applied: this runner is already registered, and Forgejo owns its labels from registration time. It still has: ${RECORDED}. Labels are what 'runs-on' matches, so changing them means re-registering: 'rig forgejo-runner remove' then install again with the labels you want."
else
warn "this runner's labels differ from rig's current default (recorded: ${RECORDED}). Forgejo owns labels from registration time — a plain re-run does not change them. Re-register ('rig forgejo-runner remove' then install) only if you need labels the recorded set is missing (e.g. a newly added default). Jobs matching labels this runner already has are unaffected."
fi
if [ "$LABELS_EXPLICIT" -eq 1 ] && [ "$RECORDED" != "$LABELS" ]; then
warn "--labels was not applied: this runner is already registered, and Forgejo owns its labels from registration time. It still has: ${RECORDED}. Labels are what 'runs-on' matches, so changing them means re-registering: 'rig forgejo-runner remove' then install again with the labels you want."
elif [ "$LABELS_EXPLICIT" -eq 0 ]; then
# One pattern per past DEFAULT_LABELS value. Add a pattern when the
# default string changes so plain converges of older installs notice.
case "$RECORDED" in
'ubuntu-latest:docker://ghcr.io/catthehacker/ubuntu:act-22.04,docker:docker://node:22-bookworm')
warn "this runner was registered with an older rig default label set. The current default adds ubuntu-latest-full (the GitHub-parity image). Labels are fixed at registration, so picking it up means re-registering: 'rig forgejo-runner remove' then install again. Nothing you run today is affected — re-register only if you want the new label." ;;
esac
fi
fi
else

View file

@ -3714,13 +3714,16 @@ check "forgejo-runner: an explicit --labels on a rerun warns it was not applied"
grep -o -- "--labels was not applied" "$FR"
check "forgejo-runner: that warning is gated on --labels being EXPLICIT" 0 "LABELS_EXPLICIT" \
grep -o "LABELS_EXPLICIT" "$FR"
# #144 option B: plain converge must notice when rig's default map moved since
# registration (e.g. a newly added ubuntu-latest-full), without implying that
# every re-run rewrites Forgejo-side labels or that existing matching jobs fail.
check "forgejo-runner: plain converge warns when recorded labels differ from current default" 0 "differ from rig's current default" \
grep -o "differ from rig's current default" "$FR"
check "forgejo-runner: that plain-converge warn says re-register only for missing labels" 0 "only if you need labels the recorded set is missing" \
grep -o "only if you need labels the recorded set is missing" "$FR"
# #144 option B: plain converge warns only for known *retired* defaults — not
# for every RECORDED != current default (that would noise custom --labels
# forever, including drill's Leg 3). Pins match the case arm + message.
check "forgejo-runner: plain converge warns on a known retired default label set" 0 "registered with an older rig default label set" \
grep -o "registered with an older rig default label set" "$FR"
check "forgejo-runner: that warn says re-register only if you want the new label" 0 "re-register only if you want the new label" \
grep -o "re-register only if you want the new label" "$FR"
check "forgejo-runner: the pre-#144 default string is the retired-default case arm" 0 \
"ubuntu-latest:docker://ghcr.io/catthehacker/ubuntu:act-22.04,docker:docker://node:22-bookworm" \
grep -F "ubuntu-latest:docker://ghcr.io/catthehacker/ubuntu:act-22.04,docker:docker://node:22-bookworm" "$FR"
# Default map: slim ubuntu-latest (act), opt-in full, docker — pin the three
# so a silent drop of the full rider or a flip back to full-as-default fails.
check "forgejo-runner: DEFAULT_LABELS maps ubuntu-latest to act-22.04 (slim)" 0 "ubuntu-latest:docker://ghcr.io/catthehacker/ubuntu:act-22.04" \