manage.py run: Fix Package URL (pkg:) handling and comma-splitting in input_location
Maintainers usually reply within 1 day
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 30/100
Research direction
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.
Written by the indexing model from the issue text.
Description
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.
- Dominant language
- Python
- Stars
- 226
- Forks
- 222
- Avg merge
- 1d 5h
- Merged PRs (30d)
- 32
Getting set up
- Ships a Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from aboutcode-org/scancode.io
-
Register Missing Models in Django Admin (DiscoveredLicense, ProjectMessage, CodebaseRelation, Run, WebhookSubscription)Possibly taken @Rucha0901 claimed this 5 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
aboutcode-org/scancode.io#2329 ·
Maintainers usually reply within 1 day
-
ignored_dependency_scopes does not exclude npm devDependenciesPossibly taken @MGpromax claimed this 83 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
aboutcode-org/scancode.io#2215 ·
Maintainers usually reply within 1 day
-
Delivery Error in scan_single_package: No connection adapters were found for '/notifications/send_scan_notification/May be free again @akshat-lakhera claimed this 30 days ago, and no pull request is open. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
aboutcode-org/scancode.io#2206 · 1 comment ·
Maintainers usually reply within 1 day
-
update `run` cli command to run pipelines without an inputPossibly taken @NoiceHax claimed this 95 days ago. Opennice-to-have
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
aboutcode-org/scancode.io#2203 · 1 comment ·
Maintainers usually reply within 1 day
-
Local developement docs are outdatedPossibly taken @nik-767 claimed this 125 days ago. Open
Difficulty 1/5 Under an hour Newbie friendliness 82/100
aboutcode-org/scancode.io#2197 · 1 comment ·
Maintainers usually reply within 1 day
All issues in aboutcode-org/scancode.io
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
GoogleCloudPlatform/professional-services-data-validator#1899 ·
Maintainers usually reply within 4 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
mohanraj00/entelos#200 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 68/100
-
sweep
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
bketelsen/truenas-mcp#77 ·
Maintainers usually reply within 1 day
-
Console writes URL credentials to the local log, though AGENTS.md says secrets never reach diskOpen
Difficulty 1/5 Under an hour Newbie friendliness 86/100
sandbox-quantum/switch#2163 ·
Maintainers usually reply within 1 day