Enhancement: use `mix.lock` as an SBOM lockfile and emit `pkg:hex/` PURLs

Aperta
#723 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
55/100
Tipo di issue
Funzionalità
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
elixir, typescript

Direzione di ricerca

Start with src/engine/lockfile.ts (fullDependencyGraph), src/reporting/commands/sbom.ts (PROJECT_ECOSYSTEM), and src/core-open/utils/lockfile-parse.ts (KIND_BY_BASENAME); read the Elixir rows in docs/sbom-dependency-scope.md and compare the composer lockfile path and its tests. Add mix.lock coverage for Hex packages while excluding git, path, and in-umbrella entries, then update the scope documentation. Done when CycloneDX and SPDX produce the expected Hex PURL, invalid lockfiles fail clearly, and --no-transitive keeps only declared packages.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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

docs/sbom-dependency-scope.md states that the export list has no mix.lock, so a package that appears only there is absent, and CycloneDX dependencies / SPDX DEPENDS_ON are omitted. fullDependencyGraph in src/engine/lockfile.ts (around lines 396–410) walks npm, pnpm, yarn, Cargo.lock, go.sum, poetry, uv, Pipfile.lock, Gemfile.lock, composer.lock, and packages.lock.json — not mix.lock. PROJECT_ECOSYSTEM in src/reporting/commands/sbom.ts (around lines 70–84) has no elixir entry, so an Elixir project is treated as an unknown type and projectEcosystem falls back to 'npm' (with a guessed-ecosystem warning). That is adjacent to open #167 (do not guess npm PURLs), but this issue is specifically: expand mix.lock and map Elixir to Hex.

The scan already parses mix.lock in src/core-open/scanners/elixir-scanner.ts (around lines 649–659), and src/core-open/utils/version-timeline.ts already has parseMixLock. Fail-closed syntax checking in src/core-open/utils/lockfile-parse.ts (KIND_BY_BASENAME) also omits mix.lock.

Expected behaviour
  • Map elixir → Hex in PROJECT_ECOSYSTEM and emit pkg:hex/<name>@<version> (no npm fallback).
  • Expand mix.lock in fullDependencyGraph: hex entries (:hex) become components; git / path / in-umbrella entries are not registry components.
  • A lockfile package also declared in mix.exs at that version stays direct; a package only in the lockfile is transitive.
  • Development / optional marks from the manifest still apply when the name matches; follow the existing Elixir rows in docs/sbom-dependency-scope.md.
  • A truncated or invalid mix.lock fails the export the same way composer.lock does (LockfileParseError).
  • --no-transitive omits lockfile-only rows and keeps declared mix.exs rows.
  • Update docs/sbom-dependency-scope.md.
Acceptance
  • Tests modelled on test/sbom-composer-lock.test.ts / test/sbom-php-require-dev.test.ts.
  • CycloneDX and SPDX both emit pkg:hex/[email protected] (example) and never pkg:npm/jason.
  • A lockfile-only transitive hex package appears only when transitives are on.
  • Git / path lock entries are absent from the component list.
  • An invalid mix.lock exits non-zero with an actionable, content-free error.

Lingua principale
TypeScript
Stelle
4
Fork
3
Merge medio
1g 22h
PR unite (30g)
76

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di vibgrate/cli

Tutte le issue di vibgrate/cli

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.