Skip to the content
Documentation
Help Start
Reading in:
  • German: 9,199 of 9,199 pages
About the help in other languages
All help pages

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 >…

Download as PDF

Address: https://doc.exponential.earth/exphelp/viewer/ext/exp_package_registry/ci.md

On this page

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.

CheckFails whenBlocks by default
php-lintphp -l fails on one of [Scan] PhpBinaries[]yes
composer-auditcomposer audit finds a known vulnerability in the release's composer.lock, or in a lock resolved for its requirements (composer update --no-install)yes
encodedionCube/SourceGuardian, eval of decoded strings, long encoded blobsyes
licenseno license in composer.json, no LICENSE/COPYING file, or (public packages) not GPL-compatibleyes
docsno README or no changelogyes
design-rulesthe kernel's AdminStylingRulesTest rules on the templates: <style>, style="", inline handlers in admin designsyes
api-rules[StandardsRules] Rules[], drawn from the documented API rulesyes
codestylethe kernel's phpcs rules (phpcs.xml.dist) when the dev tools are installedno (CodestyleBlocking)
phpstanthe kernel's phpstan at PhpstanLevel when Phpstan=enabledyes 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 );
}
  • local runs 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.
  • cluster writes <data>/ci/requests/<scan id>.json (package, version, reference, dist URL and SHA-256, the matrix of [ClusterRunner] Matrix[], or FullMatrix[] for private packages) and leaves the scan pending. 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 below MinFreeGB free), runs every check above there and then every cell of the matrix, and reports through expPackageRegistryScanner::complete(); the request moves to ci/done.

The compatibility matrix

A cell is an Exponential version, a PHP version and a database. Its parts:

PartPassedSkippedFailed
phpevery 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
exponentialthe release's requirement of the kernel (KernelPackages[]) allows the version, or it has nonethe requirement excludes it ("not supported")-
databasethe 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 ownno test server for the engine: never reported as passeda 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.

Something wrong on this page? Report an error

Documentation license

This page is part of the documentation of the extension exp_package_registry and is distributed under the license of that extension.