Skip to content

NO-JIRA: fix(ci): use PR base SHA for api-lint diff in GHA#8430

Merged
enxebre merged 1 commit intoopenshift:release-4.22from
bryan-cox:fix-lint-base-sha
May 6, 2026
Merged

NO-JIRA: fix(ci): use PR base SHA for api-lint diff in GHA#8430
enxebre merged 1 commit intoopenshift:release-4.22from
bryan-cox:fix-lint-base-sha

Conversation

@bryan-cox
Copy link
Copy Markdown
Member

Summary

Root cause

The api-lint target runs --new-from-rev=${PULL_BASE_SHA}. The Makefile defaults:

UPSTREAM_REMOTE ?= $(shell git remote -v | grep 'openshift/hypershift.*fetch' | head -1 | cut -f1)
PULL_BASE_SHA ?= $(if $(UPSTREAM_REMOTE),$(UPSTREAM_REMOTE)/main,main)

In GHA, UPSTREAM_REMOTE resolves to origin, so PULL_BASE_SHA becomes origin/main. For release-4.22 PRs, the diff sees divergent lines as "new" and flags them.

Test plan

  • This PR's own lint check should pass (it targets release-4.22, so api-lint will diff against the release-4.22 base SHA instead of origin/main)
  • Verify PRs targeting main still work (github.event.pull_request.base.sha resolves to main's HEAD for those PRs)

🤖 Generated with Claude Code

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>
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 5, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository YAML (base), Central YAML (inherited)

Review profile: CHILL

Plan: Enterprise

Run ID: bda105ce-9d6a-47f7-aee8-cb616b7904ea

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands and usage tips.

@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented May 5, 2026

[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

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

@openshift-ci openshift-ci Bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label May 5, 2026
@openshift-ci openshift-ci Bot requested review from devguyio and muraee May 5, 2026 20:52
@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented May 5, 2026

@bryan-cox: all tests passed!

Full PR test history. Your PR dashboard.

Details

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-sigs/prow repository. I understand the commands that are listed here.

@enxebre
Copy link
Copy Markdown
Member

enxebre commented May 6, 2026

/lgtm
/verified by tests @enxebre

@enxebre enxebre added the backport-risk-assessed Indicates a PR to a release branch has been evaluated and considered safe to accept. label May 6, 2026
@openshift-ci-robot openshift-ci-robot added the verified Signifies that the PR passed pre-merge verification criteria label May 6, 2026
@openshift-ci-robot
Copy link
Copy Markdown

@enxebre: This PR has been marked as verified by tests @enxebre.

Details

In response to this:

/lgtm
/verified by tests @enxebre

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.

@openshift-ci openshift-ci Bot added the lgtm Indicates that a PR is ready to be merged. label May 6, 2026
@enxebre enxebre added area/ci-tooling Indicates the PR includes changes for CI or tooling and removed lgtm Indicates that a PR is ready to be merged. labels May 6, 2026
@enxebre enxebre changed the title fix(ci): use PR base SHA for api-lint diff in GHA NO-JIRA: fix(ci): use PR base SHA for api-lint diff in GHA May 6, 2026
@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label May 6, 2026
@openshift-ci-robot
Copy link
Copy Markdown

@bryan-cox: This pull request explicitly references no jira issue.

Details

In response to this:

Summary

Root cause

The api-lint target runs --new-from-rev=${PULL_BASE_SHA}. The Makefile defaults:

UPSTREAM_REMOTE ?= $(shell git remote -v | grep 'openshift/hypershift.*fetch' | head -1 | cut -f1)
PULL_BASE_SHA ?= $(if $(UPSTREAM_REMOTE),$(UPSTREAM_REMOTE)/main,main)

In GHA, UPSTREAM_REMOTE resolves to origin, so PULL_BASE_SHA becomes origin/main. For release-4.22 PRs, the diff sees divergent lines as "new" and flags them.

Test plan

  • This PR's own lint check should pass (it targets release-4.22, so api-lint will diff against the release-4.22 base SHA instead of origin/main)
  • Verify PRs targeting main still work (github.event.pull_request.base.sha resolves to main's HEAD for those PRs)

🤖 Generated with Claude Code

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.

@enxebre
Copy link
Copy Markdown
Member

enxebre commented May 6, 2026

/lgtm

@openshift-ci openshift-ci Bot added the lgtm Indicates that a PR is ready to be merged. label May 6, 2026
@enxebre enxebre merged commit 807ebc5 into openshift:release-4.22 May 6, 2026
9 of 10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. area/ci-tooling Indicates the PR includes changes for CI or tooling backport-risk-assessed Indicates a PR to a release branch has been evaluated and considered safe to accept. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. lgtm Indicates that a PR is ready to be merged. verified Signifies that the PR passed pre-merge verification criteria

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants