-
Notifications
You must be signed in to change notification settings - Fork 47
Fix GitLab integration test failures & golangci-lint, govet #373
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
Conversation
Fixes go vet errors introduced in the GitLab integration PR that merged with failing tests. Changes improve code testability by using interfaces instead of concrete types. Changes: - Fix test assertions to use correct struct fields (result.User.Username instead of result.Username, result.User.ID instead of result.GitLabUserID) - Change kubernetes.Clientset to kubernetes.Interface in function signatures to support both real and fake clients for testing - Fix GetCurrentUser call to use package-level function instead of method - Remove unused imports (time, corev1) Updated functions: - k8s.StoreGitLabToken, k8s.GetGitLabToken, k8s.DeleteGitLabToken - k8s.HasGitLabToken, k8s.StoreGitLabConnection, k8s.GetGitLabConnection - k8s.DeleteGitLabConnection, k8s.HasGitLabConnection - k8s.ListGitLabConnections, git.GetGitLabToken - gitlab.NewConnectionManager and ConnectionManager.clientset field This follows Go best practices (accept interfaces, return structs) and makes the code more testable without changing runtime behavior. Related: PR #339 (GitLab integration) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> Signed-off-by: sallyom <somalley@redhat.com>
This comment has been minimized.
This comment has been minimized.
Addresses linting errors flagged by golangci-lint CI checks: 1. git/operations.go: - Use tagged switch instead of if-else chains for provider checks (QF1003) - Lowercase error message prefixes per Go conventions (ST1005) - Merge conditional assignments into variable declaration (QF1007) 2. handlers/gitlab_auth.go: - Apply De Morgan's law to simplify character validation logic (QF1001) These changes improve code quality and follow Go best practices without changing functionality. Related: PR #339 (GitLab integration) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> Signed-off-by: sallyom <somalley@redhat.com>
This comment was marked as outdated.
This comment was marked as outdated.
Addresses remaining golangci-lint staticcheck errors: - types/gitlab.go: Fix ParsedGitLabRepo comment format (ST1021) - types/common.go: Fix BoolPtr, StringPtr, IntPtr comment format (ST1020) Per Go conventions, comments on exported types and functions must start with the exported identifier name.
Claude Code ReviewSummaryThis PR successfully fixes go vet errors and test failures from PR #339 (GitLab integration). The changes improve code quality and testability by transitioning from concrete Kubernetes client types ( Overall Assessment: ✅ LGTM - Ready to merge. All CI checks pass, changes follow repository standards, and the code improvements are well-executed. Issues by Severity🟡 Major Issues1. Inconsistent Interface Usage Across Codebase
🔵 Minor Issues1. Missing Function Documentation for Helper Functions
2. Error Message Capitalization Standardization
Positive Highlights✅ Excellent Adherence to Go Best Practices
✅ Superior Code Quality Improvements
✅ Test Coverage Maintained and Improved
✅ Minimal Scope with Clear Purpose
✅ Backward Compatibility Preserved
✅ Security Standards Maintained
✅ Proper Error Handling
RecommendationsMedium Priority (Follow-up PR)
Low Priority (Nice-to-have)
Alignment with Repository Standards (CLAUDE.md)✅ Backend Development Standards
✅ Go Standards
✅ Git Workflow
Final Verdict✅ APPROVED - Merge when ready This PR demonstrates excellent engineering:
The noted issues are either non-blocking inconsistencies that can be addressed in follow-up work, or are actually positive changes that improve code quality. The PR is well-scoped, thoroughly tested, and ready for production. Recommended merge strategy: Squash and merge (maintains clean git history) |
Fixes go vet errors introduced in the GitLab integration PR that merged. Changes improve code testability by using interfaces instead of concrete types.
Fixes golangci-lint errors
@jeremyeder @aegeiger