Skip to content

feat: add package-source-overrides dev container feature#17

Merged
rosstaco merged 1 commit into
mainfrom
feat/package-source-overrides
Jul 24, 2026
Merged

feat: add package-source-overrides dev container feature#17
rosstaco merged 1 commit into
mainfrom
feat/package-source-overrides

Conversation

@rosstaco

Copy link
Copy Markdown
Owner

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

  • Writes standard config at system and per-user scope (root + remote user):
    Ecosystem System User
    npm / pnpm /etc/npmrc (via NPM_CONFIG_GLOBALCONFIG) ~/.npmrc
    pip /etc/pip.conf ~/.config/pip/pip.conf
    NuGet /etc/opt/NuGet/Config/NuGet.Config ~/.nuget/NuGet/NuGet.Config
  • Replace policy — public feeds are cleared (registry=, index-url, NuGet <clear/>), not augmented.
  • No auth (anonymous proxies), matching the intended scope.
  • strictSsl: false emits npm strict-ssl=false, pip trusted-host, and NuGet allowInsecureConnections for self-signed/HTTP proxies.
  • Providing no URLs makes the Feature a safe no-op.

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.md documents listing it first in overrideFeatureInstallOrder for a hard guarantee.

Options

npmRegistry, pipIndexUrl, nugetSource, nugetSourceName (default override), scope (system|user|both, default both), strictSsl (default true).

Testing

  • shellcheck clean on install.sh and all test scripts.
  • devcontainer features test:
    • Autogenerated no-op test passes on mcr.microsoft.com/devcontainers/base:ubuntu and debian:latest.
    • Scenarios npm, pip, nuget, all-insecure, scope-user all pass (24 checks).
  • Wired into the justfile (build recipe, build-all, clean) and both CI matrices in .github/workflows/test.yaml; added a section to the root README.md.

Note: the branch was renamed from feat/package-feeds to feat/package-source-overrides to match the final feature id.

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
@rosstaco
rosstaco merged commit 188a0a1 into main Jul 24, 2026
31 checks passed
@rosstaco
rosstaco deleted the feat/package-source-overrides branch July 24, 2026 07:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant