Repository navigation
.github/workflows/check.yml: compute the checkpatch range from the merge base - #20696
Merged
Merged
Conversation
…rge base github.event.pull_request.base.sha is a cached value that GitHub updates asynchronously, so a synchronize event can carry the base SHA from when the PR was opened even after the branch was rebased onto the current base. The checked range then spans every commit that landed on the base branch since, and any commit there that fails checkpatch fails the PR. Compute the range from the merge base against the live base branch so only the PR commits are checked. Assisted-by: Claude Code Signed-off-by: raiden00pl <raiden00@railab.me>
casaroli
approved these changes
Oct 15, 2026
Contributor
|
yes, please |
Contributor
|
I tested this on #20640 stale merge commit and I can confirm this is a huge developer quality of life improvement. |
xiaoxiang781216
approved these changes
Oct 16, 2026
Contributor
|
@raiden00pl should we change apps too? |
cederom
approved these changes
Oct 16, 2026
cederom
left a comment
Contributor
There was a problem hiding this comment.
Thank you @raiden00pl :-)
We are loosing format fix for other places that way :-P
acassis
pushed a commit
to apache/nuttx-apps
that referenced
this pull request
Oct 16, 2026
…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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
github.event.pull_request.base.sha is a cached value that GitHub updates asynchronously, so a synchronize event can carry the base SHA from when the PR was opened even after the branch was rebased onto the current base. The checked range then spans every commit that landed on the base branch since, and any commit there that fails checkpatch fails the PR.
Compute the range from the merge base against the live base branch so only the PR commits are checked.
Impact
try to fix broken CI: https://github.com/apache/nuttx/actions/runs/38791720234/job/116617691575#step:3:253
Testing
none