Why we need it?
Every Kubeflow repo needs the same Apache 2.0 header check, and right now each one vendors its own copy of boilerplate.py from this repo. That copy immediately drifts — each repo runs its own ruff/lint config over it, so the "downloaded from kubeflow/testing @ " comment stops being verifiable the moment the file lands.
Creating this issue to add a reusable composite action (.github/actions/verify-boilerplate) that runs the boilerplate check against a repo's changed files, so repos can call it directly instead of vendoring and maintaining a divergent script.
Already vendored / being vendored in:
Source of truth: hack/boilerplate/boilerplate.py in this repo.
Requirement
- Composite action wrapping
hack/boilerplate/boilerplate.py, with the script sourced
from this repo so callers never vendor it.
- Input for the base ref to diff against, defaulting to the PR base branch
(github.base_ref), so only changed/new files are checked.
- Input for the boilerplate template directory, for repos that keep custom templates.
- Sets up Python itself so callers don't each add a
setup-python step.
- Non-zero exit with the existing remediation output on failure.
Why we need it?
Every Kubeflow repo needs the same Apache 2.0 header check, and right now each one vendors its own copy of
boilerplate.pyfrom this repo. That copy immediately drifts — each repo runs its own ruff/lint config over it, so the "downloaded from kubeflow/testing @ " comment stops being verifiable the moment the file lands.Creating this issue to add a reusable composite action (
.github/actions/verify-boilerplate) that runs the boilerplate check against a repo's changed files, so repos can call it directly instead of vendoring and maintaining a divergent script.Already vendored / being vendored in:
trainerhttps://github.com/kubeflow/trainer/blob/master/hack/boilerplate/boilerplate.pysdk— in review as part of kubeflow/sdk#765 (tracking kubeflow/sdk#566)mcp-server— planning to adopt once this action existsSource of truth:
hack/boilerplate/boilerplate.pyin this repo.Requirement
hack/boilerplate/boilerplate.py, with the script sourcedfrom this repo so callers never vendor it.
(
github.base_ref), so only changed/new files are checked.setup-pythonstep.