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

未关闭
#724 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
74/100
Issue 类型
功能
描述清晰度
描述清楚
活跃度
活跃
技术栈
dart, typescript
领域
backend, security

调研方向

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.

由索引模型根据 Issue 内容生成。

描述

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.

主要语言
TypeScript
星标
4
派生
3
平均合并
1 天 22 小时
30 天内合并 PR
76

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

vibgrate/cli 的其他 Issue

查看 vibgrate/cli 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。