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 doctoc detection in verify-doctoc.sh #9112

Merged
merged 1 commit into from
Aug 3, 2023

Conversation

sbueringer
Copy link
Member

@sbueringer sbueringer commented Aug 3, 2023

Signed-off-by: Stefan Büringer [email protected]

What this PR does / why we need it:

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes #9114

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Aug 3, 2023
hack/verify-doctoc.sh Outdated Show resolved Hide resolved
Copy link
Contributor

@killianmuldoon killianmuldoon left a comment

Choose a reason for hiding this comment

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

Just playing around with this and it looks like this script doesn't work at all - or at least not with the version of doctoc i've installed. I'm constantly just getting an error.

@sbueringer did this work for you?

@sbueringer
Copy link
Member Author

sbueringer commented Aug 3, 2023

What error are you getting?

I think for me it works in general but the way we define the list of files is broken (aka it only does something if I use something like this without the newlines: doctoc_files="docs/staging-use-cases.md")

Not sure how I can get the version of this doctoc npm module

@sbueringer
Copy link
Member Author

sbueringer commented Aug 3, 2023

npm list -g doctoc
/home/sbuerin/.nvm/versions/node/v18.10.0/lib
└── [email protected]

Seems to be latest (https://www.npmjs.com/package/doctoc)

@killianmuldoon
Copy link
Contributor

I think for me it works in general but the way we define the list of files is broken (aka it only does something if I use something like this without the newlines: doctoc_files="docs/staging-use-cases.md")

This is what I'm getting too. Would it be better to fix this in this PR? I don't know what the value of fixing the check is if the doctoc command itself doesn't work.

@sbueringer
Copy link
Member Author

Working on a fix, give me a few minutes

@k8s-ci-robot k8s-ci-robot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Aug 3, 2023
exit 0
fi

doctoc ./CONTRIBUTING.md docs/release/release-tasks.md docs/scope-and-objectives.md docs/staging-use-cases.md docs/proposals
Copy link
Member Author

Choose a reason for hiding this comment

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

Seems a lot easier than the old version. Also it doesn't hide if it does something...

@sbueringer
Copy link
Member Author

Now it works.. Updated the list to include proposals + dropped some documents that don't have and don't need a toc

@sbueringer
Copy link
Member Author

sbueringer commented Aug 3, 2023

Would it be better to fix this in this PR?

Absolutely. I didn't know that it doesn't work. I tested this script in CAPV and I think in CAPV it worked because I only used it for a single file

@@ -573,7 +576,7 @@ In this cases for ServerSideApply to work properly it is required to ensure the
type definitions, like +MapType or +MapTypeKey, see [merge strategy](https://kubernetes.io/docs/reference/using-api/server-side-apply/#merge-strategy) for more details.

Note: in order to allow the topology controller to execute templates rotation only when strictly necessary, it is necessary
to implement specific handling of dry run operations in the templates webhooks as described in [Required Changes on providers from 1.1 to 1.2](https://cluster-api.sigs.k8s.io/developer/providers/v1.1-to-v1.2.html#required-api-changes-for-providers).
to implement specific handling of dry run operations in the templates webhooks as described in [Required Changes on providers from 1.1 to 1.2](https://cluster-api.sigs.k8s.io/developer/providers/migrations/v1.1-to-v1.2#required-api-changes-for-providers).
Copy link
Member Author

Choose a reason for hiding this comment

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

Seems to be the first time we're touching this file since we published the v1.5 book

Copy link
Contributor

@killianmuldoon killianmuldoon left a comment

Choose a reason for hiding this comment

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

Working and much simpler thanks!

/lgtm
/approve

@@ -573,7 +576,7 @@ In this cases for ServerSideApply to work properly it is required to ensure the
type definitions, like +MapType or +MapTypeKey, see [merge strategy](https://kubernetes.io/docs/reference/using-api/server-side-apply/#merge-strategy) for more details.

Note: in order to allow the topology controller to execute templates rotation only when strictly necessary, it is necessary
to implement specific handling of dry run operations in the templates webhooks as described in [Required Changes on providers from 1.1 to 1.2](https://cluster-api.sigs.k8s.io/developer/providers/v1.1-to-v1.2.html#required-api-changes-for-providers).
to implement specific handling of dry run operations in the templates webhooks as described in [Required Changes on providers from 1.1 to 1.2](https://cluster-api.sigs.k8s.io/developer/providers/migrations/v1.1-to-v1.2#required-api-changes-for-providers).
Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks for updating this!

Copy link
Member Author

@sbueringer sbueringer Aug 3, 2023

Choose a reason for hiding this comment

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

Had to :D

(markdown checker action was failing)

Copy link
Contributor

Choose a reason for hiding this comment

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

I did see it in the weekly run earlier, but didn't get around to fixing.

Copy link
Member Author

Choose a reason for hiding this comment

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

Ah good to know!

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Aug 3, 2023
@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

Git tree hash: 0150390a4bcf7bba755dfcf0a21adace6747e995

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: killianmuldoon

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

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 3, 2023
@k8s-ci-robot k8s-ci-robot merged commit 54dfd42 into kubernetes-sigs:main Aug 3, 2023
11 checks passed
@k8s-ci-robot k8s-ci-robot added this to the v1.6 milestone Aug 3, 2023
@sbueringer sbueringer deleted the pr-fix-doctoc branch August 3, 2023 14:15
@killianmuldoon
Copy link
Contributor

/area documentation

@k8s-ci-robot k8s-ci-robot added the area/documentation Issues or PRs related to documentation label Aug 4, 2023
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. area/documentation Issues or PRs related to documentation cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Ensure the doctoc tool works
3 participants