08dcbb1d3c
ci-arm64-advisory / fast-checks (pull_request) Waiting to run
CI / Python Lint & Test (pull_request) Successful in 6s
Block internal-flavored paths / Block forbidden paths (pull_request) Successful in 17s
CI / Detect changes (pull_request) Successful in 20s
E2E API Smoke Test / detect-changes (pull_request) Successful in 22s
CI / Shellcheck (E2E scripts) (pull_request) Successful in 3s
CI / Canvas (Next.js) (pull_request) Successful in 6s
E2E Chat / detect-changes (pull_request) Successful in 20s
E2E Staging Canvas (Playwright) / detect-changes (pull_request) Successful in 20s
lint-mask-pr-atomicity / lint-mask-pr-atomicity (pull_request) Has started running
Lint pre-flip continue-on-error / Verify continue-on-error flips have run-log proof (pull_request) Has started running
Lint forbidden tenant-env keys / Scan for repo-host token write into tenant workspace surface (pull_request) Successful in 6s
E2E API Smoke Test / E2E API Smoke Test (pull_request) Successful in 4s
Lint curl status-code capture / Scan workflows for curl status-capture pollution (pull_request) Successful in 10s
CI / Canvas Deploy Status (pull_request) Successful in 3s
CI / Platform (Go) (pull_request) Successful in 16s
lint-required-context-exists-in-bp / lint-required-context-exists-in-bp (pull_request) Has started running
Lint forbidden tenant-env keys / Scan workspace_secrets writers for forbidden env keys (pull_request) Successful in 14s
Handlers Postgres Integration / detect-changes (pull_request) Successful in 25s
E2E Chat / E2E Chat (pull_request) Successful in 10s
CI / all-required (pull_request) Successful in 6s
lint-setup-go-cache / lint-setup-go-cache (pull_request) Has started running
E2E Staging Canvas (Playwright) / Canvas tabs E2E (pull_request) Successful in 14s
lint-required-workflows-docker-host-pinned / Lint docker-host pin on docker-touching workflows (pull_request) Successful in 12s
Secret scan / Scan diff for credential-shaped strings (pull_request) Has started running
Lint shellcheck (arm64 pilot) / shellcheck-arm64 (pilot) (pull_request) Successful in 16s
lint-continue-on-error-tracking / lint-continue-on-error-tracking (pull_request) Failing after 1m6s
sop-checklist / all-items-acked (pull_request_target) Has started running
sop-checklist / review-refire (pull_request_target) Has been skipped
Handlers Postgres Integration / Handlers Postgres Integration (pull_request) Successful in 50s
Lint workflow YAML (Gitea-1.22.6-hostile shapes) / Lint workflow YAML for Gitea-1.22.6-hostile shapes (pull_request) Successful in 40s
gate-check-v3 / gate-check (pull_request_target) Successful in 28s
lint-required-no-paths / lint-required-no-paths (pull_request) Successful in 1m1s
Ops Scripts Tests / Ops scripts (unittest) (pull_request) Failing after 1m12s
Local Provision Lifecycle E2E / Local Provision Lifecycle E2E (stub) (pull_request) Successful in 1m57s
Local Provision Lifecycle E2E / Local Provision Lifecycle E2E (real image + MiniMax LLM, advisory) (pull_request) Successful in 2m14s
qa-review / approved (pull_request_target) Approved via pull_request_review trigger
qa-review / approved (pull_request_review) Successful in 15s
security-review / approved (pull_request_target) Approved via pull_request_review trigger
security-review / approved (pull_request_review) Successful in 24s
Static workflow-shape lint forbidding setup-go cache (cache:true OR the default-true cases) — the actions/cache untar-over-GOCACHE-bind-mount corruption from the 2026-06-09/10 rollout. Lands advisory (continue-on-error: true); flips to required after the core#2524 sweep merges + 3 clean days. Also removes the 4 default-true hits the sweep PR does not touch (ci.yml, ci-arm64-advisory, handlers-postgres-integration, weekly-platform-go). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
115 lines
2.9 KiB
Python
115 lines
2.9 KiB
Python
"""Unit tests for lint_setup_go_cache — fixture catch + clean proofs."""
|
|
import importlib.util
|
|
import os
|
|
import textwrap
|
|
|
|
import pytest
|
|
|
|
HERE = os.path.dirname(__file__)
|
|
SCRIPT = os.path.join(HERE, "..", ".gitea", "scripts", "lint_setup_go_cache.py")
|
|
spec = importlib.util.spec_from_file_location("lint_setup_go_cache", SCRIPT)
|
|
mod = importlib.util.module_from_spec(spec)
|
|
spec.loader.exec_module(mod)
|
|
|
|
|
|
def _write(tmp_path, body):
|
|
p = tmp_path / "wf.yml"
|
|
p.write_text(textwrap.dedent(body))
|
|
return str(p)
|
|
|
|
|
|
def test_cache_true_explicit_flagged(tmp_path):
|
|
p = _write(tmp_path, """\
|
|
jobs:
|
|
build:
|
|
runs-on: docker-host
|
|
steps:
|
|
- uses: actions/setup-go@v5
|
|
with:
|
|
go-version: 'stable'
|
|
cache: true
|
|
cache-dependency-path: go.sum
|
|
""")
|
|
viols = mod.scan_file(p)
|
|
assert len(viols) == 1
|
|
assert "cache: true" in viols[0][1]
|
|
|
|
|
|
def test_default_true_with_cachedep_flagged(tmp_path):
|
|
p = _write(tmp_path, """\
|
|
jobs:
|
|
build:
|
|
runs-on: docker-host
|
|
steps:
|
|
- uses: actions/setup-go@v5
|
|
with:
|
|
go-version: 'stable'
|
|
cache-dependency-path: go.sum
|
|
""")
|
|
viols = mod.scan_file(p)
|
|
assert len(viols) == 1
|
|
assert "defaults to true" in viols[0][1]
|
|
|
|
|
|
def test_bare_setup_go_default_true_flagged(tmp_path):
|
|
p = _write(tmp_path, """\
|
|
jobs:
|
|
build:
|
|
runs-on: docker-host
|
|
steps:
|
|
- uses: actions/setup-go@v5
|
|
with:
|
|
go-version: 'stable'
|
|
- run: go build ./...
|
|
""")
|
|
viols = mod.scan_file(p)
|
|
assert len(viols) == 1
|
|
assert "defaults to true" in viols[0][1]
|
|
|
|
|
|
def test_cache_false_clean(tmp_path):
|
|
p = _write(tmp_path, """\
|
|
jobs:
|
|
build:
|
|
runs-on: docker-host
|
|
steps:
|
|
- uses: actions/setup-go@v5
|
|
with:
|
|
go-version: 'stable'
|
|
cache: false
|
|
cache-dependency-path: go.sum
|
|
""")
|
|
assert mod.scan_file(p) == []
|
|
|
|
|
|
def test_no_setup_go_clean(tmp_path):
|
|
p = _write(tmp_path, """\
|
|
jobs:
|
|
build:
|
|
runs-on: docker-host
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- run: echo hi
|
|
""")
|
|
assert mod.scan_file(p) == []
|
|
|
|
|
|
def test_multiple_steps_only_bad_flagged(tmp_path):
|
|
p = _write(tmp_path, """\
|
|
jobs:
|
|
build:
|
|
runs-on: docker-host
|
|
steps:
|
|
- uses: actions/setup-go@v5
|
|
with:
|
|
go-version: 'stable'
|
|
cache: false
|
|
- uses: actions/setup-go@v6
|
|
with:
|
|
go-version: '1.25'
|
|
cache: true
|
|
""")
|
|
viols = mod.scan_file(p)
|
|
assert len(viols) == 1
|
|
assert "cache: true" in viols[0][1]
|