Enhancement: use `pubspec.lock` as an SBOM lockfile

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

Maintainer thường phản hồi trong vòng 1 ngày

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
74/100
Loại issue
Tính năng
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
dart, typescript
Lĩnh vực
backend, security

Hướng nghiên cứu

Read src/engine/lockfile.ts around the pubspecLock helper, then trace how fullDependencyGraph handles pubspec.yaml and how test/sbom-composer-lock.test.ts and test/sbom-dart-dev-dependencies.test.ts cover exports. Add nearby Dart lockfile tests for transitive packages, SDK exclusions, development scope, invalid input, and --no-transitive; update docs/sbom-dependency-scope.md. Done when the acceptance cases pass for CycloneDX and SPDX.

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

Mô tả

enhancement help wanted
  • Difficulty: medium
  • Area: SBOM / Dart
Problem

Same shape as issue 18, for Dart. docs/sbom-dependency-scope.md says the export list has no pubspec.lock. fullDependencyGraph does not call a pubspec lock tree (there is already a pubspecLock helper in src/engine/lockfile.ts around lines 147–151 for version lookup, but it is not part of the export graph). SDK packages (sdk: flutter, sdk: dart / sdk: flutter test packages) must stay out of the component list, matching the manifest rules already tested in test/sbom-dart-dev-dependencies.test.ts.

Direct pubspec.yaml rows already export with pkg:pub/…. Transitive packages that only the lockfile knows are missing from vg sbom export.

Expected behaviour

Expand pubspec.lock in fullDependencyGraph with ecosystem dart. A locked package also declared in pubspec.yaml at that version stays direct; lockfile-only packages are transitive. dev_dependencies already declared in the manifest keep their development marks (scope excluded / SPDX DEV_DEPENDENCY_OF). SDK entries in the lockfile are not components. A truncated or invalid pubspec.lock fails the export. --no-transitive drops lockfile-only rows. Update docs/sbom-dependency-scope.md. KIND_BY_BASENAME already lists pubspec.lock as YAML; keep fail-closed parsing.

Acceptance
  • Tests next to test/sbom-dart-dev-dependencies.test.ts, modelled on test/sbom-composer-lock.test.ts.
  • A lockfile-only transitive pub package appears in both CycloneDX and SPDX with a pkg:pub/… purl when transitives are on.
  • flutter / flutter_test SDK entries are still absent.
  • flutter_lints declared under dev_dependencies stays a direct development row.
  • An invalid pubspec.lock exits non-zero with an actionable, content-free error.

Ngôn ngữ chính
TypeScript
Star
4
Fork
3
Merge trung bình
1 ngày 22 giờ
Pull request đã merge (30 ngày)
76

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

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 vibgrate/cli

Tất cả issue của vibgrate/cli

Issue tương tự

Thêm issue về TypeScript

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.