NO-JIRA: fix(ci): use PR base SHA for api-lint diff in GHA#8430
NO-JIRA: fix(ci): use PR base SHA for api-lint diff in GHA#8430enxebre merged 1 commit intoopenshift:release-4.22from
Conversation
The api-lint Makefile target uses --new-from-rev=${PULL_BASE_SHA} to
only report issues on lines changed by the PR. When PULL_BASE_SHA is
not set, the Makefile defaults to origin/main.
For PRs targeting release branches, this causes the linter to diff
against main instead of the target branch, flagging pre-existing
divergences as new issues. This broke all release-4.22 PRs after
PR openshift#8166 changed AutoNode/Karpenter fields on main.
Set PULL_BASE_SHA to the PR's actual base commit SHA, matching the
pattern already used by the gitlint workflow.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository YAML (base), Central YAML (inherited) Review profile: CHILL Plan: Enterprise Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: bryan-cox 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 |
|
@bryan-cox: all tests passed! Full PR test history. Your PR dashboard. 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. I understand the commands that are listed here. |
|
/lgtm |
|
@enxebre: This PR has been marked as verified by DetailsIn response to this:
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 openshift-eng/jira-lifecycle-plugin repository. |
|
@bryan-cox: This pull request explicitly references no jira issue. DetailsIn response to this:
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 openshift-eng/jira-lifecycle-plugin repository. |
|
/lgtm |
Summary
PULL_BASE_SHAtogithub.event.pull_request.base.shain the lint GHA workflow, matching the pattern already used bygitlint.yamlPULL_BASE_SHAtoorigin/main, causingapi-lintto diff release-4.22 PRs against main instead of the target branchRoot cause
The
api-linttarget runs--new-from-rev=${PULL_BASE_SHA}. The Makefile defaults:In GHA,
UPSTREAM_REMOTEresolves toorigin, soPULL_BASE_SHAbecomesorigin/main. For release-4.22 PRs, the diff sees divergent lines as "new" and flags them.Test plan
🤖 Generated with Claude Code