Skip to content

resolve golangci-lint cache errors and improve lint output#220

Closed
vanshika622 wants to merge 3 commits intourunc-dev:mainfrom
vanshika622:fix_lint-workflow
Closed

resolve golangci-lint cache errors and improve lint output#220
vanshika622 wants to merge 3 commits intourunc-dev:mainfrom
vanshika622:fix_lint-workflow

Conversation

@vanshika622
Copy link

  • Replaced built-in golangci-lint caching with manual actions/cache for Go modules and build cache
  • Fixed "Cache service responded with 400" and save failures in GitHub Actions
  • Updated lint output format to 'github-actions' for better visibility of file-level issues

@netlify
Copy link

netlify bot commented Jul 17, 2025

Deploy Preview for urunc ready!

Name Link
🔨 Latest commit ea8f996
🔍 Latest deploy log https://app.netlify.com/projects/urunc/deploys/68936d4df8cb630008ddd6e7
😎 Deploy Preview https://deploy-preview-220--urunc.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@cmainas
Copy link
Contributor

cmainas commented Jul 18, 2025

Hello @vanshika622 ,

thank you for the contribution. Changes in the CI from a forked repository require further testing. Please bear with us and we will get back to this PR as soon as possible.

@cmainas cmainas linked an issue Jul 18, 2025 that may be closed by this pull request
@ananos
Copy link
Contributor

ananos commented Jul 21, 2025

Hi @vanshika622, please rebase your branch over urunc main and we can trigger the CI!

Signed-off-by: vanshika622 <vanshikajain622@gmail.com>
@vanshika622
Copy link
Author

Hi @vanshika622, please rebase your branch over urunc main and we can trigger the CI!

Done @ananos. I have rebased my branch

@ananos
Copy link
Contributor

ananos commented Jul 22, 2025

thanks @vanshika622!

I see an issue with the cache key name. See below:

image

I think there's a typo: $-{{ hashfiles<> }} vs ${{ hashfiles<> }}. Also in the restore-key you don't specify this variable. Is this intentional? How would this work?

Also, can you please change the name of the cache action to something more meaningful (e.g. Cache or something different than the next step ;-)).

Finally, can you please add a short description of what the patch does in the commit message? Just a few words to describe the patch. I'm not entirely sure what args: --out-format=github-actions does.

thanks!

Signed-off-by: vanshika622 <vanshikajain622@gmail.com>
@vanshika622
Copy link
Author

I think there's a typo: $-{{ hashfiles<> }} vs ${{ hashfiles<> }}. Also in the restore-key you don't specify this variable. Is this intentional? How would this work?

restore-keys: | ${{ runner.os }}-go-

I have used this as It acts as a fallback to restore any cache with a matching OS prefix, even if the exact hash key is not available. I have renamed the cache step to Cache Go Modules to make its purpose clearer. and The --out-format=github-actions flag makes linter issues appear inline in the PR, so it’s easier to spot and fix problems directly in the code view.

@gntouts
Copy link
Contributor

gntouts commented Jul 29, 2025

Hi @vanshika622 , thanks so much for your contribution and for all the changes you made — really appreciate the effort!

I was looking through the official documentation for golangci-lint, but I couldn’t find any references to the --out-format=github-actions flag. The only mention I came across was a deprecation note in the v1.59.0 changelog:
https://golangci-lint.run/product/changelog/#v1590

Would you mind sharing a link to any official documentation or usage examples of this flag? That would help clarify things.

Thanks again!

- Removed deprecated `--out-format=github-actions` flag based on v1.59.0 changelog
- Added manual Go module and build caching using actions/cache to fix "Cache service responded with 400" errors
- Set `--timeout=5m` to prevent lint step from timing out on large codebases
- Enabled all linters and disabled noisy `lll` for better error visibility
@vanshika622
Copy link
Author

Hi @vanshika622 , thanks so much for your contribution and for all the changes you made — really appreciate the effort!

I was looking through the official documentation for golangci-lint, but I couldn’t find any references to the --out-format=github-actions flag. The only mention I came across was a deprecation note in the v1.59.0 changelog: https://golangci-lint.run/product/changelog/#v1590

Would you mind sharing a link to any official documentation or usage examples of this flag? That would help clarify things.

Thanks again!

Hi @gntouts thank you for pointing this out — really appreciate the feedback!

You’re absolutely right: the --out-format=github-actions flag was deprecated in v1.59.0, and I couldn’t find any recent official documentation supporting its usage either.

Based on your input, I’ve removed the deprecated flag from the workflow in the latest commit (ea8f996) and instead improved the output by:
• Enabling all linters (--enable-all)
• Disabling the noisy lll linter
• Adding a --timeout=5m to ensure stability in larger runs

Thanks again for the review — please let me know if you’d suggest any further improvements!

@gntouts
Copy link
Contributor

gntouts commented Sep 5, 2025

Hello @vanshika622 , thanks again for your time and effort! I only have one last comment. I think enabling all linters apart from the noisy lll linter is not required in the workflow file, since we already use the .golangci.yml file in the root directory of the project to configure golangci-lint.

@sonarqubecloud
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
1 Security Hotspot

See analysis details on SonarQube Cloud

@github-actions
Copy link

This PR is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 15 days.

@github-actions github-actions bot added the Stale label Nov 18, 2025
@github-actions
Copy link

github-actions bot commented Dec 4, 2025

This PR was closed because it has been stalled for 75 days with no activity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix lint workflow warnings and improve error messages

4 participants