fix: comment status without SSA options#660
Conversation
Signed-off-by: Jesús Fernández <7312236+fernandezcuesta@users.noreply.github.com>
📝 WalkthroughWalkthroughThe PR fixes a bug where server-side apply merge-strategy markers were incorrectly applied to Observation struct fields. When status lists contained multiple items, the API server rejected updates due to conflicting default values. The fix strips SSA markers and defaults from Observation fields, with test coverage validating that markers appear only in the Spec side (Parameters) but not in the Status side (Observation). ChangesSSA Marker Removal and Test Coverage
🎯 2 (Simple) | ⏱️ ~10 minutes 🚥 Pre-merge checks | ✅ 7✅ Passed checks (7 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
pkg/types/builder_test.go (1)
642-642: ⚡ Quick winPlease rename the test case key to PascalCase (no underscores).
Nice coverage addition here. Could you rename
"SSA_InjectedKey_Not_In_Observation_Comments"to a PascalCase form (for example,SSAInjectedKeyNotInObservationComments) to match repo test naming conventions? Thanks for adding this regression case.As per coding guidelines,
**/*_test.go: “Enforce table-driven test structure: PascalCase test names (no underscores)”.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@pkg/types/builder_test.go` at line 642, Rename the table-driven test case key "SSA_InjectedKey_Not_In_Observation_Comments" to a PascalCase identifier (no underscores), e.g., SSAInjectedKeyNotInObservationComments, so it matches the repository's test naming convention; update any places that reference this map key inside builder_test.go (the test cases map entry and any lookups/assertions) to use the new PascalCase name.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@pkg/types/builder_test.go`:
- Line 642: Rename the table-driven test case key
"SSA_InjectedKey_Not_In_Observation_Comments" to a PascalCase identifier (no
underscores), e.g., SSAInjectedKeyNotInObservationComments, so it matches the
repository's test naming convention; update any places that reference this map
key inside builder_test.go (the test cases map entry and any lookups/assertions)
to use the new PascalCase name.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 89a04c5c-8ca1-44c4-ab0b-02e8246b30d5
📒 Files selected for processing (2)
pkg/types/builder_test.gopkg/types/field.go
Description of your changes
Remove SSA markers and injected key defaults in the observation (status) fields.
Fixes #659
I have:
make reviewableto ensure this PR is ready for review.backport release-x.ylabels to auto-backport this PR if necessary.How has this code been tested
Added a test.
Real e2e test WIP (testing with provider-pageduty), if needed.