fix: golangci-lint CI drift — pin version, replace reflect.Ptr, exclude ui/node_modules#547
Conversation
…de node_modules Agent-Logs-Url: https://github.com/GoCodeAlone/workflow/sessions/4f786188-50f9-4f99-bda4-43580d3d7b87 Co-authored-by: intel352 <77607+intel352@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Stabilizes Go linting in CI by pinning the golangci-lint version, updating code to avoid a newly-enforced deprecated reflect.Ptr usage, and preventing lint from traversing third-party Go sources under the UI’s node_modules.
Changes:
- Pin
golangci-lintin CI fromlatesttov2.12.0to avoid silent CI drift. - Replace deprecated
reflect.Ptrchecks withreflect.Pointerin Go code. - Exclude
ui/node_modulesfrom golangci-lint’s directory scan to avoid linting vendored third-party Go code.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
.github/workflows/ci.yml |
Pins golangci-lint version in both lint jobs to prevent future CI drift. |
.golangci.yml |
Excludes ui/node_modules from lint scanning to avoid third-party code analysis. |
schema/reflect.go |
Updates pointer-kind check to use reflect.Pointer to satisfy new govet behavior. |
module/scan_provider_test.go |
Updates pointer-kind check to use reflect.Pointer in test helper code. |
Agent-Logs-Url: https://github.com/GoCodeAlone/workflow/sessions/f311fa9b-bd27-4b20-9a65-b30017a095c5 Co-authored-by: intel352 <77607+intel352@users.noreply.github.com>
Fixed in 938eebf. The |
⏱ Benchmark Results✅ No significant performance regressions detected. benchstat comparison (baseline → PR)
|
|
@copilot https://github.com/GoCodeAlone/workflow/actions/runs/25365727568/job/74375958242?pr=547 still failing, make sure you're able to run the linter and it passes without any remaining issues. Also, ui/node_modules, seems this shouldn't be committed? And why would we have golang sources under ui/node_modules? That's supposed to have nodejs sources, not golang sources. |
Agent-Logs-Url: https://github.com/GoCodeAlone/workflow/sessions/ba87a406-9b09-4d47-b8da-078106a8bdc5 Co-authored-by: intel352 <77607+intel352@users.noreply.github.com>
Fixed in 93a7f96. Two separate issues addressed: 1. Remaining lint failures (29 issues): The new CI run revealed that the recently merged main commits (#548, #556, #557) introduced lint issues (gocritic: commentedOutCode/dupBranchBody/rangeValCopy; gosec: file permissions, G710 open redirect; staticcheck: De Morgan's law, error string format, embedded field selectors; unused functions/constants). All 29 are now fixed. 2. |
|
@copilot apply changes based on the comments in this thread Also fix merge conflicts. Also, why were multiple functions deleted in this commit? 93a7f96 |
…eted functions with nolint Agent-Logs-Url: https://github.com/GoCodeAlone/workflow/sessions/001a144d-80dd-4e02-8eb1-62770ed05dde Co-authored-by: intel352 <77607+intel352@users.noreply.github.com>
Fixed in 317d2bd:
Restored functions/constants: Brought back |
|
@copilot resolve the merge conflicts in this pull request |
… stubs) Co-authored-by: intel352 <77607+intel352@users.noreply.github.com>
Resolved in e83cd85. Merged
|
golangci-lint v2.12.0 (pulled via
version: latest) added thegovet inlinecheck, flagging the deprecatedreflect.Ptrconstant in two source files and also scanning vendored Go code inui/node_modules/that we don't own (installed at CI time bynpm ci).Changes
.github/workflows/ci.yml— Pin bothlintandlint-examplesjobs fromversion: latest→version: v2.12.0to prevent future silent driftmodule/scan_provider_test.go,schema/reflect.go— Replace deprecatedreflect.Ptrwithreflect.Pointer(canonical name since Go 1.18).golangci.yml— Addlinters.exclusions.paths: [ui/node_modules]so third-party Go code vendored by npm packages (e.g.esbuild) is excluded from analysis entirely — preventing loading/typechecking, not just suppressing findingscmd/iac-codemod/,cmd/wfctl/,iac/— Fix 29 lint issues introduced by recently merged main commits: gocritic (commentedOutCode, dupBranchBody, rangeValCopy), gosec (file permissions, G710 open redirect), staticcheck (De Morgan's law, error string format, embedded field selectors), and unused declarations. Forward-compatibility stubs (siblingUsesInterfacesImport,bodyCallsSelector,applyCanonicalCallExpr,planCanonicalCallExpr) are retained with//nolint:unuseddirectives.