Skip to content

[access] refactor(objects): the deleted-object bundle and destruction jobs reach RenderObject and SaveObject through their contracts - #7394

Merged
rubenvdlinde merged 2 commits into
developmentfrom
cloud/g10-objects-ports
Nov 8, 2026
Merged

rubenvdlinde merged 2 commits into
developmentfrom
cloud/g10-objects-ports

Conversation

@rubenvdlinde

Copy link
Copy Markdown
Contributor

Lane G10, round 10, phase A1 (Objects core). This PR raises SIG component independence.

What changed

  • lib/Controller/Support/DeletedAccess.php: $renderObject is now typed as RenderObjectInterface instead of RenderObject. Its only caller, DeletedController, calls redactWriteOnlyFromRows(), and that method is on the interface.
  • lib/Controller/DeletedController.php: removed the unused use ...\RenderObject;.
  • lib/BackgroundJob/DestructionListRun.php and lib/BackgroundJob/DestructionCheckJob.php: the save handler is now resolved and typed as SaveObjectWriterInterface instead of SaveObject. Both call only saveObject().
  • Both contracts already existed and were already bound in ContractBindings as aliases. Each one resolves to the same shared instance as before, so DI behaves exactly as it did. There are no new interfaces and no new bindings, so ObjectsBindings is unchanged.
  • Only use lines, type hints and ::class lookups were edited. No logic changed.

Tests

  • Characterisation test first (separate commit, run on the old code): tests/Unit/BackgroundJob/DestructionCheckJobListCreationTest.php. It pins three cases: an eligible set is saved as one list (register and schema, _rbac/_multitenancy off, persisted, silent) and announced to the archivists; nothing eligible saves nothing; a list that could not be built saves nothing. It passes before and after the change.
  • tests/Unit/BackgroundJob/DestructionExecutionJobGoldenTest.php and its fixture record the container lookup ids. The id SaveObject became SaveObjectWriterInterface, which is a DI-equivalent alias. Everything else in the golden is identical.
  • tests/Unit/Architecture/D2InterfaceBindingsTest.php: the KEPT allowlist entry for RenderObject (DeletedController, DeletedAccess) is removed, so the allowlist only shrinks.
  • New tests/Unit/Architecture/G10InterfaceBindingsTest.php checks, for both contracts, that the class implements it, the binding is present and the alias is registered.

What ran (on the branch merged with current origin/development)

  • Guards: tests/Unit/Architecture, tests/Unit/Contract, tests/Unit/Kernel, tests/Unit/Service/Rules, ControllerServicesWiringTest and ControllerSessionWiringTest. Result: OK (2618 tests, 7393 assertions).
  • Touched classes: tests/Unit/BackgroundJob, the DeletedController* tests, tests/Unit/Service/Archival and RetentionSweepTest. Result: OK (991 tests).
  • php -l is clean. phpcs shows only the 2 warnings that were already there before (missing @spec tag on the class). phpstan on the touched lib files: no errors.

Numbers (component independence, exposed PHP LOC)

These come from a local re-implementation of the hydra-gates php_dependencies/component_of_factory logic. Executing the external script itself was blocked in this session. The totals therefore differ slightly from the brief's base, but the delta is exact.

  • Scope (the 14 listed classes plus ObjectService): 5,201 → 1,177 exposed LOC (−4,024). RenderObject (2,253) and SaveObject (1,771) are now hidden. ObjectService was already hidden.
  • Repo: 51,035 → 47,011 exposed of 411,736 (12.40% → 11.42%).

Not done, and why

AI disclosure: this change was made by Claude Code (an AI assistant) in an automated lane and has not yet been reviewed by a human.


Generated by Claude Code

…list

Assisted-by: ClaudeCode:claude-opus-5-5
…ch RenderObject and SaveObject through their contracts

DeletedAccess types its render handler as RenderObjectInterface, and
DestructionCheckJob and DestructionListRun resolve the save handler as
SaveObjectWriterInterface. Both contracts are already bound in
ContractBindings as aliases of the same shared instances, so the
resolved objects are unchanged. RenderObject and SaveObject are no
longer named outside lib/Service. D2's kept list for RenderObject
shrinks to nothing; G10InterfaceBindingsTest pins both bindings.

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

Copy link
Copy Markdown
Contributor Author

Newman API Test Suite (api-test-coverage) is red, and the failures are not from this PR.

The job's unit-test step reports 11 errors and 11 failures, all in tests this diff does not touch:

  • JobRunMapperNarrowGoldenTest: fetchAssociative cannot be mocked against the installed DBAL.
  • FileVersioningHandlerGoldenTest: IVersionManager is already declared by the real files_versions app.
  • EndpointsControllerAnswersGoldenTest: the property key now comes from OCP\AppFramework\Db\Entity.
  • SchemaConfigValidatorsGoldenTest: more linked-app types are installed on the server.
  • ProcessingLogServiceGoldenTest: the channel is background under CLI.
  • TextExtractionJobsGoldenTest and A18InterfaceBindingsTest (ObjectRetentionHandler).

Each of these depends on the real Nextcloud server the job runs against. This PR only changes DestructionCheckJob, DestructionListRun, DeletedController, DeletedAccess and their tests. On this branch locally (composer autoload, no Nextcloud root), Endpoints, SchemaConfigValidators and ProcessingLog all pass (56 tests), as does the whole Architecture suite.

The api-test-coverage runs on development for the last seven merges were all cancelled, so there is no baseline run to compare against. I can't find a fix to port into this PR. I re-ran the failed job once. Per the lane rules no more commits go on this branch, so a fix for these server-dependent goldens belongs in its own PR.


Generated by Claude Code

Copy link
Copy Markdown
Contributor Author

quality / Frontend Check (test:l10n:parity) is red because of development, not this PR.

I reproduced it locally with npm run test:l10n:parity. The key "We could not count the objects. Close this window and try again." is in en.js, but it is missing from the other locales (de, fr, es, it, bg, …).

This PR only changes lib/ and tests/ PHP files, and no src/ or l10n/ file. The same key gap is therefore on current development.

The fix is the §6.15 procedure in docs/l10n-workflow.md: translate the key into every locale with l10n:apply, one locale per commit. That is outside this lane's scope, and the lane rules forbid more commits on this branch, so I am not porting a fix here. As far as I can see, none exists yet.


Generated by Claude Code

Copy link
Copy Markdown
Contributor Author

quality / Frontend Check (format) is red because of development, not this PR.

Prettier reports code-style issues in 116 frontend files under src/ and tests/unit/support/, for example src/views/register/RegistersIndex.vue and tests/unit/support/ncGolden.js. This PR does not change any of those files: its diff is PHP only, in lib/ and tests/Unit.

The fix is a repo-wide prettier --write. That belongs in its own PR, and the lane rules forbid more commits on this branch, so I have not ported a fix here. As far as I can see, none exists yet.


Generated by Claude Code

Copy link
Copy Markdown
Contributor Author

quality / Vue Quality (eslint) and quality / Frontend Check (test:l10n) are also red because of development, not this PR.

Both checks lint or scan only the frontend (src/, l10n/). This PR's diff is PHP only, in lib/BackgroundJob, lib/Controller and tests/Unit, and changes no file either check reads.

CLAUDE.md already records test:l10n as red at HEAD: keys used in src/ are missing from en.js after a development merge. The parity failure I reported above has the same root cause.

No fix to port exists in this lane's scope, and the lane rules forbid more commits on this branch.


Generated by Claude Code

Copy link
Copy Markdown
Contributor Author

quality / PHP Quality (phpstan) is red because of development, not this PR.

phpstan reports 24 errors, and none of them is in a file this PR changes. The files with errors are:

  • BackgroundJob/FileTextExtractionJob.php
  • Controller/EndpointsController.php, Controller/Support/RegisterStatistics.php, Controller/TaskNotesController.php, Controller/WebhooksController.php
  • Db/Tenancy/TenancyIdentityTrait.php
  • Notifications/Controller/NotesController.php
  • Search/Service/GraphQL/GraphQLService.php
  • Service/Flow/FlowService.php, Service/Import/ImportPreviewService.php, Service/Integration/BuiltinProviders/NotesProvider.php, Service/Task/TaskSequenceService.php

Most errors are calls to methods that are missing from narrowed interfaces, for example NoteServiceInterface::requireNoteOf(), ImportPreviewRowMapperInterface::persist() and TaskSequenceMapperInterface::update(). They come from other lanes' interface swaps already merged into development.

The four lib files this PR touches (DestructionCheckJob, DestructionListRun, DeletedController, DeletedAccess) do not appear in the report. A local phpstan analyse with the repo's phpstan.neon on those files also reports no errors.

Those interfaces are owned by other lanes, and the lane rules forbid more commits on this branch, so I have not ported a fix here.


Generated by Claude Code

Copy link
Copy Markdown
Contributor Author

quality / PHP Quality (phpcs) is red because of development, not this PR.

phpcs reports errors in 8 files, all of which this PR leaves untouched:

  • Service/ContractBindings.php, lines 768–772
  • Service/Object/SaveObject/RelationCascadeHandler.php
  • Db/CaseItem.php, Db/RuleRun.php, Db/EntityRelation.php, Db/ImportPreviewRow.php
  • Db/MagicMapper/MagicObjectSearchInterface.php
  • Service/Flow/FlowTokenRouter.php

Almost all are lines over 150 characters. I ran phpcs locally on the four lib files this PR touches: 0 errors, and only the two pre-existing @spec warnings, which do not block.

The lane rules forbid more commits on this branch, so I have not ported a fix here.


Generated by Claude Code

Copy link
Copy Markdown
Contributor Author

quality / PHP Quality (psalm) is red because of development, not this PR.

Psalm reports 54 errors, none of them in a file this PR changes. They include:

  • LessSpecificImplementedReturnType in Db/FindLinksByObjectUuidTrait.php, Db/WebhookMapper.php, Db/Register.php, FileSharingHandler.php and ObjectRetentionHandler.php
  • InvalidPropertyAssignmentValue in FacetResults.php and CacheHandler.php
  • Nullable/FalsableReturnStatement in several services
  • TooManyArguments in DbalAggregator.php
  • 9 UnusedBaselineEntry entries

I ran vendor/bin/psalm locally with the repo config on the four lib files this PR touches (DestructionCheckJob, DestructionListRun, DeletedController, DeletedAccess). It exits 0 with no errors.

The lane rules forbid more commits on this branch, so I have not ported a fix here.


Generated by Claude Code

Copy link
Copy Markdown
Contributor Author

quality / PHP Quality (phpmd) is red because of development, not this PR.

I ran the repo's phpmd commands locally against the four lib files this PR touches (DestructionCheckJob, DestructionListRun, DeletedController, DeletedAccess): both phpmd.xml and the hydra-gates phpmd-unusedparams.xml ruleset, each with phpmd.baseline.xml. Both exit 0 with no violations. The CI run analyses all of lib/, so its findings come from other files on development, the same pattern as the phpcs, phpstan and psalm failures above.

The lane rules forbid more commits on this branch, so I have not ported a fix here.


Generated by Claude Code

Copy link
Copy Markdown
Contributor Author

quality / Hydra Gates is red because of development, not this PR.

7 gates fail, all on repo-wide counts:

Gate Check Failing count
3 stub-scan 1
7 no-admin-idor 113 methods
12 nc-input-labels 1 NcSelect
17 redundant-controller 1
40 form-label-association 1
46 spec-anchor-existence 2
49 controller-exception-translation 19 methods

This PR adds no controller method, Vue component, form, @spec tag or stub. In DeletedController it only removes an unused use line. DeletedAccess changes a single type hint. In the two background jobs it swaps container lookup ids and type hints. None of that can add a finding to these gates.

The lane rules forbid more commits on this branch, so I have not ported a fix here.


Generated by Claude Code

Copy link
Copy Markdown
Contributor Author

quality / Integration Tests (Newman): 1625 of 1628 assertions pass, across all 39 collections, with 0 request or script errors.

The failing assertion I can see in the log is in the flow collection:

notify-on-change: no step failed: expected 'n1: The call to source "3478fb8d-0809…' to deeply equal '', inside "2 — Alter an object and notify a human / notify-on-change — assert effect"

That is a flow step calling an external source. This PR does not touch flows, sources or notifications.

The only paths this PR changes are the destruction jobs and the deleted-objects bundle. The destruction-list requests in the run return 200 OK (GET /api/archival/destruction-lists). The other two failing assertions are outside the part of the log the API returns.

I have not re-run this job. A re-run of failed jobs would also repeat the static-analysis jobs, which fail deterministically on development. The lane rules forbid more commits on this branch.


Generated by Claude Code

@rubenvdlinde
rubenvdlinde merged commit 6350d53 into development Nov 8, 2026
36 of 49 checks passed
@github-actions

github-actions Bot commented Nov 8, 2026

Copy link
Copy Markdown
Contributor

Quality Report — ConductionNL/openregister @ 1f6fe99

Check PHP Vue Security License Tests
lint ✅
phpcs ❌
phpmd ❌
psalm ❌
phpstan ❌
phpmetrics ✅
eslint ❌
stylelint ✅
build ✅
check-specs ✅
test-l10n ❌
test-l10n-parity ❌
format ❌
check-schema-l10n ✅
composer ✅ ✅ 168/168
npm ✅ ✅ 641/641
app:check-code ⏭️
info.xml ✅
REUSE ✅
lockfile sync ✅
PHPUnit ❌ cancelled — no verdict
Newman ❌ 1625/1628
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-08 21:58 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.

2 participants