Skip to content
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

Disable the golangci-lint-action's own Go mod & Go build caches #181

Merged
merged 1 commit into from
Feb 28, 2024

Conversation

ulucinar
Copy link
Contributor

Description of your changes

We already manage Go mod & build caches for the CI jobs of the official provider repositories to speed up the build times. The golangci-lint action that we use to run the linter can itself maintain the Go build and mod caches, however, with a different cache key than we use, with the syntax explained here.

This PR proposes to disable that action's own Go build and mod caches and use the caches we explicitly maintain, the caches with the keys Linux-{build, pkg}-lint-. This should also prevent the occasional tar errors we observe for these cache files.

An alternative would just be not populating the build and mod caches explicitly from the Linux-{build, pkg}-lint- keys and letting the action manage its own cache. I did not choose this way because it's less efficient than building a single cache with (almost) the same contents (please see the note below).

Note: The action caches the whole pkg folder instead of the pkg/mod folder as the caches we explicitly maintain do. The action's cache also has an expiration date, i.e., even if the contents of the go.mod file does not change, the cache will expire after a certain period of time (one week). From a practical point of view, the explicitly maintained cache should also be fine though.

I have:

  • Run make reviewable test to ensure this PR is ready for review.

How has this code been tested

Manually tested in the main branch of a fork repo of upbound/provider-aws and upbound/provider-azuread.

- We already manage a Go mod & build cache. Use this cache instead.
  This should prevent the occasional tar errors we observe for
  these cache files.

Signed-off-by: Alper Rifat Ulucinar <ulucinar@users.noreply.github.com>
Copy link
Member

@sergenyalcin sergenyalcin left a comment

Choose a reason for hiding this comment

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

Thanks @ulucinar LGTM!

@ulucinar
Copy link
Contributor Author

Let's observe how the unified cache approach works. If we spot any issues then we can remove the explicitly maintained cache for the linter.

@ulucinar ulucinar merged commit b7315e7 into upbound:main Feb 28, 2024
6 checks passed
@ulucinar ulucinar deleted the linter-cache branch February 28, 2024 08:50
This pull request was closed.
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