Skip to content

[access] test(listener): cover the delete/save guards, e-Depot audit log and config type registration - #7555

Merged
rubenvdlinde merged 4 commits into
mainfrom
cloud/t02-guards
Nov 9, 2026
Merged

rubenvdlinde merged 4 commits into
mainfrom
cloud/t02-guards

Conversation

@rubenvdlinde

Copy link
Copy Markdown
Contributor

What this covers

Branch-by-branch PHPUnit tests for eight production classes in lane T02's scope (delete/save guards, the e-Depot transfer audit log, and shareable-config type registration):

File Before (CI clover, development 30fbb6d) After (subset run)
lib/Listener/ConceptDeleteGuardListener.php 0/59 58/59 (98.3%)
lib/Listener/FrozenObjectDeleteGuardListener.php 0/32 32/32 (100%)
lib/Listener/PartyTreeGuardListener.php 0/27 27/27 (100%)
lib/Listener/WorkingCalendarDeleteGuardListener.php 0/26 26/26 (100%)
lib/Service/Edepot/TransferAuditLog.php 0/53 53/53 (100%)
lib/Listener/ShareableConfigTypeRegistrationListener.php 0/8 8/8 (100%)
lib/Service/Config/ShareableConfigTypeRegistry.php 10/15 15/15 (100%)
lib/Service/Config/RegisterShareableConfigTypesEvent.php 1/2 2/2 (100%)

Why several of these were at 0 despite existing tests: phpunit.xml sets beStrictAboutCoverageMetadata="true", so a test that executes a class missing from its @covers/@uses is marked risky and its coverage is dropped (e.g. FrozenObjectDeleteGuardListenerTest executes AbstractObjectEntityEvent without @uses; ConceptDeleteGuardListenerLeavingTest only exercises ObjectLeavingEvent). The new files list every class they execute and run without risky results. Existing test files are untouched.

Each refusal test asserts the exact error payload (code, message, 409 status, detail); each allow path is paired with a refusal that flips the deciding input; fail-open guards assert the logged warning.

What ran

php -d pcov.enabled=1 -d pcov.directory=lib vendor/bin/phpunit -c phpunit.xml --no-progress --coverage-clover /tmp/t02pr1.xml <the 6 new test files> → OK (38 tests, 101 assertions), then clover_files.py on the T02 file list. This is a subset run, so the numbers are a lower bound of the full-suite figure. Weak-test scanner (weak.php) reports none of the new tests. php-cs-fixer applied.

Mutation samples (each reverted, never committed)

  • mutation: lib/Listener/ConceptDeleteGuardListener.php:215 === 0 -> < 0 -> 1 test failed
  • mutation: lib/Listener/FrozenObjectDeleteGuardListener.php:134 return $userId -> return 'x' -> 1 test failed
  • mutation: lib/Listener/PartyTreeGuardListener.php:100 dropped stopPropagation() -> 2 tests failed
  • mutation: lib/Listener/WorkingCalendarDeleteGuardListener.php:128 === 0 -> !== 0 -> 2 tests failed
  • mutation: lib/Service/Edepot/TransferAuditLog.php:180 setUser('admin') -> setUser('root') -> 1 test failed
  • mutation: lib/Listener/ShareableConfigTypeRegistrationListener.php:81 dropped scanned-type registration -> 1 test failed
  • mutation: lib/Service/Config/ShareableConfigTypeRegistry.php:116 dropped $this->loaded = true -> 2 tests failed

No production code changed. Tests written with Claude Code.


Generated by Claude Code

…endar guards branch by branch

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

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

Copy link
Copy Markdown
Contributor Author

Newman API Test Suite (api-test-coverage) is red, but not because of this PR.

The failures are 11 errors and 11 failures across seven test classes that this PR does not touch:

  • A18InterfaceBindingsTest
  • TextExtractionJobsGoldenTest
  • EndpointsControllerAnswersGoldenTest
  • JobRunMapperNarrowGoldenTest
  • SchemaConfigValidatorsGoldenTest
  • FileVersioningHandlerGoldenTest (Cannot declare class OCA\Files_Versions\Versions\IVersionManager)
  • ProcessingLogServiceGoldenTest

This PR only adds test files. The same seven classes fail in this workflow on every other open cloud/* PR I checked, for example cloud/k41-view-styles. The latest completed run of this workflow on all 25 most recent branches has concluded failure.

On development (732e0ed), those classes pass when run on their own (67 tests). That points at the full-suite run in this job, not at any one change. No fix exists yet. Fixing it means touching those tests, which belong to other lanes, so I am not widening this PR. I have not re-run the job: the failure is the same on every branch, so a re-run would not tell us anything new.


Generated by Claude Code

@rubenvdlinde
rubenvdlinde changed the base branch from development to main November 9, 2026 06:54

Copy link
Copy Markdown
Contributor Author

quality / Frontend Check (test:l10n) is red, and the cause is not in this PR.

The job reports l10n-check: FAIL — 14 translation key(s) used in source but MISSING from l10n/en.js. This PR adds only PHP unit tests. It changes no file under src/ and no file under l10n/.

The repository's own CLAUDE.md ("Known state") records that npm run test:l10n is red at development HEAD. A development merge replaced the Dutch GDPR source terms and added flow strings without adding the keys to en.js. That fix is its own l10n commit (the docs/l10n-workflow.md §6.15 procedure) and is outside this test-only PR, so I am not widening the PR. No fix exists yet. This same check will fail the same way on the other T02 test PRs.


Generated by Claude Code

Copy link
Copy Markdown
Contributor Author

quality / Frontend Check (format) is red, and the cause is not in this PR.

Prettier reports Code style issues found in 116 files. Every flagged file is an existing frontend file in src/ (.vue and .js) or a frontend test helper (tests/unit/support/*.js). This PR adds only PHP test files under tests/Unit/, and Prettier does not check those. No file this PR adds or changes is on the list.

The fix is a repo-wide prettier --write on frontend files that belong to other lanes, so I am not widening this test-only PR to do it. No fix exists yet.


Generated by Claude Code

Copy link
Copy Markdown
Contributor Author

quality / Vue Quality (eslint) and quality / Frontend Check (test:l10n:parity) are red, and the cause is not in this PR.

  • eslint: ✖ 769 problems (16 errors, 753 warnings). These are in existing JS files in the repo (for example scripts/l10n/). No PHP file appears in the output, and this PR adds only PHP test files under tests/Unit/.
  • test:l10n:parity: l10n-parity: FAIL — a locale lost parity. The check is on the l10n/* locale bundles, and this PR changes no file under l10n/ or src/. This goes with the known red test:l10n on development that CLAUDE.md records.

Both fixes are in frontend and locale files that belong to other lanes, so I am not widening this test-only PR to make them. No fix exists yet.


Generated by Claude Code

Copy link
Copy Markdown
Contributor Author

quality / PHP Quality (phpcs) and quality / Frontend Tests (unit) are red, and the cause is not in this PR.

  • phpcs: every error is in existing production files under lib/, for example lib/Db/ImportPreviewRow.php, lib/Db/RuleRun.php, lib/Service/ContractBindings.php and lib/Db/CaseItem.php. Most are lines longer than 150 characters. phpcs.xml covers lib/ only. This PR changes no production file and adds only tests under tests/Unit/.
  • Frontend Tests (unit): one suite fails, src/components/shared/refreshButton.spec.js. This PR touches no JavaScript.

The lane rules forbid me from changing production or frontend code in this test-only PR, so I am not fixing either here. No fix exists yet.


Generated by Claude Code

Copy link
Copy Markdown
Contributor Author

quality / PHP Quality (phpstan) is red, and the cause is not in this PR.

The reported errors are in existing production files under lib/, for example BackgroundJob/FileTextExtractionJob.php, Controller/EndpointsController.php, Controller/Support/RegisterStatistics.php, Controller/TaskNotesController.php and Controller/WebhooksController.php. This PR changes no production code. It adds only PHPUnit test files. The PSR-4 "Skipping" lines in the log are about other, existing test files and are notices, not errors.

The lane rules forbid me from changing production code in this test-only PR. No fix exists yet.


Generated by Claude Code

Copy link
Copy Markdown
Contributor Author

quality / PHP Quality (psalm) is red, and the cause is not in this PR.

Every psalm error is in existing production files under lib/, for example lib/Service/ObjectSource/DbalObjectSourceProvider.php and lib/Service/TaskService.php. Most are UnusedBaselineEntry (the psalm baseline is out of date with lib/). None of the errors is in a test file. This PR adds only PHPUnit test files and changes no production code or psalm baseline.

The lane rules forbid me from changing production code or the baseline in this test-only PR. No fix exists yet.


Generated by Claude Code

Copy link
Copy Markdown
Contributor Author

quality / Hydra Gates is red: 7 gates failed. I think none of them comes from this PR; one (gate 3) I could not confirm from the log.

This was a forced full-repo run ("Forced full-repo run"), so the gates scanned the whole app, not just this diff. The failing gates:

  • gate 7 no-admin-idor: 113 controller methods.
  • gate 12 nc-input-labels: a Vue NcSelect without a label.
  • gate 17 redundant-controller: a pass-through controller method.
  • gate 40 form-label-association: a form input without a label.
  • gate 46 spec-anchor-existence: two unresolved @spec targets.
  • gate 49 controller-exception-translation: 19 controller methods.
  • gate 3 stub-scan: one finding.

Gates 7, 12, 17, 40 and 49 are about production controllers and Vue files. This PR adds only six PHPUnit test files under tests/Unit/ and no production, frontend or spec file. Gate 48 confirms in the same log that "the diff … touches NO controller".

For gate 3 and gate 46, the log names only the per-gate log files, not the offending paths, so I could not confirm the location from here. I checked: the six added test files contain no stub markers (no TODO, FIXME, "not implemented" or the like). They also add no new @spec tags.

The lane rules forbid me from changing production code in this test-only PR, so I am not fixing these here. No fix exists yet.


Generated by Claude Code

@github-actions

github-actions Bot commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

Quality Report — ConductionNL/openregister @ 0578937

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 ❌ 49073/49083 · 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 16:33 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