Skip to content

test: accept both value names in the ObjectService doubles - #2104

Merged
rubenvdlinde merged 2 commits into
developmentfrom
cloud/mod-X00-published-value-doubles
Nov 21, 2026
Merged

rubenvdlinde merged 2 commits into
developmentfrom
cloud/mod-X00-published-value-doubles

Conversation

@rubenvdlinde

Copy link
Copy Markdown
Contributor

Accept both value names in the ObjectService test doubles

Fleet check for openregister package X00 (task 7.2). openregister publishes the values its ObjectServiceInterface names in its signatures (ObjectSaveOptions, BulkSaveOptions, ObjectFindOptions, ObjectDeletion, ObjectPatch, LockRequest, UnlockRequest, ObjectValidationVerdict and five values they name) as OCA\OpenRegister\Contract\<Name>. The old OCA\OpenRegister\Kernel\Contracts\Value\<Name> classes stay as deprecated final subclasses: ConductionNL/openregister#10976 and ConductionNL/openregister#10977. Then ConductionNL/openregister PR c (branch cloud/mod-X00-published-signatures) types ObjectServiceInterface and ObjectService with the published parents. A double whose parameter is typed only with the old Kernel name is then narrower than its parent, and PHP refuses to load the class.

What changes

1 test file, 1 parameter: tests/Unit/Support/MainApiObjectService (abstract ObjectServiceInterface double), saveObject()'s $options becomes ObjectSaveOptions|PublishedObjectSaveOptions (the published class imported as PublishedObjectSaveOptions), and its @param follows. Same default (still the old name), same body. optionsOf() keeps the old name.

Safe against both openregister versions

  • Today's openregister (interface typed with the old names): the union contains the parent's type by name, so PHP accepts it without loading OCA\OpenRegister\Contract\ObjectSaveOptions, which this app's test environment does not have.
  • openregister with the published values: the union contains the new parent type by name. The old name is a subclass of it, so every value the tests build still passes.

So this PR can land before the openregister PRs, and must land before them, or before a hydra-gates release that ships the new contract.

Test run

vendor/bin/phpunit -c phpunit-unit.xml --no-coverage, PHP 8.3:

Run Result
development without this change 4,384 tests, 2 failures, 39 skipped
this branch 4,384 tests, the same 2 failures, 39 skipped
this branch against the new contract (openregister's lib/Contract after PR c and its deprecated Kernel values loaded first; the ObjectService stub typed like the new ObjectService) 4,384 tests, the same 2 failures, 39 skipped
development against the new contract fatal at class load: MainApiObjectService::saveObject(array $object, OCA\OpenRegister\Kernel\Contracts\Value\ObjectSaveOptions $options = <expression>, ...) must be compatible with OCA\OpenRegister\Contract\ObjectServiceInterface::saveObject(...)

The 2 failures are on development without this change and are identical on the branch.

Tests are outside this app's phpcs and phpstan scope (lib/ only).

Order

This PR → ConductionNL/.github companion (hydra-gates contracts) → ConductionNL/openregister#10976 → #10977 → PR c. Do not merge openregister PR c before this one.

Written with Claude Code (claude-opus-5-5)


Generated by Claude Code

OpenRegister publishes the values of its ObjectServiceInterface in
OCA\OpenRegister\Contract (task 7.2); the old
OCA\OpenRegister\Kernel\Contracts\Value names become deprecated subclasses.
The published interface and ObjectService then type these parameters with
the published parent class, so a double typed with only the old name is
narrower than its parent and fatals at class load.

Every test class that implements ObjectServiceInterface or extends
ObjectService now types those parameters as the old name OR the published
one. PHP matches a union by name without loading the other class, so the
doubles load against today's openregister (old names) and against the one
that publishes the values. Behaviour, defaults and values are unchanged.

Assisted-by: ClaudeCode:claude-opus-5-5

rubenvdlinde commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor Author

Twelve checks failed on this PR. None is caused by it: the PR changes one PHP test file, tests/Unit/Support/MainApiObjectService.php (one parameter type, its @param and the use line for the published name, nothing else), and no composer.json, composer.lock, lib/, src/, JS/Vue/CSS, schema, l10n/ or manifest file.

Analyze (javascript-typescript) / Analyze (actions): the analysis ran; only the upload was refused: Code Scanning could not process the submitted SARIF file: CodeQL analyses from advanced configurations cannot be processed when the default setup is enabled (job 136858559290). The repository has CodeQL default setup enabled and also runs an advanced CodeQL workflow, so every PR hits this. The fix is a repository setting: turn off default setup under Settings → Code security, or remove the advanced CodeQL workflow. That is a decision for the maintainers.

quality / Security (composer): a composer dependency audit; it reads composer.lock, which this PR does not change. It is the same finding as Hydra gate 4 (composer-audit) below, so the advisories are in the locked dependencies on development.

quality / PHP Quality (phpmd): the job runs phpmd lib … against phpmd.baseline.xml, so it only looks at lib/, which this PR does not touch. The violations it prints are in lib/ files: lib/BackgroundJob/AttestationOverdueJob.php:67 UnusedFormalParameter, plus ViewService, ViewImageService, StackiqContactSyncService and others. Those are outside the baseline on development; the fix is to resolve them or re-record the baseline there.

quality / PHP Quality (psalm): psalm.xml analyses <directory name="lib" /> only, so this PR's file is not in its scope; whatever it reports is in lib/ on development.

quality / Features Check: docs/features.json is out of date — run scripts/extract-features.py to regenerate. The same check fails on development at 2627323 without this PR: extract-features.py --app-root . --check with .github main's script gives the same error locally. The fix is to regenerate docs/features.json on development.

quality / Vue Quality (eslint): 21 ESLint errors, all in files this PR does not touch: json/no-empty-keys in JSON fixtures (e.g. tests/fixtures/settings/email-template-defaults.json) and perfectionist/sort-named-imports in tests/vitest/ownerAttestation.spec.js and tests/vitest/portfolioReport.spec.js. ESLint does not lint PHP, so these errors are already in development.

quality / Frontend Check (format) and quality / Frontend Check (check:schema-l10n): the formatter checks JS/Vue/CSS/JSON files and the schema-l10n check compares register schemas with the l10n/ catalogues; this PR changes none of those files, so whatever they flag is on development.

quality / Hydra Gates: 12 gates fail. Each is about something this PR does not touch: composer advisories (gate 4), NoAdminRequired controller methods (7), page visual baselines (26), reduced-motion CSS (45), @spec targets (46), schema property titles (51), relation dialect (54), config gates (59), icons (60), OpenRegister container lookups in lib/ (66), the reports page (104) and app chrome (107). The maintainability floor passes (no value moves against the merge base).

quality / Frontend Tests (unit): Vitest failures in JS specs: architectureViewsPages.spec.js, complianceMatrixStates.spec.js (claimed vs verified), facets.spec.js and manifestWidgetIcons.spec.js (ModuleversieDetail.mv-vulnerabilities: ShieldAlertOutline falls back to the default icon). These run JS against src/ and the manifest; this PR changes no JS, Vue or manifest file.

quality / PHPUnit (PHP 8.3, NC stable35, pgsql) (job 136881624583): PHPUnit never started. occ app:enable stackiq died during the app's repair steps with Maximum call stack size … reached. Infinite recursion?: the 51,000-frame trace cycles through one app frame only, lib/Service/Registration/ServiceFactories.php(294) (the SettingsService factory), and the container resolving its dependencies back into it. That is a dependency-injection cycle in lib/ registration. This PR changes nothing under lib/, and the openregister installed here is main, not the openregister PRs this one prepares for, so neither side of this PR is in the cycle.

quality / Quality Report (job 136888355553): the summary job fails when any leg above fails; its table repeats them (phpmd, psalm, eslint, format, check-schema-l10n, composer, PHPUnit, Hydra gates) plus REUSE. The REUSE leg reads licence metadata repository-wide; the one file this PR edits keeps its existing @copyright / @license header unchanged, so that finding is on development too.


Generated by Claude Code

@github-actions

Copy link
Copy Markdown
Contributor

Quality Report — ConductionNL/stackiq @ d702696

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 ❌ ✅ 150/150
npm ✅ ✅ 811/811
app:check-code ⏭️
info.xml ✅
REUSE ❌
lockfile sync ✅
PHPUnit ❌
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-21 15:54 UTC

Download the full PDF report from the workflow artifacts.

cloud-merge-stackiq

Assisted-by: ClaudeCode:claude-opus-5-5
@rubenvdlinde
rubenvdlinde merged commit 50f89f4 into development Nov 21, 2026
5 of 7 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

Quality Report — ConductionNL/stackiq @ cc3fcf8

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 ❌ ✅ 150/150
npm ✅ ✅ 811/811
app:check-code ⏭️
info.xml ✅
REUSE ❌
lockfile sync ✅
PHPUnit ❌
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-21 18:30 UTC

Download the full PDF report from the workflow artifacts.

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