match_unmapped_resources ignores matched_extensions and re-sends those files to PurlDB
Maintainer thường phản hồi trong vòng 1 ngày
Đánh giá
- Độ khó
- 1/5
- Thời gian dự kiến
- Dưới một giờ
- Mức phù hợp với người mới
- 25/100
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- 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
- Có Dockerfile hoặc tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- 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.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của aboutcode-org/scancode.io
-
project_inputs.html uses undefined file variable for dropdown IDs, lacks visual tag badges, and has empty delete labelsCó thể đã có người làm @Rucha0901 đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
aboutcode-org/scancode.io#2354 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Register Missing Models in Django Admin (DiscoveredLicense, ProjectMessage, CodebaseRelation, Run, WebhookSubscription)Có thể đã có người làm @Rucha0901 đã nhận 5 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
aboutcode-org/scancode.io#2329 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
ignored_dependency_scopes does not exclude npm devDependenciesCó thể đã có người làm @MGpromax đã nhận 83 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
aboutcode-org/scancode.io#2215 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Delivery Error in scan_single_package: No connection adapters were found for '/notifications/send_scan_notification/Có thể làm lại được @akshat-lakhera đã nhận 30 ngày trước và không có pull request nào đang mở. Đang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
aboutcode-org/scancode.io#2206 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
update `run` cli command to run pipelines without an inputCó thể đã có người làm @NoiceHax đã nhận 95 ngày trước. Đang mởnice-to-have
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
aboutcode-org/scancode.io#2203 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của aboutcode-org/scancode.io
Issue tương tự
-
author-page correction move-papers
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 78/100
acl-org/acl-anthology#10978 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
PostgreSQL results table stores labels with single quotes, and a double quote in a label fails the writeCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
GoogleCloudPlatform/professional-services-data-validator#1899 ·
Maintainer thường phản hồi trong vòng 4 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
HKUDS/CLI-Anything#652 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Project-N-E-K-O/N.E.K.O#3813 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Dao-AILab/flash-attention#3191 ·
Maintainer thường phản hồi trong vòng 4 ngày