Skip to content

Relocate storage and cover source-mode environment variable - #42

Merged
Gabriel Dufresne (GabrielDuf) merged 6 commits into
masterfrom
feat/pinget-source-mode-env
Sep 1, 2026
Merged

Relocate storage and cover source-mode environment variable#42
Gabriel Dufresne (GabrielDuf) merged 6 commits into
masterfrom
feat/pinget-source-mode-env

Conversation

@GabrielDuf

Copy link
Copy Markdown
Contributor

This pull request introduces a new mechanism for controlling the storage location and source mode in Pinget via environment variables, and updates the version to 0.11.0 across all components. It adds robust logic for parsing and resolving the source mode from environment variables, updates the documentation, and expands test coverage to ensure correct behavior. These changes improve flexibility for embedding, sandboxing, and customizing Pinget's behavior in different environments.

Environment Variable Support and Source Mode Logic:

  • Added support for two environment variables: PINGET_APPROOT (controls storage root) and PINGET_SOURCE_MODE (controls source mode: auto, private, or system-winget-mirror) in both the Rust CLI and C# core. The logic ensures that explicit options override environment variables, and sensible defaults are chosen when variables are unset. (README.md, rust/crates/pinget-core/src/lib.rs, dotnet/src/Devolutions.Pinget.Core/Repository.cs)
  • Implemented parsing and resolution methods for source mode, handling various spellings and prioritization between explicit options and environment variables. (rust/crates/pinget-core/src/lib.rs, dotnet/src/Devolutions.Pinget.Core/Repository.cs)

Documentation and User Guidance:

  • Added detailed documentation in README.md explaining the new environment variable behavior, including fallback logic and embedding scenarios.

Test Coverage Improvements:

  • Added comprehensive unit tests for the new source mode parsing and resolution logic, including edge cases and environment variable interactions. (dotnet/src/Devolutions.Pinget.Core.Tests/CoreTests.cs)

Version Bump and Consistency:

  • Updated version numbers to 0.11.0 across all Rust crates, .NET projects, and PowerShell modules to reflect the new features. (dotnet/src/Devolutions.Pinget.Cli/Program.cs, dotnet/src/Devolutions.Pinget.PowerShell.Cmdlets/ModuleFiles/Devolutions.Pinget.Client.psd1, dotnet/src/Devolutions.Pinget.PowerShell.Engine/PowerShellEngineVersion.cs, nuget/Devolutions.Pinget.Cli.DotNet/Devolutions.Pinget.Cli.DotNet.csproj, nuget/Devolutions.Pinget.Cli.Rust/Devolutions.Pinget.Cli.Rust.csproj, rust/crates/pinget-cli/Cargo.toml, rust/crates/pinget-com/Cargo.toml, rust/crates/pinget-core/Cargo.toml)

Test Infrastructure:

  • Added [CollectionDefinition] attributes to test classes to ensure proper test isolation for repository state. (dotnet/src/Devolutions.Pinget.Core.Tests/CoreTests.cs)

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 encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

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 encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

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

Copilot reviewed 12 out of 12 changed files in this pull request and generated 2 comments.

Comment thread rust/crates/pinget-core/src/lib.rs Outdated
Comment thread dotnet/src/Devolutions.Pinget.Core/Repository.cs Outdated
@GabrielDuf
Gabriel Dufresne (GabrielDuf) merged commit 72828c0 into master Sep 1, 2026
13 checks passed
@GabrielDuf
Gabriel Dufresne (GabrielDuf) deleted the feat/pinget-source-mode-env branch September 1, 2026 17:49
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