Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Add Markers and Move Comments for API Docs #1802

Merged

Conversation

adambkaplan
Copy link
Member

@adambkaplan adambkaplan commented Feb 17, 2025

Changes

Update our code comment markers and copyright notice placement so that the elastic/crd-ref-docs tool can generate API reference docs:

  • Add kubebuilder:object:root=true marker for root CRD types. The crd-ref-docs tool looks for these to identify new Kind APIs.
  • Move copyright comments so they are not mistaken for package-level docs.

Note - this only applies to the v1beta1 API.

Needed for shipwright-io/website#147

/kind cleanup

Submitter Checklist

  • Includes tests if functionality changed/was added
  • Includes docs if changes are user-facing
  • Set a kind label on this PR
  • Release notes block has been filled in, or marked NONE

See the contributor guide
for details on coding conventions, github and prow interactions, and the code review process.

Release Notes

NONE

Update our code comment markers and copyright notice placement so that
the elastic/crd-ref-docs tool can generate API reference docs:

- Add `kubebuilder:object:root=true` marker for root CRD types. The
  crd-ref-docs tool looks for these to identify new `Kind` APIs.
- Move copyright comments so they are not mistaken for package-level
  docs.

Note - this only applies to the `v1beta1` API.

Signed-off-by: Adam Kaplan <[email protected]>
@openshift-ci openshift-ci bot added the release-note-none Label for when a PR does not need a release note label Feb 17, 2025
@pull-request-size pull-request-size bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Feb 17, 2025
@openshift-ci openshift-ci bot added the kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. label Feb 17, 2025
Comment on lines -7 to -9
// Package v1beta1 contains API Schema definitions for the build v1beta1 API group
// +k8s:deepcopy-gen=package,register
// +groupName=shipwright.io
Copy link
Member

Choose a reason for hiding this comment

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

I honestly do not fully know what those annotations are for, but as you had not specifically mentioned it, I'd like to make sure this was intentionally removed.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, this was intentionally removed. The markers are duplicated in doc.go, and I verified that removing this didn't change how the CRDs were generated.

@SaschaSchwarze0 SaschaSchwarze0 added this to the release-v0.15.0 milestone Feb 18, 2025
Copy link
Member

@SaschaSchwarze0 SaschaSchwarze0 left a comment

Choose a reason for hiding this comment

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

/approve
/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Feb 18, 2025
Copy link
Contributor

openshift-ci bot commented Feb 18, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: SaschaSchwarze0

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

The pull request process is described here

Needs approval from an approver in each of these files:

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

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Feb 18, 2025
@openshift-merge-bot openshift-merge-bot bot merged commit 32c9df5 into shipwright-io:main Feb 18, 2025
20 checks passed
@adambkaplan adambkaplan deleted the gen-api-docs-fix branch February 18, 2025 14:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. lgtm Indicates that a PR is ready to be merged. release-note-none Label for when a PR does not need a release note size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants