Skip to content

fix CLI reference generation for current and next versions#811

Merged
jetstack-bot merged 2 commits intocert-manager:masterfrom
jahrlin:master
Jan 26, 2022
Merged

fix CLI reference generation for current and next versions#811
jetstack-bot merged 2 commits intocert-manager:masterfrom
jahrlin:master

Conversation

@jahrlin
Copy link
Contributor

@jahrlin jahrlin commented Jan 26, 2022

This PR fixes an issue where CLI reference docs for the current release was generated from master, meaning they would contain flags included in the upcoming release.

Signed-off-by: Joakim Ahrlin joakim.ahrlin@gmail.com

generate current docs at the correct place
generate next docs with CLI

Signed-off-by: Joakim Ahrlin <joakim.ahrlin@gmail.com>
@jahrlin jahrlin requested a review from wallrj January 26, 2022 12:03
@jetstack-bot jetstack-bot added dco-signoff: yes Indicates that all commits in the pull request have the valid DCO sign-off message. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Jan 26, 2022
@netlify
Copy link

netlify bot commented Jan 26, 2022

✔️ Deploy Preview for cert-manager-website ready!

🔨 Explore the source changes: 1c28402

🔍 Inspect the deploy log: https://app.netlify.com/sites/cert-manager-website/deploys/61f16a99c42e860008d34b4e

😎 Browse the preview: https://deploy-preview-811--cert-manager-website.netlify.app

Copy link
Member

@wallrj wallrj left a comment

Choose a reason for hiding this comment

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

Thanks @jahrlin

I ran it on my laptop without errors.
And I see that the preview now shows the current webhook CLI flags rather than the flags in master: https://deploy-preview-811--cert-manager.netlify.app/docs/cli/webhook/

There are just one or two things I didn't understand about the script.

# API versions are no longer served, but the apis are still in the codebase. We
# don't want to show the docs for those API versions so this is a workaround.
# This will only be necessary for the release-1.6 branch.
checkout "release-1.6"
Copy link
Member

Choose a reason for hiding this comment

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

This checkout and the comment above relate to the rm and gendocs command below,
so I think it the genclireference commands should be moved after those.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good point, I have moved the comment.

genclireference must happen before we delete the legacy API versions because the code does not compile without them. I added a comment on that as well

genclireference "docs" "cmd/cainjector" "cainjector"
genclireference "docs" "cmd/ctl" "cmctl"
genclireference "docs" "cmd/controller" "controller"
genclireference "docs" "cmd/webhook" "webhook"
Copy link
Member

Choose a reason for hiding this comment

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

And if these lines are deliberately placed after the checkout command, then I'd add a comment explaining why it's important, so that someone doesn't come alone and rearrange this code.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have added a comment here covering this!

# and add them to the git index
# when adding a new version here use
# genversionwithcli to force generation of CLI docs
# and add them to the git index, then switch back to genversion
Copy link
Member

Choose a reason for hiding this comment

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

I don't understand this comment.
Does it mean that I should add another genversionwithcli line somewhere in the scipt.
Please add a little more detail about how this script should be modified in future.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have re-formulated the comment and included an example for the next change in this section

Signed-off-by: Joakim Ahrlin <joakim.ahrlin@gmail.com>
@jahrlin jahrlin requested a review from wallrj January 26, 2022 15:50
@jahrlin
Copy link
Contributor Author

jahrlin commented Jan 26, 2022

Thanks @wallrj - very good feedback and I have tried to simplify and clarify the comments

Copy link
Member

@wallrj wallrj left a comment

Choose a reason for hiding this comment

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

Thanks @jahrlin

/lgtm

@jetstack-bot jetstack-bot added the lgtm Indicates that a PR is ready to be merged. label Jan 26, 2022
@wallrj
Copy link
Member

wallrj commented Jan 26, 2022

/approve

@wallrj wallrj added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jan 26, 2022
@jetstack-bot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

Approval requirements bypassed by manually added approval.

This pull-request has been approved by: jahrlin, wallrj

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:

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

@jetstack-bot jetstack-bot merged commit 9202deb into cert-manager:master Jan 26, 2022
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. dco-signoff: yes Indicates that all commits in the pull request have the valid DCO sign-off message. lgtm Indicates that a PR is ready to be merged. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants