fix: resolve goconst and errorlint warnings across OCI, coverage, validators#1916
fix: resolve goconst and errorlint warnings across OCI, coverage, validators#1916andrewwhitecdw wants to merge 4 commits into
Conversation
Replaces a direct err == io.EOF comparison with stderrors.Is(err, io.EOF) so the test follows the project errorlint rules and handles wrapped EOF correctly. Signed-off-by: Andrew White <andrewh@cdw.com>
Introduces emDash in model.go and replaces repeated literal em dash strings in build.go and render.go to satisfy the goconst linter. Signed-off-by: Andrew White <andrewh@cdw.com>
Adds allocationModeExactCount and uses it for both v1beta1 and newer ResourceClaim request shapes, resolving a goconst warning. Signed-off-by: Andrew White <andrewh@cdw.com>
Adds skipMsgNCCLFewNodes and uses it in the constraint and its tests to eliminate the goconst duplication. Signed-off-by: Andrew White <andrewh@cdw.com>
|
Welcome to AICR, @andrewwhitecdw! Thanks for your first pull request. Before review, please ensure:
A maintainer will review this soon. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Enterprise Run ID: 📒 Files selected for processing (8)
📝 WalkthroughWalkthroughThe changes centralize repeated em-dash, allocation-mode, and NCCL skip-message strings into package constants, updating their production and test usages. OCI tar iteration now detects EOF with wrapped-error matching instead of direct error equality. No exported entities are changed. Estimated code review effort: 2 (Simple) | ~10 minutes Suggested reviewers: 🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
mohityadav8
left a comment
There was a problem hiding this comment.
Thanks for the PR! I fetched this locally to test the changes. I ran golangci-lint against pkg/oci/, tools/coverage/, and the validator packages. I can confirm the previous goconst and errorlint warnings are completely resolved.
LGTM
Summary
Fixes four small lint/test issues surfaced by golangci-lint and static analysis: one errorlint violation in OCI push tests and three goconst duplications in coverage tooling and validator packages.
Motivation / Context
N/A — opportunistic cleanup from a lint/test sweep.
Type of Change
Component(s) Affected
cmd/aicr,pkg/cli)cmd/aicrd,pkg/server)pkg/recipe)pkg/bundler,pkg/component/*)pkg/collector,pkg/snapshotter)pkg/validator)pkg/errors,pkg/k8s)docs/,examples/)Implementation Notes
err == io.EOFwithstderrors.Is(err, io.EOF)inpkg/oci/push_test.go.emDashintools/coverage.allocationModeExactCountinvalidators/conformance/secure_access_check.go.skipMsgNCCLFewNodesinvalidators/performance/nccl_all_reduce_bw_constraint.goand updated tests.Testing
All targeted tests pass and golangci-lint reports 0 issues. Full
make lintreached the Go lint step successfully; the overall target stopped at the YAML lint step becauseyamllintis not installed in this environment.Risk Assessment
Rollout notes: N/A
Checklist
make testwith-race)make lint)git commit -S) — GPG signing info