GitHubivarvong

ply

main
ply7 git calls211 ms22 KiB4 cachedprotocol v2
309 lines14 KiBRaw
1name: ci
3on:
4 pull_request:
5 push:
6 branches: [main]
8permissions: {}
10# A new push to a pull request cancels the run it supersedes (it holds up to 7 runners against the account's
11# concurrent-job limit); runs on main are grouped by commit, so none is ever cancelled. Mutation testing is not here:
12# mutate.yml runs it beside this workflow, out of band (it took about an hour on main and held this run open).
13concurrency:
14 group: ci-${{ github.event.pull_request.number || github.sha }}
15 cancel-in-progress: ${{ github.event_name == 'pull_request' }}
17jobs:
18 # The suite (vitest), split across 4 runners by measured per-file duration: vitest.config.ts's sequencer partitions
19 # `--shard i/N` longest-first over test/durations.json instead of vitest's count-based split.
20 # One job was 6-15 min; a shard is one file's worth (the slowest file bounds it). i and N come from the matrix itself,
21 # so the partition cannot disagree with the number of shards, and the plan covers every file listed here exactly once.
22 test-shard:
23 name: test-shard (${{ matrix.shard }})
24 runs-on: ubuntu-latest
25 permissions:
26 contents: read
27 actions: write # setup-node persists the npm cache
28 strategy:
29 fail-fast: false
30 matrix:
31 shard: [1, 2, 3, 4]
32 env:
33 GIT_AUTHOR_NAME: ply
34 GIT_AUTHOR_EMAIL: ply@example.com
35 GIT_COMMITTER_NAME: ply
36 GIT_COMMITTER_EMAIL: ply@example.com
37 steps:
38 - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
39 with:
40 persist-credentials: false
41 - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
42 with:
43 node-version: 22
44 cache: npm
45 - name: git identity
46 run: git config --global user.name ply && git config --global user.email ply@example.com
47 - run: npm ci
48 - name: vitest
49 env:
50 INDEX: ${{ strategy.job-index }}
51 TOTAL: ${{ strategy.job-total }}
52 # gate c (test/space): every test process records the src/ fail sites it reaches; the `test` job judges them
53 PLY_FAILSITES: .failsites
54 NODE_OPTIONS: --import ${{ github.workspace }}/test/space/failsite-hook.mjs
55 run: npx vitest run --shard "$((INDEX + 1))/${TOTAL}" --reporter=default --reporter=json --outputFile.json="reports/vitest/shard-$((INDEX + 1)).json"
56 # Per-file test counts and durations from a real runner (test/durations.json is refreshed from these).
57 - uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
58 if: success() || failure()
59 with:
60 name: vitest-shard-${{ matrix.shard }}
61 path: reports/vitest/
62 if-no-files-found: ignore
63 retention-days: 14
64 - uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
65 if: success() || failure()
66 with:
67 name: failsites-${{ matrix.shard }}
68 path: .failsites
69 include-hidden-files: true
70 if-no-files-found: error
71 retention-days: 14
73 # Types (tsc, isolated declarations, the TS ratchet against the PR base, the absence ratchet), lint, the dist build consumers import, and
74 # three fuzzers. The fuzzers run src/*.ts under node's type stripping; --import ./test/ts-resolve.mjs maps the .js
75 # specifiers to .ts (GitHub refuses NODE_OPTIONS through $GITHUB_ENV, so each command names the hook).
76 lint-fuzz:
77 name: lint + fuzz
78 runs-on: ubuntu-latest
79 permissions:
80 contents: read
81 actions: write # setup-node persists the npm cache
82 env:
83 GIT_AUTHOR_NAME: ply
84 GIT_AUTHOR_EMAIL: ply@example.com
85 GIT_COMMITTER_NAME: ply
86 GIT_COMMITTER_EMAIL: ply@example.com
87 steps:
88 - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
89 with:
90 fetch-depth: 0
91 persist-credentials: false
92 - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
93 with:
94 node-version: 22
95 cache: npm
96 - name: git identity
97 run: git config --global user.name ply && git config --global user.email ply@example.com
98 - run: npm ci
99 - name: typecheck (tsc, isolated declarations, TS ratchet, absence ratchet)
100 env:
101 RATCHET_BASE: ${{ github.event.pull_request.base.sha || github.event.before }}
102 run: npm run typecheck
103 # Each ratchet compares the tree with its baseline, so a change that edits both passes it. This compares the
104 # baselines with the base commit's: one that moved the unsafe way needs `Ratchet-Change: <file>: <reason>`.
105 - name: ratchet baselines loosen only with a Ratchet-Change line
106 env:
107 RATCHET_BASE: ${{ github.event.pull_request.base.sha || github.event.before }}
108 run: node scripts/ratchet-guard.mjs
109 # lint ends with the regex gate (scripts/regex-gate.mjs): every regex in src/ has an inventory row and no refused
110 # shape. The rows' ratio test is test/regex-linear.test.js, which runs in the test shards.
111 - run: npm run lint
112 # The full mutation run fits its job: the heaviest planned shard, on a runner twice as slow as the reference
113 # (RUNNER_WORST), at most 2/3 of mutate.yml's mutate-shard timeout-minutes, 60 of 90 (scripts/mutate.mjs --budget,
114 # #313). The instrumenter only, about 2 s.
115 - name: mutation plan fits the shard job limit
116 run: node scripts/mutate.mjs --budget
117 # The same command as the last step of `npm run check` (test/workflows.test.js holds the two equal). It builds
118 # into a scratch directory, imports `ply` there (Tracer and RETRY exported), then compiles the built d.ts as a
119 # consumer of every subpath, skipLibCheck false: lib ES2022 + @types/node 20, 22 and 24, lib DOM, and
120 # @cloudflare/workers-types. The type packages are pinned devDependencies that npm ci installs; a missing one
121 # fails this step, none is skipped (scripts/dist-check.mjs; test/dist-types.test.js runs it in the suite too)
122 - name: dist is what consumers import
123 run: node scripts/dist-check.mjs
124 - name: below-hash fuzzer
125 run: node --import ./test/ts-resolve.mjs test/fuzz/below-hash.mjs --n 20 --seed 1 && node --import ./test/ts-resolve.mjs test/fuzz/below-hash.mjs --seed 20261030 --n 100 --case 1730047880
126 - name: git-semantic fuzzer
127 run: node --import ./test/ts-resolve.mjs test/fuzz/git-semantic.mjs --n 20 --seed 1
128 - name: liar merge-base fuzzer
129 run: node --import ./test/ts-resolve.mjs test/fuzz/liar.mjs --op mergebase --n 40 --seed 1
131 fuzz:
132 # Deterministic fuzz, fixed seeds and sizes, in parallel with the shards and gated by `test`; it finishes before the
133 # slowest shard (154-305 s against 653-760 s on main, Nov 2026), so gating it adds no PR wall time. The deep,
134 # date-seeded runs are in nightly.yml. hostile --case 2366521731 is the pinned case npm test also runs.
135 # Each command names the .js -> .ts resolve hook (see lint-fuzz).
136 name: fuzz
137 runs-on: ubuntu-latest
138 timeout-minutes: 20
139 permissions:
140 contents: read
141 actions: write # setup-node persists the npm cache
142 env:
143 GIT_AUTHOR_NAME: ply
144 GIT_AUTHOR_EMAIL: ply@example.com
145 GIT_COMMITTER_NAME: ply
146 GIT_COMMITTER_EMAIL: ply@example.com
147 steps:
148 - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
149 with:
150 persist-credentials: false
151 - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
152 with:
153 node-version: 22
154 cache: npm
155 - name: git identity
156 run: git config --global user.name ply && git config --global user.email ply@example.com
157 - run: npm ci
158 - name: hostile fuzzer
159 run: node --import ./test/ts-resolve.mjs test/fuzz/hostile.mjs --n 180 --seed 1 && node --import ./test/ts-resolve.mjs test/fuzz/hostile.mjs --case 2366521731
160 - name: liar fuzzer
161 run: node --import ./test/ts-resolve.mjs test/fuzz/liar.mjs --n 120 --seed 1
162 - name: protocol fuzzer
163 run: node --import ./test/ts-resolve.mjs test/fuzz/protocol.mjs --n 300 --seed 1
164 - name: packs fuzzer
165 run: node --import ./test/ts-resolve.mjs test/fuzz/packs.mjs --n 36 --seed 1
166 - name: codec fuzzer
167 run: node --import ./test/ts-resolve.mjs test/fuzz/codec.mjs --n 15000 --seed 1
168 - name: attributes fuzzer
169 run: node --import ./test/ts-resolve.mjs test/fuzz/attributes.mjs --n 120 --seed 1
171 # Cells at or under 16 MiB and 65_536 entries, each in its own process on the default heap and at 128 MiB (workerd
172 # cells once, in their own workerd process: workerd is a devDependency).
173 # The full matrix (past those sizes, and the long delta chains) is the nightly job. `test` gates on it (the vitest
174 # shards do not run this file); it finishes before the slowest shard (160-250 s on main, Nov 2026).
175 sweep:
176 name: limit sweep
177 runs-on: ubuntu-latest
178 timeout-minutes: 40
179 permissions:
180 contents: read
181 actions: write # setup-node persists the npm cache
182 env:
183 GIT_AUTHOR_NAME: ply
184 GIT_AUTHOR_EMAIL: ply@example.com
185 GIT_COMMITTER_NAME: ply
186 GIT_COMMITTER_EMAIL: ply@example.com
187 steps:
188 - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
189 with:
190 persist-credentials: false
191 - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
192 with:
193 node-version: 22
194 cache: npm
195 - name: git identity
196 run: git config --global user.name ply && git config --global user.email ply@example.com
197 - run: npm ci
198 - name: sweep (small cells)
199 run: node --import ./test/ts-resolve.mjs test/sweep/run.mjs --ci
201 # What a consumer installs: the npm pack tarball, built from a fresh export of the tracked files, installed with
202 # --ignore-scripts into an empty project (one package, no registry), the root and every subpath imported, and
203 # require('ply') compared with README Install, under Node 22 and then the same tarball under Node 20 and 24
204 # (scripts/pack-check.mjs). On Node 22 it also runs the setup command examples/README.md documents in a fresh export
205 # and starts each example. The tarball is uploaded as the artifact `ply-tarball`.
206 # It runs on every pull request and every push to main, and `test` gates on it: a tarball that misses a file, breaks a
207 # subpath export or fails under Node 20 or 24 fails `test`.
208 pack:
209 name: pack + install
210 runs-on: ubuntu-latest
211 timeout-minutes: 15
212 permissions:
213 contents: read
214 steps:
215 - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
216 with:
217 persist-credentials: false
218 - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
219 with:
220 node-version: 22
221 - run: npm ci
222 - name: pack, install --ignore-scripts, import every subpath, examples from a fresh export (Node 22)
223 run: node scripts/pack-check.mjs --out pack-out
224 - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
225 with:
226 node-version: 20
227 - name: the same tarball under Node 20
228 run: node scripts/pack-check.mjs --tarball pack-out/ply-*.tgz
229 - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
230 with:
231 node-version: 24
232 - name: the same tarball under Node 24
233 run: node scripts/pack-check.mjs --tarball pack-out/ply-*.tgz
234 - uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
235 with:
236 name: ply-tarball
237 path: pack-out/ply-*.tgz
238 if-no-files-found: error
240 # The gate. Its name stays `test` so anything waiting on that check still works. It runs even when a shard fails or
241 # is cancelled (a skipped check would count as passing), and fails unless every shard, lint + fuzz, fuzz, limit sweep
242 # and pack + install succeeded.
243 test:
244 name: test
245 needs: [test-shard, lint-fuzz, fuzz, sweep, pack]
246 if: always()
247 runs-on: ubuntu-latest
248 permissions:
249 contents: read
250 actions: read # the shards' fail-site records
251 steps:
252 - name: every needed job succeeded
253 env:
254 SHARDS: ${{ needs.test-shard.result }}
255 LINT_FUZZ: ${{ needs.lint-fuzz.result }}
256 FUZZ: ${{ needs.fuzz.result }}
257 SWEEP: ${{ needs.sweep.result }}
258 PACK: ${{ needs.pack.result }}
259 run: |
260 echo "test-shard: $SHARDS, lint-fuzz: $LINT_FUZZ, fuzz: $FUZZ, sweep: $SWEEP, pack: $PACK"
261 for r in "$SHARDS" "$LINT_FUZZ" "$FUZZ" "$SWEEP" "$PACK"; do
262 if [ "$r" != success ]; then exit 1; fi
263 done
264 # gate c over every shard's records: each fail site reached by a cell, each merged space's claims reached by it, and
265 # every merged CI space's runners recorded on Linux (test/space/failsites.test.js)
266 - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
267 with:
268 persist-credentials: false
269 - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
270 with:
271 node-version: 22
272 - run: npm ci
273 - uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
274 with:
275 pattern: failsites-*
276 path: .failsites
277 merge-multiple: true
278 - name: gate c (fail sites)
279 env:
280 PLY_FAILSITES: .failsites
281 PLY_FAILSITES_GATE: 1
282 run: npx vitest run test/space/failsites.test.js
284 supply-chain:
285 name: actionlint
286 runs-on: ubuntu-latest
287 permissions:
288 contents: read
289 steps:
290 - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
291 with:
292 persist-credentials: false
293 - name: actionlint
294 env:
295 ACTIONLINT_VERSION: 1.7.12
296 ACTIONLINT_SHA256: 8aca8db96f1b94770f1b0d72b6dddcb1ebb8123cb3712530b08cc387b349a3d8
297 run: |
298 set -euo pipefail
299 curl -fsSL -o actionlint.tar.gz "https://github.com/rhysd/actionlint/releases/download/v${ACTIONLINT_VERSION}/actionlint_${ACTIONLINT_VERSION}_linux_amd64.tar.gz"
300 echo "${ACTIONLINT_SHA256} actionlint.tar.gz" | sha256sum -c
301 tar -xzf actionlint.tar.gz actionlint
302 ./actionlint -color
303 - uses: zizmorcore/zizmor-action@53290badfa369cb0bf7ad16342cb62c2fa47ac7b # v0.8.0
304 with:
305 inputs: .github/workflows
306 version: "1.31.1"
307 online-audits: false
308 advanced-security: false
309 persona: regular
Diagnostics7 git calls · 211 ms
CallStatusSizeTime0211 ms
discover200191 B2 ms
git.upload-pack discover
http.response.status_code=200
git.upstream.cf_ray=-
git.upstream.phase=fetch
git.upstream.dur_ms=2
git.response.bytes=191
git.server.agent=git/github-9922ec520325-Linux
git.server.object_format=sha1
git.server.caps=agent ls-refs fetch server-option object-format
git.server.fetch=shallow wait-for-done filter
git.protocol.version=2
git.pkt.frames=9
git.pkt.data=7
git.pkt.flush=2
git.pkt.delim=0
git.pkt.bytes=191
git.pkt.payload.max=36
ls-refs20012 KiB2 ms
git.upload-pack ls-refs
http.response.status_code=200
git.upstream.cf_ray=-
git.upstream.phase=ls-refs
git.upstream.dur_ms=2
git.response.bytes=11990
git.response.cache=UPDATING
git.response.duration_ms=2
git.protocol.version=2
git.pkt.frames=152
git.pkt.data=151
git.pkt.flush=1
git.pkt.delim=0
git.pkt.bytes=11990
git.pkt.payload.max=122
git.ls_refs.count=151
git.ls_refs.head=refs/heads/main
fetchtree:0 · deepen 102004.2 KiB · hit2 ms
git.upload-pack fetch
http.response.status_code=200
git.upstream.cf_ray=-
git.upstream.phase=fetch
git.upstream.dur_ms=3
git.response.bytes=4347
git.response.cache=HIT
git.response.duration_ms=2
git.fetch.filter=tree:0
git.fetch.wants=19912563f540228593df0c489082e5e2508e21e4
git.fetch.haves.count=0
git.fetch.deepen=10
git.fetch.thin_pack=false
git.fetch.ofs_delta=true
git.protocol.version=2
git.pkt.frames=7
git.pkt.data=5
git.pkt.flush=1
git.pkt.delim=1
git.pkt.bytes=4347
git.pkt.payload.max=4247
git.sideband.band1.bytes=4247
git.sideband.band2.bytes=0
git.sideband.band3.bytes=0
git.pack.objects=10
git.pack.bytes=4247
git.pack.ofs_delta=0
git.pack.ref_delta=0
git.pack.chain.max=0
git.pack.trailer=a6caf8e129bea82c9bae4cbc7c130c9205add400
git.pack.full=10
Open pack map
fetchtree:0200919 B · hit3 ms
git.upload-pack fetch
http.response.status_code=200
git.upstream.cf_ray=-
git.upstream.phase=fetch
git.upstream.dur_ms=4
git.response.bytes=919
git.response.cache=HIT
git.response.duration_ms=3
git.fetch.filter=tree:0
git.fetch.wants=800d30ba8923860bfc460ca884b7f9ba22083588
git.fetch.haves.count=0
git.fetch.deepen=0
git.fetch.thin_pack=false
git.fetch.ofs_delta=true
git.protocol.version=2
git.pkt.frames=4
git.pkt.data=3
git.pkt.flush=1
git.pkt.delim=0
git.pkt.bytes=919
git.pkt.payload.max=892
git.sideband.band1.bytes=892
git.sideband.band2.bytes=0
git.sideband.band3.bytes=0
git.pack.objects=1
git.pack.bytes=892
git.pack.trailer=5323b9266eea5ded637285d1c5320699f12be76e
Open pack map
fetchtree:0200143 B · hit4 ms
git.upload-pack fetch
http.response.status_code=200
git.upstream.cf_ray=-
git.upstream.phase=fetch
git.upstream.dur_ms=3
git.response.bytes=143
git.response.cache=HIT
git.response.duration_ms=4
git.fetch.filter=tree:0
git.fetch.wants=acaa5a302ae76735950954bedde15c5073911dff
git.fetch.haves.count=0
git.fetch.deepen=0
git.fetch.thin_pack=false
git.fetch.ofs_delta=true
git.protocol.version=2
git.pkt.frames=4
git.pkt.data=3
git.pkt.flush=1
git.pkt.delim=0
git.pkt.bytes=143
git.pkt.payload.max=116
git.sideband.band1.bytes=116
git.sideband.band2.bytes=0
git.sideband.band3.bytes=0
git.pack.objects=1
git.pack.bytes=116
git.pack.trailer=14c5da7c3898ed3ab371e1548304ea110a893c7f
Open pack map
fetchtree:0200206 B · hit3 ms
git.upload-pack fetch
http.response.status_code=200
git.upstream.cf_ray=-
git.upstream.phase=fetch
git.upstream.dur_ms=196
git.response.bytes=206
git.response.cache=HIT
git.response.duration_ms=3
git.fetch.filter=tree:0
git.fetch.wants=1d0ad94ed315cb03775b57547f074d530e4acc80
git.fetch.haves.count=0
git.fetch.deepen=0
git.fetch.thin_pack=false
git.fetch.ofs_delta=true
git.protocol.version=2
git.pkt.frames=4
git.pkt.data=3
git.pkt.flush=1
git.pkt.delim=0
git.pkt.bytes=206
git.pkt.payload.max=179
git.sideband.band1.bytes=179
git.sideband.band2.bytes=0
git.sideband.band3.bytes=0
git.pack.objects=1
git.pack.bytes=179
git.pack.trailer=c9ad2e83a5acba191285d2448625f70de0746fab
Open pack map
fetch2004.3 KiB197 ms
git.upload-pack fetch
http.response.status_code=200
git.response.bytes=4446
git.response.cache=MISS
git.response.duration_ms=197
git.fetch.wants=bd4af2699e0d1fb074d50a2e690d2ed4a4f1ec31
git.fetch.haves.count=0
git.fetch.deepen=0
git.fetch.thin_pack=false
git.fetch.ofs_delta=true
git.protocol.version=2
git.pkt.frames=4
git.pkt.data=3
git.pkt.flush=1
git.pkt.delim=0
git.pkt.bytes=4446
git.pkt.payload.max=4419
git.sideband.band1.bytes=4419
git.sideband.band2.bytes=0
git.sideband.band3.bytes=0

Each row is one HTTP round trip ply made to the git server for this page, on one timeline. discover asks what the server speaks, ls-refs lists branch tips, fetch brings objects by id. A hit was served by Workers Cache. Tap a row for its wire details.

Remote
https://github.com/ivarvong/ply
Ref
refs/heads/main
Commit
19912563f540228593df0c489082e5e2508e21e4
cf-ray
a5e19fbdde0c3cd0
Request
2dbb4b70…
Protocol
v2 · sha1
Agent
git/github-9922ec520325-Linux
Filter
advertised
Fetch
shallow wait-for-done filter
Capabilities
agent ls-refs fetch server-option object-format