Issue #3624667: Take the metrics generator back to one version, and leave test files out of the architecture surface
Two sessions improved the shared metrics generator at the same time, and it ended up in three versions: kessai's on #3621973, audit_trail's on #3620405, and the one this module carried. A file whose whole point is to be identical in every module cannot be three files.
This brings the union here, so all five carry the same file byte for byte:
- The dirty-tree warning, so regenerating with uncommitted changes says so rather than writing a page that only reproduces from a commit that does not exist yet.
- The architecture surface counted from shipped files in every row, not only the three read from PHP.
- The reason git gives when it cannot list the files, and a path git quotes (
"caf\303\251.md") read back as the name it really has — cloc finds no file of the quoted name and drops it from the count with a zero exit. - A docs link that names no module's branch, pointing at
HEADrather than1.x. - The info-file glob documented as non-recursive, with a refusal rather than a guess when a second one exists.
- The docblock says where the tests live: kessai's
tests/src/Unit/MetricsGeneratorTest.phpcovers every copy for as long as the copies stay identical, which the metrics job does not check.
The surface change
The table reported Services 205 where there are 199, event subscribers 27 where there are 26, and routes 102 where there are 98.
A test-support module is a module: it carries its own info file and can ship services, routes, permissions, a schema and plugins, all of it scaffolding for the suite and none of it surface a site gets. Verified by computing the surface twice, once from every tracked file and once from production files only, and asserting the two agree — which is one of the three tests in kessai.
Verification
- Regenerating twice produces identical pages.
- The page reproduces byte for byte in a Debian container with PHP 8.5 and the cloc the page names.
phpcs --standard=Drupal,DrupalPracticeclean.
Issue #3624667.