validate-pr: accept context-only cherry-picks#479
Open
nirmoy wants to merge 2 commits into
Open
Conversation
Collaborator
Author
BaseOS Kernel ReviewSummaryThe validate-pr changes introduce two correctness regressions: exact patch-ID matches can now be rejected as MISMATCH when the merge-tree subprocess fails on transient git/environment errors, and valid cherry-picks of merge or root commits are unconditionally rejected. Both cause false CI failures on legitimate PRs. No issues in the self-tests commit. Findings: Critical: 0, High: 0, Medium: 2, Low: 0 Latest watcher review: open review Generated test plan: open test plan Kernel deb build: failed (failure log, build artifacts) Head: This comment is maintained by nv-pr-bot. It is updated when the GitHub watcher publishes a newer review. |
Stable patch IDs include context lines, so legitimate cherry-picks can differ when nearby lines change. Compare zero-context patch IDs, then replay the upstream commit onto the local parent with merge-tree and require the resulting tree to match the local commit. Replay ordinary patch-ID matches too so identical changes applied at a different occurrence are rejected.
Run focused black-box tests for exact and context-only cherry-picks, malformed Git output, wrong-location changes, object paths containing separators, and replay failures whenever validator files change. Pin third-party workflow actions to immutable commit SHAs.
397c7cd to
8ebd0ca
Compare
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
Root cause
NVIDIA/NV-Kernels#476 applies two independent upstream commits that touch adjacent lines. The second local commit therefore has different diff context even though its changed lines are identical to upstream, causing
git patch-id --stableto report a mismatch.Patch IDs also ignore hunk line numbers, so an equal patch ID alone cannot prove that a change was applied to the correct one of two byte-identical occurrences. Both equal and context-only candidates now replay the upstream change onto the local parent and require the resulting tree to exactly match the local commit.
The check remains fail-closed: changed content, relocation to another occurrence, replay conflicts or errors, malformed Git output, and unequal trees fail validation.
Validation
python3 .github/scripts/test_validate_pr.py -v— 12/12 passeddaccaf10eb077..50594a932608passed with:50594a932608:contextddc654b5fbd0:matchgit diff --checkpassedFork workflow replay
daccaf10eb077/50594a932608, matching upstream PR [26.04_linux-nvidia] Pull Request - vlan and log fixes to lan743x driver #47650594a932608=context;ddc654b5fbd0=match