fix: warn only on retired default labels, not custom maps (#144)
Plain converge comparing RECORDED to the current default nags every runner registered with intentional --labels (including drill Leg 3). Match known past DEFAULT_LABELS strings instead — same intent, no noise. Changelog split per review. Refs #144
This commit is contained in:
parent
23965bebca
commit
f0f17ad2ff
3 changed files with 37 additions and 21 deletions
|
|
@ -1,3 +1,8 @@
|
||||||
|
### Added
|
||||||
|
|
||||||
|
- Default Forgejo runner labels include opt-in `ubuntu-latest-full` for the GitHub-parity image (#144)
|
||||||
|
|
||||||
### Fixed
|
### 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)
|
||||||
|
|
|
||||||
|
|
@ -425,21 +425,29 @@ if [ -e "$RUNNER_DIR/.runner" ]; then
|
||||||
#
|
#
|
||||||
# Two warn paths (#144):
|
# Two warn paths (#144):
|
||||||
# EXPLICIT --labels that differs → operator asked and it was not applied.
|
# EXPLICIT --labels that differs → operator asked and it was not applied.
|
||||||
# Plain converge whose recorded labels differ from the current default →
|
# Plain converge whose recorded labels match a known *retired* default →
|
||||||
# rig's default map moved (e.g. a new opt-in label). Without this warn the
|
# rig's default map moved (e.g. added ubuntu-latest-full). Without this
|
||||||
# operator re-runs install, sees "already registered", and believes they
|
# the operator re-runs install, sees "already registered", and believes
|
||||||
# have the new default while Forgejo still holds the old set.
|
# 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
|
# Do NOT warn on every RECORDED != current default: that fires forever for
|
||||||
# only to pick up labels that are missing from the recorded set.
|
# 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
|
if [ -r "$RUNNER_DIR/.rig-labels" ]; then
|
||||||
RECORDED="$(cat "$RUNNER_DIR/.rig-labels")"
|
RECORDED="$(cat "$RUNNER_DIR/.rig-labels")"
|
||||||
if [ "$RECORDED" != "$LABELS" ]; then
|
if [ "$LABELS_EXPLICIT" -eq 1 ] && [ "$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."
|
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
|
elif [ "$LABELS_EXPLICIT" -eq 0 ]; then
|
||||||
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."
|
# One pattern per past DEFAULT_LABELS value. Add a pattern when the
|
||||||
fi
|
# 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
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
|
|
|
||||||
17
test/cli.sh
17
test/cli.sh
|
|
@ -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"
|
grep -o -- "--labels was not applied" "$FR"
|
||||||
check "forgejo-runner: that warning is gated on --labels being EXPLICIT" 0 "LABELS_EXPLICIT" \
|
check "forgejo-runner: that warning is gated on --labels being EXPLICIT" 0 "LABELS_EXPLICIT" \
|
||||||
grep -o "LABELS_EXPLICIT" "$FR"
|
grep -o "LABELS_EXPLICIT" "$FR"
|
||||||
# #144 option B: plain converge must notice when rig's default map moved since
|
# #144 option B: plain converge warns only for known *retired* defaults — not
|
||||||
# registration (e.g. a newly added ubuntu-latest-full), without implying that
|
# for every RECORDED != current default (that would noise custom --labels
|
||||||
# every re-run rewrites Forgejo-side labels or that existing matching jobs fail.
|
# forever, including drill's Leg 3). Pins match the case arm + message.
|
||||||
check "forgejo-runner: plain converge warns when recorded labels differ from current default" 0 "differ from rig's current default" \
|
check "forgejo-runner: plain converge warns on a known retired default label set" 0 "registered with an older rig default label set" \
|
||||||
grep -o "differ from rig's current default" "$FR"
|
grep -o "registered with an older rig default label set" "$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" \
|
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 "only if you need labels the recorded set is missing" "$FR"
|
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
|
# 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.
|
# 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" \
|
check "forgejo-runner: DEFAULT_LABELS maps ubuntu-latest to act-22.04 (slim)" 0 "ubuntu-latest:docker://ghcr.io/catthehacker/ubuntu:act-22.04" \
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue