Dry-run preview UI for retention at all three scopes (#3604793)
Phase 3 of #3604793, on the same issue fork. Adds the dry-run preview UI that Phases 1 (site-wide cleanup) and 2 (per-workflow/per-tenant overrides + hold) were missing: a live count, on each retention form, of how many instances the current policy would purge right now, in that form's scope, without deleting anything.
What changed
RetentionManager::previewEligible($scope_type, $scope_id)counts eligible instances site-wide, for one workflow, or for one tenant. It reuses the existing eligibility, precedence (workflow override > tenant override > site default) and hold logic by ANDing a single scope filter into every query, so the preview can never disagree with what the purge would actually do.- A shared
RetentionPreviewTraitrenders the same preview line on all three forms: the site Retention settings, the per-workflow Retention tab, and a new per-tenant Retention form. - Tenants get an admin surface for the first time: a Tenants list (
TenantListBuilder) under the Orchestra admin menu, showing each tenant's effective override and linking to itsTenantRetentionForm. The override is still stored on the tenant config entity (Phase 2); the form is only a UI surface, mirroring the workflow form.
Tests
InstanceRetentionTest: two new scoped-preview cases (workflow scope incl. a held workflow previewing zero; tenant scope). Full kernel suite green (12 tests).- New functional
RetentionUiTest: drives all three preview surfaces, the Tenants list and saving a tenant override (8 assertions, green in Docker). phpcsclean;phpstanno new errors.