ci(extension): lint lockfile tarball hosts against the dotnet-public-npm mirror#17403
Draft
radical wants to merge 1 commit into
Draft
ci(extension): lint lockfile tarball hosts against the dotnet-public-npm mirror#17403radical wants to merge 1 commit into
radical wants to merge 1 commit into
Conversation
The internal microsoft-aspire pipeline runs `yarn install` from extension/Extension.proj and can only reach the dotnet-public-npm mirror. Any `resolved` URL in extension/yarn.lock or extension/package-lock.json that points elsewhere makes the install fail with `connect EACCES 192.0.2.14:443`. This has broken main twice -- PR microsoft#16489 (postcss/uuid) and PR microsoft#17361 (tree-sitter, microsoft#17399) -- and both times the bad URLs cleared PR CI undetected because GitHub runners have unrestricted egress and silently pulled from registry.npmjs.org. New workflow .github/workflows/extension-lockfile-lint.yml, triggered on PRs and pushes. It asserts: - Every `resolved` URL in extension/yarn.lock and extension/package-lock.json points at the dotnet-public-npm mirror. - extension/.npmrc and extension/.yarnrc do not contain `replace-registry-host=never` (the knob microsoft#17361 used to disable Yarn's default host rewrite). Sub-second pure-grep step, no network or Node dependency. Verified by replaying the lint against the pre-microsoft#17402 origin/main tree: exit 1 and flags all six bad URLs plus the .npmrc knob. Against the microsoft#17402 tree: exit 0. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 17403Or
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 17403" |
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.
The internal
microsoft-aspirepipeline runsyarn installfromextension/Extension.projand can only reach thedotnet-public-npmmirror atpkgs.dev.azure.com. AnyresolvedURL inextension/yarn.lockorextension/package-lock.jsonthat points elsewhere makes the install fail withconnect EACCES 192.0.2.14:443. This has now brokenmaintwice — PR #16489 (postcss/uuid) and PR #17361 (tree-sitter, #17399) — and both times the bad URLs cleared PR CI undetected because GitHub runners have unrestricted egress and silently pulled fromregistry.npmjs.org.The fix
New workflow
.github/workflows/extension-lockfile-lint.yml, triggered on PRs and pushes touchingextension/**. It asserts:resolvedURL inextension/yarn.lockandextension/package-lock.jsonpoints at thedotnet-public-npmmirror.extension/.npmrcandextension/.yarnrcdo not containreplace-registry-host=never(the knob Use parser-backed AppHost resource parsing #17361 used to disable Yarn's default host rewrite).Sub-second pure-grep step, no network or Node dependency.
Verified by replaying the lint against
origin/main: it exits 1 and flags all six badresolvedURLs plus the.npmrcknob. Against the tree from #17402 (the unblock-mainPR) it exits 0.Why not also switch PR CI to yarn
I considered flipping
extension_tests_winfromnpm installtoyarn install --frozen-lockfileso PR CI uses the same toolchain as the internal pipeline. Two reasons not to:dnceng/public. The feed serves cached tarballs anonymously but returns 401 for any tarball upstream hasn't been lazily pulled yet ("please provide authentication to access versions from upstream that have not yet been saved to your feed"). So every PR adding a new transitive dep would 401 in PR CI until an authenticated internal run primes the cache — a new flaky failure mode for no added coverage. Killing the npm/yarn divergence properly would mean deletingextension/package-lock.jsonand theoverridesblock; better as its own PR.