Skip to content

✨ (kustomize/v2; go/v4) feat: improve UX and maintainability by auto-uncommenting webhook blocks when possible #4826

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

Merged
merged 1 commit into from
Jun 21, 2025

Conversation

camilamacedo86
Copy link
Member

@camilamacedo86 camilamacedo86 commented May 25, 2025

  • Automatically uncomments webhook blocks in config/default/kustomization.yaml during scaffolding.
  • Supports default and conversion webhooks.
  • Adds warnings if auto-uncommenting fails, without breaking the flow.
  • Updates mocks and tutorial examples to rely on the new behaviour.

Fixes #4422
Closes: #4565

@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 25, 2025
@k8s-ci-robot k8s-ci-robot requested a review from Kavinjsir May 25, 2025 10:57
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: camilamacedo86

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 approved Indicates a PR has been approved by an approver from all required OWNERS files. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels May 25, 2025
@camilamacedo86 camilamacedo86 force-pushed the add-ux-webhooks branch 4 times, most recently from ac268d7 to 8035b9d Compare May 25, 2025 11:48
@camilamacedo86 camilamacedo86 changed the title WIP : ✨ Improve UX by uncomment webhooks replacements automatically ✨ Improve UX by uncomment webhooks replacements automatically May 25, 2025
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label May 25, 2025
@camilamacedo86 camilamacedo86 changed the title ✨ Improve UX by uncomment webhooks replacements automatically WIP: ✨ Improve UX by uncomment webhooks replacements automatically May 25, 2025
@k8s-ci-robot k8s-ci-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label May 25, 2025
@camilamacedo86 camilamacedo86 force-pushed the add-ux-webhooks branch 4 times, most recently from 93574c5 to c2bac90 Compare May 26, 2025 07:47
@camilamacedo86 camilamacedo86 changed the title WIP: ✨ Improve UX by uncomment webhooks replacements automatically ✨ Improve UX by uncomment webhooks replacements automatically May 26, 2025
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label May 26, 2025
@camilamacedo86 camilamacedo86 force-pushed the add-ux-webhooks branch 2 times, most recently from eb70bd1 to 3e83a08 Compare May 26, 2025 08:01
@camilamacedo86
Copy link
Member Author

/retest-required

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label May 27, 2025
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label May 27, 2025
@camilamacedo86
Copy link
Member Author

/test pull-kubebuilder-e2e-k8s-1-31-4

@camilamacedo86 camilamacedo86 force-pushed the add-ux-webhooks branch 3 times, most recently from f663884 to 84879a2 Compare June 1, 2025 16:24
@camilamacedo86 camilamacedo86 changed the title ✨ Improve UX by uncomment webhooks replacements automatically 🐛 (kustomize/v2; webhook/v4) Fix UX by uncomment webhooks replacements automatically Jun 1, 2025
@camilamacedo86 camilamacedo86 changed the title 🐛 (kustomize/v2; webhook/v4) Fix UX by uncomment webhooks replacements automatically 🐛 (kustomize/v2; go/v4) Fix UX by uncomment webhooks replacements automatically Jun 1, 2025
This change enhances the user experience by automatically uncommenting
webhook-related code blocks during scaffolding. It also improves
maintainability by eliminating the need to manually uncomment code when
running end-to-end tests for examples and mocks.
@camilamacedo86 camilamacedo86 changed the title 🐛 (kustomize/v2; go/v4) Fix UX by uncomment webhooks replacements automatically ✨ (kustomize/v2; go/v4) Fix UX by uncomment webhooks replacements automatically Jun 1, 2025
@camilamacedo86 camilamacedo86 changed the title ✨ (kustomize/v2; go/v4) Fix UX by uncomment webhooks replacements automatically ✨ (kustomize/v2; go/v4) feat: improve UX and maintainability by auto-uncommenting webhook blocks when possible Jun 1, 2025
@camilamacedo86
Copy link
Member Author

/test pull-kubebuilder-e2e-k8s-1-33-0

@camilamacedo86
Copy link
Member Author

Since no objections have been raised so far.
This is a minor improvement/fix, and we can easily validate it with the end-to-end (E2E) tests and samples.
Also, since it fixes the samples and might help us figure out the e2e issues faced after k8s 1.33 I am moving forward with this one.

@camilamacedo86 camilamacedo86 added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jun 21, 2025
@k8s-ci-robot k8s-ci-robot merged commit cc59c89 into kubernetes-sigs:master Jun 21, 2025
36 checks passed
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. 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.

Automate Uncommenting Webhook Blocks in kustomize.yaml When Scaffolding Webhooks
2 participants