Skip to content

Commit 4327342

Browse files
committed
👷 ci: give the fetch-lib gate its own step and drop the delegation crutch
hack/test/ci_fetch_lib_hardening_test.sh reached CI only because the CI-HELMDL-01 gate invoked it first. That is circular: delete the nested call and the fetch gate silently stops running, which is exactly the state its own self-wiring assertion exists to prevent. It also filed every fetch-lib failure under a step named "install-helm hardening". Wire it as its own lint step, immediately before the install-helm gate -- the helper is the more fundamental diagnosis, so it should be the one read first -- and remove the delegation from ci_install_helm_hardening_test.sh. The fetch gate's self-wiring assertion accepts either route by design and needed no change; verified by replicating its pipeline per candidate file, which now counts the ci.yaml step and zero delegation hits. Its header comment claimed the delegation as current fact, so that is corrected. The step's position is unchanged from where it already ran, so it still precedes the Install Helm and yq steps; the gate needs neither.
1 parent 5856124 commit 4327342

3 files changed

Lines changed: 19 additions & 27 deletions

File tree

.github/workflows/ci.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,16 @@ jobs:
238238
run: bash hack/test/demo_01_default_samples_test.sh
239239
- name: Verify demo sample Kustomizations render (DOC-04)
240240
run: bash hack/test/demo_04_samples_kustomize_test.sh
241+
# CI-FETCHLIB-01: the shared fetch helper (hack/lib/fetch.sh) that every hack/install-*.sh
242+
# and the kind-e2e-setup action now download through. It gets its OWN step rather than being
243+
# invoked from the CI-HELMDL-01 gate below, which is how it first reached CI: that route was
244+
# circular (delete the nested call and this gate silently stops running) and it filed every
245+
# fetch-lib failure under a step named "install-helm hardening". Not matched by the dist_* or
246+
# sonar_ko_* globs, hence the explicit run. It goes BEFORE the install-helm gate because
247+
# install-helm's hardening is now a property of the helper, so "the helper is broken" is the
248+
# more fundamental diagnosis and the one an operator should read first.
249+
- name: Verify shared fetch helper hardening (CI-FETCHLIB-01)
250+
run: bash hack/test/ci_fetch_lib_hardening_test.sh
241251
# CI-HELMDL-01: hack/install-helm.sh is what the kind-e2e-setup composite action runs to
242252
# get helm, and a single transient `curl: (7)` to get.helm.sh reddened the REQUIRED
243253
# kind-smoke check on PR #351. This gate locks in the retry/protocol-pinning hardening

hack/test/ci_fetch_lib_hardening_test.sh

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -844,15 +844,16 @@ pass "the kind download goes through the shared helper, with no hand-rolled loop
844844
# Self-wiring. "An unwired gate is not a gate" (house precedent: hack/test/dev_mise_pin_drift_test.sh).
845845
# ================================================================================================
846846
#
847-
# This gate is reached in CI TODAY through hack/test/ci_install_helm_hardening_test.sh, which
848-
# .github/workflows/ci.yaml already runs as an explicit step in the lint job. That indirection
849-
# is deliberate and is recorded here rather than hidden: the lane that wrote this file does not
850-
# own .github/workflows/**, and shipping a gate that reds until an unrelated lane lands a
851-
# workflow line would be worse than shipping one that runs. The preferred wiring -- its own
852-
# named step, so a failure here is attributed to fetch-lib rather than to helm -- is a one-line
853-
# addition and is recorded in this lane's handover.
847+
# This gate is reached in CI through its own named step in the lint job of
848+
# .github/workflows/ci.yaml ("Verify shared fetch helper hardening (CI-FETCHLIB-01)"), so a
849+
# failure here is attributed to fetch-lib rather than to helm. It first reached CI by delegation
850+
# from hack/test/ci_install_helm_hardening_test.sh, because the lane that wrote this file did not
851+
# own .github/workflows/**; that crutch was circular -- deleting the nested call silently
852+
# unwired this gate -- and GATE-CIWIRING-02 replaced it with the workflow step and removed it.
854853
#
855-
# Either route satisfies the assertion; ZERO routes does not. The `-Fx` match on a trimmed,
854+
# The assertion below still accepts EITHER route, deliberately: it is a check that the gate is
855+
# reachable, not a check of which file reaches it, and pinning it to one spelling would red this
856+
# gate for a legitimate rewiring. ZERO routes is the failure. The `-Fx` match on a trimmed,
856857
# comment-stripped, `run:`-unwrapped view is what stops a commented-out or neutered invocation
857858
# ("# bash ...", "bash ... || true", "bash ... &") from counting as wiring: GATE-COMMENT-01 and
858859
# GATE-SCOPE-01, both from hack/test/dist_ci_wiring_test.sh, are the house records of a

hack/test/ci_install_helm_hardening_test.sh

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -61,25 +61,6 @@ pass() {
6161
[[ -f "${LIB}" ]] ||
6262
fail "${LIB} is missing -- hack/install-helm.sh sources it for every fetch, so the flag assertions below would have nothing to inspect"
6363

64-
# ---------------------------------------------------------------------------------------------
65-
# CI-FETCHLIB-01 sibling gate, run FIRST.
66-
#
67-
# hack/test/ci_fetch_lib_hardening_test.sh proves the shared helper's behaviour against a real
68-
# local HTTPS origin, and asserts that every hack/install-*.sh routes through it. This file is
69-
# invoked from an explicit step in the lint job of .github/workflows/ci.yaml; the sibling is not,
70-
# because the lane that added it does not own .github/workflows/**, and the dist_*/sonar_ko_*
71-
# globs in that job do not match its filename. Invoking it here is what keeps it in CI rather
72-
# than in the tree-but-never-run state that makes a gate decorative.
73-
#
74-
# It runs BEFORE this file's own assertions on purpose: install-helm.sh's hardening is now a
75-
# property of the helper, so "the helper is broken" is the more fundamental diagnosis and is the
76-
# one an operator should read first. The lane handover records the one-line ci.yaml step that
77-
# would give the sibling its own name in the job log; until that lands, this is the wiring.
78-
# ---------------------------------------------------------------------------------------------
79-
echo "--- CI-FETCHLIB-01 shared fetch helper gate ---"
80-
bash "${ROOT}/hack/test/ci_fetch_lib_hardening_test.sh"
81-
echo "--- back to CI-HELMDL-01 install-helm assertions ---"
82-
8364
# ---------------------------------------------------------------------------------------------
8465
# Static assertions over the source text.
8566
# ---------------------------------------------------------------------------------------------

0 commit comments

Comments
 (0)