Repository navigation
v0.1.34
Added
-
promote-reportreads PERF-01 and PERF-07. It uses the same static assessment as thePerformance budgetsstep (PerformanceCheck::assess(), whichrun()now shares):would-blockwith the problems of the budgets file or of the nightly measures,clean, ornot-applicablewhen the repository declares neither. Without it the two rules showed asno-probeonce PERF-01 and PERF-07 became observed. -
PERF-01 and PERF-07 are
observed: a Performance budgets step reads the query budgets and the nightly measures of a repository, without running a site. PERF-01: when the repository has a budgets file (tests/e2e/budgets.jsonby default, the framework's{ "pages": { "home": { "wordpress": 24, "laravel": 0 } } }), the step validates its shape (whole numbers ornull), lists thenullbudgets as measured-only and applies a ratchet: a budget that went up, becamenullor was removed since the base commit (HEAD^1, orcheck --budgets-base=REF) fails; a base that is not in the checkout, a file new since the base or an unreadable base file givenot compared with <base>: <why>, never a pass that did not compare. PERF-07: when the repository has the nightly measuring spec (tests/e2e/specs/perf-metrics.spec.ts) or declaresperformance.nightly, the step checks that the measuring file and the comparing script exist, that a workflow has anon: schedulewith acronand runs both, and that the comparison's--toleranceis at most 0.1. A repository that declares neither getsskippedwith the reason. The newperformancekey of.harness.json(budgets,nightly.measure,nightly.compare,nightly.workflow, all optional, paths inside the repository) is read, written byratchet --updateand kept byinit. The step is observed by default (Plan::OBSERVED_BY_DEFAULT), socheckhas 13 steps instead of 12; the catalogue now counts 32 enforced, 6 observed and 2 planned rules. The reusable workflowphp-package.ymlalways checks out two commits (fetch-depth: 2; it was 2 only for a limited mutation scope) so that the budgets can be compared. -
CONV-02 is
observed: a WordPress registration is not described by a raw array in the public API.Architecture\RawRegistrationArraysreads the PSR-4 files withnikic/php-parser(no autoloader) and reports (1) a public method or global function whose array parameter flows intoregister_post_type(),register_taxonomy(),register_block_type(),register_block_type_from_metadata(),register_rest_route()(their$args) oradd_menu_page()/add_submenu_page(), through array operations, local variables and closures, and (2) a public method (interface methods too) namedregister…,create…,define…oradd…about a post type, taxonomy, block, route or menu, with an$args,$arguments,$config,$optionsor$settingsparameter that can hold an array. The infrastructure layer (Infrastructure,Adapternamespaces), non-public methods,@internalcode, literal arrays built inside a method and object-typed parameters are not reported; the rule's limits (array stored then registered elsewhere, registration through a wrapper) are in the README. A file that does not parse is listed, never skipped. Registered bytests/Arch.phplike CONV-08/09/12 (incomplete with the list,not evaluatedwhen there is no class); the catalogue now counts 32 enforced, 5 observed and 3 planned rules. Measured over the 45 repositories (36 have PHP): 10 reports in 2 repositories (framework 8, entity 2), about 1.0 s in total, 0.21 s for the framework. -
Mutation on pull requests: only what the pull request changes.
checktakes--mutation-scope=all|changed|added, which wins overmutation.scopeof.harness.jsonfor that run (an unknown value, or the option without value, fails before any gate runs). A limited scope is held tomutation.min, or toMutationSettings::PULL_REQUEST_MINIMUM(50 %) when the file sets none. The reusable workflowphp-package.ymlhas a new optional inputmutation-on-pull-request(changedby default,allfor the old behaviour): on apull_requestevent a repository withoutmutation.scoperuns--mutation-scope=changed --mutation-base=HEAD^1on the merge commit (checkout depth 2); a checkout that is not a merge commit falls back to the whole repository with a warning instead of counting from the wrong base; every other event mutates everything, so themsiratchet is still measured on the main branch. A pull request without a PHP source file passes with "nothing to mutate". The Ratchet step saysmsiwas not measured on purpose in a limited run. No job name,needsorifchanges. Measured cost: the mutation is 80 to 90 % of the quality job (101 jobs, 33 repositories, 20 November). See Mutation on pull requests in the README for the trade-off (the whole score is no longer measured on a pull request). -
CONV-08, CONV-09 and CONV-12 are
observed: three architecture rules read from the files, which report and never block. CONV-08 (a class isfinalunless it is an extension point: abstract, a builder named…Builder, a class that usesMacroable, or a parent that another class of the repository extends), CONV-09 (a facade is a thin front: onlygetFacadeAccessor(), returningService::classor a binding name; aService::classof the repository that is a concrete class is reported, a contract is an interface) and CONV-12 (no PHPUnit test class: a concrete class extending a…TestCasewith a test method is reported;#[RunInSeparateProcess]/#[RunTestsInSeparateProcesses]and the PHPStan rule tests are the documented exceptions; theFixturesandStubsdirectories are not read). They are read from the tokens (Architecture\SourceTypes,FinalClasses,FacadeClasses,TestClasses), without an autoloader. A rule that the catalogue lists asobservedis registered bytests/Arch.phpas a test that is marked incomplete, withobserved, not blocking: <rule> — N problem(s)and the list, when it finds something (the step stays green) and passes when it finds nothing;enforcedin the catalogue makes the same test fail. Measured over the 45 repositories of the ecosystem (a script running the three analyses on each repository's files, withoutvendor/): CONV-08 reports 671 classes in 20 repositories (framework 400, attributes 82, metabox 54, colt 23, skeleton 19, woocommerce 16, nectar 16, query 12, assets 12, entity 11), CONV-09 4 facades in the framework, CONV-12 13 test classes (meilifacets 11, skeleton 2); about 1.1 s in total over the 45 repositories, 0.33 s for the framework. A rule with nothing to read (no class, no test file) is skipped withnot evaluated: <rule> — <reason>. The catalogue now counts 32 enforced, 4 observed and 4 planned rules. -
type_coverageis measured (CONV-11):checkandratchetcount the declarations that carry a native type.Metrics\TypeCoveragereads the PHP of the repository withnikic/php-parser(now a requirement,^5.6: it was only there through Pest's dev dependencies, and PHPStan and Rector ship it inside their phars), so it needs neither Pest's type-coverage plugin (installed in two repositories out of forty-five) nor an autoloader. It counts the return type of every function and method (constructors and destructors excepted), every parameter (promoted ones once) and every property;mixedis a type; closures and arrow functions are out;%placeholder%markers of theme templates are neutralised; the parameters of the methods that override an untyped method of WordPress (Walker*,WP_Widget; the parent must be the global class,\Walker_Nav_Menu) are left out and reported, because a child cannot narrow them. The files read are thepsr-4,psr-0,classmapandfilesentries ofautoloadplussrcandapp, minusvendor,node_modules,testsand Blade. The Ratchet step prints the percentage, the share of returns, parameters and properties, the five files that concentrate the gap and any file that does not parse (never ignored silently); a repository that recordstype_coveragein itsratchetcan no longer lower it, andratchet --updaterecords it. Measured over the 45 repositories: 97.19 % (18 316 of 18 846 declarations) in 1.5 s, 0.46 s for the framework. CONV-11 staysobserveduntil the floors are recorded. -
pollora-qa promote-report [--json]: what would block if each observed rule became enforced. For everyobservedrule of the catalogue, in the current repository: the number of problems and the first five,clean,not applicable(nothing to read) orno probe(an observed rule it cannot measure is listed, never left out). CONV-08, CONV-09 and CONV-12 run the same analyses as their Pest tests, CONV-11 compares the static type count with the recordedtype_coveragefloor. Read only, no tool run, always exit 0; works without.harness.json. README: Promoting a rule. -
CONV-08, CONV-09 and CONV-12 can be exempted (
allow_rules) before they are promoted. They joinRuleExemption::EXEMPTIBLEand the rules named by the Architecture and Tests and architecture steps (Plan::ARCHITECTURE_RULES). While a rule isobservedits exemption is accepted, counted by theexempted_rulesceiling and shown (declared, not applied while the rule is observed) but not applied: the rule keeps reporting, and the step does not list it asexempted. Once the catalogue saysenforced, the same entry skips the rule with its reason.
Changed
- A
ratchetvalue that cannot be compared makes.harness.jsoninvalid.coverage,type_coverageandmsimust be numbers from 0 to 100,phpstan_levelan integer from 0 to 10 or"max",phpstan_baselineandexempted_ruleswhole numbers from 0. Until now"type_coverage": "95"or120was read as "never measured" and silently never compared (InvalidConfig::ratchetValue). None of the 45 repositories holds such a value. - A layer shared with an installed package is now judged, on the classes of the repository only, instead of not evaluated. The 0.1.32 compromise skipped ARCH-01, ARCH-03, CONV-03, CONV-05 and CONV-07 on a namespace that a package under
vendor/also maps (the framework lost six CONV-07 tests withpollora/media0.9). Those rules now receive the explicit list of the classes found in the repository's own PSR-4 directories instead of the namespace: the engine of Pest resolves a class name to its own file only, so the package's classes are never read andObjectDescriptionBase::$pathis never reached. Only a class that the package also has under the same name is left out, with a skipped test… (classes shared with a package)that names it, and a namespace with no class to judge is skipped with the reason. The test names are unchanged.ForeignNamespaceskeeps the directories of each foreign prefix (directories) and tells a shadowed class (shadows()),Layers::classesIn()lists the classes of a namespace. - The job summary table of
checkhas one more column, Time, between Rules and Result.
Fixed
-
SEC-06 no longer reports a bare constant.
$token[0] === T_STRING, a lexer token compared with its tokenizer constant, is a type check, not a secret comparison; it joins the literals,null, numbers andCls::NAMEconstants that were already left out. Found by the first run of the rule as a blocking one, on the harness's own code (4 findings,src/Architecture/SourceTypes.php); the fixtures that must be detected still are (43 detections, unchanged), a negative fixture was added, and the self scan ofsrc/goes from 4 findings to none. -
Fewer
HTTP/2 429fromcodeload.github.comduringcomposer install. The Composer steps are authenticated with the job's token (COMPOSER_AUTH,github-oauth), the Composer download cache is restored (and saved by non-pull-request runs), and a pull request's older run is cancelled when a new push arrives. Every job has atimeout-minutes.
Security
- The workflows pin what they run.
php-package.yml,template.ymlandci.ymlreferenceactions/checkout,shivammathur/setup-php,actions/upload-artifact,actions/setup-nodeand the newactions/cacheby the full commit SHA of their tag (tag in a comment), installsemgrep==1.186.0and runghcr.io/gitleaks/gitleaks:v8.30.1by digest instead oflatest. The one${{ }}of a step output inside arun:(the downstream job's package name) goes throughenv:. zizmor 1.32.0: 34 high and 1 informational findings before, none after. Inputs, outputs and job names are unchanged. See Reliability and security of the workflows in the README.