manage.py run: Fix Package URL (pkg:) handling and comma-splitting in input_location
维护者通常 1 天内回复
评估
调研方向
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:
- Run: python manage.py run scan_single_package pkg:npm/[email protected]
- See error: CommandError: pkg:npm/[email protected] not found.
- Or run: python manage.py run scan_single_package "pkg:deb/debian/[email protected]?arch=i386,distro=jessie"
- 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 小时
- 30 天内合并 PR
- 32
环境准备
- 提供 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
aboutcode-org/scancode.io 的其他 Issue
-
project_inputs.html uses undefined file variable for dropdown IDs, lacks visual tag badges, and has empty delete labels可能已有人在做 @Rucha0901 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 82/100
aboutcode-org/scancode.io#2354 ·
维护者通常 1 天内回复
-
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 天前认领,目前没有进行中的 PR。 未关闭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 天内回复
查看 aboutcode-org/scancode.io 的全部 Issue
相似的 Issue
-
author-page correction move-papers
难度 1/5 1 小时以内 新手友好度 78/100
acl-org/acl-anthology#10978 · 1 条评论 ·
维护者通常 1 天内回复
-
PostgreSQL results table stores labels with single quotes, and a double quote in a label fails the write可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭
难度 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 天内回复