feat: add reusable verify-boilerplate composite action - #1070
Conversation
Signed-off-by: Prachi01Yadav <archeyyadav111@gmail.com>
|
@Prachi01Yadav please check the nit comments, rest looks good to me. cc @tariq-hasan for review |
Signed-off-by: Prachi01Yadav <archeyyadav111@gmail.com>
tariq-hasan
left a comment
There was a problem hiding this comment.
I've just had a few additional comments. Overall lgtm. Thanks.
Co-authored-by: Tariq Hasan <mmtariquehsn@gmail.com> Signed-off-by: Prachi Yadav <archeyyadav111@gmail.com>
Co-authored-by: Tariq Hasan <mmtariquehsn@gmail.com> Signed-off-by: Prachi Yadav <archeyyadav111@gmail.com>
Signed-off-by: Prachi01Yadav <archeyyadav111@gmail.com>
@tariq-hasan Thanks for the review! I've applied all your suggestions (removed the checkout/cleanup steps and simplified the fallback). Let me know if everything looks good now! |
tariq-hasan
left a comment
There was a problem hiding this comment.
Hi @Prachi01Yadav! I have added some further comments to help refine the first iteration and make it more robust.
Co-authored-by: Tariq Hasan <mmtariquehsn@gmail.com> Signed-off-by: Prachi Yadav <archeyyadav111@gmail.com>
Co-authored-by: Tariq Hasan <mmtariquehsn@gmail.com> Signed-off-by: Prachi Yadav <archeyyadav111@gmail.com>
Co-authored-by: Tariq Hasan <mmtariquehsn@gmail.com> Signed-off-by: Prachi Yadav <archeyyadav111@gmail.com>
Co-authored-by: Tariq Hasan <mmtariquehsn@gmail.com> Signed-off-by: Prachi Yadav <archeyyadav111@gmail.com>
Co-authored-by: Tariq Hasan <mmtariquehsn@gmail.com> Signed-off-by: Prachi Yadav <archeyyadav111@gmail.com>
Co-authored-by: Tariq Hasan <mmtariquehsn@gmail.com> Signed-off-by: Prachi Yadav <archeyyadav111@gmail.com>
Co-authored-by: Tariq Hasan <mmtariquehsn@gmail.com> Signed-off-by: Prachi Yadav <archeyyadav111@gmail.com>
|
Thanks @Prachi01Yadav! |
|
Depending on preference we can self-test this composite action directly on this testing repo (perhaps something like |
let's just test it directly in kubeflow/sdk#765, I can update that PR to use this action as soon as this is merged.. let me know if that sounds good to you |
There was a problem hiding this comment.
🟡 Changes recommended
Documented input names do not match the action’s implementation, causing caller values to be ignored.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Adds a reusable composite GitHub Action for enforcing Apache 2.0 boilerplate headers.
Changes:
- Configures Python and runs the shared boilerplate checker.
- Supports base-reference, template-directory, and repository-root inputs.
File summaries
| File | Review |
|---|---|
.github/actions/verify-boilerplate/action.yml |
Two moderate issues (2 votes each): rename base-reference to documented base-ref, and boilerplate-directory to boilerplate-dir, including all references. |
Review details
Suppressed comments (1)
.github/actions/verify-boilerplate/action.yml:111
setup-pythonputs the cross-platformpythonexecutable onPATH, whereas apython3executable is not guaranteed on Windows. Since this composite action has no runner-OS restriction, it can fail after successfully setting up Python on Windows runners. Invokepythonhere so the configured interpreter is used on every supported runner.
python3 "${script}" \
- Files reviewed: 1/1 changed files
- Comments generated: 2
- Review effort level: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| fetch-depth: 0 so the base branch can be resolved. | ||
|
|
||
| inputs: | ||
| base-reference: |
There was a problem hiding this comment.
I've created a separate issue to track this gap - #1074 - so we can move forward with this PR in the meantime.
| added files; all files are checked for header match regardless. | ||
| required: false | ||
| default: "" | ||
| boilerplate-directory: |
|
Thanks for the contribution @Prachi01Yadav! |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: tariq-hasan The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Fixes #1069
What this PR does
Adds a reusable composite GitHub Action at
.github/actions/verify-boilerplate/that wraps the existinghack/boilerplate/boilerplate.pyscript, so Kubeflow subprojects can enforce Apache 2.0 copyright headers without vendoring the script.Requirements checklist
hack/boilerplate/boilerplate.py— script is sourced directly fromkubeflow/testingviaactions/checkoutwith sparse-checkout, so callers never vendor it.base-refinput defaults to the PR base branch (github.base_ref), so only changed/new files are flagged for year-less header enforcement.boilerplate-dirinput lets repos with custom templates point to their own directory. Defaults tokubeflow/testing's templates.setup-pythonstep (default3.12) so callers don't need to add one.Usage
Callers can use this action in their workflows like:
Context