match_unmapped_resources ignores matched_extensions and re-sends those files to PurlDB
I maintainer di solito rispondono entro 1 giorno
Valutazione
- Difficoltà
- 1/5
- Tempo stimato
- Meno di un'ora
- Idoneità per principianti
- 25/100
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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.
- Lingua principale
- Python
- Stelle
- 226
- Fork
- 222
- Merge medio
- 1g 5h
- PR unite (30g)
- 32
Preparare l'ambiente
- Include un Dockerfile o un file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di aboutcode-org/scancode.io
-
Register Missing Models in Django Admin (DiscoveredLicense, ProjectMessage, CodebaseRelation, Run, WebhookSubscription)Forse già presa @Rucha0901 l’ha presa 5 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
aboutcode-org/scancode.io#2329 ·
I maintainer di solito rispondono entro 1 giorno
-
ignored_dependency_scopes does not exclude npm devDependenciesForse già presa @MGpromax l’ha presa 83 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
aboutcode-org/scancode.io#2215 ·
I maintainer di solito rispondono entro 1 giorno
-
Delivery Error in scan_single_package: No connection adapters were found for '/notifications/send_scan_notification/Forse di nuovo libera @akshat-lakhera l’ha presa 30 giorni fa e non c’è nessuna pull request aperta. Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
aboutcode-org/scancode.io#2206 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
update `run` cli command to run pipelines without an inputForse già presa @NoiceHax l’ha presa 95 giorni fa. Apertanice-to-have
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
aboutcode-org/scancode.io#2203 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Local developement docs are outdatedForse già presa @nik-767 l’ha presa 125 giorni fa. Aperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 82/100
aboutcode-org/scancode.io#2197 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di aboutcode-org/scancode.io
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
GoogleCloudPlatform/professional-services-data-validator#1899 ·
I maintainer di solito rispondono entro 4 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
mohanraj00/entelos#200 ·
I maintainer di solito rispondono entro 1 giorno
-
Dead url in mise.tomlAperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 68/100
-
sweep
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
bketelsen/truenas-mcp#77 ·
I maintainer di solito rispondono entro 1 giorno
-
Console writes URL credentials to the local log, though AGENTS.md says secrets never reach diskAperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 86/100
sandbox-quantum/switch#2163 ·
I maintainer di solito rispondono entro 1 giorno