Skip to content

cirrus: save/restore golangci-lint cache for linux #2832

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

kolyshkin
Copy link
Contributor

This shaves off some time from golangci-lint run (unless either golangci-lint or go version changes).

The cache size is pretty small (a few MB).

@kolyshkin kolyshkin force-pushed the golangci-lint-cache branch from 86b938b to 5fc4dad Compare April 16, 2025 19:26
@kolyshkin kolyshkin marked this pull request as ready for review April 16, 2025 19:26
This shaves off some time (40 seconds, ~15%) from a validate job
(unless either golangci-lint or go version changes).

The cache size is pretty small (currently 686Kb compressed).

Signed-off-by: Kir Kolyshkin <[email protected]>
@kolyshkin kolyshkin force-pushed the golangci-lint-cache branch from 5fc4dad to 284222e Compare April 18, 2025 00:33
Copy link
Collaborator

@mtrmac mtrmac left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

This is interesting, and some experiments in #2837 suggest that there might be much more.

… and there are potentially quite a few other things that could be cleaned up and sped up in the tests. That’s clearly not this PR, but it might be something we could ask for help with, from a CI specialist.

golangci-lint_cache:
folder: /root/.cache/golangci-lint
reupload_on_changes: true
fingerprint_script:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking at https://github.com/golangci/golangci-lint-action?tab=readme-ov-file#caching-internals , is this sufficient?

I do think the two existing values are relevant, but invalidating also on go.mod (go.sum??) seems reasonable. Compare also https://github.com/containers/image/pull/2837/files#r2054800484 about regular refreshes.

reupload_on_changes does help against missing updates, but it is not optimal for efficiency, e.g. if we branch and the two branches differ in code but not (yet) in tool versions — the reupload + the same fingerprint would cause the two branches to stop on each others’ caches.

@@ -14,5 +14,5 @@ linters:
exclusions:
presets:
- comments
- common-false-positives
# - common-false-positives
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this intentional?

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.

2 participants