Skip to content

ci: stop install-script from throwing away the output it asserts on - #433

Merged
scttfrdmn merged 3 commits into
mainfrom
fix/install-script-log-swallowed
Aug 14, 2026
Merged

scttfrdmn merged 3 commits into
mainfrom
fix/install-script-log-swallowed

Conversation

@scttfrdmn

Copy link
Copy Markdown
Owner

install-script (rockylinux:9) failed on #431, whose entire diff was one toolchain go1.26.6 line. The same job passed on main and on #430 within minutes of it, and the rerun was green — so it was a flake. But the flake's cause cannot be recovered, because the step discarded the evidence.

The bug

out=$(docker run ... bash -c "... ; /opt/ofs/bin/objectfs --version")
echo "$out"

The container's last command exits 127 when the install did not produce a binary. Under set -euo pipefail that kills the step at the assignment, so echo "$out" never runs. The entire log for the failure was:

bash: line 1: /opt/ofs/bin/objectfs: No such file or directory
##[error]Process completed with exit code 127.

Not one of the three ::error:: messages appeared — including the carefully worded ones about a bypassed checksum and about an installer that "succeeds and leaves a binary that cannot run has produced the same outcome as one that failed, minus the explanation." Those messages were unreachable on precisely the runs they were written for.

The refusal branch immediately above already has || true for this exact reason. The success branch was missing it.

Fix

Add || true to the substitution. The three grep assertions then decide the outcome from the captured text, which is what the step was written to do — and the captured text, including the failing --version line, lands in the log either way.

Verified by simulating both forms:

old form: exit=127, printed nothing before dying
new form: exit=0 at the assignment, printed "installing / EXIT=0 / No such file or directory",
          then reached the assertions

The idempotency step below has the same shape and does not need the same fix: its substitution ends in [ "$a" = "$b" ] && echo SAME || echo DIFFERENT, which exits 0 regardless. Noted in a comment so the next reader does not have to re-derive that.

No attempt to paper over the flake itself — both downloaders in scripts/install.sh already pass --retry 3. The next occurrence will now say what happened.

The success branch captured the install output in a command substitution without
`|| true`, so under `set -e` a failing install killed the step at the assignment
and `echo "$out"` never ran. The log then held only bash's

  /opt/ofs/bin/objectfs: No such file or directory
  Process completed with exit code 127

and none of the three ::error:: messages below it — messages written specifically
for the runs where they would now never be printed. The refusal branch above already
has `|| true` for exactly this reason.

Found while diagnosing a transient rockylinux:9 failure on #431 whose only diff was
a toolchain line. The same job passed on main and on #430 at the same time, and the
rerun was green, so the failure was a flake — but the flake's cause is unrecoverable
because the step discarded the evidence. A job whose assertions can only be read
when they pass reports the same non-answer this job exists to reject.

The idempotency step below has the same shape and does not need the same fix: its
substitution ends in `[ ... ] && echo SAME || echo DIFFERENT`, which exits 0
regardless.
@scttfrdmn scttfrdmn added type: ci-cd Continuous integration or deployment improvements priority: medium Important but not urgent area: ci-cd CI workflows, gates, and release automation labels Aug 14, 2026
…o host is absent

install.sh's header said "Both objectfs.io and packages.objectfs.io resolve to
registrar parking IPs", which stopped being true when #429 put the landing page and
the docs on Pages. The conclusion is unchanged and the reason it is unchanged is the
part worth writing down: Porkbun answers a wildcard, so packages.objectfs.io resolves
exactly like every other name under the domain and completes no TLS handshake.
Resolution was never the evidence — which is the same argument the landing-page
domain test exists to make.
@scttfrdmn
scttfrdmn merged commit 901a810 into main Aug 14, 2026
42 checks passed
@scttfrdmn
scttfrdmn deleted the fix/install-script-log-swallowed branch August 14, 2026 03:57
scttfrdmn added a commit that referenced this pull request Aug 14, 2026
…ined (#415) (#435)

A gosec finding did not block a merge, and every part of the mechanism looked
like it did. `Security Scan` runs `gosec -no-fail`, so the job passed on any
number of findings. The check that went red was `gosec` — the code-scanning
check derived from the SARIF upload, a different check with a different name —
and that one reports on pull requests and not on `push: main`, measured across
four commits. So it could not be added to the required contexts either: a
required check that does not always report blocks every PR forever (#413).

The result was that #414 added a `uint64 -> int64` conversion, gosec reported
"1 new alert including 1 error", and the PR stayed mergeable. It was caught by
someone reading the checks by hand.

`-no-fail` stays. The upload needs the complete report, including the three
`sdks/c` G115 findings that the "Fix Gosec SARIF format" step back-fills a path
onto — and which golangci-lint discards for the same cgo reason, so they reach
no other tool. Dropping the flag would end the job before either step ran,
which reads as a tightening and is a loosening.

The gate is instead a final step running .github/scripts/gosec-gate.sh, which
diffs the report against .github/gosec-baseline.txt. `Security Scan` is a job
name, so it reports on every trigger the workflow has, which is what lets it be
required. Last in the job and `if: always()`, so a new conversion does not also
cost the run its govulncheck result, Trivy upload and license check.

The baseline is the twelve pre-existing findings across eight files, keyed by
(rule, file, count). Not by line number, which moves whenever anything above it
moves, so a line-keyed baseline goes stale on unrelated edits and reports on the
wrong thing. A severity threshold was not available: all twelve are G115 at
`error` level, identical to what a new finding reports, so there is nothing to
threshold on. The ratchet is exact in both directions — fixing one of these
fails too, until its line goes with it, because a slot kept after its finding
was fixed is permanent headroom for the next conversion in that file.

Two things are gated in Go, in internal/config/gosec_gate_test.go, because both
failure modes are silent: every path in the baseline must exist (a renamed file
leaves a standing allowance pointing at nothing, and the script would report it
as a fixed finding, which is true said misleadingly), and the workflow must
still invoke the script, still pass `-no-fail`, and the script must still be
executable. All six branches were mutation-verified: each fails with its own
message and the suite returns to green.

The script's own failure path was verified by running it, not by reading it —
and that caught a bug in it. `diff` exits 1 on a difference, `pipefail` promotes
that to the pipeline, and `set -e` ended the script at `diff | tail`, so the
first mutant printed the diff and then none of the three paragraphs explaining
what to do about it. Which is the exact failure #433 had just fixed elsewhere,
sitting directly below a comment describing it.

Refs #415
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: ci-cd CI workflows, gates, and release automation priority: medium Important but not urgent type: ci-cd Continuous integration or deployment improvements

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant