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

Đang mở
#2,336 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

@Rucha0901 đang làm issue này rồi.

Từ ngày 16/11/2026.

  • #2337 của @Rucha0901 — đang mở

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
30/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
python
Lĩnh vực
cli

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.

Ngôn ngữ chính
Python
Star
226
Fork
222
Merge trung bình
1 ngày 5 giờ
Pull request đã merge (30 ngày)
32

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của aboutcode-org/scancode.io

Tất cả issue của aboutcode-org/scancode.io

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.