-
Notifications
You must be signed in to change notification settings - Fork 0
feat(vex): manifest-less VEX from hosted/vendored lockfiles + npm 12 allow-remote auto-config (v5) #251
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Mikola Lysenko (mikolalysenko)
merged 9 commits into
main
from
feat/vex-lockfile-inventory
Sep 24, 2026
Merged
feat(vex): manifest-less VEX from hosted/vendored lockfiles + npm 12 allow-remote auto-config (v5) #251
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
e31da36
fix(core): hosted/vendored rewriter fixes found by the real-PM matrices
mikolalysenko 60ddaf8
feat(hosted): auto-configure npm 12 allow-remote in the project .npmrc
mikolalysenko 56d791f
refactor(core/vendor): split lock_inventory into per-format submodules
mikolalysenko 52e71ee
feat(core/vex): discover hosted and vendored patch references from lo…
mikolalysenko 4868030
feat(vex): manifest-less VEX — attest hosted and vendored patches fro…
mikolalysenko 4f595bc
test(cli): manifest-less VEX suites, real-PM capstones and shared hel…
mikolalysenko 75c80e8
ci: run the manifest-less VEX real-PM matrices and backtest steps
mikolalysenko 780d76e
docs: manifest-less VEX, npm 12 allow-remote and the v5 changelog
mikolalysenko 78a9f55
test(vex): golden snapshot of discovery over committed fixtures
mikolalysenko File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
Large diffs are not rendered by default.
Oops, something went wrong.
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,77 @@ | ||
| name: Go patch compatibility | ||
|
|
||
| # Real Go releases (1.18 = first with go.work, 1.21, 1.24 = the CI pin, | ||
| # 1.26 = newest) through the hermetic hosted, vendored, go.work and | ||
| # go-patches capstones, each ending in the manifest-less VEX step. The | ||
| # suites use a file GOPROXY, so no network beyond the toolchain download. | ||
|
|
||
| on: | ||
| pull_request: | ||
| paths: | ||
| - '.github/workflows/go-compatibility.yml' | ||
| - 'crates/socket-patch-core/src/vendor/go*.rs' | ||
| - 'crates/socket-patch-core/src/vendor/golang.rs' | ||
| - 'crates/socket-patch-core/src/patch/redirect/**' | ||
| - 'crates/socket-patch-core/src/crawlers/go_crawler.rs' | ||
| - 'crates/socket-patch-core/src/vex/**' | ||
| - 'crates/socket-patch-cli/src/commands/vex*.rs' | ||
| - 'crates/socket-patch-cli/src/commands/vendor*' | ||
| - 'crates/socket-patch-cli/tests/e2e_golang_*build.rs' | ||
| - 'crates/socket-patch-cli/tests/e2e_vendor_golang_build.rs' | ||
| - 'crates/socket-patch-cli/tests/golang_e2e_matrix/**' | ||
| - 'crates/socket-patch-cli/tests/e2e_vex_lockfile/golang.rs' | ||
| - 'crates/socket-patch-cli/tests/vex_e2e_common/**' | ||
| push: | ||
| branches: [main] | ||
| workflow_dispatch: | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| concurrency: | ||
| group: go-compat-${{ github.event.pull_request.number || github.ref }} | ||
| cancel-in-progress: true | ||
|
|
||
| env: | ||
| SOCKET_NO_CONFIG: '1' | ||
| SOCKET_NO_UPDATE_CHECK: '1' | ||
|
|
||
| jobs: | ||
| go: | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| os: [ubuntu-latest] | ||
| go: ['1.18.10', '1.21.13', '1.24.13', '1.26.3'] | ||
| include: | ||
| # macOS-latest dyld refuses binaries without LC_UUID (Go < 1.24 | ||
| # linkers; see ci.yml's vexctl step). | ||
| - {os: macos-latest, go: '1.24.13'} | ||
| - {os: macos-latest, go: '1.26.3'} | ||
| runs-on: ${{ matrix.os }} | ||
| timeout-minutes: 45 | ||
| steps: | ||
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | ||
| with: | ||
| persist-credentials: false | ||
| - run: rustup show | ||
| - uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1 | ||
| with: | ||
| key: go-compat | ||
| save-if: ${{ github.ref == 'refs/heads/main' }} | ||
| - uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0 | ||
| with: | ||
| go-version: ${{ matrix.go }} | ||
| cache: false | ||
| - name: Real-go hosted + vendored flows with manifest-less VEX | ||
| env: | ||
| SOCKET_PATCH_GO_E2E_VERSION: ${{ matrix.go }} | ||
| SOCKET_PATCH_GO_E2E_REQUIRED: '1' | ||
| # The hermetic manifest-less VEX cells are the `golang::` module of | ||
| # the shared `e2e_vex_lockfile` binary; its filter goes in a second | ||
| # command so it does not also filter the build suites' tests. | ||
| run: | | ||
| cargo test -p socket-patch-cli --no-fail-fast \ | ||
| --test e2e_golang_hosted_build --test e2e_vendor_golang_build \ | ||
| --test e2e_golang_build --test e2e_golang_workspace_build -- --nocapture | ||
| cargo test -p socket-patch-cli --test e2e_vex_lockfile -- golang:: --nocapture |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,95 @@ | ||
| name: npm hosted/vendored compatibility | ||
|
|
||
| # Real npm releases (at least one per major, 6 through 12) through the | ||
| # hermetic hosted (`e2e_redirect_npm_build`) and vendored | ||
| # (`e2e_vendor_npm_build`) capstones, each flow ending in the manifest-less | ||
| # VEX checks. Builds the CLI and both test binaries once; every matrix leg | ||
| # installs one pinned npm and runs them. See docs/testing/npm-compatibility.md. | ||
|
|
||
| on: | ||
| pull_request: | ||
| push: | ||
| branches: [main] | ||
| workflow_dispatch: | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| build: | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 25 | ||
| steps: | ||
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | ||
| with: | ||
| persist-credentials: false | ||
| - name: Compile CLI and npm capstones once | ||
| run: | | ||
| cargo test --locked -p socket-patch-cli --test e2e_redirect_npm_build --test e2e_vendor_npm_build --no-run --message-format=json > target-build.json | ||
| python3 - <<'PY' | ||
| import json, pathlib, shutil | ||
| dest = pathlib.Path('target/npm-e2e'); dest.mkdir(parents=True, exist_ok=True) | ||
| shutil.copy2('target/debug/socket-patch', dest / 'socket-patch') | ||
| for line in pathlib.Path('target-build.json').read_text().splitlines(): | ||
| item = json.loads(line) | ||
| name = item.get('target', {}).get('name') | ||
| if name in ('e2e_redirect_npm_build', 'e2e_vendor_npm_build') and item.get('executable'): | ||
| shutil.copy2(item['executable'], dest / name) | ||
| assert all((dest / n).is_file() for n in ('e2e_redirect_npm_build', 'e2e_vendor_npm_build')) | ||
| PY | ||
| - uses: ./.github/actions/upload-artifact | ||
| with: | ||
| name: npm-e2e | ||
| path: target/npm-e2e/ | ||
| if-no-files-found: error | ||
| retention-days: 7 | ||
|
|
||
| install-proof: | ||
| needs: build | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 25 | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| include: | ||
| # node 16's bundled npm 8 writes the v2 lock for the npm 6 x v2 test. | ||
| - {npm: '6.14.18', node: '16.20.2'} | ||
| - {npm: '7.0.0', node: '16.20.2'} | ||
| - {npm: '7.24.2', node: '16.20.2'} | ||
| - {npm: '8.19.4', node: '16.20.2'} | ||
| - {npm: '9.0.0', node: '18.20.8'} | ||
| - {npm: '9.9.4', node: '18.20.8'} | ||
| - {npm: '10.9.9', node: '22.22.2'} | ||
| - {npm: '11.20.0', node: '24.11.1'} | ||
| - {npm: '12.0.0', node: '24.15.0'} | ||
| - {npm: '12.1.0', node: '24.15.0'} | ||
| steps: | ||
| # Same workspace path as the build job, so the socket-patch path | ||
| # compiled into the tests (CARGO_BIN_EXE_socket-patch) resolves. | ||
| - uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4 | ||
| with: | ||
| pattern: npm-e2e* | ||
| merge-multiple: true | ||
| path: target/debug | ||
| - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4 | ||
| with: | ||
| node-version: '24.11.1' | ||
| - name: Install the pinned npm | ||
| env: | ||
| NPM_TEST_VERSION: ${{ matrix.npm }} | ||
| run: | | ||
| npm install --prefix "$RUNNER_TEMP/npm-tool" --no-audit --no-fund "npm@$NPM_TEST_VERSION" | ||
| echo "SOCKET_PATCH_NPM_E2E_BIN=$RUNNER_TEMP/npm-tool/node_modules/.bin/npm" >> "$GITHUB_ENV" | ||
| - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4 | ||
| with: | ||
| node-version: ${{ matrix.node }} | ||
| - name: Hosted + vendored installs, manifest-less VEX | ||
| env: | ||
| SOCKET_PATCH_NPM_E2E_VERSION: ${{ matrix.npm }} | ||
| SOCKET_PATCH_NPM_E2E_REQUIRED: '1' | ||
| SOCKET_NO_CONFIG: '1' | ||
| SOCKET_NO_UPDATE_CHECK: '1' | ||
| run: | | ||
| chmod +x target/debug/socket-patch target/debug/e2e_redirect_npm_build target/debug/e2e_vendor_npm_build | ||
| target/debug/e2e_redirect_npm_build --include-ignored --test-threads 4 | ||
| target/debug/e2e_vendor_npm_build --include-ignored --test-threads 4 |
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.