yarn.lock v1 with a scoped alias of an unscoped package yields no packages and no error
メンテナーはふだん 2 日以内に返信
評価
調査の方向性
src/packagedcode/npm.py の、@ 文字を数えるアサーション付近にある YarnLockV1Handler.parse を読みます。提供された、スコープなしパッケージのスコープ付きエイリアスで失敗を再現し、近くにある Yarn v1 の解析テストを調べて、どこにカバレッジを追加するか特定します。解析エラーなしでロックファイルからパッケージと依存関係のデータが得られれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Description
In a Yarn v1 yarn.lock, an alias whose own name is scoped and whose target is not scoped has three @:
"@jest/react-is-18@npm:react-is@^18.3.1":
version "18.3.1"
resolved "https://registry.yarnpkg.com/react-is/-/react-is-18.3.1.tgz#..."
YarnLockV1Handler.parse asserts that a requirement starting with @ has two @ (a scoped package) or four (a scoped alias of a scoped package):
if req.startswith('@'):
# 2 = package, 4 = alias
assert req.count('@') in [2, 4]
With three, the parsing fails with an AssertionError at src/packagedcode/npm.py line 1063 and the whole lockfile is lost. Through the CLI the scan completes with no package data, no dependencies and no scan error for the file.
In a sample of 6 Yarn v1 lockfiles from well-known projects, 2 fail this way (webpack/webpack and GoogleChrome/lighthouse), both on @jest/react-is-18@npm:react-is@^18.3.1 and @jest/react-is-19@npm:react-is@^19.2.5.
How To Reproduce
- Download
yarn.lockfrom https://github.com/webpack/webpack at commit71338e24bc. - Run
scancode --package --json-pp out.json yarn.lock - In
out.json,package_datais empty for the file,dependenciesis empty andscan_errorsis empty.
Calling packagedcode.npm.YarnLockV1Handler.parse() on the file directly shows the AssertionError.
System configuration
- macOS (Apple Silicon)
- scancode-toolkit 32.5.0; the same code is on
developat e423b48a1 - installed with pip, Python 3.12
- 主要言語
- Python
- スター
- 2.7k
- フォーク
- 871
- 平均マージ
- 1日 10時間
- マージ済み PR(30日)
- 3
環境構築
- Dockerfile または Docker Compose ファイルあり
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
aboutcode-org/scancode-toolkit のほかの issue
-
package-lock.json dependencies report file_references as a list inside a list対応中かも @Anbarasu2410 が 9 日前に担当しました。 オープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
aboutcode-org/scancode-toolkit#5449 · コメント 4 件 ·
メンテナーはふだん 2 日以内に返信
-
scancode aborts when encountering a broken RPM archive対応中かも @Ashutosh-Panda2004 が 14 日前に担当しました。 オープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
aboutcode-org/scancode-toolkit#5407 · コメント 3 件 ·
メンテナーはふだん 2 日以内に返信
-
Four silent bugs: IsRequiredPhrase.license_expression returns None, find_in_path ignores later PATH changes, duplicate dict keys override license mappings対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープンbug
難易度 2/5 半日 初心者へのやさしさ 65/100
aboutcode-org/scancode-toolkit#5405 · コメント 1 件 ·
メンテナーはふだん 2 日以内に返信
-
parse_maintainer_name_email returns empty name and wrong email when string has "@" but no angle brackets対応中かも @RohitSutar1823 が 15 日前に担当しました。 オープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
aboutcode-org/scancode-toolkit#5402 ·
メンテナーはふだん 2 日以内に返信
-
bug: Unreachable JSON extension and format validation in validate_input_path対応中かも @0Cymantek0 が 38 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
aboutcode-org/scancode-toolkit#5351 · コメント 1 件 ·
メンテナーはふだん 2 日以内に返信
aboutcode-org/scancode-toolkit の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
GoogleCloudPlatform/professional-services-data-validator#1899 ·
メンテナーはふだん 4 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
mohanraj00/entelos#200 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 68/100
-
sweep
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
bketelsen/truenas-mcp#77 ·
メンテナーはふだん 1 日以内に返信
-
Console writes URL credentials to the local log, though AGENTS.md says secrets never reach diskオープン
難易度 1/5 1時間未満 初心者へのやさしさ 86/100
sandbox-quantum/switch#2163 ·
メンテナーはふだん 1 日以内に返信