fix(gate-57): delete six orphaned write capabilities - #530
Merged
Conversation
gate-57 orphaned-write-capability reported 6 findings over 55 lib/Service files. All six had zero callers; all six are deleted. - AangebodenGebruik\GebruikStatusHandler::updateStatus — the whole class is unreferenced. Its docblock says "AangebodenGebruikService delegates all updateStatus() logic here"; AangebodenGebruikService has no such method and never constructs the handler, so the method-decomposition extraction landed without its caller ever being updated. Deleted with the class, and with StatusTransitionValidator, whose only consumer it was. - SoftwareCatalogContactSyncService::importContact — validated a UID and returned it unchanged. The two live consumers (OrganizationContactSyncJob, Repair\MigrateContactsToNc) use isAvailable/findContactByUid/ findContactForRecord/syncToContacts, which already serve resolve-or-create. Spec REQ-SCNC-003 updated: the service no longer names importContact. - SoftwareCatalogue\ContactPersonHandler::updateUserGroupsFromRoles — already @deprecated, logged "deprecated - role assignment now based on organization type" on every call, ignored both role arguments and forwarded to updateUserGroupsFromContactData(). No caller, so its backward compatibility had no consumer. Group membership is a permission fact; a second entry point into it is a surface, not a convenience. - SoftwareCatalogueService::sendGebruikerWelcomeEmail, ::syncUserWithRevertedContact and ::updateUserFromRevertedGebruiker — each was a single logger->info() and nothing else. They named capabilities (send a welcome mail, reconcile a user after an object revert) that have never been implemented; wiring a log line in would have hidden the gap.⚠️ SoftwareCatalogEventListenerTest asserted that the listener calls sendGebruikerWelcomeEmail, syncUserWithRevertedContact and updateUserFromRevertedGebruiker exactly once each. It does not, and there is no code path in SoftwareCatalogEventListener that ever did — the tests described a wiring that does not exist. They are corrected here rather than deleted: the revert case now asserts the true invariant (the revert path runs without reaching a capability the app does not implement). Before: 6 findings over 55 files. After: 0 findings over 53 files (two service files fewer because the dead handler pair was deleted).
Two pre-existing phpcs errors ('Inline comments must start with a capital
letter') in a file this branch already touches, per the fix-what-you-touch
rule. lib/Service/SoftwareCatalogueService.php is now phpcs-clean (0 errors).
Contributor
Quality Report — ConductionNL/softwarecatalog @
|
| Check | PHP | Vue | Security | License | Tests |
|---|---|---|---|---|---|
| lint | ✅ | ||||
| phpcs | ❌ | ||||
| phpmd | ❌ | ||||
| psalm | ❌ | ||||
| phpstan | ❌ | ||||
| phpmetrics | ✅ | ||||
| eslint | ✅ | ||||
| stylelint | ✅ | ||||
| build | ✅ | ||||
| check-manifest | ✅ | ||||
| check-vue-demi | ✅ | ||||
| test-l10n | ✅ | ||||
| format | ✅ | ||||
| composer | ✅ | ✅ 130/130 | |||
| npm | ✅ | ✅ 704/704 | |||
| app:check-code | ⏭️ | ||||
| info.xml | ✅ | ||||
| REUSE | ❌ | ||||
| PHPUnit | ❌ | ||||
| Newman | ⏭️ | ||||
| Playwright | ❌ | ||||
| Hydra gates | ❌ |
Quality workflow — 2026-08-16 10:53 UTC
Download the full PDF report from the workflow artifacts.
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.
gate-57 orphaned-write-capability — softwarecatalog
Workstream S8 of the fleet debt programme. Base at branch point
0335cb20, which is the head of run 31937314279 — 13 failing jobs (psalm, phpmd, phpcs, phpstan, 6× PHPUnit, E2E, Hydra Gates, Quality Report) from therefactor/adr-084-type-hint-the-contractmerge at 08:46:30. That is slot R1's scope, not this PR's. Please judge this PR at parity with that run, job by job.Gate evidence (L1 / L3 / L4)
File set reproduced from
run-hydra-gates.sh:git ls-files -- lib/Service,.php, minustests/. Output captured to a file; never piped intogrep.The file count drops by 2 because two dead service classes are deleted. Helper identity line:
app_id=softwarecatalog source=appinfo/info.xml foundation=no.conduction/hydra-gates, so the helper and the phpcs/phpmd rulesets were mounted in from docudesk's vendored copy and run on softwarecatalog's own paths (the helper derives each app root from the file's own path, never from cwd).Per-finding judgement — 6 findings, 6 deletes, 0 wires
AangebodenGebruik/GebruikStatusHandler.php:66 updateStatusSoftwareCatalogContactSyncService.php:133 importContactBackgroundJob\OrganizationContactSyncJobandRepair\MigrateContactsToNc, useisAvailable()/findContactByUid()/findContactForRecord()/syncToContacts(), which already serve resolve-or-create. Spec REQ-SCNC-003 updated so it no longer names a method the service does not have.SoftwareCatalogue/ContactPersonHandler.php:964 updateUserGroupsFromRoles@deprecated; logged "updateUserGroupsFromRoles is deprecated - role assignment now based on organization type" on every call; ignored both$newRolesand$oldRoles; forwarded toupdateUserGroupsFromContactData(), the live method. No caller — so the backward compatibility it existed for had no consumer either. Group membership is a permission fact; a second, role-shaped entry point into it is a surface, not a convenience.SoftwareCatalogueService.php:851 sendGebruikerWelcomeEmaillogger->info('Sending gebruiker welcome email'). It never sent anything.SoftwareCatalogueService.php:969 syncUserWithRevertedContactlogger->info().SoftwareCatalogueService.php:988 updateUserFromRevertedGebruikerlogger->info().1 —
GebruikStatusHandler. The class docblock says "AangebodenGebruikService delegates allupdateStatus()logic here so that its own methods stay below ExcessiveMethodLength."AangebodenGebruikServicehas no such method, never constructs the handler, and nothing else references the class — the method-decomposition extraction landed and its caller was never updated. Deleted with the class, and withStatusTransitionValidator, whose only consumer it was. Neither is DI-registered and neither has tests.4/5/6 — why deleting a log line is the right remedy. These three name capabilities the app does not have: send a welcome mail; reconcile the Nextcloud user after an object revert. Wiring a method whose entire body is a log line would have turned "this capability is missing" into "this capability is called", which is the invisible pass the programme forbids. Removing them leaves the gap visible; both are on the fleet board as capability gaps rather than dead code.
tests/Unit/EventListener/SoftwareCatalogEventListenerTest.phpasserted->expects($this->once())onsendGebruikerWelcomeEmail,syncUserWithRevertedContactandupdateUserFromRevertedGebruiker.SoftwareCatalogEventListenerdoes not call any of them, and there is no code path in it that ever did — the tests described a wiring that does not exist.They are corrected rather than deleted:
handleNewGebruikeris called) and drops the imaginary one;ObjectRevertedEventreaches the listener, runs, and does not reach a capability the app does not implement.Worth flagging to whoever is looking at the 6 red PHPUnit cells on the branch point: these three expectations could not have been passing.
No gate-exclusion comment was used anywhere in this PR.
Quality (L10)
Run under PHP 8.3 in a
php:8.3-clicontainer against this worktree (host PHP is 8.2):lint— clean on every changed filephpcson the 3 changedlib/files — 0 errors, 8 warnings (pre-existing). That includes two pre-existing phpcs errors fixed here (Inline comments must start with a capital letter, lines 1998 and 2090 ofSoftwareCatalogueService.php), per the fix-what-you-touch rule; the file is now phpcs-clean.phpmdon the same 3 files — clean, exit 0. This PR only deletes, so no complexity ceiling moves.phpunit— the branch point already has 6 red cells from the adr-084 rollout. Please compare this PR's own CI to run31937314279job by job rather than to a green expectation.