Skip to content

fix(go-ci): stage per-function coverage in RUNNER_TEMP, not shared /tmp#33

Open
monsieurleberre wants to merge 1 commit into
devfrom
fix/12-go-ci-sudo-coverage
Open

fix(go-ci): stage per-function coverage in RUNNER_TEMP, not shared /tmp#33
monsieurleberre wants to merge 1 commit into
devfrom
fix/12-go-ci-sudo-coverage

Conversation

@monsieurleberre

Copy link
Copy Markdown
Contributor

Closes #12.

Context

Issue #12 reported go-ci.yaml's coverage step failing on the self-hosted Hetzner runner because it called sudo. That sudo chown was already removed in PR #29 (commit 115dc93, released v2.3.2) — the step now takes ownership of the root-owned coverage report via a same-directory cp + mv -f copy that needs only workspace permissions. The issue stayed open only because #29 never linked it. Independently confirmed: no sudo invocation remains anywhere in go-ci.yaml on dev.

This change

Hardens the one residual self-hosted hazard in the same step. Per-function coverage was staged at the fixed path /tmp/cov-func.txt. On shared Hetzner hosts /tmp outlives the job and is shared across runner instances, so a leftover file owned by another runner user fails the step with permission-denied (same failure class as the v2.3.3 dotnet-coverage fix), and concurrent Go jobs on one host can cross-contaminate the coverage column. It now uses "$RUNNER_TEMP/cov-func.txt" — per-runner-instance, emptied at the start and end of every job. Behavior on GitHub-hosted runners is unchanged.

Verification

  • actionlint clean; shellcheck -s bash clean on the extracted step script.
  • All three touchpoints (truncate, append, read) updated consistently; no dangling /tmp/cov-func.txt reference remains.
  • Pre-open review: SHIP.

Note for closing

v1 (frozen at d072766) still contains the original sudo chown; @v1 consumers must migrate to @v2.

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.

go-ci.yaml: build-and-test fails on self-hosted Hetzner runner due to sudo in coverage step

1 participant