-
Notifications
You must be signed in to change notification settings - Fork 1
Add script to validate upstream references in PR branch commits #22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
19700ef
to
2198c68
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is Great maybe just some cleanups
c87fea4
to
1144d0b
Compare
So this might be a problem with vibe coding, or maybe more specifically with me vibe coding. The git cat-file method for verifying upstream commits exist was not actually working in what I checked in. Not sure how I got to that point because the script was definitely able to find bogus commits at one point. In the current version that function is now using git merge-base --is-ancestor which seems to work and is perhaps easier to reason about by the casual observer anyway. 🤷♂️ |
Just so its clear. The code is working as is. So review away. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds a Python script to validate upstream Linux kernel commit references in PR branch commits. The script checks if referenced commits exist in mainline and reports any that have been marked with Fixes: tags.
- Adds
check_kernel_commits.py
with functionality to parse PR commits, validate upstream references, and detect fixes - Supports both terminal and markdown output formats for GitHub PR integration
- Includes comprehensive error handling and reference validation
This script scans each commit in a PR branch for upstream Linux kernel commit references and validates those references. If a commit references an upstream commit, the script checks that the referenced commit exists in mainline and reports if it has been marked with a Fixes: tag in the upstream kernel. Usage: python3 check_kernel_commits.py --repo path --pr_branch branch_name --base_branch branch_name [--markdown] By default, the script outputs results for terminal display. Use the --markdown flag to format output for GitHub PR comments.
1144d0b
to
6300ec6
Compare
Just force pushed to incorporate some improvements suggested by copilot |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for all the updates.
We can improve it later if needed
This script scans each commit in a PR branch for upstream Linux kernel commit references and validates those references. If a commit references an upstream commit, the script checks that the referenced commit exists in mainline and reports if it has been marked with a Fixes: tag in the upstream kernel.
Usage:
python3 check_kernel_commits.py --repo path --pr_branch branch_name --base_branch branch_name [--markdown]
By default, the script outputs results for terminal display. Use the --markdown flag to format output for GitHub PR comments.
This kernel-src-tree PR ctrliq/kernel-src-tree#323 includes a github action that uses this script to comment on the PR. There is a lot of messy history in the PR due to testing, but the interesting thing to look at is the github action ctrliq/kernel-src-tree@b82196f and the comment that the github actions bot made flagging the bogus upstream commit reference and available upstream fixes