Skip to content

docs: document fieldpath semantics in Unstructured.SetValue#320

Open
boxcee-interview wants to merge 1 commit into
crossplane:mainfrom
boxcee-interview:fix/issue-49-document-fieldpath-semantics
Open

docs: document fieldpath semantics in Unstructured.SetValue#320
boxcee-interview wants to merge 1 commit into
crossplane:mainfrom
boxcee-interview:fix/issue-49-document-fieldpath-semantics

Conversation

@boxcee-interview

Copy link
Copy Markdown

Closes #49

Summary

Add documentation to the SetValue method on composed.Unstructured explaining:

  • How dot notation works in field paths (dots are separators, not literal characters)
  • That keys containing dots create nested maps when using SetValue
  • Alternative methods (SetLabels, SetAnnotations) for setting label/annotation keys with dots
  • That SetLabels and SetAnnotations replace the entire map

How to Test

Review the godoc comment on SetValue at resource/composed/composed.go. No behavioral changes — documentation only.

Build and tests pass: go build ./... and go test ./...

Signed-off-by: Moritz Schmitz von Hülst <mschmitzvonhuelst@gmail.com>
@coderabbitai

coderabbitai Bot commented Jun 21, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 689f1889-edfd-42d8-a851-51a20f559672

📥 Commits

Reviewing files that changed from the base of the PR and between 1cb7c55 and 7445b67.

📒 Files selected for processing (1)
  • resource/composed/composed.go

📝 Walkthrough

Walkthrough

A multi-line doc comment is added to (*Unstructured).SetValue in resource/composed/composed.go. The comment explains that dot-delimited field paths are interpreted as nested maps, shows the resulting YAML structure, and directs callers to use SetLabels or SetAnnotations when their keys contain dots. No logic was changed.

Changes

SetValue dot-notation documentation

Layer / File(s) Summary
SetValue doc comment
resource/composed/composed.go
Adds a 20-line comment block above (*Unstructured).SetValue documenting how dot-delimited paths produce nested maps and advising use of SetLabels/SetAnnotations for label/annotation keys that themselves contain dots.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately and concisely describes the change: adding documentation about fieldpath semantics to the SetValue method.
Description check ✅ Passed The description clearly relates to the changeset, explaining the documentation additions and how they address the issue about dot notation in field paths.
Linked Issues check ✅ Passed The PR fully addresses issue #49 by documenting SetValue behavior with dotted keys and recommending SetLabels/SetAnnotations as alternatives.
Out of Scope Changes check ✅ Passed All changes are focused on documentation for the SetValue method without any functional modifications, remaining within scope.
Breaking Changes ✅ Passed This PR only adds godoc documentation to the existing SetValue method—no exported functions, types, methods, fields, or signatures were modified. No behavioral changes to public APIs detected.

✏️ 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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Document fieldpath semantics

1 participant