Skip to content

refactor: fix the architecture rules the harness now runs and exempt the rest - #587

Open
ogorzalka wants to merge 1 commit into
developfrom
fix/arch-debt
Open

ogorzalka wants to merge 1 commit into
developfrom
fix/arch-debt

Conversation

@ogorzalka

Copy link
Copy Markdown
Member

develop and main are red since the harness started running tests/Arch.php (pollora/harness 0.1.20). The framework requires ^0.1.15, so the scheduled run of 5 November installed 0.1.22 on the same commit that was green on 4 November (0.1.19). Twelve architecture tests failed; none of them is caused by a recent change, CI never ran those rules before.

Fixed

Rule Change
CONV-05 LaravelPluginModule and LaravelThemeModule read VAPOR_MAINTENANCE_MODE with Illuminate\Support\Env::get() (what env() calls) instead of env(); the two PHPStan baseline entries for it go away (baseline 58 → 56)
CONV-07 PluginManager and ThemeManager read the console detection service from the container they receive, not from resolve()
ARCH-03 Route WordPressTypeResolverInterface moves to Pollora\Route\Domain\Contracts; the former name is a class_alias
ARCH-03 Schedule ScheduleStatus no longer imports LaravelQueueDriver for its name
ARCH-03 VersionCheck PackageVersionChecker depends on the new VersionSourceResolver contract, which VersionSources implements

Exempted (allow_rules, harness 0.1.23)

  • ARCH-01: ModuleCollection and PluginCollection extend Illuminate\Support\Collection; they are published classes.
  • ARCH-03: the application layers of Modules, Plugin and Theme still build infrastructure services directly, and the module named Application is read as a layer. This needs ports, one module at a time.

The scope of an exemption is the whole rule, so the ratchet caps the count (exempted_rules: 2). The workflow and composer.json move to harness 0.1.23.

Checks

Full Pest suite: 1645 pass. Two tests fail in the DDEV environment (it accepts an empty database password, MissingBuildNotice), and they fail the same way on an untouched develop. Pint, PHPStan, Rector and the public surface gate pass.

…the rest

The harness gate runs tests/Arch.php since pollora/harness 0.1.20, and the
framework's floating ^0.1.15 constraint picked it up: develop and main went
red on 12 architecture tests that CI never ran before.

Fixed: CONV-05 (env() in the plugin and theme modules), CONV-07 (resolve() in
PluginManager and ThemeManager), ARCH-03 for Route (the type resolver
interface moves to the domain, the old name stays as an alias), Schedule and
VersionCheck (new VersionSourceResolver contract).

Exempted with a reason and capped by the ratchet: ARCH-01 and ARCH-03 for the
Modules, Plugin and Theme application layers.
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.

1 participant