Repository navigation
evetest-pr: compute the PR diff with git, not the API - #7012
Conversation
`gh pr diff` fails with HTTP 406 for a PR touching more than 300 files, which a vendor bump easily exceeds (e.g. PR lf-edge#5644). discover-suites then failed before any suite was scheduled, so evetest never ran for such PRs even though "Ready for evetest" was reported. Check out the PR head from the upstream repo with actions/checkout, blobless and with the full history of every branch (about 20 MB), and diff it against its merge-base with the base branch. Vendored code is left out of the diff; instead, the vendored modules added, removed or bumped are read from vendor/modules.txt and listed in pr-context.txt. If fetching or diffing fails, Claude is not asked for a skip decision and the run falls back to the full suite instead of failing. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Milan Lenco <milan@zededa.com>
|
Claude finished @eriknordmark's task in 3m 20s —— View job ReviewI reviewed the switch from
Verified correct:
One non-blocking nit (posted inline): the per-module-tree header is derived from the No correctness, security, or performance blockers. LGTM. |
| git -C "$src" diff "$mb" HEAD -- . ":(glob,exclude)**/vendor/**" > "$out/pr.diff" | ||
| # Vendored modules added, removed or bumped, from vendor/modules.txt. | ||
| vendored=$(git -C "$src" diff --unified=0 "$mb" HEAD -- ':(glob)**/vendor/modules.txt' \ | ||
| | sed -nE -e 's#^\+\+\+ b/(.*)/modules\.txt$#\n\1:#p' -e 's#^([-+])\# (.*)$# \1 \2#p') |
There was a problem hiding this comment.
Minor / non-blocking: the dir header is derived only from the +++ b/.../modules.txt line. If an entire vendored tree is removed in the PR, that line is +++ /dev/null, so no dir: header is emitted and the - github.com/... module lines get attributed to the previous module's section (or to none). Newly-added and bumped modules.txt are fine — only the whole-dir-deletion case is affected. Since this only feeds an advisory summary (and the skip heuristic is backed by the nightly full-suite net), it's cosmetic, not a correctness problem for the gating.
Description
gh pr difffails with HTTP 406 ("the diff exceeded the maximum number of files (300)") for a PR touching more than 300 files, which a vendor bump easily exceeds. The "Fetch the PR diff" step ofdiscover-suitesinevetest-pr.ymlthen failed before any suite was scheduled, so evetest never ran for such PRs even though "Ready for evetest" was reported. This is what happened to #5644, both after its approval and after a/evetestcomment.This PR:
refs/pull/<n>/head) from the upstream repo withactions/checkout, blobless (filter: blob:none), with the full history of every branch (about 20 MB) and a sparse working tree. The PR is diffed against its merge-base with the base branch.**/vendor/**) out ofpr.diff. The vendored modules added, removed or bumped are read fromvendor/modules.txtand listed at the end ofpr-context.txt, and the Claude prompt says so.continue-on-error, and Claude is only asked when the diff step succeeded. Previously the whole job failed and nothing ran.How to test and validate this PR
Not covered by an automated test. Validated locally by reproducing what the checkout action fetches for #5644 (all branches plus
refs/pull/5644/head, blobless, sparse) and running the new diff step on it:pr.diffhas 47 files (go.mod/go.sum included) and no vendored file, where the API refused the diffpr-context.txtholds the PR title, description, commit messages and the vendored module changes of edgeview, kube-init, newlog and wwan/mmagent with their versionsactionlintpasses.To validate in CI: once merged, comment
/eveteston #5644 (or any PR touching more than 300 files).discover-suitesshould get past "Fetch the PR diff", Claude should post its skip decision, and the suites should be scheduled.Changelog notes
None. CI-only change.
PR Backports
Checklist
I've provided a proper description
I've added the proper documentation
I've tested my PR on amd64 device
I've tested my PR on arm64 device
I've written the test verification instructions
I've set the proper labels to this PR
I've checked the boxes above, or I've provided a good reason why I didn't check them. This is a CI workflow change: no documentation or device testing applies. The diff step was tested locally against pubsub: send messages as frames over unix stream sockets #5644.
🤖 Generated with Claude Code