Skip to content

feat(policies): Add missing package managers to API - #83

Closed
Vladyslav Nikonov (vnikonov-devolutions) wants to merge 4 commits into
masterfrom
feat/add-more-package-managers
Closed

feat(policies): Add missing package managers to API#83
Vladyslav Nikonov (vnikonov-devolutions) wants to merge 4 commits into
masterfrom
feat/add-more-package-managers

Conversation

@vnikonov-devolutions

@vnikonov-devolutions Vladyslav Nikonov (vnikonov-devolutions) commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Adds the 14 package managers supported by UniGetUI that were missing from the policy/broker API, so policies and broker requests can cover the full manager set (including non-Windows ones): Apt, Bun, Cargo, Chocolatey, Dnf, Dotnet, Flatpak, Homebrew, Npm, Pacman, Pip, Scoop, Snap, Vcpkg.

Changes

  • Rust (now-policy, now-policy-api, now-policy-server-template): new ManagerName variants in the policy model and API enums, policy-compat conversions, mock server capabilities for all 17 managers, and a new Chocolatey request fixture.
  • .NET (Devolutions.Now.Policy.Model / .Api): mirrored enum variants and compatibility mappings.
  • Capability checking: CapabilitiesResponse::manager_capability / supports_manager (Rust) and GetManagerCapability / SupportsManager (.NET) let callers check whether a broker advertises a manager before sending a request; the client preflight gate rejects unadvertised managers with UnsupportedCapability.
  • Regenerated the OpenAPI document and policy JSON schema.

Notes

  • The API and policy schema stay at version 1.0: we are not in a release state, so shipping the expanded manager set as part of the existing 1.0 contract (a breaking change for pre-release consumers) was agreed to be acceptable. An earlier revision of this PR introduced a 1.1 version bump with per-manager protocol gating; it was removed after team discussion.
  • Generic.NuGet from UniGetUI is intentionally excluded (shared base implementation, not a standalone manager).

Validation

  • cargo test / cargo clippy / cargo fmt clean for all three crates (all features).
  • dotnet test green (232 tests across net9.0/net10.0).

Add Apt, Bun, Cargo, Chocolatey, Dnf, Dotnet, Flatpak, Homebrew, Npm,
Pacman, Pip, Scoop, Snap, and Vcpkg to the policy and broker API manager
enums (Rust and .NET), bump the broker API version to 1.1, and regenerate
the OpenAPI document and policy JSON schema.

Managers introduced in 1.1 are version-gated: ManagerName exposes its
minimum API version, CapabilitiesResponse gains manager support check
methods distinguishing a protocol-version gap from a missing capability,
and the .NET client refuses to send a too-new manager to an older broker
with a distinct UnsupportedApiVersion error kind.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings July 27, 2026 18:43
@vnikonov-devolutions Vladyslav Nikonov (vnikonov-devolutions) changed the title feat(policies): add UniGetUI package managers with version-gated support feat(policies): Add more package managers to API Jul 27, 2026

Copilot AI 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 overview

Adds UniGetUI package-manager parity and API-version-aware capability checks across Rust and .NET.

Changes:

  • Adds 14 package managers across models, schemas, conversions, mocks, and fixtures.
  • Bumps broker API to 1.1 and policy crates to 0.2.0.
  • Adds tri-state manager support and .NET client preflight gating.

Reviewed changes

Copilot reviewed 23 out of 24 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
policies/rust/now-policy/src/enums.rs Adds policy manager variants.
policies/rust/now-policy/schema/devolutions.now-policy.schema.json Extends policy schema enum.
policies/rust/now-policy/Cargo.toml Bumps crate version.
policies/rust/now-policy-server-template/src/mock.rs Advertises all manager capabilities.
policies/rust/now-policy-server-template/Cargo.toml Updates crate and dependency versions.
policies/rust/now-policy-server-template/assets/samples/responses/health-ready.response.json Updates response versions.
policies/rust/now-policy-server-template/assets/samples/responses/capabilities.response.json Adds manager capability fixtures.
policies/rust/now-policy-server-template/assets/samples/requests/chocolatey-git-install.request.json Adds Chocolatey request fixture.
policies/rust/now-policy-api/src/policy_compat.rs Adds manager conversions.
policies/rust/now-policy-api/src/lib.rs Bumps API and adds version comparison.
policies/rust/now-policy-api/src/enums.rs Adds managers and minimum versions.
policies/rust/now-policy-api/src/capabilities.rs Adds manager support classification and tests.
policies/rust/now-policy-api/openapi/now-policy-api.yaml Updates OpenAPI contract.
policies/rust/now-policy-api/Cargo.toml Bumps crate dependencies.
policies/dotnet/Devolutions.Now.Policy.Model/Enums.cs Adds policy manager variants.
policies/dotnet/Devolutions.Now.Policy.Client/README.md Documents version gating.
policies/dotnet/Devolutions.Now.Policy.Client/BrokerClientErrorKind.cs Adds version error kind.
policies/dotnet/Devolutions.Now.Policy.Client/BrokerClient.cs Adds request preflight gating.
policies/dotnet/Devolutions.Now.Policy.Client.Tests/BrokerClientTests.cs Tests distinct client errors.
policies/dotnet/Devolutions.Now.Policy.Api/PolicyCompatibility.cs Adds manager conversions.
policies/dotnet/Devolutions.Now.Policy.Api/MetaModels.cs Adds capability helper APIs.
policies/dotnet/Devolutions.Now.Policy.Api/Enums.cs Adds API manager variants.
policies/dotnet/Devolutions.Now.Policy.Api/BrokerApi.cs Adds version metadata and comparison.
Cargo.lock Records Rust package bumps.

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

Comment thread policies/rust/now-policy/schema/devolutions.now-policy.schema.json
Comment thread policies/rust/now-policy-api/src/capabilities.rs Outdated
Comment thread policies/dotnet/Devolutions.Now.Policy.Api/MetaModels.cs Outdated
Comment thread policies/rust/now-policy-api/src/capabilities.rs Outdated
Comment thread policies/rust/now-policy-api/Cargo.toml Outdated
Comment thread policies/rust/now-policy/Cargo.toml Outdated
Comment thread policies/rust/now-policy-server-template/Cargo.toml Outdated
- Revert crate versions to 0.1.0 (managed by cargo-release) and fixture
  ServerVersion back to 0.1.0
- Add IncompatibleApiVersion to ManagerSupport (Rust + .NET) so a broker
  with a different major API version or malformed version is no longer
  misclassified as RequiresNewerApiVersion; client raises a distinct
  message for it
- Version the policy schema: bump canonical URI to
  now-policy.schema.1.1.json, keep accepting the 1.0 URI on read
  (Rust marker + .NET consts), default PolicyVersion to 1.1.0,
  regenerate schema JSON
- Strengthen version-gating test: old broker now advertises Chocolatey
  and the version gate still wins; add incompatible-major tests in both
  languages
- Reword 'broker speaks version' to 'broker advertises version'

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
A broker with a different major API version fails much earlier, when
parsing the response envelope, so classifying it per-manager is not
meaningful. Keep ManagerSupport focused on Supported /
RequiresNewerApiVersion / NotAdvertised in both Rust and .NET.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@vnikonov-devolutions Vladyslav Nikonov (vnikonov-devolutions) changed the title feat(policies): Add more package managers to API feat(policies): Add missing package managers to API Jul 27, 2026
We are not in a release state, so breaking version compatibility is
acceptable: the expanded manager set ships as part of the existing 1.0
contract. Removes the redundant versioning machinery:

- API_VERSION_STR / BrokerApi.Version back to 1.0 (fixtures included)
- Drop ManagerName::minimum_api_version / GetMinimumApiVersion,
  ApiVersion::supports / ApiVersionSupports and ManagerSupport
- Drop the BrokerClient protocol-version gate and
  BrokerClientErrorKind.UnsupportedApiVersion
- Policy schema URI and PolicyVersion defaults back to 1.0 / 1.0.0;
  regenerate schema and OpenAPI

Capability checking stays via CapabilitiesResponse::supports_manager /
manager_capability (SupportsManager / GetManagerCapability in .NET).

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@vnikonov-devolutions

Copy link
Copy Markdown
Contributor Author

Copilot we have failing CI because of not allowed rust-cache version; Please create separate PR with rust cache fix, use devolutions-gateway PR as example: Devolutions/devolutions-gateway#1868 (Updates Swatinem/rust-cache@v2.8.2 to Swatinem/rust-cache@v2.9.1)

Copilot AI commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Vladyslav Nikonov (@vnikonov-devolutions) I've opened a new pull request, #84, to work on those changes. Once the pull request is ready, I'll request review from you.

@vnikonov-devolutions

Copy link
Copy Markdown
Contributor Author

Changes were merged in #84

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.

3 participants