Skip to content

Stop claiming a machine scope and a package index Pip never resolved - #5466

Merged
Gabriel Dufresne (GabrielDuf) merged 1 commit into
mainfrom
fix/5437-pip-broker-scope-and-source
Oct 2, 2026
Merged

Gabriel Dufresne (GabrielDuf) merged 1 commit into
mainfrom
fix/5437-pip-broker-scope-and-source

Conversation

@GabrielDuf

Copy link
Copy Markdown
Contributor

This pull request updates the BrokerRequestBuilder logic to better handle the specifics of the Pip package manager, especially regarding installation scope and source URL handling. It also adds comprehensive tests to ensure correct behavior for Pip and other managers.

Key changes:

BrokerRequestBuilder logic improvements

  • Updated MapScope to accept the manager parameter and return null for Scope.Machine if the manager is Pip, as Pip does not distinguish system-wide installs. This prevents incorrectly setting the scope for Pip requests. [1] [2]
  • Modified logic so that the source URL is omitted for Pip packages, keeping only the source name, since Pip does not use source URLs in the same way as other managers. [1] [2]

Test coverage enhancements

  • Added multiple tests to verify that machine scope is omitted for Pip, user scope is preserved, and source URL is only included for managers that support it.
  • Added integration-style tests using a mock broker client to ensure that Pip requests with machine scope do not fail capability checks and are allowed by the broker.

Test utilities

  • Added a helper to build Pip package test instances and a mock transport for simulating broker responses in Pip-related tests. [1] [2]

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.

Copilot review overview

🟢 Approval recommended

The focused mapping changes are consistent with Pip behavior and are adequately covered by tests.

Review effort: Balanced
Findings: None

What changed in this PR

Updates broker request mapping to reflect Pip’s scope and source semantics.

Changes:

  • Omits Pip machine/global scope and source URLs from broker requests.
  • Preserves Pip user scope and other managers’ existing behavior.
  • Adds unit and broker capability-validation tests.
File Description
src/​UniGetUI.PackageEngine.AgentBroker/​BrokerRequestBuilder.cs Adds Pip-specific scope and source URL mapping.
src/​UniGetUI.PackageEngine.Tests/​BrokerRequestBuilderTests.cs Covers request mapping and broker capability checks.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@randy-but-a-ro randy-but-a-ro Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🤖 Pull request was approved automatically: the AI review is complete and all its review threads are resolved. 🎉

Integration Details
{
	"deliveryId": "efefe640-be6f-11f1-9cb6-5d836a2c28b4",
	"headSha": "71080f859bc1550f6ad0f1f4feecd2bd61f5e215",
	"reviewer": "copilot-pull-request-reviewer[bot]"
}

@GabrielDuf
Gabriel Dufresne (GabrielDuf) merged commit f11fb78 into main Oct 2, 2026
6 checks passed
@GabrielDuf
Gabriel Dufresne (GabrielDuf) deleted the fix/5437-pip-broker-scope-and-source branch October 2, 2026 15:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Pip updates fail through Agent broker: Global is sent as Machine

2 participants