Skip to content

Commit da74c57

Browse files
George-iamclaude
andcommitted
fix(ci): verify-step extracts the .vsix instead of grepping the listing
The previous round of verify-step used `unzip -l | grep -F` to assert required files. Even after I switched to fixed-string matching, the grep kept reporting false negatives on Windows Git Bash — the file listing dumped on failure clearly showed every required path was present, but grep still didn't match them. Likely CRLF / encoding quirks in `unzip -l` output piped through `echo "$MANIFEST"` under Git Bash. Stop fighting it. Just extract the .vsix into a temp dir and run `test -f` against each REQUIRED path. Real filesystem checks, no parsing, no regex, no string-mode ambiguity. This adds ~75 MB of disk I/O per build (we extract the whole zip) which is fine for CI — the win32-x64 .vsix takes ~30s to package anyway and the runner has plenty of disk. On verify failure: still dump the relevant directories via `ls -la` so a real future regression is diagnosable from the CI log. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 5825b5c commit da74c57

1 file changed

Lines changed: 17 additions & 11 deletions

File tree

.github/workflows/publish-extension.yml

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -225,26 +225,32 @@ jobs:
225225
"extension/bin/node-runtime/node_modules/npm/bin/npm-cli.js"
226226
"extension/bin/node-runtime/node_modules/npm/bin/npm-prefix.js"
227227
)
228-
# `unzip -l` formats paths with variable leading whitespace
229-
# (depending on the size + date columns), so anchoring with
230-
# ` <path>$` in -E regex is unreliable and triggers false
231-
# negatives. Use -F (fixed string) and just look for the
232-
# path as a substring anywhere on the line — false positives
233-
# would require a different file ending with the same suffix
234-
# which doesn't happen in our .vsix layout.
235-
MANIFEST=$(unzip -l "$VSIX")
228+
# Earlier attempts grepped `unzip -l` output. That kept producing
229+
# false negatives on Windows Git Bash — even when the files were
230+
# clearly listed (we dumped them on failure), the grep didn't
231+
# match. Suspected cause: CRLF / encoding quirks in the unzip
232+
# listing. Switch to the bulletproof approach: actually extract
233+
# the .vsix into a temp dir and use `test -f` on each required
234+
# path. Same archive, real filesystem checks, no regex / grep
235+
# ambiguity.
236+
rm -rf .verify-extract
237+
unzip -q "$VSIX" -d .verify-extract
236238
missing=0
237239
for path in "${REQUIRED[@]}"; do
238-
if ! echo "$MANIFEST" | grep -qF "$path"; then
240+
if [ ! -f ".verify-extract/$path" ]; then
239241
echo "::error::Missing from $VSIX: $path"
240242
missing=1
241243
fi
242244
done
243245
if [ "$missing" -ne 0 ]; then
244-
echo "--- $VSIX contents (first 60 lines) ---"
245-
echo "$MANIFEST" | head -60
246+
echo "--- $VSIX contents (top of tree) ---"
247+
ls -la .verify-extract/extension/bin/ || true
248+
ls -la .verify-extract/extension/bin/node-runtime/ 2>/dev/null || echo "(node-runtime/ missing)"
249+
ls -la .verify-extract/extension/bin/node-runtime/node_modules/npm/bin/ 2>/dev/null || echo "(npm/bin/ missing)"
250+
rm -rf .verify-extract
246251
exit 1
247252
fi
253+
rm -rf .verify-extract
248254
echo "OK — all required bundled-Node files are inside $VSIX."
249255
250256
- uses: actions/upload-artifact@v4

0 commit comments

Comments
 (0)