Skip to content

Chore upgrade golangci lint#53

Merged
creativeprojects merged 4 commits intomainfrom
chore--upgrade-golangci-lint
Mar 28, 2026
Merged

Chore upgrade golangci lint#53
creativeprojects merged 4 commits intomainfrom
chore--upgrade-golangci-lint

Conversation

@creativeprojects
Copy link
Copy Markdown
Owner

No description provided.

- Upgrade Go version in CI workflow to 1.25 and 1.26
- Update actions/checkout and actions/setup-go to v6
- Upgrade codecov-action to v6
- Refactor various functions to use context for better cancellation support
- Improve variable naming for clarity
- Add verification step in Makefile for Go installation
- Update linters and their settings in .golangci.yml
Copilot AI review requested due to automatic review settings March 28, 2026 18:26
@codecov
Copy link
Copy Markdown

codecov bot commented Mar 28, 2026

Codecov Report

❌ Patch coverage is 64.28571% with 10 lines in your changes missing coverage. Please review.
✅ Project coverage is 76.95%. Comparing base (865cbd9) to head (97a5645).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
github_source.go 0.00% 5 Missing ⚠️
gitlab_source.go 71.43% 2 Missing ⚠️
http_source.go 60.00% 1 Missing and 1 partial ⚠️
gitlab_release.go 0.00% 1 Missing ⚠️

❌ Your patch status has failed because the patch coverage (64.29%) is below the target coverage (70.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files
@@           Coverage Diff           @@
##             main      #53   +/-   ##
=======================================
  Coverage   76.95%   76.95%           
=======================================
  Files          28       28           
  Lines        1167     1167           
=======================================
  Hits          898      898           
  Misses        218      218           
  Partials       51       51           
Flag Coverage Δ
unittests 76.95% <64.29%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Updates the project to work with a newer golangci-lint configuration/tooling, including lint-driven Go code cleanups and CI/Makefile adjustments.

Changes:

  • Refactors various identifiers and APIs to satisfy updated lint rules (e.g., any, assetID, downloadURL, request context propagation).
  • Updates golangci-lint configuration to v2-style YAML and adds/adjusts targeted //nolint suppressions.
  • Updates local tooling (Makefile) and CI workflow to install/run golangci-lint v2.

Reviewed changes

Copilot reviewed 22 out of 22 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
update.go Renames assetIdassetID for Go initialism conventions.
repository_slug.go Updates Get() return type to any.
repository_id.go Updates Get() return type to any.
repository.go Updates interface Get() return type to any.
package.go Uses http.NewRequestWithContext for proper cancellation propagation.
mockdata_test.go Minor formatting + identifier initialism cleanup in tests.
log.go Updates logger variadics from interface{} to any.
internal/resolve_path_windows.go Import formatting + adds gosec suppression on Windows syscall.
http_source_test.go Renames test helper Http...HTTP... (initialism).
http_source.go downloadURL rename + adds //nolint:staticcheck suppressions on Http* API.
http_release.go Adds //nolint:staticcheck suppressions on Http* API.
gitlab_source.go downloadURL rename + related log/message update.
gitlab_release.go Removes redundant cast when setting asset ID.
github_source.go downloadURL rename in proxy download path.
github_release.go Receiver rename (ar) for consistency.
detect_test.go Removes per-iteration loop var rebinding in parallel subtests.
decompress.go Uses embedded gzip header field (r.Name) instead of r.Header.Name.
cmd/serve-repo/logger.go Adds gosec suppression on a request logging line.
arm_test.go Uses exec.CommandContext (adds context import).
Makefile Adds tool installation targets and switches to a golangci-lint-v2 binary.
.golangci.yml Migrates config to golangci-lint v2 format + updates exclusions/settings structure.
.github/workflows/build.yml Updates Go matrix + action versions and adds golangci-lint GitHub Action step.
Comments suppressed due to low confidence (2)

package.go:58

  • http.NewRequestWithContext already attaches ctx to the request, so the subsequent req = req.WithContext(ctx) is redundant. Consider removing the extra WithContext call to avoid confusion and keep the request construction minimal.
	req, err := http.NewRequestWithContext(ctx, http.MethodGet, url, nil)
	if err != nil {
		return nil, err
	}
	req = req.WithContext(ctx)

http_release.go:32

  • Same concern as in http_source.go: //nolint:staticcheck on these exported Http* types suppresses all staticcheck checks for the declaration. If this is only to avoid ST1003 (HTTP initialism), it’s safer to exclude that specific check in the linter config (or add a justification) rather than blanket-disabling staticcheck here.
type HttpAsset struct { //nolint:staticcheck
	ID   int64  `yaml:"id"`
	Name string `yaml:"name"`
	Size int    `yaml:"size"`
	URL  string `yaml:"url"`
}

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 21 out of 21 changed files in this pull request and generated 1 comment.

Comments suppressed due to low confidence (1)

package.go:58

  • http.NewRequestWithContext already attaches ctx to the request, so the subsequent req = req.WithContext(ctx) is redundant. Dropping the extra WithContext call will simplify the code and avoid implying that the first call might not have set the context.
	req, err := http.NewRequestWithContext(ctx, http.MethodGet, url, nil)
	if err != nil {
		return nil, err
	}
	req = req.WithContext(ctx)

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@creativeprojects creativeprojects merged commit eb6d9af into main Mar 28, 2026
8 of 9 checks passed
@creativeprojects creativeprojects deleted the chore--upgrade-golangci-lint branch March 28, 2026 21:42
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