Skip to content

Boilerplate verification to ensure LICENSE information is present #880

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

Conversation

bharathbrat
Copy link
Contributor

@bharathbrat bharathbrat commented May 28, 2025

Adds boilerplate verification to ensure LICENSE information is present wherever required.

This is copied from gateway-api repository: https://github.com/kubernetes-sigs/gateway-api/blob/main/hack/boilerplate/boilerplate.py. Main modification was to trim skipped dirs or files from the original file. There are some I have left in because they look like generic folders.

Fixes: #848

@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 28, 2025
@k8s-ci-robot k8s-ci-robot requested review from Jeffwan and robscott May 28, 2025 08:42
@k8s-ci-robot
Copy link
Contributor

Welcome @bharathbrat!

It looks like this is your first PR to kubernetes-sigs/gateway-api-inference-extension 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes-sigs/gateway-api-inference-extension has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@k8s-ci-robot
Copy link
Contributor

Hi @bharathbrat. Thanks for your PR.

I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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-sigs/prow repository.

@k8s-ci-robot k8s-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label May 28, 2025
Copy link

linux-foundation-easycla bot commented May 28, 2025

CLA Signed

The committers listed above are authorized under a signed CLA.

@k8s-ci-robot k8s-ci-robot added cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels May 28, 2025
Copy link

netlify bot commented May 28, 2025

Deploy Preview for gateway-api-inference-extension ready!

Name Link
🔨 Latest commit d683c35
🔍 Latest deploy log https://app.netlify.com/projects/gateway-api-inference-extension/deploys/683df271ad520d0008cf4c30
😎 Deploy Preview https://deploy-preview-880--gateway-api-inference-extension.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. and removed cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. labels May 28, 2025
@bharathbrat bharathbrat marked this pull request as ready for review May 28, 2025 10:18
@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 28, 2025
@k8s-ci-robot k8s-ci-robot requested a review from ahg-g May 28, 2025 10:19
@ahg-g
Copy link
Contributor

ahg-g commented May 28, 2025

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels May 28, 2025
@k8s-ci-robot k8s-ci-robot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels May 31, 2025
@k8s-ci-robot k8s-ci-robot added the do-not-merge/invalid-commit-message Indicates that a PR should not merge because it has an invalid commit message. label May 31, 2025
@bharathbrat bharathbrat force-pushed the boilerplate_verification branch from 45ddaaa to 3043ba5 Compare May 31, 2025 03:45
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/invalid-commit-message Indicates that a PR should not merge because it has an invalid commit message. label May 31, 2025
Copy link
Contributor

@nirrozenbaum nirrozenbaum left a comment

Choose a reason for hiding this comment

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

some files were copied from another repo and contain 2014/2015 year in their header.. should fix those

@ahg-g
Copy link
Contributor

ahg-g commented Jun 2, 2025

/retest

@bharathbrat
Copy link
Contributor Author

I am a bit puzzled by the latest test failures here.

When I check locally these files pass:

> hack/verify-all.sh -v
Skipping hack/../hack/verify-all.sh
Verified 176 file headers match boilerplate
SUCCESS: hack/../hack/verify-boilerplate.sh 

All tests passed successfully.

Do the files under client-go get regenerated at build time? Wondering if that causes these failures.

@nirrozenbaum
Copy link
Contributor

we should have one boilerplate for go files and one for go generated files (which we have).
the right thing is to modify in makefile (in generate target) the boilerplate file that is used instead of using it’s own file.

to be more concrete, I think hack/boilerplate.go should be removed, hack/boilerplate/boilerplate.gogenerate should be used in make generate as header file, and hack/boilerplate/boilerplate.go should keep the year

Copy link
Member

@robscott robscott left a comment

Choose a reason for hiding this comment

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

Thanks @bharathbrat!

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jun 2, 2025
@ahg-g
Copy link
Contributor

ahg-g commented Jun 2, 2025

/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ahg-g, bharathbrat

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 Jun 2, 2025
@k8s-ci-robot k8s-ci-robot merged commit b54126f into kubernetes-sigs:main Jun 2, 2025
8 checks passed
irar2 pushed a commit to irar2/gateway-api-inference-extension that referenced this pull request Jun 3, 2025
…bernetes-sigs#880)

* Copy boilerplate.py from gateway-api

* Create boilerplate.generatego.txt

* Create boilerplate.go.txt

* Create boilerplate.py.txt

* Create boilerplate.sh.txt

* Create verify-boilerplate.sh

* Create verify-all.sh

* Create kube-env.sh

* Update Makefile to run static analysis that calls verify-all.sh which in turn calls verify-boilerplate.sh

* trim unrequired dirs and files from skipped list in boilerplate.py

* Fix definition of verify-all.sh in the Makefile

* Adding execute permissions for the verify-all and verify-boilerplate scripts

* Adding execute permissions for boilerplate.py

* Fixing all existing violations that boilerplate verification found initially

* Adding some files to ignore list because modifying their licenses causes some diff errors to show up when compared to .orig files

* Update boilerplate verification scripts license year to 2025

* Remove year from boilerplate template for update-codegen.sh

* Add bin/kube_codegen.sh to skipped files for boilerplate verification

* Switch go codegen to use boilerplate.generatego.txt and remove the old redundant source
shmuelk pushed a commit to shmuelk/gateway-api-inference-extension that referenced this pull request Jun 3, 2025
…bernetes-sigs#880)

* Copy boilerplate.py from gateway-api

* Create boilerplate.generatego.txt

* Create boilerplate.go.txt

* Create boilerplate.py.txt

* Create boilerplate.sh.txt

* Create verify-boilerplate.sh

* Create verify-all.sh

* Create kube-env.sh

* Update Makefile to run static analysis that calls verify-all.sh which in turn calls verify-boilerplate.sh

* trim unrequired dirs and files from skipped list in boilerplate.py

* Fix definition of verify-all.sh in the Makefile

* Adding execute permissions for the verify-all and verify-boilerplate scripts

* Adding execute permissions for boilerplate.py

* Fixing all existing violations that boilerplate verification found initially

* Adding some files to ignore list because modifying their licenses causes some diff errors to show up when compared to .orig files

* Update boilerplate verification scripts license year to 2025

* Remove year from boilerplate template for update-codegen.sh

* Add bin/kube_codegen.sh to skipped files for boilerplate verification

* Switch go codegen to use boilerplate.generatego.txt and remove the old redundant source
rlakhtakia pushed a commit to rlakhtakia/gateway-api-inference-extension that referenced this pull request Jun 11, 2025
…bernetes-sigs#880)

* Copy boilerplate.py from gateway-api

* Create boilerplate.generatego.txt

* Create boilerplate.go.txt

* Create boilerplate.py.txt

* Create boilerplate.sh.txt

* Create verify-boilerplate.sh

* Create verify-all.sh

* Create kube-env.sh

* Update Makefile to run static analysis that calls verify-all.sh which in turn calls verify-boilerplate.sh

* trim unrequired dirs and files from skipped list in boilerplate.py

* Fix definition of verify-all.sh in the Makefile

* Adding execute permissions for the verify-all and verify-boilerplate scripts

* Adding execute permissions for boilerplate.py

* Fixing all existing violations that boilerplate verification found initially

* Adding some files to ignore list because modifying their licenses causes some diff errors to show up when compared to .orig files

* Update boilerplate verification scripts license year to 2025

* Remove year from boilerplate template for update-codegen.sh

* Add bin/kube_codegen.sh to skipped files for boilerplate verification

* Switch go codegen to use boilerplate.generatego.txt and remove the old redundant source
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. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Boilerplate verification
5 participants