Tighten Dependabot auto-fix prompt: truthful counts, minimal diffs#1562
Merged
priyanshu92 merged 1 commit intomainfrom Apr 23, 2026
Merged
Conversation
Observed on the first run (PR #1559): - The PR body claimed "33+ open Dependabot alerts (32 moderate, 1 high)" but the Dependabot API only had ONE open alert (uuid, #172). The inflated count appears to have come from counting transitive `node_modules/**/uuid` occurrences in package-lock.json rather than distinct alert records. - The agent ran `npm audit fix`, which dragged along unrelated version bumps: brace-expansion and path-to-regexp (whose alerts had been auto-dismissed weeks earlier) and ~20 @fluidframework/* packages from 2.91.0 to 2.93.0. The diff ballooned well beyond what the single open alert required. Prompt changes: 1. Alert enumeration is the single source of truth. The agent must run a specific `gh api` query, persist the output to alerts.json, and build the PR title/body one-to-one from that list. It must not count transitive-path occurrences as separate alerts. 2. Preference order for fixes. (a) overrides in package.json, (b) direct-dependency bump, (c) parent-package bump only if (a)/(b) are infeasible, with justification required. `npm audit fix` is explicitly forbidden. 3. Diff discipline. After regenerating the lockfile, run `git diff --stat origin/main` and abort if package.json touches deps not on the alert list (other than adding overrides), or if any bump crosses a MAJOR version unnecessarily. 4. Structured PR body. Title is `chore(deps): fix N open Dependabot alert(s)` where N matches the alert count. Body has fixed sections: Summary, Alerts addressed (one bullet per alert with strategy noted), Collateral changes (or "None"), Verification. 5. Reaffirm no Co-authored-by trailers (these caused CLA friction on the first run).
amitjoshi438
approved these changes
Apr 23, 2026
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.
Context
The first scheduled run of the Dependabot auto-fix workflow (PR #1559) revealed two prompt-level problems:
Changes to the prompt in
.github/workflows/dependabot-autofix.ymlgh apiquery, persists the output toalerts.json, and builds the PR title + body 1-for-1 from that list. It is forbidden from treating transitive-path occurrences as separate alerts.overridesinpackage.json, (b) direct-dependency bump, (c) parent-package bump only if (a)/(b) are infeasible, and only with a justification in the PR body.npm audit fix/npm audit fix --forceare explicitly forbidden.git diff --stat origin/mainand aborts ifpackage.jsontouches deps not on the alert list (other than adding overrides), or if any dep crosses a MAJOR version unnecessarily.chore(deps): fix N open Dependabot alert(s)where N matches the alert count. Body has fixed sections: Summary, Alerts addressed (one bullet per alert with the chosen strategy), Collateral changes (or"None"), Verification.Co-authored-by:trailers (these caused CLA friction on the first run when the bot`s identity was added as a co-author).Test plan
After merge, trigger the workflow manually via
workflow_dispatchand check:gh api repos/microsoft/powerplatform-vscode/dependabot/alerts?state=open | jq length.git diff --statonly touches files/packages listed in the alert set, plus justified collateral.