Issue importing a scancode.io JSON results into VirtualCodebase

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

Chưa có ai nhận issue này.

Đánh giá

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

Hướng nghiên cứu

Bắt đầu trong commoncode/resource.py, khoảng dòng 671, và theo dõi cách các tài nguyên JSON của scancode.io được nạp vào VirtualCodebase. Tái hiện trường hợp walk() với các tài nguyên có tên example.zip và example.zip-extract, sau đó xác minh rằng các phần tử con được nhập vẫn giữ nguyên các tên tệp đầy đủ đó và việc duyệt tiếp tục vượt qua virtual_root.

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

Mô tả

We're encountering the issue where we cannot walk a VirtualCodebase created from a scancode.io scan (prior to v31.0.0). When the scan is loaded into VirtualCodebase, and we call walk(), only the virtual_root is returned. This is due to the scancode.io Resource names not containing the extensions. The full filename is required for a VirtualCodebase to work since we keep the filenames of the children of each Resource (https://github.com/nexB/commoncode/blob/main/src/commoncode/resource.py#L671). If the filename isn't the complete filename, then the Resource will never find the child Resource when walking.

For example, in the problematic scan, the two resources at the root have the paths example.zip and example.zip-extract, but their names are both example. When loaded into a VirtualCodebase, the virtual_root has two children, but their names are both example, when it should be example.zip and example.zip-extract. Since virtual_root/example does not exist in resources_by_path of the VirtualCodebase, then we cannot continue the walk.

Ngôn ngữ chính
Python
Star
4
Fork
25
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

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

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

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/commoncode

Tất cả issue của aboutcode-org/commoncode

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.