ci: allow overriding APIDiff with apidiff-override label#5690
ci: allow overriding APIDiff with apidiff-override label#5690isumitsolanki wants to merge 1 commit into
Conversation
Signed-off-by: Sumit Solanki <sumit.solanki@ibm.com>
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: isumitsolanki The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
Welcome @isumitsolanki! |
|
Hi @isumitsolanki. 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 Regular contributors should join the org to skip this step. Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions 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. |
| uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0 | ||
| with: | ||
| go-version-file: go.mod | ||
| # When go-apidiff fails, maintainers may add label apidiff-override to accept intentional API changes (fork PRs use GitHub Actions; same-repo PRs use Prow). |
There was a problem hiding this comment.
The check here is not go-apidfiff
We must ajust it for our check
Could you please check it out?
| go-version-file: go.mod | ||
| # When go-apidiff fails, maintainers may add label apidiff-override to accept intentional API changes (fork PRs use GitHub Actions; same-repo PRs use Prow). | ||
| - name: Execute go-apidiff | ||
| id: go-apidiff |
Description
The fork-only APIDiff workflow (
.github/workflows/apidiff.yml) still runsjoelanford/go-apidiffas before, but the step now usescontinue-on-errorwith idgo-apidiff. A new step Require clean API diff or override label runs when that step fails: it uses the GitHub CLI andGITHUB_TOKENto list the PR’s labels and passes the job only if the labelapidiff-overrideis present; otherwise it fails with a clear error message. The job gainspull-requests: readso token permissions are sufficient to read labels.Motivation
For pull requests from forks, API compatibility is enforced by GitHub Actions, while Prow handles checks for PRs from the main repo. That split meant there was no supported maintainer escape hatch when
go-apidifffailed but an incompatible API change was intentional and already reviewed. Adding a label-based override matches the pattern used in other projects (e.g. API diff jobs that allow a dedicated override label) and keeps the default behavior strict unless a maintainer explicitly approves the exception.Issue
Fixes #5655