Skip to content

lookup: allow git for JSONStream - #1158

Open
reggi wants to merge 1 commit into
nodejs:mainfrom
reggi:fix/jsonstream-allow-git
Open

reggi wants to merge 1 commit into
nodejs:mainfrom
reggi:fix/jsonstream-allow-git

Conversation

@reggi

@reggi reggi commented Oct 2, 2026

Copy link
Copy Markdown

Summary

Allow the JSONStream fixture to fetch its transitive Git dependency when CITGM runs its tests with npm 12.

Why this is needed

npm 12 changed allow-git to default to none. JSONStream itself does not use a Git dependency at runtime, but CITGM installs its development dependencies to execute the package test suite. The selected dependency tree contains:

JSONStream@1.3.5
└── it-is@1.0.3
    └── assertions@2.3.4
        └── fomatto@git://github.com/BonsaiDen/Fomatto.git#468666f600b46f9067e3da7200fd9df428923ea6

assertions@2.3.4 references fomatto directly by Git commit. npm 12 therefore stops installation with EALLOWGIT before the JSONStream tests execute.

The Git dependency is transitive, so allow-git=root would not permit it. This change sets npm_config_allow_git=all only in JSONStream's CITGM environment. npm's default policy remains unchanged for every other fixture.

JSONStream remains useful in CITGM because it exercises an existing package name containing uppercase characters, as discussed in #1113.

Addresses npm/cli#10026. This replaces the unmerged approach from #1127 without changing JSONStream's unrelated platform skips.

Validation

  • ./node_modules/.bin/eslint --cache
  • ./node_modules/.bin/prettier --check lib/lookup.json
  • ./node_modules/.bin/tap run test/test-lookup.js test/test-create-options.js
  • jq empty lib/lookup.json
  • git diff --check

The full test suite was also attempted locally. Tests that spawn npm could not run because the machine's npm executable is linked to an npm/cli checkout with missing workspace links. The targeted lookup and environment tests pass.

Allow JSONStream test dependencies to fetch their transitive Git dependency when running with npm 12.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 1896c431-0032-423c-afbe-3133ce92cec7
@codecov-commenter

codecov-commenter commented Oct 2, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.20%. Comparing base (8914dd0) to head (8d0f14f).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1158   +/-   ##
=======================================
  Coverage   96.20%   96.20%           
=======================================
  Files          29       29           
  Lines        2213     2213           
=======================================
  Hits         2129     2129           
  Misses         84       84           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@MikeMcC399

MikeMcC399 commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

I originally submitted the same change as you've suggested here in #1127 which I then abandoned since nobody was available to merge it.

In the meantime the repo has become active again.

Hopefully this time it will be actioned!

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.

3 participants