Repository navigation
refactor(listener): split the three object event handlers (REVIEW) - #1413
Merged
Merged
Conversation
handleObjectCreated (92 lines), handleObjectUpdated (203) and handleObjectDeleted (137) took the event plus three services. They now take the event and one services array, read the object facts once (objectContext), look the catalog schemas up lazily in the same order (firstMatchingSchema), and hand each matched type to a small method. The contact person and contactgegevens update and deletion branches share runContactAction with their log lines in a table. Every call and log line keeps its order and text. Golden: 37 cases over handle() for created, updated and deleted events of every catalog type, with sync, refetch and contact failures, recorded on the old code. Assisted-by: ClaudeCode:claude-opus-5-5
rubenvdlinde
marked this pull request as ready for review
November 3, 2026 17:37
…op the stale skipped test Two golden cases from review, recorded on the old code: an Error from the contact person service escapes handle() (catch (\Exception) does not catch it), and an organisation update with schema id "01" matches schema 1. StackiqEventListenerTest skipped all 12 of its cases in setUp(): they were written against a constructor and service calls the listener no longer has. The golden test covers the current dispatch, so the stale file goes. Assisted-by: ClaudeCode:claude-opus-5-5
Contributor
Author
|
Rerun with the two golden cases and the stale test removed: full unit suite (pcov, --fail-on-risky) exit 0, 1599 tests, 0 failures, 0 risky, 47 skipped (12 fewer skips: the stale StackiqEventListenerTest is gone). |
Contributor
Author
|
Hydra gates --scope-to-diff --base origin/development (through heavy.sh): 33 of 33 applicable gates ran, 0 FAIL. |
Contributor
Quality Report — ConductionNL/stackiq @
|
| Check | PHP | Vue | Security | License | Tests |
|---|---|---|---|---|---|
| lint | ✅ | ||||
| phpcs | ✅ | ||||
| phpmd | ✅ | ||||
| psalm | ✅ | ||||
| phpstan | ✅ | ||||
| phpmetrics | ✅ | ||||
| eslint | ✅ | ||||
| stylelint | ✅ | ||||
| build | ✅ | ||||
| check-manifest | ✅ | ||||
| check-vue-demi | ✅ | ||||
| test-l10n | ✅ | ||||
| format | ✅ | ||||
| check-schema-l10n | ❌ | ||||
| check-l10n-js | ✅ | ||||
| composer | ✅ | ✅ 127/127 | |||
| npm | ❌ | ✅ 807/807 | |||
| app:check-code | ⏭️ | ||||
| info.xml | ✅ | ||||
| REUSE | ❌ | ||||
| lockfile sync | ✅ | ||||
| PHPUnit | ✅ 1591/1591 · 8 skipped | ||||
| Newman | ⏭️ | ||||
| Playwright | ⏭️ deferred: E2E runs locally and on the promotion path only. This pull request targets development, so the suite is asked once per promotion into beta and main rather than once per push per open pull request. Run it locally with npx playwright test, or from the Actions tab on a branch with no open pull request into development. |
||||
| Hydra gates | ❌ |
Quality workflow — 2026-11-04 00:56 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.
REVIEW (this listener provisions organisations, contact person accounts and usage). Held. Behaviour-preserving refactor.
What
StackiqEventListenerhad three handlers:The change:
dispatchEventnow take the event and one services array.objectContextreads the object facts once.firstMatchingSchemalooks the catalog schemas up lazily, in the same order as before. The settings calls happen in the same sequence, and the lookup stops at the first match.runContactAction, with their log lines in a table.Every call and every log line keeps its order and its text.
After: handleObjectCreated 51 lines (McCabe 6), handleObjectUpdated 50 (McCabe 6), handleObjectDeleted 35 (McCabe 3). Every new unit takes at most 2 parameters.
Evidence
StackiqEventListenerGoldenTesthas 39 cases overhandle(): created, updated and deleted events of every catalog type, active, inactive and unchanged organisations, refetch, sync and contact failures, unconfigured schemas, two types sharing a schema id, anErrorfrom the contact person service escapinghandle()(catch (\Exception)does not catch it, on both trees), and an organisation update with schema id "01" (both from RW118). It records every container, settings, contact person, sync, object service and logger call, with clock and trace values masked. It was recorded on the old code and passes on old and new.Stale test removed
StackiqEventListenerTestskipped all 12 of its cases insetUp(). They were written against a constructor and service calls that the listener no longer has. The golden test covers the current dispatch, so the stale file is deleted. That removes 12 of the app's 59 skipped tests.Numbers (PHP, lizard, against development)
Verified locally
--fail-on-risky(exit 0).phpunit-unit.xml, pcov,--fail-on-risky): exit 0, 1609 tests, 0 failures, 0 risky, 59 skipped (inherited).--scope-to-diff --base origin/development) is queued. Its result follows in a comment.Assisted-by: ClaudeCode:claude-opus-5-5