Make Gemnasium scan, report PHP Composer dev dependencies
Release notes
N/A
Problem to solve
Gemnasium doesn't scan development dependencies of PHP Composer, but it scans dev. dependencies of npm, yarn, and Ruby bundler projects. This behaviour is inconsistent.
Proposal
- Change the dependency file parser that handles
composer.lockto make it process bothpackagesandpackages-devwhenopts.IncludeDevis set to true. This is a trivial change since both share the same JSON structure, andpackagesis already parsed. - Update the expected report for the
tests/php-composertest project; it already contains development dependencies.
Further details
The file parser currently ignores packages-dev. See scanner/parser/composer/composer.go.
We already have a test project with dev. dependencies. See composer.json and composer.lock. Its dev dependencies are not reported. See expected report.
Implementation Plan
-
Update composer.Documentwith a new field:PackagesDev []Package json:`"packages-dev"` -
Update composer.Parseto include the dev packages only ifopts.IncludeDevis set to true. -
Update composer_test.goto test exclusion of dev packages whenopts.IncludeDevis set tofalse. -
Update integration test in gemnasium_image_spec.rbto include test cases when including and not including dev packages.
/cc @gonzoyumo @NicoleSchwartz
This page may contain information related to upcoming products, features and functionality. It is important to note that the information presented is for informational purposes only, so please do not rely on the information for purchasing or planning purposes. Just like with all projects, the items mentioned on the page are subject to change or delay, and the development, release, and timing of any products, features, or functionality remain at the sole discretion of GitLab Inc.