Skip to content

ci: make golangci-lint cache configurable - #41

Merged
trakhimenok merged 2 commits into
mainfrom
ci/restore-golangci-lint-cache
Jul 22, 2026
Merged

ci: make golangci-lint cache configurable#41
trakhimenok merged 2 commits into
mainfrom
ci/restore-golangci-lint-cache

Conversation

@trakhimenok

@trakhimenok trakhimenok commented Jul 22, 2026

Copy link
Copy Markdown
Member

What changed

  • adds a golangci_lint_cache reusable-workflow input, enabled by default
  • lets callers disable analysis caching when transfer costs exceed lint time
  • exposes the cache invalidation interval, defaulting to the action's seven-day policy
  • documents the reusable workflow policy separately from the composite action

Why

Sneat-Go's old lint cache had accumulated analysis for extensions subsequently removed from the repository. A stale-seeded cache made CI slower, but a cache populated exclusively from the decoupled repository is small and materially faster.

Process: faster CI feedback shortens delivery time for fixes to the top-priority SneatBot.

Sneat-Go timing evidence

Scenario Lint job Lint-cache details
Cache disabled 2m34s no restore/save
Stale-prefix first run 6m25s 122 MB restore; 154s save
Stale exact-key warm run 2m49s 106 MB; 50s restore
Truly clean population run 2m36s no restore; 1.7s save
Clean exact-key warm run 1 1m32s 1.7 MB; 2.0s restore; 11.2s lint
Clean exact-key warm run 2 1m43s 1.7 MB; 1.6s restore; 9.9s lint

The two clean warm runs are 51–62 seconds faster than cache-off. The clean archive is about 98.5% smaller than the stale archive.

Validation

  • actionlint .github/workflows/workflow.yml .github/workflows/ci.yml .github/workflows/release.yml
  • go test ./...
  • go vet ./...
  • git diff --check
  • shared workflow PR checks, composite-action smoke test, and release-calculator regression checks passed
  • Sneat-Go clean population run plus two exact-SHA warm reruns passed

Rollout

After release, delete only Sneat-Go's stale golangci-lint.cache entries, update the Sneat-Go probe to the immutable release commit, and require its normal PR/main/deployment gates.

Process: faster CI feedback shortens delivery time for fixes to the top-priority SneatBot.
@trakhimenok

Copy link
Copy Markdown
Member Author

Controlled Sneat-Go timing result: do not change the default.

The linked Sneat-Go probe #839 compared the current cache-off workflow with a first cache-enabled run and an exact-SHA warm rerun.

  • cache-off Lint job: 2m34s
  • first cache-enabled Lint job: 6m25s
  • exact-key warm Lint job: 2m49s
  • warm cache restore: 106 MB in 50.3s
  • warm actual lint analysis: 35.9s
  • first-run cache save: 154.0s

Although the warm analysis itself was faster, cache transfer erased the gain. The exact warm run was still 15s slower overall, while a changed key imposed several minutes of overhead.

Closing without merge; v1.10.4 remains the active released policy with skip-cache: true.

Process: accurate CI cache measurements shorten feedback time for fixes to the top-priority SneatBot.
@trakhimenok trakhimenok reopened this Jul 22, 2026
@trakhimenok

Copy link
Copy Markdown
Member Author

Reopening for a stricter follow-up requested after reviewing the first probe.

The first experiment restored a prior seven-day cache through the action's prefix fallback, so it did not answer whether a cache built only from the decoupled repository is worthwhile. This branch now exposes golangci_lint_cache_invalidation_interval; the Sneat-Go probe sets it to 1, a namespace not present in the repository's current cache inventory.

The follow-up will measure:

  1. a guaranteed no-restore population run;
  2. an exact-SHA rerun of the newly populated clean cache.

No existing cache is deleted.

@trakhimenok
trakhimenok marked this pull request as ready for review July 22, 2026 10:14
@trakhimenok
trakhimenok merged commit 6689b03 into main Jul 22, 2026
5 checks passed
@trakhimenok
trakhimenok deleted the ci/restore-golangci-lint-cache branch July 22, 2026 10:14
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