feat: Retention management — bewaartermijnen and selectielijsten#986
feat: Retention management — bewaartermijnen and selectielijsten#986rubenvdlinde merged 3 commits intodevelopmentfrom
Conversation
Quality Report
Summary
PHP Quality
Vue Quality
Security
License Compliance
composer dependencies (147 total)
npm dependencies (586 total)
PHPUnit TestsPHPUnit tests were not enabled for this run. Integration Tests (Newman)Newman integration tests were not enabled for this run. E2E Tests (Playwright)Playwright E2E tests were not enabled for this run. Generated automatically by the Quality workflow.
|
rjzondervan
left a comment
There was a problem hiding this comment.
PR shows various PHPstan errors, and is also using a way of calling server variables that is deprecated
| $objectMapper = \OC::$server->get(MagicMapper::class); | ||
| $connection = \OC::$server->getDatabaseConnection(); |
There was a problem hiding this comment.
This way of requesting global parameters is being phased out by Nextcloud and should not be added new
| $retentionService = \OC::$server->get(RetentionService::class); | ||
| $settingsHandler = \OC::$server->get(ObjectRetentionHandler::class); | ||
| $objectMapper = \OC::$server->get(MagicMapper::class); | ||
| $auditMapper = \OC::$server->get(AuditTrailMapper::class); | ||
| $deleteObject = \OC::$server->get(DeleteObject::class); | ||
| $saveObject = \OC::$server->get(\OCA\OpenRegister\Service\Object\SaveObject::class); |
rjzondervan
left a comment
There was a problem hiding this comment.
Some style notes for later reference, furthermore ok.
| MagicMapper $objectMapper, | ||
| LegalHoldService $legalHoldService, | ||
| DeleteObject $deleteObject, | ||
| AuditTrailMapper $auditTrailMapper, | ||
| IAppConfig $appConfig, | ||
| IJobList $jobList, | ||
| IUserSession $userSession, | ||
| LoggerInterface $logger |
There was a problem hiding this comment.
Note for updating agents: these can all be done in the PHP 8 style:
private readonly MagicMapper $objectMapper,
And without needing any lines within the {} for the constructor.
| * | ||
| * @return array<string, mixed> The destruction certificate data. | ||
| */ | ||
| public function generateCertificate(array $destructionList, array $executionResult): array |
| // Apply archival metadata from schema archive configuration. | ||
| try { | ||
| $retentionService = \OC::$server->get(\OCA\OpenRegister\Service\RetentionService::class); | ||
| $preparedObject = $retentionService->applyArchivalMetadata($preparedObject, $schema); | ||
| } catch (\Throwable $e) { | ||
| $this->logger->debug( | ||
| '[SaveObject] RetentionService not available, skipping archival metadata: '.$e->getMessage() | ||
| ); | ||
| } | ||
|
|
There was a problem hiding this comment.
When would the retentionservice not be available?
Summary
Context
This PR was previously merged and reverted along with other PRs while investigating a development branch issue.