✨ feat: add kubebuilder:externalDoc marker#1335
✨ feat: add kubebuilder:externalDoc marker#1335pedjak wants to merge 1 commit intokubernetes-sigs:mainfrom
kubebuilder:externalDoc marker#1335Conversation
|
Welcome @pedjak! |
|
Hi @pedjak. Thanks for your PR. I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions 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-sigs/prow repository. |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: pedjak The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
kubebuilder:externalDoc markerkubebuilder:externalDoc marker
|
Related to kubernetes/kubernetes#136988 and kubernetes/kubernetes#136977 |
|
/ok-to-test |
|
Lgtm. |
It looks like there is an infra issue with the failed job: I can even reproduce it locally. |
|
|
||
| // This field has a doc comment link definition. | ||
| // | ||
| // [Link Def Docs]: https://example.com/link-def |
There was a problem hiding this comment.
Why do we need to support this syntax instead of just supporting the explicit markers?
There was a problem hiding this comment.
I thought it is a nice add-on, given that many projects today put already links in godoc. This would allows us to find them and put them as externalDocs structure. If you think it could be surprising to users, we could enable this behavior with a command line flag?
There was a problem hiding this comment.
I'd prefer we didn't carry this complexity at all if I'm honest. We don't have existing behaviour like this, everything is explicitly part of the markers and I think we should probably stick to that pattern
CC @sbueringer @alvaroaleman keep me honest here
There was a problem hiding this comment.
Agree. I also would prefer to only use markers for this
There was a problem hiding this comment.
Agree. I also would prefer to only use markers for this
done, ptal.
There was a problem hiding this comment.
I'd prefer we didn't carry this complexity at all if I'm honest. We don't have existing behaviour like this, everything is explicitly part of the markers and I think we should probably stick to that pattern
I have removed godoc link parsing, but just got an idea: how about that we control the link source via an additional parameter, e.g.:
// +kubebuilder:externalDoc:fromComment
or simply just
// +kubebuilder:externalDoc
and then we look into godoc comment for links? wdyt @JoelSpeed ? This enables users to keep links in the single place, without duplication.
|
@pedjak Yes, please see #1334 (comment) for more details |
|
/test pull-controller-tools-test-main |
Implement the `kubebuilder:externalDoc` marker to allow specifying external documentation (url and description) on fields and types, populating the externalDocs field in the generated OpenAPI schema. The url field is required and validated to be a well-formed URL. The description field is optional. Ref: https://spec.openapis.org/oas/v3.0.0.html#external-documentation-object Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1694f3d to
3abdb9c
Compare
|
/retest |
|
/lgtm /assign @JoelSpeed |
|
LGTM label has been added. DetailsGit tree hash: d2461f42e581c3dba6601b03e7f27ad863bf0e73 |
Implement the
kubebuilder:externalDocmarker to allow specifying external documentation (url and description) on fields and types, populating the externalDocs field in the generated OpenAPI schema.The url field is required and validated to be a well-formed URL.
The description field is optional.
Ref: https://spec.openapis.org/oas/v3.0.0.html#external-documentation-object
Co-Authored-By: Claude Opus 4.6 noreply@anthropic.com