Skip to content

WIP: automatically diff KEP headings versus the template #5267

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

BenTheElder
Copy link
Member

Sharing a quick proof of concept using mdtoc (which we already use for update-toc.sh)

See thread: https://kubernetes.slack.com/archives/C5P3FE08M/p1746127465971139

TODO:

  • remove hardcoded default commit range (used for ease of testing)
  • ignore headings with "(Optional)" in them (and the subheadings under these)
  • cleanup

The gist is there though, we can check for any new questions that have been missed by diffing against the template for kep READMEs touched by the PR.

  • One-line PR description:
  • Issue link:
  • Other comments:

@k8s-ci-robot k8s-ci-robot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels May 1, 2025
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: BenTheElder
Once this PR has been reviewed and has the lgtm label, please assign jeremyrickard for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found 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 requested a review from johnbelamaric May 1, 2025 21:38
@k8s-ci-robot k8s-ci-robot added the area/enhancements Issues or PRs related to the Enhancements subproject label May 1, 2025
@k8s-ci-robot k8s-ci-robot requested a review from palnabarun May 1, 2025 21:38
@k8s-ci-robot k8s-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label May 1, 2025
@@ -0,0 +1,100 @@
#!/usr/bin/env bash
Copy link
Member Author

Choose a reason for hiding this comment

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

this is based on hack/update-toc.sh + hack/apidiff.sh (kubernetes/kubernetes)

@BenTheElder BenTheElder force-pushed the diff-kep-template branch from eb4fc35 to ea63ef8 Compare May 1, 2025 21:42
echo >&2 "Diffing table of contents for $kep_readme:"
# diff only removals versus the template
# we don't care about _additional_ headings in the KEP
# TODO: ignore certain allowed removals "(Optional)"
Copy link
Member Author

@BenTheElder BenTheElder May 1, 2025

Choose a reason for hiding this comment

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

if we just stuck (Optional) in all of the optional headings (most already do), then this is already implemented.

proof of concept using mdtoc (which we already use for update-toc.sh)
@BenTheElder BenTheElder force-pushed the diff-kep-template branch from ea63ef8 to 1c4a3e8 Compare May 1, 2025 22:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/enhancements Issues or PRs related to the Enhancements subproject cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants