Skip to content

Fix CI crash on empty-range yarn.lock specifiers - #851

Merged
martin-henz merged 1 commit into
masterfrom
fix/ci-package-name-regex
Jul 27, 2026
Merged

Fix CI crash on empty-range yarn.lock specifiers#851
martin-henz merged 1 commit into
masterfrom
fix/ci-package-name-regex

Conversation

@martin-henz

Copy link
Copy Markdown
Member

Summary

  • extractPackageName() in .github/actions/src/lockfiles.ts threw on a bare pkg-name@ specifier (no resolution after the @), crashing the "Get Package Information" job on any PR whose yarn.lock diffs against master.
  • Root cause: @shikijs/vitepress-twoslash depends on @shikijs/twoslash with an empty version range ("npm:"), which the lockfile parser surfaces as the specifier @shikijs/twoslash@ — nothing after the trailing @. Confirmed by running snyk-nodejs-lockfile-parser against this repo's yarn.lock directly. Seen live in https://github.com/source-academy/modules/actions/runs/30240624537/job/89896871565 (PR Deploy conductor-ready modules to modules-conductor  #680).
  • Fix: relax the regex to allow an empty resolution part (.+$.*$), so these bare specifiers parse to just the package name instead of throwing.

Test plan

  • yarn test in .github/actions — 25/25 passing, including a new regression test for extractPackageName('@shikijs/twoslash@')
  • yarn build in .github/actions succeeds

🤖 Generated with Claude Code

https://claude.ai/code/session_014SWoqgBNWe8oP21aL2qejk

…ash@)

@shikijs/vitepress-twoslash declares its @shikijs/twoslash dependency
with an empty version range, which the yarn.lock parser surfaces as a
bare `pkg-name@` specifier. extractPackageName's regex required a
non-empty resolution part and threw on this, crashing the "Get
Package Information" job on any PR that touches yarn.lock.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014SWoqgBNWe8oP21aL2qejk
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Caution

The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased.

@martin-henz
martin-henz merged commit aa93cb1 into master Jul 27, 2026
12 checks passed
@martin-henz
martin-henz deleted the fix/ci-package-name-regex branch July 27, 2026 06:21
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.

1 participant