Skip to content

fix: don't silently skip an optional dependency if if fails trust policy check - #10211

Merged
zkochan merged 2 commits into
mainfrom
fix/10208
Nov 20, 2025
Merged

zkochan merged 2 commits into
mainfrom
fix/10208

Conversation

@zkochan

@zkochan zkochan commented Nov 20, 2025

Copy link
Copy Markdown
Member

close #10208

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes an issue where optional dependencies that fail trust policy checks were being silently skipped. The fix ensures that trust policy violations cause installation to fail regardless of whether the dependency is marked as optional.

Key Changes

  • Modified the error handling logic to prevent skipping optional dependencies when a trust downgrade error occurs
  • Added a test case to verify that installation fails with the appropriate error when an optional dependency violates the trust policy
  • Updated @pnpm/registry-mock from version 5.1.0 to 5.2.0 to support the new test scenario

Reviewed Changes

Copilot reviewed 4 out of 5 changed files in this pull request and generated no comments.

Show a summary per file
File Description
pkg-manager/resolve-dependencies/src/resolveDependencies.ts Added condition to check if error is a trust downgrade before skipping optional dependencies
pnpm/test/install/misc.ts Added test case to verify trust policy failure with optional dependencies
pnpm-workspace.yaml Updated registry-mock version in catalog to 5.2.0
pnpm-lock.yaml Updated all references to registry-mock and related dependencies to match new versions
.changeset/open-animals-speak.md Added changeset documenting the bug fix
Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@zkochan
zkochan merged commit 83fe533 into main Nov 20, 2025
@zkochan
zkochan deleted the fix/10208 branch November 20, 2025 11:51
zkochan added a commit that referenced this pull request Nov 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Some optional dependencies on 3rd level of dependency tree are uninstalled with trustPolicy: no-downgrade

2 participants