Skip to content

Commit 4be201a

Browse files
committed
Merge main (v5 manifest-less VEX) into Go fixes
Resolves the CHANGELOG/CLI_CONTRACT and go_sum_edit.rs conflicts by keeping both sides. The hosted ownership check now accepts the same patch.socket.dev/gopatch/<uuid>[/vN] shapes VEX discovery does, and VEX discovery still flags Socket-looking replace targets the CLI does not own (another checkout's vendored copy, an absolute path, a malformed hosted module) instead of skipping them silently. Assisted-by: Claude Code:claude-opus-5-5
2 parents 47a4996 + cf8150b commit 4be201a

275 files changed

Lines changed: 94283 additions & 8289 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.gitattributes‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,8 @@
55
crates/socket-patch-core/tests/fixtures/redirect/** -text
66

77
crates/socket-patch-core/tests/fixtures/pdm-native/*.lock -text
8+
9+
# The captured pnpm 1-12 locks are byte-real: the hosted/vendored rewriters
10+
# refuse CRLF by design (vendor_lockfile_crlf_unsupported), and the tests
11+
# derive their CRLF variants from the LF bytes themselves.
12+
crates/socket-patch-core/tests/fixtures/pnpm-hosted/** -text

‎.github/workflows/bun-compatibility.yml‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,12 @@ on:
3434
- 'crates/socket-patch-core/src/utils/process.rs'
3535
- 'crates/socket-patch-core/tests/fixtures/redirect/npm/bun/**'
3636
- 'crates/socket-patch-cli/src/commands/get.rs'
37+
- 'crates/socket-patch-core/src/vex/**'
38+
- 'crates/socket-patch-cli/src/commands/vex.rs'
39+
- 'crates/socket-patch-cli/src/commands/vex_consumed.rs'
40+
- 'crates/socket-patch-cli/src/commands/vex_sources.rs'
41+
- 'crates/socket-patch-cli/src/commands/apply.rs'
42+
- 'crates/socket-patch-cli/tests/vex_e2e_common/**'
3743
- 'crates/socket-patch-cli/src/commands/scan/**'
3844
- 'crates/socket-patch-cli/src/commands/rollback.rs'
3945
- 'crates/socket-patch-cli/src/commands/vendor.rs'
@@ -60,6 +66,12 @@ on:
6066
- 'crates/socket-patch-core/src/vendor/**'
6167
- 'crates/socket-patch-core/src/patch/redirect/**'
6268
- 'crates/socket-patch-cli/src/commands/get.rs'
69+
- 'crates/socket-patch-core/src/vex/**'
70+
- 'crates/socket-patch-cli/src/commands/vex.rs'
71+
- 'crates/socket-patch-cli/src/commands/vex_consumed.rs'
72+
- 'crates/socket-patch-cli/src/commands/vex_sources.rs'
73+
- 'crates/socket-patch-cli/src/commands/apply.rs'
74+
- 'crates/socket-patch-cli/tests/vex_e2e_common/**'
6375
- 'crates/socket-patch-cli/src/commands/scan/**'
6476
- 'crates/socket-patch-cli/src/commands/rollback.rs'
6577
- 'crates/socket-patch-cli/src/commands/vendor.rs'

‎.github/workflows/ci.yml‎

Lines changed: 474 additions & 28 deletions
Large diffs are not rendered by default.
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
name: Go patch compatibility
2+
3+
# Real Go releases (1.18 = first with go.work, 1.21, 1.24 = the CI pin,
4+
# 1.26 = newest) through the hermetic hosted, vendored, go.work and
5+
# go-patches capstones, each ending in the manifest-less VEX step. The
6+
# suites use a file GOPROXY, so no network beyond the toolchain download.
7+
8+
on:
9+
pull_request:
10+
paths:
11+
- '.github/workflows/go-compatibility.yml'
12+
- 'crates/socket-patch-core/src/vendor/go*.rs'
13+
- 'crates/socket-patch-core/src/vendor/golang.rs'
14+
- 'crates/socket-patch-core/src/patch/redirect/**'
15+
- 'crates/socket-patch-core/src/crawlers/go_crawler.rs'
16+
- 'crates/socket-patch-core/src/vex/**'
17+
- 'crates/socket-patch-cli/src/commands/vex*.rs'
18+
- 'crates/socket-patch-cli/src/commands/vendor*'
19+
- 'crates/socket-patch-cli/tests/e2e_golang_*build.rs'
20+
- 'crates/socket-patch-cli/tests/e2e_vendor_golang_build.rs'
21+
- 'crates/socket-patch-cli/tests/golang_e2e_matrix/**'
22+
- 'crates/socket-patch-cli/tests/e2e_vex_lockfile/golang.rs'
23+
- 'crates/socket-patch-cli/tests/vex_e2e_common/**'
24+
push:
25+
branches: [main]
26+
workflow_dispatch:
27+
28+
permissions:
29+
contents: read
30+
31+
concurrency:
32+
group: go-compat-${{ github.event.pull_request.number || github.ref }}
33+
cancel-in-progress: true
34+
35+
env:
36+
SOCKET_NO_CONFIG: '1'
37+
SOCKET_NO_UPDATE_CHECK: '1'
38+
39+
jobs:
40+
go:
41+
strategy:
42+
fail-fast: false
43+
matrix:
44+
os: [ubuntu-latest]
45+
go: ['1.18.10', '1.21.13', '1.24.13', '1.26.3']
46+
include:
47+
# macOS-latest dyld refuses binaries without LC_UUID (Go < 1.24
48+
# linkers; see ci.yml's vexctl step).
49+
- {os: macos-latest, go: '1.24.13'}
50+
- {os: macos-latest, go: '1.26.3'}
51+
runs-on: ${{ matrix.os }}
52+
timeout-minutes: 45
53+
steps:
54+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
55+
with:
56+
persist-credentials: false
57+
- run: rustup show
58+
- uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1
59+
with:
60+
key: go-compat
61+
save-if: ${{ github.ref == 'refs/heads/main' }}
62+
- uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
63+
with:
64+
go-version: ${{ matrix.go }}
65+
cache: false
66+
- name: Real-go hosted + vendored flows with manifest-less VEX
67+
env:
68+
SOCKET_PATCH_GO_E2E_VERSION: ${{ matrix.go }}
69+
SOCKET_PATCH_GO_E2E_REQUIRED: '1'
70+
# The hermetic manifest-less VEX cells are the `golang::` module of
71+
# the shared `e2e_vex_lockfile` binary; its filter goes in a second
72+
# command so it does not also filter the build suites' tests.
73+
run: |
74+
cargo test -p socket-patch-cli --no-fail-fast \
75+
--test e2e_golang_hosted_build --test e2e_vendor_golang_build \
76+
--test e2e_golang_build --test e2e_golang_workspace_build -- --nocapture
77+
cargo test -p socket-patch-cli --test e2e_vex_lockfile -- golang:: --nocapture
Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
name: npm hosted/vendored compatibility
2+
3+
# Real npm releases (at least one per major, 6 through 12) through the
4+
# hermetic hosted (`e2e_redirect_npm_build`) and vendored
5+
# (`e2e_vendor_npm_build`) capstones, each flow ending in the manifest-less
6+
# VEX checks. Builds the CLI and both test binaries once; every matrix leg
7+
# installs one pinned npm and runs them. See docs/testing/npm-compatibility.md.
8+
9+
on:
10+
pull_request:
11+
push:
12+
branches: [main]
13+
workflow_dispatch:
14+
15+
permissions:
16+
contents: read
17+
18+
jobs:
19+
build:
20+
runs-on: ubuntu-latest
21+
timeout-minutes: 25
22+
steps:
23+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
24+
with:
25+
persist-credentials: false
26+
- name: Compile CLI and npm capstones once
27+
run: |
28+
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
29+
python3 - <<'PY'
30+
import json, pathlib, shutil
31+
dest = pathlib.Path('target/npm-e2e'); dest.mkdir(parents=True, exist_ok=True)
32+
shutil.copy2('target/debug/socket-patch', dest / 'socket-patch')
33+
for line in pathlib.Path('target-build.json').read_text().splitlines():
34+
item = json.loads(line)
35+
name = item.get('target', {}).get('name')
36+
if name in ('e2e_redirect_npm_build', 'e2e_vendor_npm_build') and item.get('executable'):
37+
shutil.copy2(item['executable'], dest / name)
38+
assert all((dest / n).is_file() for n in ('e2e_redirect_npm_build', 'e2e_vendor_npm_build'))
39+
PY
40+
- uses: ./.github/actions/upload-artifact
41+
with:
42+
name: npm-e2e
43+
path: target/npm-e2e/
44+
if-no-files-found: error
45+
retention-days: 7
46+
47+
install-proof:
48+
needs: build
49+
runs-on: ubuntu-latest
50+
timeout-minutes: 25
51+
strategy:
52+
fail-fast: false
53+
matrix:
54+
include:
55+
# node 16's bundled npm 8 writes the v2 lock for the npm 6 x v2 test.
56+
- {npm: '6.14.18', node: '16.20.2'}
57+
- {npm: '7.0.0', node: '16.20.2'}
58+
- {npm: '7.24.2', node: '16.20.2'}
59+
- {npm: '8.19.4', node: '16.20.2'}
60+
- {npm: '9.0.0', node: '18.20.8'}
61+
- {npm: '9.9.4', node: '18.20.8'}
62+
- {npm: '10.9.9', node: '22.22.2'}
63+
- {npm: '11.20.0', node: '24.11.1'}
64+
- {npm: '12.0.0', node: '24.15.0'}
65+
- {npm: '12.1.0', node: '24.15.0'}
66+
steps:
67+
# Same workspace path as the build job, so the socket-patch path
68+
# compiled into the tests (CARGO_BIN_EXE_socket-patch) resolves.
69+
- uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4
70+
with:
71+
pattern: npm-e2e*
72+
merge-multiple: true
73+
path: target/debug
74+
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
75+
with:
76+
node-version: '24.11.1'
77+
- name: Install the pinned npm
78+
env:
79+
NPM_TEST_VERSION: ${{ matrix.npm }}
80+
run: |
81+
npm install --prefix "$RUNNER_TEMP/npm-tool" --no-audit --no-fund "npm@$NPM_TEST_VERSION"
82+
echo "SOCKET_PATCH_NPM_E2E_BIN=$RUNNER_TEMP/npm-tool/node_modules/.bin/npm" >> "$GITHUB_ENV"
83+
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
84+
with:
85+
node-version: ${{ matrix.node }}
86+
- name: Hosted + vendored installs, manifest-less VEX
87+
env:
88+
SOCKET_PATCH_NPM_E2E_VERSION: ${{ matrix.npm }}
89+
SOCKET_PATCH_NPM_E2E_REQUIRED: '1'
90+
SOCKET_NO_CONFIG: '1'
91+
SOCKET_NO_UPDATE_CHECK: '1'
92+
run: |
93+
chmod +x target/debug/socket-patch target/debug/e2e_redirect_npm_build target/debug/e2e_vendor_npm_build
94+
target/debug/e2e_redirect_npm_build --include-ignored --test-threads 4
95+
target/debug/e2e_vendor_npm_build --include-ignored --test-threads 4

‎.github/workflows/pdm-compatibility.yml‎

Lines changed: 38 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,11 @@ on:
2020
- 'crates/socket-patch-cli/src/commands/scan/**'
2121
- 'crates/socket-patch-cli/src/commands/rollback.rs'
2222
- 'crates/socket-patch-core/tests/fixtures/pdm-native/**'
23+
- 'crates/socket-patch-core/src/vex/**'
24+
- 'crates/socket-patch-cli/src/commands/vex*.rs'
25+
- 'crates/socket-patch-cli/tests/e2e_vex_build/main.rs'
26+
- 'crates/socket-patch-cli/tests/e2e_vex_build/pdm.rs'
27+
- 'crates/socket-patch-cli/tests/vex_pypi_real_common/**'
2328
push:
2429
branches: [main]
2530
paths:
@@ -83,7 +88,7 @@ jobs:
8388
# Every stable PDM major family (0.x, 1.x, 2.x) and each 2.x lock-format
8489
# boundary, on Linux and Windows; macOS samples the ends of the range.
8590
os: [ubuntu-latest, windows-latest]
86-
pdm: ['0.12.3', '1.15.5', '2.0.3', '2.1.5', '2.3.4', '2.6.1', '2.7.4', '2.8.2', '2.9.3', '2.10.4', '2.11.2', '2.17.3', '2.20.1', '2.25.9', '2.29.2']
91+
pdm: ['0.12.3', '1.15.5', '2.0.3', '2.1.5', '2.3.4', '2.6.1', '2.7.4', '2.8.2', '2.9.3', '2.10.4', '2.11.2', '2.17.3', '2.20.1', '2.22.4', '2.25.9', '2.29.2']
8792
include:
8893
- { os: macos-latest, pdm: '0.12.3' }
8994
- { os: macos-latest, pdm: '2.8.2' }
@@ -143,3 +148,35 @@ jobs:
143148
native-pdm/cases/**/pdm.lock
144149
native-pdm/cases/**/*.log
145150
retention-days: 14
151+
152+
# The hermetic Rust capstone (wiremock Socket API that also serves the
153+
# hosted wheel) over every PDM release the backtest covers: real hosted +
154+
# vendored flows ending in the manifest-less VEX matrix; refused lock
155+
# formats (3.1, 4.0-4.2) must attest nothing.
156+
capstone:
157+
strategy:
158+
fail-fast: false
159+
matrix:
160+
os: [ubuntu-latest, macos-latest]
161+
pdm: ['0.12.3', '1.0.0', '1.4.5', '1.8.5', '1.15.5', '2.0.3', '2.7.4', '2.8.2', '2.10.4', '2.11.2', '2.17.3', '2.20.1', '2.22.4', '2.25.9', '2.29.2']
162+
runs-on: ${{ matrix.os }}
163+
timeout-minutes: 30
164+
steps:
165+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
166+
with:
167+
persist-credentials: false
168+
- uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1
169+
with:
170+
key: pdm-vex-capstone
171+
# Only main writes the cache: 30 PR matrix cells saving would churn
172+
# the repo's 10 GiB budget (ci.yml's rust-cache note).
173+
save-if: ${{ github.ref == 'refs/heads/main' }}
174+
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5
175+
with:
176+
python-version: '3.12'
177+
- run: python -m pip install uv==0.11.19
178+
- name: Real-PDM hosted + vendored flows with manifest-less VEX
179+
env:
180+
SOCKET_PATCH_PDM_E2E_REQUIRED: '1'
181+
SOCKET_PATCH_PDM_E2E_VERSION: ${{ matrix.pdm }}
182+
run: cargo test --locked -p socket-patch-cli --test e2e_vex_build -- 'pdm::' --ignored

‎.github/workflows/pipenv-compatibility.yml‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ on:
2323
- 'crates/socket-patch-cli/src/commands/vex.rs'
2424
- 'crates/socket-patch-core/src/patch/redirect/replay.rs'
2525
- 'scripts/backtest-pipenv.py'
26+
- 'scripts/tests/test_backtest_harnesses.py'
27+
- 'crates/socket-patch-core/src/vex/**'
28+
- 'crates/socket-patch-cli/src/commands/vex_sources.rs'
2629
- '.github/workflows/pipenv-compatibility.yml'
2730
push:
2831
branches: [main]
@@ -70,6 +73,8 @@ jobs:
7073
cargo build --locked -p socket-patch-cli
7174
mkdir -p "$RUNNER_TEMP/bin"
7275
cp target/debug/socket-patch "$RUNNER_TEMP/bin/socket-patch"
76+
- name: Harness unit tests
77+
run: python3 -m unittest scripts/tests/test_backtest_harnesses.py
7378
- name: Run the Pipenv matrix
7479
env:
7580
SOCKET_NO_CONFIG: '1'

‎.github/workflows/pnpm-compatibility.yml‎

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,19 +17,22 @@ jobs:
1717
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
1818
with:
1919
persist-credentials: false
20-
- name: Compile CLI and pnpm integration test once
20+
- name: Compile CLI and pnpm integration tests once
2121
run: |
22-
cargo test --locked -p socket-patch-cli --test e2e_redirect_pnpm_build --no-run --message-format=json > target-build.json
22+
cargo test --locked -p socket-patch-cli --test e2e_redirect_pnpm_build --test e2e_vendor_pnpm_build --no-run --message-format=json > target-build.json
2323
python3 - <<'PY'
2424
import json, pathlib, shutil
2525
dest = pathlib.Path('target/pnpm-e2e')
2626
dest.mkdir(parents=True, exist_ok=True)
2727
shutil.copy2('target/debug/socket-patch', dest / 'socket-patch')
28+
names = {'e2e_redirect_pnpm_build': 'pnpm-e2e', 'e2e_vendor_pnpm_build': 'pnpm-vendor-e2e'}
2829
for line in pathlib.Path('target-build.json').read_text().splitlines():
2930
item = json.loads(line)
30-
if item.get('target', {}).get('name') == 'e2e_redirect_pnpm_build' and item.get('executable'):
31-
shutil.copy2(item['executable'], dest / 'pnpm-e2e')
32-
assert (dest / 'pnpm-e2e').is_file()
31+
name = item.get('target', {}).get('name')
32+
if name in names and item.get('executable'):
33+
shutil.copy2(item['executable'], dest / names[name])
34+
for n in names.values():
35+
assert (dest / n).is_file(), n
3336
PY
3437
- uses: ./.github/actions/upload-artifact
3538
with:
@@ -41,7 +44,7 @@ jobs:
4144
install-proof:
4245
needs: build
4346
runs-on: ubuntu-latest
44-
timeout-minutes: 10
47+
timeout-minutes: 15
4548
strategy:
4649
fail-fast: false
4750
matrix:
@@ -100,3 +103,15 @@ jobs:
100103
chmod +x bin/socket-patch bin/pnpm-e2e
101104
export SOCKET_PATCH_PNPM_E2E_SOCKET_BIN="$PWD/bin/socket-patch"
102105
bin/pnpm-e2e pnpm_pinned_matrix --ignored --nocapture
106+
- name: Require vendored lifecycle and manifest-less VEX
107+
# pnpm >= 9: full vendored capstone (vendor + get --mode vendored);
108+
# 7-8: the legacy lifecycle; 1-6: vendoring refused, nothing attested.
109+
env:
110+
SOCKET_PATCH_PNPM_E2E_VERSION: ${{ matrix.pnpm }}
111+
SOCKET_PATCH_PNPM_E2E_REQUIRED: '1'
112+
SOCKET_NO_CONFIG: '1'
113+
SOCKET_NO_UPDATE_CHECK: '1'
114+
run: |
115+
chmod +x bin/socket-patch bin/pnpm-vendor-e2e
116+
export SOCKET_PATCH_PNPM_E2E_SOCKET_BIN="$PWD/bin/socket-patch"
117+
bin/pnpm-vendor-e2e pnpm_pinned_matrix --ignored --nocapture

0 commit comments

Comments
 (0)