Repository navigation
[TASK] Check the ci/ PHP code with GrumPHP and add PHPUnit tests - #602
Merged
Merged
Conversation
ci/ now uses pluswerk/grumphp-config: composer validate and normalize, PSR-12, PHPStan level 8, Rector, composer audit and PHPUnit, run by `vendor/bin/grumphp run`. The new CI job "Check ci/" runs it; no image build waits for it. The code is changed only as far as the checks require, and the generated files stay byte-identical: .github/workflows/build.yaml (apart from the new job), docs/assets/readme-banner-*.svg and glyphs.json. - Types for PHPStan level 8, Rector's PHP 8.4 and code quality rules - FileReader, GithubJobBuilder and the commands take the repository root, so the tests can run them against tests/Fixtures/repository - FileReader::collectDockerfiles() returns a sorted list of paths - bluem/tree 4.0: Node keeps the case of property keys, so the workaround for imageParent/imageparent is gone, and so is the PHP 8.4 deprecation - --blacklist entries match at the start of the image name too - symfony/yaml 6.4.50 for a security advisory 184 PHPUnit tests cover every class in ci/src. TrueTypeFont and GposKerning are tested with small fonts the tests write themselves.
- Empty and blank --blacklist entries, and -b without a value, match no image any more; str_contains() matched every image with them, and a missing value ended in a TypeError. Blank lines in ci/BLACKLIST are skipped the same way. - The commands get their names from #[AsCommand] instead of the static $defaultName that symfony/console deprecated in 6.1. - FileReader returns the Dockerfiles relative to the repository root, so the build context no longer depends on both classes getting the same root path string. GithubCommand takes autoLatestTag from FileReader instead of parsing conf/console.yml a second time. - "Validate Automation" installs the generators with --no-dev. - The test repository has docker/php/8.4 as a symbolic link, like docker/php/<version>, and the tests check it is not built twice. - Tests no longer pick a step by its index or compare two realpath() results that can both be false; AGENTS.md says that GrumPHP, not only PHPStan and Rector, checks files Git knows only.
- Entries of --blacklist and ci/BLACKLIST lose surrounding whitespace; an entry such as "php-nginx " matched no image, so the image was built anyway. - "docker: autoLatestTag" in conf/console.yml has to be a quoted tag. An unquoted 22.10 is a number in YAML and ended in a TypeError; a missing or empty value now stops with a message, too.
|
Kanti
marked this pull request as ready for review
November 9, 2026 14:58
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.




Summary
Adds the checks of pluswerk/grumphp-config and PHPUnit tests to
ci/, before the generators move to PHP. The generated files do not change;build.yamlonly gets the new job and--no-dev.Changes
ci/: composer validate and normalize, PSR-12, PHPStan level 8, Rector, Fractor,composer audit, PHPUnit. GrumPHP's own Composer plugin is off, so it installs no Git hooks.ci/src: fixes for PHPStan and Rector,#[AsCommand]instead of the deprecated$defaultName, the repository root as constructor argument for the tests, Dockerfile paths relative to the root.bluem/tree4.0 (3.2 triggers a deprecation on PHP 8.4),symfony/yaml6.4.50 (security advisory).--blacklistentries also match at the start of the image name; empty entries match nothing.ci/src, using a small fixture repository and fonts the tests write themselves.--no-dev.How it was verified
vendor/bin/grumphp run: all tasks pass, PHPUnit without deprecations.github:generate-ci,readme-banner:generateandreadme-banner:build-glyphsproduce the same files as master, apart from the new job and--no-dev.