Skip to content

fix(ci): the install-script gate authenticates, and its required-check guard covers all 39 - #573

Merged
scttfrdmn merged 1 commit into
mainfrom
fix/install-script-auth-and-required-checks
Oct 1, 2026
Merged

scttfrdmn merged 1 commit into
mainfrom
fix/install-script-auth-and-required-checks

Conversation

@scttfrdmn

Copy link
Copy Markdown
Owner

What this fixes

install-script (opensuse/leap:15.6, ...) failed on #571 with

curl: (22) The requested URL returned error: 403
objectfs-install: error: could not reach the GitHub API to find the latest release. Pass --version to skip this step

on a diff that touched two Go files in internal/awsname. It is one of thirty-nine required
status checks on main, so it blocks that pull request.

resolve_latest in scripts/install.sh already has the fix, and has had it since the commit that
added it. Its comment names the caller it was written for:

A token is used when one is present and never required. Unauthenticated API calls are rate limited
by IP, which is fine for a person and not fine for CI on a shared runner.

The job on the far side of that sentence never passed one. The capability existed, was documented as
being for this job, and was unreachable from it — the same shape as a MountOptions field nothing
sets, and it failed the same way: silently, until the shared runner's sixty-an-hour ran out.

Retrying is not the alternative, and the script says so at two call sites. --retry 3 has been on
that curl all along; curl does not retry a 403, and wget_retry_flags excludes 403 deliberately
because it is an authorization answer rather than a transient one. Nor would retrying help if it did
— the primary rate limit resets up to an hour out, against this job's 15-minute timeout.
Authenticated is 5,000 requests an hour against 60 for a shared runner IP.

-e GITHUB_TOKEN goes only on the two runs that download. The two refusal runs deliberately do not
get it: preflight exits before resolve_latest is reached, confirmed from the failing log, where the
opensuse refusal printed the missing-tar list and EXIT=1 with no curl output at all.

Three more defects, found while diagnosing it

The idempotency step passed vacuously on total failure

Both installs are silenced to /dev/null and the step compares digests. When the install fails there
is no binary, sha256sum prints nothing to stdout, a and b are both the empty string — and two
empty strings compare equal, so it echoed SAME and passed.

That assertion was green for every possible failure of the thing it exists to test, including the
403 that took the step beside it down. The digests are now checked for being digests before they are
compared.

requiredChecks transcribed 20 of the 39 configured names

Nothing in it had gone stale — it was written when there were twenty and never grew. So nineteen
required contexts had no guard against the local rename that orphans them: build-tags (s3compat),
deploy-manifests, docs-site, all ten fuzz-smoke cells, all three install-script rows,
labels, sdk-metrics, systemd-unit.

A half-populated list is worse than an empty one, because the test passing reads as the whole set
being covered.

ci.yml's header claimed "Twenty check names are required on main"

...and enumerated that same subset — in a comment block whose own opening paragraph owns up to having
said "four" while listing five. Replaced with a pointer to the transcription, for the same reason the
version constant lives in exactly one place.

Tests

The job cannot catch this itself: an unauthenticated run passes whenever the quota happens not to be
exhausted, which is most of the time. A check that is only wrong under load is one nobody reads as
wrong.

  • TestInstallScriptJobAuthenticatesEveryRunThatDownloads — keys on the success assertions rather
    than on step names, because a name is prose and those two greps are what would have to be deleted
    for a step to stop needing a token. Asserts a floor of two matching steps, so a rewording cannot
    leave it checking nothing.
  • TestWorkflowsNeverForwardAnUnsetEnvironmentVariableToAContainer — walks every workflow.
    docker run -e FOO with no = forwards FOO from the caller's environment and forwards nothing
    when it is unset there, with no error. So the -e and the step's env: are one change in two
    places, and the missing half reproduces the original symptom with the fix apparently applied.

jobSteps is added to workflow_test.go rather than as a fifth hand-rolled map[any]any walk, per
#504.

Verified by mutation, not by prediction

Each mutant was confirmed to still compile — FAIL [build failed] proves nothing.

Mutation Result
Drop -e GITHUB_TOKEN from the installing docker run TestInstallScriptJobAuthenticatesEveryRunThatDownloads FAIL
Drop GITHUB_TOKEN from the twice-step env:, keep the -e both new tests FAIL
Rename the labels job in ci.yml TestRequiredChecksStillHaveAJobToReportThem FAIL, naming labels
Same rename, with "labels" removed from the list (the pre-change state) ok — passes

The last two are the pair that matters: the identical rename that orphans a required check passed
before this change and fails after it.
That is the coverage gap closed, shown by execution.

Not fixed here, deliberately — #572

The completeness guard strips the (...) suffix, so it cannot see a matrix cell rename, and
install-script's three contexts embed a container image tag and a zypper command line. Bumping
Leap 15.6 to 16 would silently orphan all three and block every PR with nothing red to point at.

modulefiles already solved this for itself with an explicit name:, and the same fix applies — but
it renames a required check, which means a branch-protection change, and that is a repository setting
rather than something this repository changes from code. Filed as #572 with the exact gh api call
and a note that PATCH replaces the contexts array rather than merging into it.

Verification

go build ./...                                → ok
make test                                     → EXIT=0, 37 packages ok, no failures, no races
GOOS=linux golangci-lint run ./internal/config/ → 0 issues
go test -race ./internal/config/              → ok

GOOS=linux because CI lints linux and this machine's golangci-lint (v2.14.0) is newer than the
pinned v2.12.2.

No CHANGELOG.md entry: scripts/install.sh is unchanged and nothing here is user-facing.

Unblocks #571.

…k guard covers all 39

The `install-script (opensuse/leap:15.6, ...)` row failed on PR #571 with

    curl: (22) The requested URL returned error: 403
    objectfs-install: error: could not reach the GitHub API to find the latest release

against a diff that touched two Go files in `internal/awsname`. It is one of thirty-nine required
status checks on `main`, so it blocks the pull request.

`resolve_latest` in `scripts/install.sh` already has the fix, and has had it since the commit that
added it. Its comment names the caller it was written for: "Unauthenticated API calls are rate
limited by IP, which is fine for a person and not fine for CI on a shared runner." The job on the
far side of that sentence never passed a token. The capability existed, was documented as being for
this job, and was unreachable from it.

Retrying is not the alternative, and the script says so at two call sites: `--retry 3` has been on
that curl all along, curl does not retry a 403, and `wget_retry_flags` excludes 403 deliberately
because it is an authorization answer rather than a transient one. Nor would retrying help — the
primary rate limit resets up to an hour out, against this job's 15-minute timeout. Authenticated is
5,000 requests an hour against 60 for the shared runner IP.

Three further defects found while diagnosing it:

**The idempotency step passed vacuously on total failure.** Both installs are silenced to
/dev/null and the step compares digests; when the install fails there is no binary, `sha256sum`
prints nothing, and `a` and `b` are both empty — which are equal, so it echoed SAME and passed. That
assertion was green for every possible failure of the thing it exists to test, including the 403
that took the step beside it down. The digests are now checked for being digests before they are
compared.

**`requiredChecks` transcribed twenty of the thirty-nine configured names.** Nothing in it had gone
stale; it was written when there were twenty and never grew, so nineteen required contexts had no
guard against the local rename that orphans them — `build-tags (s3compat)`, `deploy-manifests`,
`docs-site`, all ten `fuzz-smoke` cells, all three `install-script` rows, `labels`, `sdk-metrics`
and `systemd-unit`. A half-populated list is worse than an empty one, because the test passing reads
as the whole set being covered.

**`ci.yml`'s header said "Twenty check names are required on `main`"** and enumerated that same
subset, in a comment block whose own opening paragraph owns up to having said "four" while listing
five. Replaced with a pointer to the transcription, for the reason the version constant lives in one
place.

Two tests, because the job cannot catch this itself — an unauthenticated run passes whenever the
quota happens not to be exhausted, which is most of the time:

- `TestInstallScriptJobAuthenticatesEveryRunThatDownloads` keys on the success assertions rather
  than on step names, and asserts a floor so a rewording cannot leave it checking nothing.
- `TestWorkflowsNeverForwardAnUnsetEnvironmentVariableToAContainer` walks every workflow. `docker
  run -e FOO` with no `=` forwards FOO from the caller's environment and forwards nothing when it is
  unset there, with no error — so the `-e` and the step's `env:` are one change in two places, and
  the missing half reproduces the original symptom with the fix apparently applied.

`jobSteps` is added to `workflow_test.go` rather than as a fifth hand-rolled `map[any]any` walk,
per #504.

One residual gap is recorded rather than fixed: the guard strips the ` (...)` suffix, so it cannot
see a matrix *cell* rename, and `install-script`'s three contexts embed a container image tag and a
zypper command line. Bumping Leap to 16 would silently orphan all three. `modulefiles` already
solved this for itself with an explicit `name:`; doing the same here means renaming a required
check, which is a branch-protection change and not this repository's to make from code.
@scttfrdmn
scttfrdmn merged commit cac937c into main Oct 1, 2026
42 checks passed
@scttfrdmn
scttfrdmn deleted the fix/install-script-auth-and-required-checks branch October 1, 2026 23:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant