Skip to content

fix: unique version per custom build #5896

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 2 commits into
base: main
Choose a base branch
from

Conversation

ldez
Copy link
Member

@ldez ldez commented Jun 25, 2025

The version of the binary is used as a salt for the analysis cache.

This PR creates a unique version per custom build to invalidate the cache when modifying a custom linter without modifying the golangci-lint configuration.

The new version format is: 2.1.6-custom-gcl-yKhvEoEAOv2Z7u0U167sQAqiN0DW3mb0s5xCmd3Y.

I think behind the AI slop PR #5894 there is a real issue.

@ldez ldez added this to the v2-unreleased milestone Jun 25, 2025
@ldez ldez added bug Something isn't working linter: custom About custom/private linters labels Jun 25, 2025
@ldez ldez requested a review from bombsimon June 25, 2025 10:14
@ldez ldez force-pushed the fix/custom-randomize-version branch from 113b348 to e748a4e Compare June 25, 2025 10:20
@ldez ldez force-pushed the fix/custom-randomize-version branch from e748a4e to e0354ac Compare June 25, 2025 10:35
@ldez ldez marked this pull request as draft June 25, 2025 10:40
@ldez
Copy link
Member Author

ldez commented Jun 25, 2025

In fact, this is only a "problem" when the command is run with a local path because the go.mod is not modified.

But my modification based on time will always invalidate the cache when using CI, and this should not happen.

So I need to change the approach.

@ldez
Copy link
Member Author

ldez commented Jun 25, 2025

I found a solution by using the sumdb hash functions used by Go to compute the hash of local modules.

@ldez ldez marked this pull request as ready for review June 25, 2025 13:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working linter: custom About custom/private linters
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant