Skip to content

refactor(dossiq): save objects through ObjectSaveOptions - #5353

Closed
rubenvdlinde wants to merge 2 commits into
developmentfrom
fix/or-surface-object-save-options
Closed

rubenvdlinde wants to merge 2 commits into
developmentfrom
fix/or-surface-object-save-options

Conversation

@rubenvdlinde

Copy link
Copy Markdown
Contributor

Merge after openregister #9123 lands.

ObjectSaveOptions, ObjectFindTarget, SavePolicy and SaveActor are new in OCA\OpenRegister\Service\Object in #9123, so this has to land with #9123 or after it. ObjectFindTarget is also introduced by #9099; the delete PR (#5349) carries the same stub file.

Fixed (lib)

  • 165 ObjectService::saveObject() calls, rewritten by the fleet migrate-save script (--only=saveObject): saveObject(object:, options: new ObjectSaveOptions(target: new ObjectFindTarget(register:, schema:), uuid:, extend:, uploadedFiles:, policy: new SavePolicy(...), actor: new SaveActor(...)), _rbac:, _multitenancy:). Default values are dropped. _rbac / _multitenancy stay named, with their values unchanged.
  • 12 calls on receivers the script does not match ($context['objectService'], $store['objectService'], a container lookup, ...), converted by hand with the same mapping: AdviceService.php:566, Email/UnmatchedMailIntake.php:209, Starter/StarterStore.php:207, CaseCopyService.php:149, Workflow/WorkflowDefinitionRepository.php:339/357/468, Support/ConfiguredRegistryService.php:170, BerichtenboxService.php:192, Transitions/CaseResultWriter.php:258, Transitions/SetCaseAnswerHandler.php:85, Ai/AiAuditLog.php:96.
  • The two calls the script skipped: Zaakdossier/DocumentRecordStore.php:172 (a comment in the argument list) and AdvisoryBodyService.php:157. The latter spread [$register, $schema, $data, $id] into a method whose first parameter is the object. That is already broken on today's main. It now saves $data with its register, schema and uuid.
  • No dossiq code calls saveObjects(), so #9108 needs no PR here.

Tests

  • tests/Stubs/Contract/ObjectServiceInterface.php: saveObject() on #9123's signature. The four value-object stubs are copied from #9123's head.
  • 172 saveObject() doubles and 36 mock callbacks take ObjectSaveOptions $options after $object, and read register/schema/uuid/extend/policy/actor from it with their old defaults. This was scripted.
  • By hand: positional seeding calls on test doubles (WorkQueueServiceTest 44, BeschikkingServiceTest, ArmBezwaarArchiveTimersTest, BezwaarArchiveTriggerTest); parent::saveObject() and inner-store forwarding in subclassed doubles; with() expectations in AiServiceAuditLoggingCompletenessTest and WooPublicationServiceTest. Doubles that change the uuid before forwarding (LifecycleRegister, UuidAnsweringRegister, CaseSplitStatusTest) rebuild the options with it.
  • Three golden logs (berichtenbox-send/*, dso-case-service.json, objection-decision-service.json) now record the ObjectSaveOptions in place of the old positional list. The values are the same; only the shape differs. hearing-service.json is unchanged.

What ran

  • php -l on every changed file: clean. phpcs on the changed lib files: no errors.
  • Full PHPUnit --no-coverage: 10,949 tests, 19 failures, the same 19 that fail on development (no new reds).

AI disclosure: prepared with Claude Code (claude-opus-5-5).

openregister #9123 changes ObjectService::saveObject() to take the object
and one ObjectSaveOptions (target register/schema, uuid, extend, uploaded
files, a SavePolicy and a SaveActor) next to the access flags.

165 calls were rewritten by the fleet migrate-save script; 12 calls on
receivers it does not match and the two it skipped were converted by
hand. AdvisoryBodyService spread [register, schema, data, id] into a
method whose first parameter is the object; it now saves the data with
its register, schema and uuid. _rbac and _multitenancy keep their values.

Tests: the object-service doubles, mock callbacks and expectations take
the options; subclassed doubles that change the uuid before forwarding
rebuild the options with it. Three golden logs record the new call shape
with the same values.

Assisted-by: ClaudeCode:claude-opus-5-5
Assisted-by: ClaudeCode:claude-opus-5-5
@github-actions

Copy link
Copy Markdown
Contributor

Quality Report — ConductionNL/dossiq @ d08814a

Check PHP Vue Security License Tests
lint ✅
phpcs ✅
phpmd ❌
psalm ✅
phpstan ❌
phpmetrics ✅
eslint ❌
stylelint ✅
build ✅
check-manifest ✅
check-vue3-compile ✅
test-l10n ✅
format ❌
check-schema-l10n ❌
check-l10n-js ✅
check-debt-ratchet ❌
check-types-e2e ✅
composer ❌ ✅ 109/109
npm ✅ ✅ 657/657
app:check-code ⏭️
info.xml ✅
REUSE ❌
lockfile sync ✅
PHPUnit ❌ 3910/3944 · 3 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-10 22:37 UTC

Download the full PDF report from the workflow artifacts.

This was referenced Nov 11, 2026
@rubenvdlinde

Copy link
Copy Markdown
Contributor Author

Superseded by #6581 (merged into development), which moves every find/saveObject/deleteObject/patchObject/lock call and flow node in this app to openregister main's option objects in one pass, test doubles included.

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