-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Generate API reference docs for Pipeline #4494
Conversation
/assign @skaegi |
dda844a
to
7272f70
Compare
I've had to hack things around with go.mod - I can't seem to get
So I've hardcoded EDIT: Ok, jumped through some hoops (bumping Go to 1.15 mainly) and got it to vendor. Now I need to fix something else. |
20f994f
to
c7e43f4
Compare
/retest |
@abayer: GitHub didn't allow me to assign the following users: lbernick. Note that only tektoncd members, repo collaborators and people who have commented on this issue/PR can be assigned. Additionally, issues/PRs can only have 10 assignees at the same time. In response to this:
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. |
31b1a7c
to
81ed625
Compare
*/ | ||
|
||
// Package apis contains API Schema definitions for the various API groups | ||
package apis |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this need an annotation similar to those in pod/doc.go
and run/v1alpha1/doc.go
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It doesn't strictly need one, but we could add +k8s:deepcopy-gen=package
like in https://github.com/knative/serving/blob/main/pkg/apis/doc.go#L17. I don't think it would actually do anything, though.
Awesome, thank you Andrew! Do you need to also add the annotations to the other CRDs? (e.g. here for Pipeline and similarly for PipelineRun, Task, TaskRun, etc) |
@lbernick No - |
81ed625
to
a29a3a3
Compare
LGTM! |
go.mod
Outdated
@@ -3,6 +3,7 @@ module github.com/tektoncd/pipeline | |||
go 1.16 | |||
|
|||
require ( | |||
github.com/abayer/gen-crd-api-reference-docs v0.999.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you comment here with a link to your PR https://github.com/ahmetb/gen-crd-api-reference-docs/pull/43/files so we don't forget to switch back once it's merged?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point! On it.
f079b5c
to
c9a8b74
Compare
/retest |
c9a8b74
to
1161a56
Compare
1161a56
to
b820618
Compare
Issues go stale after 90d of inactivity. /lifecycle stale Send feedback to tektoncd/plumbing. |
Stale issues rot after 30d of inactivity. /lifecycle rotten Send feedback to tektoncd/plumbing. |
/remove-lifecycle rotten I'm actually working on resurrecting this today. =) |
b820618
to
69acedf
Compare
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: vdemeester 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 |
/cc @afrittoli @lbernick - I think this should work/be ready now, using https://github.com/tektoncd/ahmetb-gen-crd-api-reference-docs. |
/retest |
@@ -149,3 +151,5 @@ require ( | |||
sigs.k8s.io/json v0.0.0-20211208200746-9f7c6b3444d2 // indirect | |||
sigs.k8s.io/structured-merge-diff/v4 v4.2.1 // indirect | |||
) | |||
|
|||
replace github.com/ahmetb/gen-crd-api-reference-docs => github.com/tektoncd/ahmetb-gen-crd-api-reference-docs v0.3.1-0.20220729140133-6ce2d5aafcb4 // Waiting for https://github.com/ahmetb/gen-crd-api-reference-docs/pull/43/files to merge |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the comment here still relevant? do you need the replace
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, because the package in the forked repo is still github.com/ahmetb/gen-crd-api-reference-docs
.
hack/update-reference-docs.sh
Outdated
set -o nounset | ||
|
||
echo "Generating API reference docs ..." | ||
# TODO(abayer): Switch to github.com/ahmetb/gen-crd-api-reference-docs when https://github.com/ahmetb/gen-crd-api-reference-docs/pull/43 is merged/vendor is updated |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this comment can be removed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch, I forgot that.
@@ -0,0 +1,42 @@ | |||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would you mind adding a readme in /hack that explains a bit what these files you're adding are for, and link to any reference docs?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lemme see what I can remember. =)
This is the first part of addressing tektoncd#1250 (and tektoncd/website#117). Using https://github.com/ahmetb/gen-crd-api-reference-docs/, the tool Knative uses for this, plus my PR at ahmetb/gen-crd-api-reference-docs#43, forked to https://github.com/tektoncd/ahmetb-gen-crd-api-reference-docs, for an issue with `pkg/apis/pipeline/pod`, this adds generation of `docs/pipeline-api.md` to `hack/update-codegen.sh`. Signed-off-by: Andrew Bayer <andrew.bayer@gmail.com>
69acedf
to
6d31e0f
Compare
@@ -9,4 +9,7 @@ Tekton Pipelines. | |||
- [`update-openapigen.sh`](./update-openapigen.sh): Updates OpenAPI specification and Swagger file. | |||
- [`verify-codegen.sh`](./verify-codegen.sh): Verifies that auto-generated | |||
client libraries are up-to-date. | |||
- [`update-reference-docs.sh`](./update-reference-docs.sh) and related files: Generates [`docs/pipeline-api.md`](../docs/pipeline-api.md). | |||
- [`reference-docs-gen-config.json`](./reference-docs-gen-config.json) is the configuration file for the [`gen-api-reference-docs`](https://github.com/tektoncd/ahmetb-gen-crd-api-reference-docs) binary. | |||
- [`reference-docs-template`](./reference-docs-template) contains Go templates for the generated Markdown. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@lbernick Is this (and above) what you were looking for?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sure yeah this works!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
@@ -9,4 +9,7 @@ Tekton Pipelines. | |||
- [`update-openapigen.sh`](./update-openapigen.sh): Updates OpenAPI specification and Swagger file. | |||
- [`verify-codegen.sh`](./verify-codegen.sh): Verifies that auto-generated | |||
client libraries are up-to-date. | |||
- [`update-reference-docs.sh`](./update-reference-docs.sh) and related files: Generates [`docs/pipeline-api.md`](../docs/pipeline-api.md). | |||
- [`reference-docs-gen-config.json`](./reference-docs-gen-config.json) is the configuration file for the [`gen-api-reference-docs`](https://github.com/tektoncd/ahmetb-gen-crd-api-reference-docs) binary. | |||
- [`reference-docs-template`](./reference-docs-template) contains Go templates for the generated Markdown. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sure yeah this works!
Changes
This is the first part of addressing #1250 (and tektoncd/website#117).
Using https://github.com/ahmetb/gen-crd-api-reference-docs/, the tool Knative uses for this, plus my PR at ahmetb/gen-crd-api-reference-docs#43 for an issue with
pkg/apis/pipeline/pod
, this adds generation ofdocs/pipeline-api.md
tohack/update-codegen.sh
.I assume there'll need to be a follow up PR to the website tooling to actually do something with this new file!
/kind documentation
Submitter Checklist
As the author of this PR, please check off the items in this checklist:
functionality, content, code)
Release Notes