Skip to content

chore: add boilerplate enforcement - #568

Closed
Ashvatthaa wants to merge 1 commit into
kubeflow:mainfrom
Ashvatthaa:chore/boilerplate-enforcement
Closed

Ashvatthaa wants to merge 1 commit into
kubeflow:mainfrom
Ashvatthaa:chore/boilerplate-enforcement

Conversation

@Ashvatthaa

@Ashvatthaa Ashvatthaa commented Jul 7, 2026 •

Copy link
Copy Markdown

Summary

This PR standardizes the repository's Apache 2.0 copyright boilerplate and adds automated boilerplate verification to ensure consistent copyright headers across the codebase.

Related Issue: Issue #566

Fixes #566

What changed

  • Added a local boilerplate verification script under hack/boilerplate/.
  • Added canonical Apache 2.0 boilerplate templates for Python, Shell, and Go source files.
  • Integrated boilerplate verification into the CI workflow using GitHub Actions.
  • Standardized existing copyright headers across the repository to follow the project's current Apache 2.0 convention.

Validation

  • python hack/boilerplate/boilerplate.py --base-ref main
  • python -m pytest .github/scripts/test_scripts.py -v
  • python -m py_compile on the modified Python files
  • git diff --check

Copilot AI review requested due to automatic review settings July 7, 2026 08:07
@google-oss-prow
google-oss-prow Bot requested review from fege and szaher July 7, 2026 08:07
@google-oss-prow

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

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

The full list of commands accepted by this bot can be found 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

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@github-actions

github-actions Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

🎉 Welcome to the Kubeflow SDK! 🎉

Thanks for opening your first PR! We're happy to have you as part of our community 🚀

Here's what happens next:

  • If you haven't already, please check out our Contributing Guide for repo-specific guidelines and the Kubeflow Contributor Guide for general community standards
  • Our team will review your PR soon! cc @kubeflow/kubeflow-sdk-team

Join the community:

Feel free to ask questions in the comments if you need any help or clarification!
Thanks again for contributing to Kubeflow! 🙏

Signed-off-by: Ashvatthaa <ashvatthaaj@gmail.com>
@Ashvatthaa
Ashvatthaa force-pushed the chore/boilerplate-enforcement branch from ea45214 to 384de33 Compare July 7, 2026 08:45
@Ashvatthaa

Copy link
Copy Markdown
Author

@Electronic-Waste Hi , I've addressed the requested changes and updated my PR. All required changes from my side have been completed. The remaining workflows are awaiting maintainer approval. I'd appreciate it if you could review the PR and approve the workflows as soon as possible. Thank you!

Comment thread Makefile
Comment on lines +157 to +158
verify-boilerplate: ## Verify copyright boilerplate headers in source files.
@python3 hack/boilerplate/boilerplate.py --base-ref "$${TARGET_BRANCH:-main}"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for this work @Ashvatthaa!
Can we re-use @tariq-hasan's script instead of copying it in Kubeflow SDK?
https://github.com/kubeflow/trainer/blob/master/hack/boilerplate/boilerplate.py

Ideally, we need to move those scripts to the common repo.
cc @nsingla

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Sure, that make the work simple

@tariq-hasan

Copy link
Copy Markdown
Member

Hi @Ashvatthaa! Have you been able to address the comments?

I am happy to pick up the work and get it completed.

@andreyvelich

Copy link
Copy Markdown
Member

@tariq-hasan Please can you help to finalize this PR, so we validate the boilerplate?

@Ashvatthaa

Copy link
Copy Markdown
Author

Hi @tariq-hasan and @andreyvelich,

Thanks for the feedback. I looked into the Trainer implementation and noticed it has diverged significantly from the SDK version.

Before I make further changes, could you clarify whether you'd prefer:

adapting the Trainer boilerplate.py into the SDK repository, or
moving toward a shared/common implementation as mentioned in the review?

I'm happy to update the PR in whichever direction you recommend.

@andreyvelich

Copy link
Copy Markdown
Member

adapting the Trainer boilerplate.py into the SDK repository, or
moving toward a shared/common implementation as mentioned in the review?

@Ashvatthaa Let's try to use Trainer as a baseline script to verify SDK boilerplates.
@tariq-hasan did many updates to ensure we appropriately validate the YEAR.
Eventually, we can merge these scripts to the common repo.

@andreyvelich

Copy link
Copy Markdown
Member

@Ashvatthaa Are you still working on this issue?
We migrated the script here: https://github.com/kubeflow/testing/tree/master/hack/boilerplate

@andreyvelich

Copy link
Copy Markdown
Member

@Ashvatthaa Given that we migrated @tariq-hasan's script to this common repo, can you update your PR to re-use it please?
https://github.com/kubeflow/testing/tree/master/hack/boilerplate

@andreyvelich

Copy link
Copy Markdown
Member

Resolved in: #765 (review)
/close

@google-oss-prow google-oss-prow Bot closed this Oct 2, 2026
@google-oss-prow

Copy link
Copy Markdown
Contributor

@andreyvelich: Closed this PR.

Details

In response to this:

Resolved in: #765 (review)
/close

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/test-infra repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Standardize copyright boilerplate and enforce with CI workflow

4 participants