Skip to content

Commit 2899d76

Browse files
authored
chore(openspec): archive cmdb-import-mapping-view (#2080)
Syncs REQ-CMDB-020 to 022 and the modified REQ-CMDB-005 and 014 into the cmdb-export-import spec, sets the land-cmdb-mapping row to built and repoints the @SPEC tags at the synced spec and archived tasks. Assisted-by: ClaudeCode:claude-opus-5-5
1 parent 7ee3d15 commit 2899d76

52 files changed

Lines changed: 341 additions & 199 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎appinfo/routes.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@
126126
['name' => 'cmdbImport#import', 'url' => '/api/cmdb-import', 'verb' => 'POST'],
127127
['name' => 'cmdbImport#cancel', 'url' => '/api/cmdb-import/{operationId}/cancel', 'verb' => 'POST'],
128128
// The mapping the CMDB import uses, read-only — same posture as the import (Nextcloud admins only, CSRF).
129-
// @spec openspec/changes/cmdb-import-mapping-view/specs/cmdb-export-import/spec.md#requirement-the-admin-settings-shall-show-the-mapping-the-import-uses-req-cmdb-020
129+
// @spec openspec/specs/cmdb-export-import/spec.md#requirement-the-admin-settings-shall-show-the-mapping-the-import-uses-req-cmdb-020
130130
['name' => 'settings#getCmdbImportMapping', 'url' => '/api/settings/cmdb-import/mapping', 'verb' => 'GET'],
131131

132132
// User Groups management routes

‎lib/Controller/CmdbImportController.php‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -510,7 +510,7 @@ private function error(string $code, int $status, array $details = []): JSONResp
510510
*
511511
* @SuppressWarnings(PHPMD.CyclomaticComplexity) One branch per contract error code.
512512
*
513-
* @spec openspec/changes/cmdb-import-mapping-view/tasks.md#task-1
513+
* @spec openspec/changes/archive/2026-11-20-cmdb-import-mapping-view/tasks.md#task-1
514514
*/
515515
private function message(string $code, array $details): string {
516516
$megabytes = (string)round((int)($details['maxBytes'] ?? $this->importService->maxFileBytes()) / 1048576, 1);
@@ -551,7 +551,7 @@ private function message(string $code, array $details): string {
551551
*
552552
* @return string
553553
*
554-
* @spec openspec/changes/cmdb-import-mapping-view/tasks.md#task-1
554+
* @spec openspec/changes/archive/2026-11-20-cmdb-import-mapping-view/tasks.md#task-1
555555
*/
556556
private function mappingMessage(array $details): string {
557557
$pack = ($details['pack'] ?? null);

‎lib/Controller/SettingsController.php‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ class SettingsController extends Controller {
126126
* @SuppressWarnings(PHPMD.ExcessiveParameterList)
127127
*
128128
* @spec openspec/changes/adopt-connection-registry/specs/admin-integrations/spec.md#requirement-req-stackiq-conn-002-a-save-asks-integriq-to-look-again-and-a-run-reports-what-it-met
129-
* @spec openspec/changes/cmdb-import-mapping-view/specs/cmdb-export-import/spec.md#requirement-the-admin-settings-shall-show-the-mapping-the-import-uses-req-cmdb-020
129+
* @spec openspec/specs/cmdb-export-import/spec.md#requirement-the-admin-settings-shall-show-the-mapping-the-import-uses-req-cmdb-020
130130
*/
131131
public function __construct(
132132
$appName,
@@ -3489,8 +3489,8 @@ public function getEolSyncStatus(): JSONResponse {
34893489
*
34903490
* @auth admin-only the import's configuration; the import writes with RBAC and multitenancy off, so its view keeps that posture.
34913491
*
3492-
* @spec openspec/changes/cmdb-import-mapping-view/specs/cmdb-export-import/spec.md#requirement-the-admin-settings-shall-show-the-mapping-the-import-uses-req-cmdb-020
3493-
* @spec openspec/changes/cmdb-import-mapping-view/tasks.md#task-3
3492+
* @spec openspec/specs/cmdb-export-import/spec.md#requirement-the-admin-settings-shall-show-the-mapping-the-import-uses-req-cmdb-020
3493+
* @spec openspec/changes/archive/2026-11-20-cmdb-import-mapping-view/tasks.md#task-3
34943494
*/
34953495
public function getCmdbImportMapping(): JSONResponse {
34963496
$profile = ($this->cmdbImportProfile ?? (new HelperFactory())->cmdbImportProfile(container: $this->container));
@@ -3552,7 +3552,7 @@ public function getCmdbImportMapping(): JSONResponse {
35523552
*
35533553
* @return string|null Null when the pack is not stored in OpenRegister or the link cannot be built.
35543554
*
3555-
* @spec openspec/changes/cmdb-import-mapping-view/tasks.md#task-3
3555+
* @spec openspec/changes/archive/2026-11-20-cmdb-import-mapping-view/tasks.md#task-3
35563556
*/
35573557
private function packEditUrl(?int $packId): ?string {
35583558
if ($packId === null || $this->urlGenerator === null) {
@@ -3582,7 +3582,7 @@ private function packEditUrl(?int $packId): ?string {
35823582
*
35833583
* @return string
35843584
*
3585-
* @spec openspec/changes/cmdb-import-mapping-view/specs/cmdb-export-import/spec.md#requirement-the-admin-settings-shall-show-the-mapping-the-import-uses-req-cmdb-020
3585+
* @spec openspec/specs/cmdb-export-import/spec.md#requirement-the-admin-settings-shall-show-the-mapping-the-import-uses-req-cmdb-020
35863586
*/
35873587
private static function boundedReason(string $message): string {
35883588
$firstLine = strtok($message, "\r\n");

‎lib/Kernel/Contracts/CmdbImportPackStoreInterface.php‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ interface CmdbImportPackStoreInterface {
5858
*
5959
* @return bool
6060
*
61-
* @spec openspec/changes/cmdb-import-mapping-view/tasks.md#task-1
61+
* @spec openspec/changes/archive/2026-11-20-cmdb-import-mapping-view/tasks.md#task-1
6262
*/
6363
public function isAvailable(): bool;
6464

@@ -79,7 +79,7 @@ public function isAvailable(): bool;
7979
* that fails because another request seeded the pack
8080
* first is no failure: that pack is used.
8181
*
82-
* @spec openspec/changes/cmdb-import-mapping-view/tasks.md#task-1
82+
* @spec openspec/changes/archive/2026-11-20-cmdb-import-mapping-view/tasks.md#task-1
8383
*/
8484
public function resolve(array $shipped): array;
8585
}//end interface

‎lib/Kernel/Contracts/CmdbImportProfileInterface.php‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,8 @@ interface CmdbImportProfileInterface {
6161
* @throws CmdbImportException MAPPING_UNAVAILABLE when the validator is missing,
6262
* or the profile or a pack is unreadable or invalid.
6363
*
64-
* @spec openspec/changes/cmdb-import-mapping-view/specs/cmdb-export-import/spec.md#requirement-the-admin-settings-shall-show-the-mapping-the-import-uses-req-cmdb-020
65-
* @spec openspec/changes/cmdb-import-mapping-view/tasks.md#task-3
64+
* @spec openspec/specs/cmdb-export-import/spec.md#requirement-the-admin-settings-shall-show-the-mapping-the-import-uses-req-cmdb-020
65+
* @spec openspec/changes/archive/2026-11-20-cmdb-import-mapping-view/tasks.md#task-3
6666
*/
6767
public function mappingOverview(): array;
6868

@@ -75,7 +75,7 @@ public function mappingOverview(): array;
7575
*
7676
* @throws CmdbImportException MAPPING_UNAVAILABLE when the validator is missing or a file is unreadable or invalid.
7777
*
78-
* @spec openspec/changes/cmdb-import-mapping-view/tasks.md#task-2
78+
* @spec openspec/changes/archive/2026-11-20-cmdb-import-mapping-view/tasks.md#task-2
7979
*/
8080
public function shippedEditablePacks(): array;
8181
}//end interface

‎lib/Repair/SeedCmdbImportPacks.php‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
* @license EUPL-1.2 https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
2525
* @link https://github.com/ConductionNL/stackiq
2626
*
27-
* @spec openspec/changes/cmdb-import-mapping-view/tasks.md#task-2
27+
* @spec openspec/changes/archive/2026-11-20-cmdb-import-mapping-view/tasks.md#task-2
2828
*
2929
* SPDX-FileCopyrightText: 2026 Conduction B.V. <info@conduction.nl>
3030
* SPDX-License-Identifier: EUPL-1.2
@@ -44,7 +44,7 @@
4444
/**
4545
* Seeds and updates the CMDB import packs in OpenRegister's migration-pack store.
4646
*
47-
* @spec openspec/changes/cmdb-import-mapping-view/tasks.md#task-2
47+
* @spec openspec/changes/archive/2026-11-20-cmdb-import-mapping-view/tasks.md#task-2
4848
*/
4949
class SeedCmdbImportPacks implements IRepairStep {
5050
/**
@@ -54,7 +54,7 @@ class SeedCmdbImportPacks implements IRepairStep {
5454
* @param CmdbImportPackStoreInterface $store OpenRegister's migration-pack store.
5555
* @param LoggerInterface $logger Logger for seed diagnostics.
5656
*
57-
* @spec openspec/changes/cmdb-import-mapping-view/tasks.md#task-2
57+
* @spec openspec/changes/archive/2026-11-20-cmdb-import-mapping-view/tasks.md#task-2
5858
*/
5959
public function __construct(
6060
private readonly CmdbImportProfileInterface $profile,
@@ -68,7 +68,7 @@ public function __construct(
6868
*
6969
* @return string
7070
*
71-
* @spec openspec/changes/cmdb-import-mapping-view/tasks.md#task-2
71+
* @spec openspec/changes/archive/2026-11-20-cmdb-import-mapping-view/tasks.md#task-2
7272
*/
7373
public function getName(): string {
7474
return 'Seed the CMDB import mapping packs into OpenRegister';
@@ -81,7 +81,7 @@ public function getName(): string {
8181
*
8282
* @return void
8383
*
84-
* @spec openspec/changes/cmdb-import-mapping-view/tasks.md#task-2
84+
* @spec openspec/changes/archive/2026-11-20-cmdb-import-mapping-view/tasks.md#task-2
8585
*/
8686
public function run(IOutput $output): void {
8787
if ($this->store->isAvailable() === false) {
@@ -124,7 +124,7 @@ private function shippedPacks(IOutput $output): ?array {
124124
*
125125
* @return void
126126
*
127-
* @spec openspec/changes/cmdb-import-mapping-view/tasks.md#task-2
127+
* @spec openspec/changes/archive/2026-11-20-cmdb-import-mapping-view/tasks.md#task-2
128128
*/
129129
private function seed(IOutput $output, array $shipped): void {
130130
$stored = $this->storedPack(output: $output, shipped: $shipped);

‎lib/Service/Cmdb/CmdbImportPackMarker.php‎

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
* @license EUPL-1.2 https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
1919
* @link https://github.com/ConductionNL/stackiq
2020
*
21-
* @spec openspec/changes/cmdb-import-mapping-view/tasks.md#task-1
21+
* @spec openspec/changes/archive/2026-11-20-cmdb-import-mapping-view/tasks.md#task-1
2222
*
2323
* SPDX-FileCopyrightText: 2026 Conduction B.V. <info@conduction.nl>
2424
* SPDX-License-Identifier: EUPL-1.2
@@ -31,7 +31,7 @@
3131
/**
3232
* Adds, reads and compares the seed marker of a stored pack.
3333
*
34-
* @spec openspec/changes/cmdb-import-mapping-view/tasks.md#task-1
34+
* @spec openspec/changes/archive/2026-11-20-cmdb-import-mapping-view/tasks.md#task-1
3535
*/
3636
class CmdbImportPackMarker {
3737
/**
@@ -46,7 +46,7 @@ class CmdbImportPackMarker {
4646
*
4747
* @return string
4848
*
49-
* @spec openspec/changes/cmdb-import-mapping-view/tasks.md#task-1
49+
* @spec openspec/changes/archive/2026-11-20-cmdb-import-mapping-view/tasks.md#task-1
5050
*/
5151
public function hash(array $pack): string {
5252
$json = json_encode($this->canonical(value: $pack), JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE | JSON_PRESERVE_ZERO_FRACTION);
@@ -60,7 +60,7 @@ public function hash(array $pack): string {
6060
*
6161
* @return array<string, mixed>
6262
*
63-
* @spec openspec/changes/cmdb-import-mapping-view/tasks.md#task-1
63+
* @spec openspec/changes/archive/2026-11-20-cmdb-import-mapping-view/tasks.md#task-1
6464
*/
6565
public function seed(array $shipped): array {
6666
$definition = $this->strip(definition: $shipped);
@@ -79,7 +79,7 @@ public function seed(array $shipped): array {
7979
*
8080
* @return array<string, mixed>
8181
*
82-
* @spec openspec/changes/cmdb-import-mapping-view/tasks.md#task-1
82+
* @spec openspec/changes/archive/2026-11-20-cmdb-import-mapping-view/tasks.md#task-1
8383
*/
8484
public function strip(array $definition): array {
8585
unset($definition[self::KEY]);
@@ -93,7 +93,7 @@ public function strip(array $definition): array {
9393
*
9494
* @return bool|null Null when it carries no marker, so nobody knows what was seeded.
9595
*
96-
* @spec openspec/changes/cmdb-import-mapping-view/tasks.md#task-1
96+
* @spec openspec/changes/archive/2026-11-20-cmdb-import-mapping-view/tasks.md#task-1
9797
*/
9898
public function isEdited(array $definition): ?bool {
9999
$recorded = $this->recordedHash(definition: $definition);
@@ -112,7 +112,7 @@ public function isEdited(array $definition): ?bool {
112112
*
113113
* @return bool
114114
*
115-
* @spec openspec/changes/cmdb-import-mapping-view/tasks.md#task-1
115+
* @spec openspec/changes/archive/2026-11-20-cmdb-import-mapping-view/tasks.md#task-1
116116
*/
117117
public function isOutdated(array $definition, array $shipped): bool {
118118
return $this->isEdited(definition: $definition) === false
@@ -127,7 +127,7 @@ public function isOutdated(array $definition, array $shipped): bool {
127127
*
128128
* @return bool
129129
*
130-
* @spec openspec/changes/cmdb-import-mapping-view/tasks.md#task-1
130+
* @spec openspec/changes/archive/2026-11-20-cmdb-import-mapping-view/tasks.md#task-1
131131
*/
132132
public function isNewerShipped(array $definition, array $shipped): bool {
133133
return $this->isEdited(definition: $definition) === true
@@ -141,7 +141,7 @@ public function isNewerShipped(array $definition, array $shipped): bool {
141141
*
142142
* @return string|null
143143
*
144-
* @spec openspec/changes/cmdb-import-mapping-view/tasks.md#task-1
144+
* @spec openspec/changes/archive/2026-11-20-cmdb-import-mapping-view/tasks.md#task-1
145145
*/
146146
private function recordedHash(array $definition): ?string {
147147
$hash = ($definition[self::KEY]['shippedHash'] ?? null);
@@ -159,7 +159,7 @@ private function recordedHash(array $definition): ?string {
159159
*
160160
* @return mixed
161161
*
162-
* @spec openspec/changes/cmdb-import-mapping-view/tasks.md#task-1
162+
* @spec openspec/changes/archive/2026-11-20-cmdb-import-mapping-view/tasks.md#task-1
163163
*/
164164
private function canonical(mixed $value): mixed {
165165
if (is_array($value) === false) {

‎lib/Service/Cmdb/CmdbImportPackRules.php‎

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
* @license EUPL-1.2 https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
2222
* @link https://github.com/ConductionNL/stackiq
2323
*
24-
* @spec openspec/changes/cmdb-import-mapping-view/tasks.md#task-1
24+
* @spec openspec/changes/archive/2026-11-20-cmdb-import-mapping-view/tasks.md#task-1
2525
*
2626
* SPDX-FileCopyrightText: 2026 Conduction B.V. <info@conduction.nl>
2727
* SPDX-License-Identifier: EUPL-1.2
@@ -36,7 +36,7 @@
3636
/**
3737
* Lists the import rules a pack breaks.
3838
*
39-
* @spec openspec/changes/cmdb-import-mapping-view/tasks.md#task-1
39+
* @spec openspec/changes/archive/2026-11-20-cmdb-import-mapping-view/tasks.md#task-1
4040
*/
4141
class CmdbImportPackRules {
4242
/**
@@ -149,7 +149,7 @@ class CmdbImportPackRules {
149149
*
150150
* @param string|null $settingsDirectory Directory of the register file and its fragments; null is the shipped one.
151151
*
152-
* @spec openspec/changes/cmdb-import-mapping-view/tasks.md#task-1
152+
* @spec openspec/changes/archive/2026-11-20-cmdb-import-mapping-view/tasks.md#task-1
153153
*/
154154
public function __construct(
155155
private ?string $settingsDirectory = null,
@@ -170,7 +170,7 @@ public function __construct(
170170
*
171171
* @throws CmdbImportException MAPPING_UNAVAILABLE when the register cannot be read.
172172
*
173-
* @spec openspec/changes/cmdb-import-mapping-view/tasks.md#task-1
173+
* @spec openspec/changes/archive/2026-11-20-cmdb-import-mapping-view/tasks.md#task-1
174174
*/
175175
public function violations(string $target, array $pack, array $profile): array {
176176
$never = $profile['neverWritten'][$target] ?? [];
@@ -206,7 +206,7 @@ public function violations(string $target, array $pack, array $profile): array {
206206
*
207207
* @return array<int, string>
208208
*
209-
* @spec openspec/changes/cmdb-import-mapping-view/tasks.md#task-1
209+
* @spec openspec/changes/archive/2026-11-20-cmdb-import-mapping-view/tasks.md#task-1
210210
*/
211211
private function requiredViolations(string $target, array $pack, string $keyColumn): array {
212212
$violations = [];
@@ -235,7 +235,7 @@ private function requiredViolations(string $target, array $pack, string $keyColu
235235
*
236236
* @return bool
237237
*
238-
* @spec openspec/changes/cmdb-import-mapping-view/tasks.md#task-1
238+
* @spec openspec/changes/archive/2026-11-20-cmdb-import-mapping-view/tasks.md#task-1
239239
*/
240240
private function hasRequiredMapping(array $pack, string $field, string $keyColumn): bool {
241241
foreach (($pack['fieldMappings'] ?? []) as $mapping) {
@@ -261,7 +261,7 @@ private function hasRequiredMapping(array $pack, string $field, string $keyColum
261261
*
262262
* @return array<int, string>
263263
*
264-
* @spec openspec/changes/cmdb-import-mapping-view/tasks.md#task-1
264+
* @spec openspec/changes/archive/2026-11-20-cmdb-import-mapping-view/tasks.md#task-1
265265
*/
266266
private function mappingViolations(string $target, array $pack, array $allowed, array $refused): array {
267267
$violations = [];
@@ -285,7 +285,7 @@ private function mappingViolations(string $target, array $pack, array $allowed,
285285
*
286286
* @return array<int, string>
287287
*
288-
* @spec openspec/changes/cmdb-import-mapping-view/tasks.md#task-1
288+
* @spec openspec/changes/archive/2026-11-20-cmdb-import-mapping-view/tasks.md#task-1
289289
*/
290290
private function defaultViolations(string $target, array $pack, array $allowed, array $refused): array {
291291
$defaults = $pack['defaults'] ?? [];
@@ -320,7 +320,7 @@ private function defaultViolations(string $target, array $pack, array $allowed,
320320
*
321321
* @return string
322322
*
323-
* @spec openspec/changes/cmdb-import-mapping-view/tasks.md#task-1
323+
* @spec openspec/changes/archive/2026-11-20-cmdb-import-mapping-view/tasks.md#task-1
324324
*/
325325
private static function fieldViolation(string $field, array $refused, string $target): string {
326326
if (in_array($field, $refused['managed'], true) === true) {
@@ -349,7 +349,7 @@ private static function fieldViolation(string $field, array $refused, string $ta
349349
*
350350
* @throws CmdbImportException MAPPING_UNAVAILABLE when the register file or one of its fragments cannot be read.
351351
*
352-
* @spec openspec/changes/cmdb-import-mapping-view/tasks.md#task-1
352+
* @spec openspec/changes/archive/2026-11-20-cmdb-import-mapping-view/tasks.md#task-1
353353
*/
354354
private function schemaFields(): array {
355355
if ($this->registerSchema === null) {
@@ -368,7 +368,7 @@ private function schemaFields(): array {
368368
*
369369
* @throws CmdbImportException MAPPING_UNAVAILABLE when the register cannot be read.
370370
*
371-
* @spec openspec/changes/cmdb-import-mapping-view/tasks.md#task-1
371+
* @spec openspec/changes/archive/2026-11-20-cmdb-import-mapping-view/tasks.md#task-1
372372
*/
373373
private function targetFields(string $target): array {
374374
$schema = (self::TARGET_SCHEMAS[$target] ?? null);
@@ -389,7 +389,7 @@ private function targetFields(string $target): array {
389389
*
390390
* @throws CmdbImportException MAPPING_UNAVAILABLE when the register cannot be read.
391391
*
392-
* @spec openspec/changes/cmdb-import-mapping-view/tasks.md#task-1
392+
* @spec openspec/changes/archive/2026-11-20-cmdb-import-mapping-view/tasks.md#task-1
393393
*/
394394
private function fieldsWithReason(string $target, string $reason): array {
395395
$schema = (self::TARGET_SCHEMAS[$target] ?? null);

0 commit comments

Comments
 (0)