You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Enhancement: keep composer.json require-dev packages as development rows in vg scan and vg sbom export #544
parseComposerJson in src/core-open/scanners/php-scanner.ts already reads require-dev with isDev: true, but the scanner then keeps only allDeps.filter(d => !d.isDev) before building rows, so PHP development packages never reach the scan artifact. docs/sbom-dependency-scope.md lists this as gap 9: PHPUnit, PHPStan and friends are invisible in vg sbom export, unlike npm, Python, Rust, JVM, .NET and Elixir dev dependencies, which are exported with CycloneDX scope: excluded and SPDX DEV_DEPENDENCY_OF.
What to do
Emit require-dev packages as section: 'devDependencies' rows (the row-building code already maps isDev to that section).
Keep Packagist lookups and drift buckets on production rows only, as Elixir and Python do, so drift scores do not change.
A name in both require and require-dev is stored once, as dependencies.
Update the composer rows and gap 9 in docs/sbom-dependency-scope.md.
Acceptance
A require-dev package appears in vg sbom export with CycloneDX scope: excluded and SPDX DEV_DEPENDENCY_OF.
Drift score and buckets for a PHP fixture are unchanged.
Tests cover dev-only, prod-only, and a name in both tables.
Confirmed: parseComposerJson already sets isDev: true for require-dev, and the row builder maps dep.isDev to devDependencies (around line 330 of php-scanner.ts), but the loop runs over prodDeps = allDeps.filter(d => !d.isDev), so dev rows never get built. Keep prodDeps for the Packagist lookups and drift buckets, then add dev rows in a separate pass that skips the registry call and the bucket counters, the same pattern elixir-scanner.ts uses. Dedupe by name first so a package in both tables stays dependencies. Updating gap 9 in docs/sbom-dependency-scope.md to say require-dev is now exported (while composer.lock expansion is still #550) will keep the doc honest.
Activity
vibgrate-team commentedon Nov 2, 2026
Confirmed:
parseComposerJsonalready setsisDev: trueforrequire-dev, and the row builder mapsdep.isDevtodevDependencies(around line 330 ofphp-scanner.ts), but the loop runs overprodDeps = allDeps.filter(d => !d.isDev), so dev rows never get built. KeepprodDepsfor the Packagist lookups and drift buckets, then add dev rows in a separate pass that skips the registry call and the bucket counters, the same patternelixir-scanner.tsuses. Dedupe by name first so a package in both tables staysdependencies. Updating gap 9 indocs/sbom-dependency-scope.mdto sayrequire-devis now exported (whilecomposer.lockexpansion is still #550) will keep the doc honest.feat: export composer require-dev packages in scan and SBOM (vibgrate…