Skip to content

Add fallback to ShapeRef documentation when Shape.Documenation is empty#682

Open
knottnt wants to merge 1 commit intoaws-controllers-k8s:mainfrom
knottnt:nested-primitive-descriptions
Open

Add fallback to ShapeRef documentation when Shape.Documenation is empty#682
knottnt wants to merge 1 commit intoaws-controllers-k8s:mainfrom
knottnt:nested-primitive-descriptions

Conversation

@knottnt
Copy link
Copy Markdown
Contributor

@knottnt knottnt commented Mar 27, 2026

Issue #, if available:

Description of changes:
Primitive fields (string, integer, boolean, etc) fields that were nested in an object didn't have their CRD descriptions populated with the contents to their API shape's #documentation trait. This was due the TypeDef Attrs using a generic primitive shape instead the member's ShapeRef. This PR adds a fallback to using ShapeRef.Documentation when Shape.Documentation.

  • Update Attr type to include ShapeRef property
  • Add Attr.Documentation() func to handle fallback to ShapeRef.Documentation if Shape.Documentation is unavailable
  • Update type_def.go.tpl to use new Attr.Documentation() func

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

- Update Attr type to include ShapeRef property
- Add Attr.Documentation() func to handle fallback to ShapeRef.Documentation if Shape.Documentation is unavailable
- Update type_def.go.tpl to use new Attr.Documentation() func
@ack-prow ack-prow bot requested review from jlbutler and michaelhtm March 27, 2026 00:16
@ack-prow ack-prow bot added the approved label Mar 27, 2026
@knottnt
Copy link
Copy Markdown
Contributor Author

knottnt commented Mar 27, 2026

Example PR showing changes applied to a controller.
aws-controllers-k8s/cognitoidentityprovider-controller#39

Copy link
Copy Markdown
Member

@michaelhtm michaelhtm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work @knottnt
/lgtm

@ack-prow ack-prow bot added the lgtm Indicates that a PR is ready to be merged. label Mar 30, 2026
@ack-prow
Copy link
Copy Markdown

ack-prow bot commented Mar 30, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: a-hilaly, knottnt, michaelhtm

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:
  • OWNERS [a-hilaly,knottnt,michaelhtm]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@knottnt
Copy link
Copy Markdown
Contributor Author

knottnt commented Mar 30, 2026

/retest

@knottnt
Copy link
Copy Markdown
Contributor Author

knottnt commented Mar 30, 2026

/test s3-controller-test

1 similar comment
@knottnt
Copy link
Copy Markdown
Contributor Author

knottnt commented Mar 30, 2026

/test s3-controller-test

@knottnt
Copy link
Copy Markdown
Contributor Author

knottnt commented Mar 31, 2026

/retest

2 similar comments
@knottnt
Copy link
Copy Markdown
Contributor Author

knottnt commented Mar 31, 2026

/retest

@knottnt
Copy link
Copy Markdown
Contributor Author

knottnt commented Apr 1, 2026

/retest

@ack-prow
Copy link
Copy Markdown

ack-prow bot commented Apr 1, 2026

@knottnt: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
s3-controller-test 6bc30eb link true /test s3-controller-test

Full PR test history. Your PR dashboard.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

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

Labels

approved lgtm Indicates that a PR is ready to be merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants