Repository navigation
fix(archimate): link GEMMA standards, back-fill command, and split the SBOM import - #1411
Merged
Merged
Conversation
…ions The import recorded a GEMMA link only when `$standardId === true`, which a string identifier never is, so no reference component ever got its recommended, mandatory or combined standards and no standard version got its standard. The post-save fix had the same `$uuid === true` pattern and updated the `standaard` column, which is `standard` since the catalog rename. The classic import also never matched, because its sections are plural. The linking moves out of ArchiMateImportService into GemmaStandardLinker (with GemmaObjectReader), which references a linked object by its uuid id, or by its slug when it has none. `occ stackiq:gemma:link-standards` back-fills the links for earlier imports: it patches only link properties that differ, so a second run writes nothing, and `--dry-run` reports without writing. ObjectPages is the paged reader both occ commands now share. Assisted-by: ClaudeCode:claude-opus-5-5
…leVersie lookup importForModuleVersie (82 lines) keeps the order of every call; starting and completing the progress, the log line and the summary move into helpers. The moduleVersie lookup that importForModuleVersie, resolveParentModuleUuid and getStatus each repeated is one findModuleVersion(). Golden: every object service, progress and logger call over nine imports (both formats, VEX, empty, unsupported, missing version, 50 and 60 components), recorded on the old code. Assisted-by: ClaudeCode:claude-opus-5-5
Assisted-by: ClaudeCode:claude-opus-5-5
Assisted-by: ClaudeCode:claude-opus-5-5
Contributor
Author
|
Hydra gates --scope-to-diff --base origin/development (through heavy.sh): 37 of 37 applicable gates ran. The single FAIL was gate 16, a missing @SPEC on GemmaStandardLinksCommand::configure(), fixed in 8th commit; gate 16's checker re-run on the new head reports count=0. Full unit suite on the merged tree: exit 0, 1609 tests (the fix is a docblock only). |
rubenvdlinde
marked this pull request as ready for review
November 3, 2026 19:18
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Batch PR for stackiq (SQ5). It holds two changes, each with its own section, so a red can be traced back to the change behind it. The first change is meant to change data.
1. GEMMA standards are linked to reference components and standard versions (data-changing fix)
The bug.
processRelationshipImmediateandprocessStandardVersionRelationshiprecorded a link only when$standardId === true. A string identifier is never=== true, so no GEMMA reference component ever got itsrecommendedStandards,mandatoryStandards,standardsorlinkedStandardVersions, and no standard version got itsstandard.fixStandaardVersieUuidshad the same pattern ($uuid === true). It also updated astandaardcolumn that has been calledstandardsince the catalog rename. The classic import never matched either, because its sections are plural (elements,relationships). All of these patterns came in with the mechanical PHPCS commit eb72884 (if ($a && $b)became$a !== false && $b === true).The fix.
ArchiMateImportServiceintoService\ArchiMate\GemmaStandardLinker, which reads the objects throughGemmaObjectReader. That removes 462 lines from the 4,830-line service.inversedByonly to uuid values, so the old identifier-without-prefix value would not have resolved even with the condition fixed.fixStandaardVersieUuidschecks for non-empty strings and writes thestandardcolumn.What this changes in data. Every import from now on writes the links. On
lib/Settings/GEMMA_release.xmlthat is:All 686 standard references are uuids. Before this change every one of these counts was 0.
Back-fill for earlier imports.
occ stackiq:gemma:link-standards [--dry-run] [--register vng-gemma] [--element-schema element] [--relation-schema relation]:N GEMMA objects read, N need links, N written, N failed, and lists the ids with-v. It exits 1 when a write fails.The paged reader it uses,
Command\ObjectPages, is now shared withReferencesAuditCommand, whose own copy is removed.Tests (written to fail first).
ArchiMateGemmaStandardLinksTestruns both import entry points over a new fixture. On the old code it had 5 failures.GemmaStandardLinkerTesthas 11 cases.GemmaStandardLinksCommandTestcovers writes, idempotency, link order, dry run, a failed write and an unreadable register.ObjectPagesTestcovers paging, payloads and scoping.ArchiMateImportGoldenTestwas re-recorded. I checked the diff: apart from the GEMMA log lines, the only change is the post-saveUPDATE ... SET standard = ?, which now runs in 15 cases.Mutants (capped, with a no-op control that survived):
One planned linker mutant (no deduplication of the linked versions) showed that the
array_uniquewas redundant: each version has exactly one standard, and the standards are already deduplicated. So I removed thearray_uniqueinstead of keeping dead code.2. SbomImportService::importForModuleVersie split
importForModuleVersie,resolveParentModuleUuidandgetStatuseach repeated the same lookup, which is now onefindModuleVersion(). That removes a 7-line clone repeated three times.Golden.
SbomImportGoldenTestcovers nine imports (both formats, VEX, empty, unsupported, missing version, 50 and 60 components) plus the status. It was recorded on the old code and passes on old and new.Mutants. 10 of 10 killed, and the control survived.
Numbers (PHP, lizard, against development)
No unit gained parameters. Every new helper takes at most 2 parameters.
Verified locally
--fail-on-risky(exit 0).phpunit-unit.xml, pcov,--fail-on-risky): exit 0, 1609 tests, 0 failures, 0 risky, 59 skipped (inherited).--scope-to-diff --base origin/development) is queued. Its result follows in a comment.Assisted-by: ClaudeCode:claude-opus-5-5