Skip to content

.github/workflows/check.yml: Compute the checkpatch range from the merge base. - #3854

Merged
acassis merged 1 commit into
apache:masterfrom
casaroli:ci-check-merge-base
Oct 16, 2026
Merged

acassis merged 1 commit into
apache:masterfrom
casaroli:ci-check-merge-base

Conversation

@casaroli

Copy link
Copy Markdown
Contributor

Summary

The check job runs checkpatch on github.event.pull_request.base.sha..HEAD. HEAD is the merge commit that GitHub made for the pull request, and that merge commit can be on an older base than base.sha. checkpatch diffs the two endpoints, so every change on master since that older base looks like a change of the pull request, and old style errors in those files fail the check.

This happened on apache/nuttx#20640: its merge commit was on an old master, and check failed with nxstyle errors in three files that the PR does not touch.

This PR fetches the base branch and checks from the merge base of the base branch and HEAD. It is the same change as apache/nuttx#20696.

Impact

CI only. The check job checks only the commits and files of the pull request.

Testing

Simulated with apps PR #3846 (fork point 7e03b98, master 12 commits ahead). I made a merge commit of its head on an older master (467e220), with base.sha = master b1a17ba:

  • Old range: 11 files (10 of them changed on master, not by the PR) and one commit.
  • New range: only .github/workflows/build.yml and the same commit, which is the PR's own change.

With a merge commit on the current base, both ranges are the same.

tools/checkpatch.sh -c -u -m -g passes.

…rge base.

The check job checked github.event.pull_request.base.sha..HEAD. HEAD is
the merge commit that GitHub made for the pull request, and that merge
commit can be on an older base than base.sha. checkpatch then diffs the
two endpoints, so every change on master since that older base looks
like a change of the pull request. Old files in that range fail the
check.

Fetch the base branch and check from the merge base of the base branch
and HEAD. This is the same change as apache/nuttx#20696.

Assisted-by: Claude Code:claude-opus-5-5
Signed-off-by: Marco Casaroli <marco.casaroli@gmail.com>

@cederom cederom left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @casaroli :-)

We are loosing format fix for other places that way :-P

@acassis
acassis merged commit 04d8bd5 into apache:master Oct 16, 2026
73 of 79 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants