Repository navigation
fix(operator): OPS-9038 use promoted fields in the DGD resource syncer test - #17453
Conversation
…r test The operator lint job fails on main. golangci-lint v2.15.0 reports two modernize/embedlit findings in dgd_resource_syncer_test.go, lines 106 and 109. #16910 added the file with `ObjectMeta: metav1.ObjectMeta{...}` literals. Its last CI run came before #16771 enabled modernize and rewrote all such literals in the operator. Set Name, Namespace and UID through the promoted fields, as #16771 did, and remove the metav1 import, which has no other use in the file. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Dmitry Tokarev <dtokarev@nvidia.com>
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Update test fixture metadata fields deploy/operator/internal/controller/dgd_resource_syncer_test.go |
The test removes the unused metav1 import. Both fixtures set Name, Namespace, and UID directly instead of using nested ObjectMeta literals. |
Priority:
Estimated code review effort: 1 (Trivial) | ~2 minutes
Merge Risk: 
Minimal · up to 726c8
-
This is a test-only lint cleanup with no production behavior change. The compile-failure concern was refuted, so the change is safe to merge.
Pre-merge checks: 
4 · 
1
-
Failed checks: 1 warning Passed checks: 4 passed-
Full details: Description check
-
Explanation
The description explains the lint failure, the code change, the issue reference, and validation results. It does not use every template heading, but it provides the required issue reference and sufficient technical detail.
-
Full details: Docstring Coverage
-
Explanation
Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 1 functions across 1 files.
Resolution
Write docstrings for the functions missing them to satisfy the coverage threshold.
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Comment @coderabbitai help to get the list of available commands.
Linear: OPS-9038
Summary
The
operatorjob in Pre Merge fails onmain. golangci-lint v2.15.0 reports twomodernizefindings:dgd_resource_syncer_test.gowith twoObjectMeta: metav1.ObjectMeta{...}literals. Its last Pre Merge run was on 2026-10-20. build(operator): enable the modernize golangci-lint linter #16771 enabledmodernizeon 2026-10-23 and rewrote all such literals in the operator, so that run never saw the new rule.df083f8e0a(refactor(operator): share ownership-safe deletion for DGD auxiliary resources #16910) failed the operator job with these two findings. The push run on its parent95f1b12d0bpassed that job. The later push runs onmainskip the operator job, somainlooks green. Every PR that runs the operator job fails until this file changes.Name,NamespaceandUIDthrough the promoted fields, in the form that build(operator): enable the modernize golangci-lint linter #16771 used. It also removes themetav1import, because the file has no other use of it.Validation
All local runs used the
golang:1.27.3image with the CI digest (sha256:921f6112…), golangci-lint v2.15.0, linux/arm64 and--network none.golangci-lint runonmain(cffc4fa75c) gives the two findings above. This branch gives0 issues.mainbefore refactor(operator): share ownership-safe deletion for DGD auxiliary resources #16910 (95f1b12d0b) also gives0 issues, so no othermodernizefinding remains.main, the arm64 lint output is the same as the amd64 output of the CI job.go test ./internal/controller/ -run '^TestDGDResourceSyncerDeleteIfControlledBy$'passes 8 of 8 subtests onmainand on this branch.go vet ./internal/controller/andgofmt -lare clean on this branch.pre-commit run --all-filespasses all 40 hooks.make check, the fullmake test,make envtest, and amd64. The operator job of this PR runs them.🤖 Generated with Claude Code
Summary by CodeRabbit