match_unmapped_resources ignores matched_extensions and re-sends those files to PurlDB
メンテナーはふだん 1 日以内に返信
評価
- 難易度
- 1/5
- 見積もり時間
- 1時間未満
- 初心者へのやさしさ
- 25/100
調査の方向性
Read match_unmapped_resources() in scanpipe/pipes/d2d.py and the corresponding tests in test_d2d.py. The issue reports that the result of .exclude() is discarded; confirm which resources reach the mocked PurlDB matcher when matched_extensions=[".java"]. Done means only the unmatched extension reaches the matcher and the test passes; a linked pull request is already open.
索引モデルが issue の本文から書いたものです。
説明
Describe the bug
match_unmapped_resources() in scanpipe/pipes/d2d.py is supposed to skip the extensions that were already looked up in PurlDB by the match_resources_to_purldb step (matched_extensions=self.ecosystem_config.matchable_resource_extensions), but the filter is never applied:
if matched_extensions:
to_unmapped.exclude(extension__in=matched_extensions)
The result of .exclude() is discarded, so to_unmapped still contains every file with a matched extension (for example all the .class files of a Java project) and they are sent to PurlDB a second time.
System configuration
- ScanCode.io
main(39acd55) - Local install, macOS
- Pipeline:
map_deploy_to_develop
To Reproduce
- Create a project with two
to/files that have no status, for exampleBaz.javaandexpected.json. - Call
d2d.match_unmapped_resources(project, matched_extensions=[".java"], logger=print)with_match_purldb_resourcesmocked. - The log says
Mapping 2 to/ resources with empty status in PurlDB using SHA1andBaz.javais passed to the PurlDB matcher.
Expected behavior
Only expected.json is sent to PurlDB (Mapping 1 to/ resources ...). Files with a matched extension still get the requires-review status at the end of the step, as they do today.
Proposed fix: assign the result, to_unmapped = to_unmapped.exclude(extension__in=matched_extensions), plus a unit test in test_d2d.py that calls match_unmapped_resources with matched_extensions and checks which resources reach the matcher. I have the change and the test ready locally and can open a PR.
- 主要言語
- Python
- スター
- 226
- フォーク
- 222
- 平均マージ
- 1日 5時間
- マージ済み PR(30日)
- 32
環境構築
- Dockerfile または Docker Compose ファイルあり
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
aboutcode-org/scancode.io のほかの issue
-
Register Missing Models in Django Admin (DiscoveredLicense, ProjectMessage, CodebaseRelation, Run, WebhookSubscription)対応中かも @Rucha0901 が 5 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
aboutcode-org/scancode.io#2329 ·
メンテナーはふだん 1 日以内に返信
-
ignored_dependency_scopes does not exclude npm devDependencies対応中かも @MGpromax が 83 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
aboutcode-org/scancode.io#2215 ·
メンテナーはふだん 1 日以内に返信
-
Delivery Error in scan_single_package: No connection adapters were found for '/notifications/send_scan_notification/再び着手できるかも @akshat-lakhera が 30 日前に担当しましたが、オープン中のプルリクエストはありません。 オープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
aboutcode-org/scancode.io#2206 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
update `run` cli command to run pipelines without an input対応中かも @NoiceHax が 95 日前に担当しました。 オープンnice-to-have
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
aboutcode-org/scancode.io#2203 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
Local developement docs are outdated対応中かも @nik-767 が 125 日前に担当しました。 オープン
難易度 1/5 1時間未満 初心者へのやさしさ 82/100
aboutcode-org/scancode.io#2197 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
aboutcode-org/scancode.io の issue をすべて見る
似ている issue
-
author-page correction move-papers
難易度 1/5 1時間未満 初心者へのやさしさ 78/100
acl-org/acl-anthology#10978 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
GoogleCloudPlatform/professional-services-data-validator#1899 ·
メンテナーはふだん 4 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
HKUDS/CLI-Anything#652 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
Project-N-E-K-O/N.E.K.O#3813 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
Dao-AILab/flash-attention#3191 ·
メンテナーはふだん 4 日以内に返信