feat: add package-source-overrides dev container feature#17
Merged
Conversation
Configure npm, pnpm, pip, and NuGet to use internal override package sources instead of public feeds. Config is written system- and user-wide as early as possible in the container lifecycle so that other Features resolve packages through the override sources during their own install. - New feature src/package-source-overrides (install.sh, options, NOTES, README) - Options: npmRegistry, pipIndexUrl, nugetSource, nugetSourceName, scope, strictSsl; empty URLs make the feature a safe no-op (replace policy) - No installsAfter so it sorts early; writes root-readable config and documents overrideFeatureInstallOrder for a hard ordering guarantee - Tests: no-op default + npm/pip/nuget/all-insecure/scope-user scenarios - Wire into justfile (build recipe, build-all, clean) and CI test matrices; add a section to the root README Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 9a35c641-c703-4ecf-b6a0-b7775b16551f
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
Adds a new dev container Feature,
package-source-overrides, for environments that cannot use public package feeds. It points npm, pnpm, pip, and NuGet at internal override sources (a pull-through proxy such as Artifactory, Nexus, or Azure Artifacts) instead of the public registries.Configuration is written as early as possible in the container lifecycle and at root-readable locations so that other Features installed in the same container also resolve their packages through the override sources during their own installation.
What it does
/etc/npmrc(viaNPM_CONFIG_GLOBALCONFIG)~/.npmrc/etc/pip.conf~/.config/pip/pip.conf/etc/opt/NuGet/Config/NuGet.Config~/.nuget/NuGet/NuGet.Configregistry=,index-url, NuGet<clear/>), not augmented.strictSsl: falseemits npmstrict-ssl=false, piptrusted-host, and NuGetallowInsecureConnectionsfor self-signed/HTTP proxies.Lifecycle / ordering
A Feature can't force itself ahead of arbitrary third-party Features, so it declares no
installsAfter(sorts as early as possible) and writes root-readable config that later Features' build-time (root) package installs pick up automatically.NOTES.mddocuments listing it first inoverrideFeatureInstallOrderfor a hard guarantee.Options
npmRegistry,pipIndexUrl,nugetSource,nugetSourceName(defaultoverride),scope(system|user|both, defaultboth),strictSsl(defaulttrue).Testing
shellcheckclean oninstall.shand all test scripts.devcontainer features test:mcr.microsoft.com/devcontainers/base:ubuntuanddebian:latest.npm,pip,nuget,all-insecure,scope-userall pass (24 checks).justfile(build recipe,build-all,clean) and both CI matrices in.github/workflows/test.yaml; added a section to the rootREADME.md.