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

CI: upgrade to setup-go v4 and disable cache with golangci #1005

Merged
merged 1 commit into from
Jul 27, 2023

Conversation

Shwetha-Acharya
Copy link
Contributor

@Shwetha-Acharya Shwetha-Acharya commented Jul 26, 2023

Below errors were seen with setup-go@v4 in golangci Lint: Error: /usr/bin/tar: ../../../go/pkg/mod/sigs.k8s.io/[email protected]/yaml_ test.go: Cannot open: File exists
/usr/bin/tar: ../../../go/pkg/mod/sigs.k8s.io/[email protected]/LICENSE: Cannot open: File exists

Disabling Cache with golangci solves the problem and makes sure that we are in a recent setup-go as well.

Cache can be enabled once the resultant issue is fixed in golangci lint action repo.
Issue that is to be tracked:
golangci/golangci-lint-action#135

Updates: #1000

Copy link
Member

@nirs nirs left a comment

Choose a reason for hiding this comment

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

It works, but I would check if this can be solved in golanci, since the issue is the cache used in golanci, not setup-go.

In any case, when we change the defaults we want to add a comment explaining why the change is needed.

with:
go-version: ${{ env.GO_VERSION }}
cache: false
Copy link
Member

Choose a reason for hiding this comment

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

We need a comment here why we skip the cache, or maybe we should skip golangci cache instead, since the issue is in golanci?

Copy link
Contributor Author

@Shwetha-Acharya Shwetha-Acharya Jul 27, 2023

Choose a reason for hiding this comment

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

I agree, but I did not find any workarounds with golangci.
I will raise a new issue in the golangci to highlight this scenario.
Also the golangci issue135 has one partial fix which went in 2.4.1 and we are already in golangci-lint-action@v3.

I had tried by updating the' with version' in golangci/golangci-lint-action:
uses: golangci/golangci-lint-action@v3
with:
version: v1.49.0
But did not find much luck with it.

I am not sure what version v1.49.0 is actually representing.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@@ -58,6 +57,7 @@ jobs:
git --no-pager diff
git diff-index --quiet HEAD


Copy link
Member

Choose a reason for hiding this comment

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

The whitespace changes are unrelated and should be in another commit.

Copy link
Member

@ShyamsundarR ShyamsundarR left a comment

Choose a reason for hiding this comment

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

The white space changes do not look consistent to me, not sure if the intent is to separate sections using 2 lines. Can you clarify @Shwetha-Acharya ?

@Shwetha-Acharya
Copy link
Contributor Author

It works, but I would check if this can be solved in golanci, since the issue is the cache used in golanci, not setup-go.

In any case, when we change the defaults we want to add a comment explaining why the change is needed.

As of now we are disabling cache on setup-go only when we are using golangci.
I agree it would be better if there was a fix from golangci.

The white space changes do not look consistent to me, not sure if the intent is to separate sections using 2 lines. Can you clarify @Shwetha-Acharya ?

I was experimenting with many changes to resolve this issue and did not notice that I had added extra spaces.

Below errors were seen with setup-go@v4 in golangci Lint:
Error: /usr/bin/tar: ../../../go/pkg/mod/sigs.k8s.io/[email protected]/yaml_
test.go: Cannot open: File exists
/usr/bin/tar: ../../../go/pkg/mod/sigs.k8s.io/[email protected]/LICENSE:
Cannot open: File exists

Disabling Cache with golangci solves the problem and makes
sure that we are in a reecent setup-go as well.

Cache can be enabled once the resultant issue is fixed in
golangci lint action repo.
Issue that is to be tracked:
golangci/golangci-lint-action#135

Updates: RamenDR#1000
Signed-off-by: Shwetha K Acharya <[email protected]>
@nirs nirs merged commit 9e91714 into RamenDR:main Jul 27, 2023
@nirs nirs linked an issue Jul 31, 2023 that may be closed by this pull request
2 tasks
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.

CI: upgrading to setup-go v4 is leads to Golangci Lint errors
3 participants