Skip to content

[access] refactor(retention): the destruction check, retention recalculation and webhook retry jobs take at most four parameters per unit - #7504

Merged
rubenvdlinde merged 6 commits into
mainfrom
cloud/k13-background-jobs
Nov 9, 2026
Merged

rubenvdlinde merged 6 commits into
mainfrom
cloud/k13-background-jobs

Conversation

@rubenvdlinde

Copy link
Copy Markdown
Contributor

Lane K13, round 10c (SIG unit interfacing).

What changed

  • DestructionCheckJob::sendObjectNotification (6 params) now takes the approaching object and the logger; it reads the subject, title, action date and category off the object itself through small typed helpers (subjectOf, titleOf, classificationOf). A category that isn't a string is still refused the way the old typed parameter refused it. The payload sent to the archivist group is unchanged.
  • RelatedRetentionRecalculationJob::recalculateBatch (5 params) now takes the batch and a RetentionDependantPlace: the source uuid, the relation, the register and the schema of the dependants. That place goes through the batch, the per-candidate step (recalculateOne) and the store step (storeFollowed). The reference check, the failure logging and the counting are unchanged.
  • WebhookRetryJob::__construct (5 params) takes the webhook and webhook-log mappers as one WebhookDeliveryStores bundle, wired by DI autowiring.

No access decision changed: retention reads stay _rbac: false, _multitenancy: false exactly as before, and the hold check still runs before any notification.

Tests

  • Characterisation tests added first, on the old code: DestructionCheckJobNotificationPayloadTest pins the full notification payload (destruction subject vs e-Depot subject, name vs uuid fallback, category vs empty) and the case where there is no archivist group. A mutation (title always the uuid) makes it fail. RelatedRetentionRecalculationJobTest gains a test where a dependant fails to store: it is skipped and the others still follow.
  • Ran on the branch merged with current development: tests/Unit/Architecture, Contract, Kernel, Service/Rules, ControllerServicesWiringTest, ControllerSessionWiringTest, tests/Unit/BackgroundJob, tests/Unit/Service/Archival, RetentionSweepTest, RemoveRetiredCronJobsTest, A29SaveGuardsGoldenTest: 3590 tests, OK.
  • php -l, phpcs (no new findings) and phpstan (no errors) on the touched files.

Numbers (lane_measure.py, lane K13)

  • Interfacing LOC over 4 params in the lane's files: 224 → 141 (target ≤ 15)
  • Over 6 params: 63 → 63 (all three remaining units are blocked by another lane's caller or by a cross-repo signature)
  • Exposed LOC: 135 → 135 (target reached already)

AI disclosure: this PR was written by Claude Code (claude-opus-5-5) running as an automated lane.


Generated by Claude Code

…object it is about

sendObjectNotification took six parameters, five of them read off one object's
retention block by its only caller. It now takes the object and the logger and
reads the subject, title, action date and category itself, each through a typed
helper so a mistyped category is refused exactly as before.

Assisted-by: ClaudeCode:claude-opus-5-5
… the rest follow

Assisted-by: ClaudeCode:claude-opus-5-5
…e place they live in

recalculateBatch took the source uuid, the relation, the register and the schema
beside the batch. Those four describe one place: where the dependants of one
source live. RetentionDependantPlace carries them through the batch, the
per-candidate step and the store step, so no unit takes more than two.

Assisted-by: ClaudeCode:claude-opus-5-5
…s one bundle

WebhookDeliveryStores holds the two tables a delivery is retried from; the
constructor drops from five parameters to four. Wired by DI autowiring.

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

Copy link
Copy Markdown
Contributor Author

Newman API Test Suite (api-test-coverage workflow) is red here, but the failure doesn't come from this PR.

  • The 22 failing tests are JobRunMapperNarrowGoldenTest, FileVersioningHandlerGoldenTest, A18InterfaceBindingsTest (ObjectRetentionHandler), TextExtractionJobsGoldenTest, EndpointsControllerAnswersGoldenTest, SchemaConfigValidatorsGoldenTest and ProcessingLogServiceGoldenTest. None of them touch a file this PR changes.
  • At this PR's head (b5ec3de) the same tests pass locally against the composer OCP stubs: 75 tests, OK. In CI they run against the server tree in /var/www/html, and that is where the mock and OCP differences come from (fetchAssociative cannot be configured).
  • The workflow has failed on every one of its last 100 completed runs, development included.

No fix exists for this yet, and it is outside this PR's scope, so nothing is pushed here.


Generated by Claude Code

Copy link
Copy Markdown
Contributor Author

Three frontend checks are red here as well. None of them comes from this PR, which changes only PHP files under lib/BackgroundJob and their PHP tests.

  • quality / Frontend Check (format): Prettier reports style issues in 116 src/ and tests/unit/support/ files, for example src/views/webhooks/WebhooksIndex.vue.
  • quality / Frontend Check (test:l10n:parity): the backend .json catalogues are missing keys such as "Some objects could not be copied.".
  • quality / Frontend Tests (unit): src/components/shared/refreshButton.spec.js fails with SyntaxError: Unexpected token 'export'.

The same format, l10n and l10n-parity checks fail on docs-only PR #7484 (run 42564559789), so this is the state of development. I haven't found a fix for any of them, and they're out of this PR's scope, so nothing is pushed here.


Generated by Claude Code

Copy link
Copy Markdown
Contributor Author

Two more checks have failed since my last comment: quality / Frontend Check (test:l10n) and quality / Vue Quality (eslint). Neither is caused by this PR, which has no frontend changes.

I haven't pushed anything for these, because a fix belongs outside this PR.


Generated by Claude Code

Copy link
Copy Markdown
Contributor Author

quality / PHP Quality (phpcs) fails on this PR, but on files the PR doesn't touch. The errors are in lib/Db/ImportPreviewRow.php, lib/Db/RuleRun.php, lib/Db/EntityRelation.php, lib/Db/CaseItem.php, lib/Db/MagicMapper/MagicObjectSearchInterface.php, lib/Service/Flow/FlowTokenRouter.php, lib/Service/Object/SaveObject/RelationCascadeHandler.php and lib/Service/ContractBindings.php. All of them are line-length errors, apart from one blank-line-after-tag-group error.

Running phpcs locally on the five production files this PR changes reports no errors. Fixing the eight flagged files belongs to the lanes that own them, so I've pushed nothing here.


Generated by Claude Code

Copy link
Copy Markdown
Contributor Author

quality / PHP Quality (phpstan) is red, but none of the errors are in files this PR changes. They are all in files outside it:

  • 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

A local phpstan run on the five production files this PR changes reports [OK] No errors. Nothing is pushed here, because those files are outside this PR's scope.


Generated by Claude Code

Copy link
Copy Markdown
Contributor Author

quality / PHP Quality (psalm) reports 60 errors here. None of them is in a file this PR touches. Most are in lib/Service/Object/*, lib/Service/ObjectSource/DbalAggregator.php, lib/Service/Settings/ObjectRetentionHandler.php and lib/Service/Vocabulary/ConceptHierarchy.php. The rest are UnusedBaselineEntry findings for CalendarEventService, TaskService, GraphQLController and others. I found 0 hits for this PR's job or support files, so I'm not pushing anything here.


Generated by Claude Code

Copy link
Copy Markdown
Contributor Author

quality / Hydra Gates is red, but none of the failing gates are caused by this PR. Seven gates fail: 3 stub-scan, 7 no-admin-idor (113 controller methods), 12 nc-input-labels, 17 redundant-controller, 40 form-label-association, 46 spec-anchor-existence and 49 controller-exception-translation.

  • This PR changes no controllers and no Vue files, so gates 7, 12, 17, 40 and 49 cannot come from it.
  • Gate 46 (2 unresolved targets): every @spec target in this PR's files resolves locally, file and anchor. That includes webhook-payload-mapping, archival-destruction-workflow, retention-management#requirement-the-system-must-send-pre-destruction-notifications and archival-frozen-refuses-delete-and-dates-follow/.../retention-management#requirement-the-destruction-date-follows-its-source-date-under-every-method.
  • Docs-only PR docs: architecture and security questionnaire answers #7484 fails the same check (run 42564559789).

No fix for this belongs in this PR, so I have pushed nothing here.


Generated by Claude Code

Copy link
Copy Markdown
Contributor Author

quality / PHP Quality (phpmd) is red here, but the failure isn't caused by this PR:

  • PHPMD reports 615 findings under lib/. None of them is in a file this PR touches (DestructionCheckJob, RelatedRetentionRecalculationJob, WebhookRetryJob, Support/RetentionDependantPlace and Support/WebhookDeliveryStores have 0 matches).
  • Docs-only PR docs: architecture and security questionnaire answers #7484 fails the same check (run 42564559789).

Nothing to push here.


Generated by Claude Code

Copy link
Copy Markdown
Contributor Author

quality / Integration Tests (Newman) is red on this PR with three assertions:

  • Restore endpoint responds
  • contact destruction date follows the client ("The contact follows": expected undefined to deeply equal '2028-10-01')
  • notify-on-change: no step failed

The second one exercises the job this PR touches, RelatedRetentionRecalculationJob, so I checked it against a run that doesn't contain this PR. The docs-only PR #7484 (job 128988318035) fails the same three assertions, with the same contact-follows failure. So the failure already exists on development and isn't caused by this PR.

The unit tests of the job also pass on this branch, with the characterisation added first: RelatedRetentionRecalculationJobTest checks that a client's end date recalculates both contacts to 2028-10-01, and that a dependant which fails to store is skipped.

I haven't pushed anything for this.


Generated by Claude Code

Copy link
Copy Markdown
Contributor Author

quality / PHPUnit (PHP 8.3, NC stable35, pgsql) fails with 6 errors and 4 failures. None of them is in this PR's code; they are the same tests that fail in the Newman unit step on development:

  • Errors (6): FileVersioningHandlerGoldenTest, where IVersionManager is already declared because the real server's files_versions app is loaded.
  • Failures (4): SchemaConfigValidatorsGoldenTest (the linked-type list grew) and ProcessingLogServiceGoldenTest ×3.

This PR's tests (RelatedRetentionRecalculationJobTest, DestructionCheckJob*Test, WebhookRetryJobTest) appear only in the 4354 "risky" notices, which don't fail the run. No fix belongs in this PR, so nothing is pushed here.


Generated by Claude Code

@rubenvdlinde
rubenvdlinde merged commit c5460e1 into main Nov 9, 2026
36 of 50 checks passed
@github-actions

github-actions Bot commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

Quality Report — ConductionNL/openregister @ 72f4c62

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 ✅
test-coverage-ratchet ✅
composer ✅ ✅ 168/168
npm ✅ ✅ 641/641
app:check-code ⏭️
info.xml ✅
REUSE ✅
lockfile sync ✅
PHPUnit ❌ 49038/49048 · 19 skipped
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-09 12:08 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