-
Notifications
You must be signed in to change notification settings - Fork 1
fix: devenvs #340
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
fix: devenvs #340
Conversation
WalkthroughThree targeted updates: upgrading the controller-gen tool version from v0.14.0 to v0.17.0 in the build configuration, and refactoring error message construction in two error handling files to use explicit format strings via Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes
Poem
Pre-merge checks and finishing touches❌ Failed checks (2 warnings, 1 inconclusive)
✨ Finishing touches
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (2)
internal/core/errors.go (1)
40-40: Defensive format string handling applied.The explicit format string
"%s"prevents accidental interpretation of format specifiers ifmsgcontains%characters. This is good defensive programming, though the risk is minimal sincemsgis typically a controlled string literal.For consistency, consider auditing other direct
WithMessage(string)calls in the codebase:#!/bin/bash # Find other potential WithMessage calls that might benefit from explicit formatting rg -nP '\.WithMessage\([^"]*\)' --type=go -g '!*_test.go'internal/core/controllers.go (1)
50-50: Optimize string formatting to avoid unnecessary concatenation.The explicit format string is good for consistency, but the string concatenation before formatting creates an unnecessary allocation.
Apply this diff to use format arguments directly:
- setStatus(NewPendingError().WithMessage("%s", "pending condition: "+str)) + setStatus(NewPendingError().WithMessage("pending condition: %s", str))This is more efficient and idiomatic as it performs concatenation directly through
fmt.Sprintfrather than creating an intermediate string.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Disabled knowledge base sources:
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
⛔ Files ignored due to path filters (4)
go.modis excluded by!**/*.modgo.sumis excluded by!**/*.sum,!**/*.sumtools/kubectl-stacks/go.modis excluded by!**/*.modtools/kubectl-stacks/go.sumis excluded by!**/*.sum,!**/*.sum
📒 Files selected for processing (3)
Earthfile(1 hunks)internal/core/controllers.go(1 hunks)internal/core/errors.go(1 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
internal/core/controllers.go (1)
internal/core/errors.go (1)
NewPendingError(35-37)
🔇 Additional comments (1)
Earthfile (1)
18-18: Verify generated code after controller-gen upgrade to v0.17.0.The upgrade spans three minor versions with documented changes affecting code generation:
- v0.16.0 strips comments from CRD descriptions (marked as breaking)
- v0.17.0 adds support for encoding.TextMarshaler (marked as warning)
- Multiple fixes for Go 1.23 type alias handling in deepcopy and CRD generation
Regenerate CRDs (line 117) and deepcopy code (line 27) using the new version and verify the outputs for differences, particularly in generated manifests and type alias handling.
| } | ||
|
|
||
| setStatus(NewPendingError().WithMessage("pending condition: " + str)) | ||
| setStatus(NewPendingError().WithMessage("%s", "pending condition: "+str)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| setStatus(NewPendingError().WithMessage("%s", "pending condition: "+str)) | |
| setStatus(NewPendingError().WithMessage( "pending condition: %s", str)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(I might be missing somethign?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated by the pre-commit
| controller-gen: | ||
| FROM core+builder-image | ||
| DO --pass-args core+GO_INSTALL --package=sigs.k8s.io/controller-tools/cmd/controller-gen@v0.14.0 | ||
| DO --pass-args core+GO_INSTALL --package=sigs.k8s.io/controller-tools/cmd/controller-gen@v0.17.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@fguery This is the culprit. In conjunction with the go version from what I have understood.
No description provided.