docs(sdk): attach each criteria converter's godoc to its own function - #2246
Conversation
ToInternalCriteria's doc paragraph landed in #2243 with no blank line separating it from the pre-existing toInternalCriteria block, so Go read the two as one comment attached to the exported function. On merged main: $ go doc ./pkg/client/v1.ToInternalCriteria func ToInternalCriteria(c *Criteria) *recipe.Criteria toInternalCriteria translates a facade Criteria back into the pkg/recipe.Criteria enum-typed shape the resolver consumes... The public, semver-pinned symbol documented itself under the wrong lowercase name and led with the unexported helper's semantics, while toInternalCriteria was left undocumented. It would also trip revive's exported-comment rule if that linter is enabled later. Comment-only: each block now sits directly above the function it describes. No non-comment line changes. Signed-off-by: Mark Chmarny <mark@chmarny.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Enterprise Run ID: 📒 Files selected for processing (1)
Included review availability: Your plan includes up to 12 reviews per rolling hour; 11 remain after this review. 📝 WalkthroughWalkthroughThe change adds exported Estimated code review effort: 1 (Trivial) | ~3 minutes Merge Risk: ⚪ Minimal · up to This change only corrects which SDK functions receive their Go documentation and does not alter runtime behavior, so no actionable merge-blocking risk remains after normal checks and review. Suggested reviewers: 🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
Coverage Report ✅
Coverage BadgeNo Go source files changed in this PR. |
Summary
Separates the
ToInternalCriteriaandtoInternalCriteriadoc comments so each attaches to its own function. Comment-only; no non-comment line changes.Motivation / Context
The
ToInternalCriteriaparagraph landed in #2243 with no blank line separating it from the pre-existingtoInternalCriteriablock, so Go reads the two as one contiguous comment attached to the exported function. On mergedmain:So the public, semver-pinned symbol documents itself under the wrong lowercase name and leads with the unexported helper's semantics, while
toInternalCriteriais left with no doc at all. It would also trip revive'sexportedcomment rule if that linter is enabled later.Caught in review of #2243 (thread). Landing it standalone rather than folding into #2245 because that issue may be a while out, and leaving incorrect documentation on the stability-guaranteed surface in the meantime is the thing worth avoiding.
Related: #2243, #2026
Type of Change
Component(s) Affected
cmd/aicr,pkg/cli)cmd/aicrd,pkg/server)pkg/recipe)pkg/bundler,pkg/component/*)pkg/collector,pkg/snapshotter)pkg/validator)pkg/errors,pkg/k8s)docs/,examples/)pkg/client/v1)Implementation Notes
Each block now sits directly above the function it describes. After:
and
toInternalCriteriacarries its own doc again.Testing
make qualify # exit 0Verified the diff touches no executable line:
go docoutput before and after is quoted above; the existingTestToInternalCriteriastill passes unchanged.Risk Assessment
Comment-only, single file.
Rollout notes: N/A.
Checklist
make testwith-race)make lint)git commit -S)