Skip to content

devops: move dresscode's config beside vendor, at the root its type rules found nothing and passed - #238

Merged
landsman merged 8 commits into
mainfrom
devops/dresscode-config-beside-vendor
Oct 31, 2026
Merged

landsman merged 8 commits into
mainfrom
devops/dresscode-config-beside-vendor

Conversation

@landsman

@landsman landsman commented Oct 31, 2026 •

Copy link
Copy Markdown
Owner

With typeAnalysis: phpstan and dresscode.neon at the root, a rule that needs types reported nothing and exited 0, even on a child class written to break upgrading.classes.Override. DressCode counts its own installation, app/, as foreign code unless the config's root lies inside it (RunnerFactory::findForeignPaths), and our code is in there. A minimal project reproduces it.

So the config moves to app/, the key goes on, and #[\Override] is the first rule using it, with its two findings fixed. PHP now refuses a parent that renames a member under us.

cli/ is now above the config's root, and DressCode does not walk a directory there, so cli/dresscode.sh names each file and the hook drops --skip-excluded for them. Moving it into app/ would put scripts in the document root. The type rules read phpstan.neon only from that root too, so app/phpstan.neon includes the real one. make dresscode depends on fetch, because without the files phpstan.neon names, the types run without that config and only warn. package-app deletes every .neon from what ships.

A clean run cannot tell type rules from silence, so make dresscode also copies tests/dresscode/override-missing.php, which breaks the rule on purpose, into app/ and cli/ for one run, and fails unless both are reported or if phpstan.neon was not read. Checked by breaking each: typeAnalysis removed, the include broken, app/phpstan.neon deleted. tests/cli/dresscode-test.sh covers the same decisions and an interrupted run's cleanup.

The hook now uses the edited worktree's own config and dresscode, so a file there is no longer skipped with exit 0. Where it cannot check, with no app/vendor or no app/adminer.php, it says so to the agent. Closes #253.

make qa passes on the final commit; make check passed just before a last cleanup of the config and script. make e2e was not rerun after the review fixes, which touch only lint tooling and the dev hook. Before them the main suite passed 173 of 173 and e2e-bridge-go failed 3 of 40 in mcp.feature. That job also fails on main, a different scenario each run (here 2, 2 and 3 of 40, on main 1 and 1), too few runs to tell whether this branch makes it worse.

@landsman

landsman commented Oct 31, 2026 •

Copy link
Copy Markdown
Owner Author

Where this stands, to pick up later. Branch devops/dresscode-config-beside-vendor, worktree .claude/worktrees/dresscode-beside-vendor.

Still to do

  • Report the silent failure to DressCode: RunnerFactory::findForeignPaths in 1.3.1 treats its installation as foreign when the config's root is outside it, with exit 0 and no warning. If fixed upstream, the config could go back to the root and the cli/ workarounds could go.

Known when running e2e

  • mise run e2e-bridge-go (part of make e2e) fails here, and on main too, with a different scenario each run; the errors I read say the app stopped answering. This branch: 2, 2 and 3 of 40 failed. main: 1 and 1. Too few runs to tell whether the branch makes it worse.
  • A few full runs within about 30 minutes trip Adminer's failed-login lockout: 84 scenarios failed with could not log in after 3 attempts, and the page says "Too many unsuccessful logins". The counter is adminer-invalid in the PHP temp dir; deleting it clears the lockout. An earlier run had 9 failures that passed when rerun alone, cause not confirmed.

Decided

  • cli/ was not moved into app/: that is the document root. A custom rule cannot help either, since rules only visit files already selected.
  • Only upgrading.classes.Override is on. Other rules that need types (21 rule classes in 1.3.1) were not evaluated. deprecatedMember and classNameInString only ran with the config at the root, so their clean results mean nothing.

Comment thread app/dresscode-canary.php Resolved

@landsman landsman left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review of dee190e. One real bug: the type rules run without phpstan.neon (see the comment on Makefile). The rest are smaller. Only the phpstan.neon finding and the bad-file check's cleanup were traced through source; none of this was run.

Two things in the PR text:

  • The body calls the e2e-bridge-go failures already seen on main, but the status comment says there were too few runs to tell whether this branch makes them worse (2, 2 and 3 of 40 here, 1 and 1 on main). The body should say the same.
  • The status comment's to-do list is out of date: the silent-rule check now exists, and the e2e numbers have changed.

The docblock at cli/dresscode-hook.php:9 still describes --skip-excluded as unconditional.

Comment thread Makefile Resolved
Comment thread Makefile Resolved
Comment thread Makefile Resolved
Comment thread cli/dresscode-hook.php Resolved
Comment thread cli/dresscode-hook.php Resolved
Comment thread app/dresscode.neon Resolved
@landsman
landsman force-pushed the devops/dresscode-config-beside-vendor branch from dee190e to 54035b4 Compare October 31, 2026 23:21
@landsman
landsman merged commit 3c85c2a into main Oct 31, 2026
4 checks passed
@landsman
landsman deleted the devops/dresscode-config-beside-vendor branch October 31, 2026 23:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

devops: run the dresscode hook on a worktree's files, it skips them and exits 0

1 participant