feat: auto-register repositories via PSDependOptions.Repositories (#50)#197
Draft
HeyItsGilbert wants to merge 1 commit into
Draft
feat: auto-register repositories via PSDependOptions.Repositories (#50)#197HeyItsGilbert wants to merge 1 commit into
HeyItsGilbert wants to merge 1 commit into
Conversation
…ries PSGalleryModule, PSResourceGet, and Package DependencyScripts now check PSDependOptions.Repositories when a named repository is not registered on the current machine. If a URL is declared there the repository is registered persistently as Trusted before installation proceeds, making DependencyFiles portable without manual setup. Closes #50 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Test Results 3 files 66 suites 1m 22s ⏱️ Results for commit 79df1bf. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #50. PSDepend DependencyFiles that reference a private repository currently break on any machine where that repository isn't pre-registered. This PR lets the DependencyFile declare the URL once, and PSDepend handles registration automatically.
PSDependOptions.Repositories— a file-level hashtable mapping repository names to source URLsPSGalleryModule,PSResourceGet, andPackageDependencyScripts auto-register an unregistered repository if its name appears in the registry (persistent, Trusted, using the Dependency's Credential if present)Testaction is unchanged — never registers anythingUsage
Design decisions
An ADR is included at
docs/adr/0001-repository-registry-in-psdependoptions.mdcapturing the key trade-offs: why file-level declaration over per-Dependency URL, and why persistent over ephemeral registration.Seeking feedback on
RepositoriesinPSDependOptions— does this collide with anything in your setups?Packagetype requires a hashtable@{Url=…; ProviderName=…}while the module types take a bare string — is this acceptable or should the shape be unified?Testreturn$falsewhen the repository itself isn't registered, even if the module is installed? (Current implementation: no.)Test plan
PSGalleryModuleagainst an unregistered private repo name with a matchingRepositoriesentryPSResourceGetandPackageequivalents🤖 Generated with Claude Code