manage.py run: Fix Package URL (pkg:) handling and comma-splitting in input_location

オープン
#2,336 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

@Rucha0901 がすでに取り組んでいます。

2026年11月16日 から。

  • #2337 @Rucha0901 による — オープン

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
30/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
停滞
技術スタック
python
領域
cli

調査の方向性

Read scanpipe/management/commands/run.py, especially get_input_options() and its handling of input_location. Reproduce with the two pkg: examples in the issue. Done means Package URLs reach create-project as input URLs and commas inside qualifiers are preserved; a linked pull request is already open for this issue.

索引モデルが issue の本文から書いたものです。

説明

Describe the bug
In scanpipe/management/commands/run.py, get_input_options() inspects the input argument using location.startswith(tuple(SCHEME_TO_FETCHER_MAPPING.keys())).
Because SCHEME_TO_FETCHER_MAPPING only maps http, https, and docker, Package URLs (pkg:) are not recognized as URLs. They fall into the file handling block, where Path("pkg:...").exists() fails with CommandError: pkg:... not found.
In addition, splitting input_location indiscriminately using split(",") breaks Package URLs that contain commas in qualifiers (for example: pkg:deb/debian/[email protected]?arch=i386,distro=jessie).

System configuration

  • Which version of ScanCode.io are you running? main branch
  • Are you running the app using Docker? No
  • On which OS? macOS
  • What inputs are you using? Package URL (e.g. pkg:npm/[email protected] or pkg:deb/debian/[email protected]?arch=i386,distro=jessie)
  • Which pipeline are you running? Any pipeline run via manage.py run (e.g. scan_single_package)

To Reproduce
Steps to reproduce the behavior:

  1. Run: python manage.py run scan_single_package pkg:npm/[email protected]
  2. See error: CommandError: pkg:npm/[email protected] not found.
  3. Or run: python manage.py run scan_single_package "pkg:deb/debian/[email protected]?arch=i386,distro=jessie"
  4. See error: CommandError: distro=jessie not found.

Expected behavior
Package URLs starting with pkg: should be recognized as input URLs, qualifiers containing commas should not be split, and inputs should be passed to create-project in input_urls.

主要言語
Python
スター
226
フォーク
222
平均マージ
1日 5時間
マージ済み PR(30日)
32

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

aboutcode-org/scancode.io のほかの issue

aboutcode-org/scancode.io の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。