Fix CI crash on empty-range yarn.lock specifiers - #851
Merged
Conversation
…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
Contributor
|
Caution The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased. |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
extractPackageName()in.github/actions/src/lockfiles.tsthrew on a barepkg-name@specifier (no resolution after the@), crashing the "Get Package Information" job on any PR whoseyarn.lockdiffs against master.@shikijs/vitepress-twoslashdepends on@shikijs/twoslashwith an empty version range ("npm:"), which the lockfile parser surfaces as the specifier@shikijs/twoslash@— nothing after the trailing@. Confirmed by runningsnyk-nodejs-lockfile-parseragainst this repo'syarn.lockdirectly. Seen live in https://github.com/source-academy/modules/actions/runs/30240624537/job/89896871565 (PR Deploy conductor-ready modules to modules-conductor #680)..+$→.*$), so these bare specifiers parse to just the package name instead of throwing.Test plan
yarn testin.github/actions— 25/25 passing, including a new regression test forextractPackageName('@shikijs/twoslash@')yarn buildin.github/actionssucceeds🤖 Generated with Claude Code
https://claude.ai/code/session_014SWoqgBNWe8oP21aL2qejk