-
Notifications
You must be signed in to change notification settings - Fork 36
Description
Summary
The CI failed on the main branch after merging Dependabot PR #11024. The lint-js job failed during npm ci due to a peer dependency conflict between vitest@4.0.17 and @vitest/coverage-v8@4.0.10.
Failure Details
- Run: 21215242496
- Commit:
5b3163cbe2cfba87d7d57d936aac7dc8c5f8c70c - Branch: main
- Trigger: push (after merging PR chore(deps-dev): bump vitest from 4.0.10 to 4.0.17 in /actions/setup/js #11024)
- Failed Job:
lint-js - Failed Step: Install npm dependencies
Root Cause Analysis
Dependabot updated only vitest from 4.0.10 to 4.0.17 but did not update the related packages that have peer dependencies on vitest:
{
"devDependencies": {
"@vitest/coverage-v8": "^4.0.10", // ❌ Still pinned to 4.0.10
"@vitest/ui": "^4.0.10", // ❌ Still pinned to 4.0.10
"vitest": "^4.0.17" // ✅ Updated to 4.0.17
}
}Error Message
npm error ERESOLVE could not resolve
npm error
npm error While resolving: @vitest/coverage-v8@4.0.10
npm error Found: vitest@4.0.17
npm error
npm error Could not resolve dependency:
npm error peer vitest@"4.0.10" from @vitest/coverage-v8@4.0.10
npm error
npm error Conflicting peer dependency: vitest@4.0.10
The @vitest/coverage-v8@4.0.10 package has a strict peer dependency on vitest@4.0.10, which conflicts with the updated vitest@4.0.17.
Reproduction
cd actions/setup/js
npm ci
# Error: ERESOLVE could not resolve peer dependencyRecommended Actions
Option 1: Update All Vitest Packages Together (Recommended)
Update all vitest-related packages to 4.0.17:
cd actions/setup/js
npm install --save-dev vitest@4.0.17 @vitest/coverage-v8@4.0.17 @vitest/ui@4.0.17Option 2: Use Caret (^) Version Ranges in package.json
Change from exact versions to caret ranges to allow compatible minor/patch updates:
{
"devDependencies": {
"@vitest/coverage-v8": "^4.0.17",
"@vitest/ui": "^4.0.17",
"vitest": "^4.0.17"
}
}Note: The package.json already uses ^4.0.10 for coverage and ui packages, but the lock file has them pinned. The solution is to update the lock file by running npm install with the updated versions.
Option 3: Configure Dependabot to Update Vitest Packages Together
Add a grouped update configuration in .github/dependabot.yml:
version: 2
updates:
- package-ecosystem: "npm"
directory: "/actions/setup/js"
groups:
vitest:
patterns:
- "vitest"
- "@vitest/*"This ensures Dependabot updates all vitest packages in a single PR.
Prevention Strategies
- Group Vitest Dependencies: Configure Dependabot to update vitest and all @vitest/* packages together
- Add Pre-merge CI Check: Ensure the
lint-jsjob runs before merging Dependabot PRs - Use Renovate Instead: Consider using Renovate which has better peer dependency handling
- Lock File Validation: Add a CI step to validate that
npm cisucceeds before merge
AI Team Self-Improvement
Add this to AGENTS.md for AI coding agents:
### Dependabot PR Review Guidelines
When reviewing Dependabot PRs that update npm packages:
1. **Check for peer dependencies**: If updating packages like `vitest`, ensure all related packages (`@vitest/coverage-v8`, `@vitest/ui`, etc.) are updated in the same PR
2. **Run `npm ci` locally**: Before approving, verify that `npm ci` succeeds in the affected directory
3. **Review package.json and package-lock.json together**: Ensure version ranges (^, ~) are consistent and lock file versions are compatible
4. **Group related updates**: For packages with peer dependencies, configure Dependabot groups or manually update all related packages together
**Example: Vitest ecosystem**
- When updating `vitest`, also update `@vitest/coverage-v8`, `@vitest/ui`, `@vitest/browser`, etc.
- These packages have strict peer dependencies and must stay in syncHistorical Context
This is a new type of failure - the first npm peer dependency conflict from Dependabot in the investigation history. Previous Dependabot-related issues have been about:
- JavaScript test failures ([CI Failure Doctor] JS Test Failures - 46 Tests Failing in CI Environment (Run #29542) #9965, [CI Failure Doctor] JS tests failed after PR #10421 merged - MCP Gateway format change broke tests #10428)
- TypeScript type errors ([CI Failure Doctor] TypeScript type error in handle_agent_failure.cjs - boolean passed to renderTemplate #10427)
- Go lint failures ([CI Failure Doctor] lint-go failure after merge of PR #10756 (compiler test files) #10772)
- Test framework issues ([CI Failure Doctor] CI Failure Doctor: close_older_issues.test.cjs uses Jest instead of Vitest #10895)
Impact
- Severity: HIGH - Blocks all CI runs on main branch
- Affected Jobs: All jobs cancelled after
lint-jsfailure - Time to Fix: 5-10 minutes (update package.json + run npm install)
Files to Modify
actions/setup/js/package.json- Update @vitest/* versionsactions/setup/js/package-lock.json- Will be regenerated by npm install.github/dependabot.yml- Add vitest dependency group (optional but recommended)
AI generated by CI Failure Doctor
To add this workflow in your repository, run
gh aw add githubnext/agentics/workflows/ci-doctor.md@ea350161ad5dcc9624cf510f134c6a9e39a6f94d. See usage guide.