The checks of a release (CI hook)
After a tag's dist zip is built, the registry queues registry.scan: a row in exppkg_scan is handed to the runner
of [Scan] Runner. The results are stored as JSON and shown on the package page, in the admin (Setup > Package
registry > Checks) and in the REST and GraphQL APIs.
| Check | Fails when | Blocks by default |
|---|---|---|
| php-lint | php -l fails on one of [Scan] PhpBinaries[] | yes |
| composer-audit | composer audit finds a known vulnerability in the release's composer.lock, or in a lock resolved for its requirements (composer update --no-install) | yes |
| encoded | ionCube/SourceGuardian, eval of decoded strings, long encoded blobs | yes |
| license | no license in composer.json, no LICENSE/COPYING file, or (public packages) not GPL-compatible | yes |
| docs | no README or no changelog | yes |
| design-rules | the kernel's AdminStylingRulesTest rules on the templates: <style>, style="", inline handlers in admin designs | yes |
| api-rules | [StandardsRules] Rules[], drawn from the documented API rules | yes |
| codestyle | the kernel's phpcs rules (phpcs.xml.dist) when the dev tools are installed | no (CodestyleBlocking) |
| phpstan | the kernel's phpstan at PhpstanLevel when Phpstan=enabled | yes when it runs |
A blocking failure marks the version blocked: it stays on its page with the results and is left out of the
Composer metadata. An administrator can release it with a recorded reason, or run the checks again.
Runners
expPackageRegistryCiRunner (classes/exppackageregistrycirunner.php):
interface expPackageRegistryCiRunner
{
public function id();
/** @return array|null the result now, or null when the runner answers later */
public function submit( expPackageRegistryScan $scan, expPackageRegistryPackage $package, expPackageRegistryVersion $version, $workDir );
}localruns the checks in the worker, in<data>/ci/work/<scan id>(the zip unpacked, unsafe entries refused), every tool at nice 15 under a timeout.clusterwrites<data>/ci/requests/<scan id>.json(package, version, reference, dist URL and SHA-256, the matrix of[ClusterRunner] Matrix[], orFullMatrix[]for private packages) and leaves the scanpending. The cluster runner,./console ext:exp_package_registry:ci(its timer:timer install --ci, nice 19, idle I/O, one request a run), takes the requests oldest first, unpacks each release in tmpfs ([ClusterRunner] WorkDir, never belowMinFreeGBfree), runs every check above there and then every cell of the matrix, and reports throughexpPackageRegistryScanner::complete(); the request moves toci/done.
The compatibility matrix
A cell is an Exponential version, a PHP version and a database. Its parts:
| Part | Passed | Skipped | Failed |
|---|---|---|---|
| php | every PHP file lints clean with that PHP (PhpBinaries[<version>]) | no such PHP on the runner, or composer.json does not support it ("not supported") | a syntax error |
| exponential | the release's requirement of the kernel (KernelPackages[]) allows the version, or it has none | the requirement excludes it ("not supported") | - |
| database | the release's own sql/<engine>/schema.sql runs in a throwaway database (SQLite in memory; other engines on DatabaseDSN[<engine>]), or it has no schema of its own | no test server for the engine: never reported as passed | a statement fails (its number and the error) |
Every release gets Matrix[] (the latest Exponential; PHP 8.1 and the newest; MySQL, PostgreSQL, SQLite); private (paid)
packages get FullMatrix[] (five databases, PHP 7.4 to 8.5). The check "Compatibility matrix" sums the cells (never
blocking: a declared range is not a failure); the package page shows the table under the release's checks.