ci: replace dependabot auto-vet bot commit with patch artifact#2467
ci: replace dependabot auto-vet bot commit with patch artifact#2467bronzelle-cw wants to merge 4 commits intomainfrom
Conversation
bronzelle-cw
commented
Mar 10, 2026
- What changed:
- Replaced bot commit/push flow with patch generation and artifact upload.
- Updated PR comment to explain how authors apply the patch locally.
- Why:
- Keeps final commit ownership and signing with the PR author.
- Reduces workflow complexity compared with a review-suggestion engine.
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Explore these optional code suggestions:
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2467 +/- ##
==========================================
+ Coverage 84.26% 84.34% +0.07%
==========================================
Files 141 141
Lines 10826 10826
==========================================
+ Hits 9123 9131 +8
+ Misses 1703 1695 -8 Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Follow-up
✅ unzip -p path fixed — the fallback block now correctly references vet/auto-vet.patch inside the zip. Good catch addressed.
Two issues remain: the -S GPG signing flag (flagged last round, still present in both blocks), and a new path bug in the gh run download block that will make git apply fail for anyone who uses the preferred flow.
There was a problem hiding this comment.
Follow-up
✅ unzip -p path fixed — fallback block now correctly references vet/auto-vet.patch inside the zip. Good.
Three issues remain (two carried over, one new):
- New bug:
mkdir -p vetis missing before thegit diff … > "$patch_path"redirect — if thevet/directory doesn't already exist the shell will immediately error with No such file or directory and the patch step will exit 1 silently discarding the diff. - Carried over:
git apply --index auto-vet.patchin thegh run downloadblock still references the wrong path. - Carried over:
-S(GPG signing) in both commit blocks will silently fail or error for developers without a signing key configured.
| echo "changed=true" >> "$GITHUB_OUTPUT" | ||
| echo "sha=$sha" >> "$GITHUB_OUTPUT" | ||
| echo "pushed=true" >> "$GITHUB_OUTPUT" | ||
| git diff --binary --patch -- supply-chain > "$patch_path" |
There was a problem hiding this comment.
mkdir -p vet still missing (flagged in previous review).
patch_path is set to vet/auto-vet.patch but the vet/ directory is never created. The shell redirect will fail with No such file or directory on a clean runner where vet/ doesn't already exist. Fix:
mkdir -p vet
git diff --binary --patch -- supply-chain > "$patch_path"| lines.push('```bash'); | ||
| lines.push('git checkout <pr-branch>'); | ||
| lines.push(`gh run download ${runId} -n ${artifactName}`); | ||
| lines.push(`git apply --index auto-vet.patch`); |
There was a problem hiding this comment.
Bug (carried over): wrong apply path after gh run download.
gh run download <run-id> -n <artifact-name> creates <artifactName>/ and preserves the uploaded directory structure inside it. Because the file was uploaded from vet/auto-vet.patch, it lands at <artifactName>/vet/auto-vet.patch — not auto-vet.patch. This instruction will fail with error: can't open patch file auto-vet.patch for anyone using the preferred CLI flow.
Fix:
git apply --index ${artifactName}/vet/auto-vet.patch| lines.push(`gh run download ${runId} -n ${artifactName}`); | ||
| lines.push(`git apply --index auto-vet.patch`); | ||
| lines.push('git status'); | ||
| lines.push('git commit -S -m "chore(vet): apply automated audits"'); |
There was a problem hiding this comment.
-S still requires a GPG key (flagged in first review, present in both blocks).
git commit -S (uppercase) is GPG commit signing — it fails or produces an unverified commit for developers without a signing key configured. Use lowercase -s (DCO/Signed-off-by trailer) if a traceable attribution line is wanted, or drop the flag and let the developer sign per their own setup. Same issue at the fallback block (~line 524).
carneiro-cw
left a comment
There was a problem hiding this comment.
I tried running the action on the branch test_vet_2 multiple times, and it neither generated artifact nor it commented on the PR. https://github.com/cloudwalk/stratus/actions/runs/23492063861/job/68362706808