fix(go): merge children on MVS version key collision instead of overwriting#421
Merged
Conversation
Collaborator
Author
Verification Report for TC-4127 (commit b4bcfa9)
Acceptance Criteria Detail
Overall: PASSAll checks pass. CI is fully green across all platforms and ecosystems. This comment was AI-generated by sdlc-workflow/verify-pr v0.6.1. |
ruromero
enabled auto-merge (squash)
April 16, 2026 09:33
a-oren
reviewed
Apr 16, 2026
a-oren
approved these changes
Apr 16, 2026
…riting In getFinalPackagesVersionsForModule(), when multiple original parent versions remap to the same MVS-selected version, HashMap.put() was overwriting the children list, losing transitive dependencies. Replace put() with merge() using a LinkedHashSet to combine children lists while deduplicating entries. Before: 134 components (4 lost due to key collisions) After: 138 components (matching JS client output) Implements TC-4127 Assisted-by: Claude Code
Regenerate all 6 expected_sbom_stack_analysis.json fixtures to reflect the additional transitive dependencies now preserved by the merge() fix in getFinalPackagesVersionsForModule(). Implements TC-4127 Assisted-by: Claude Code
Remove extra spaces before colons in JSON keys to match the original
fixture formatting style ("key": vs "key" :). The CycloneDX library
outputs space-colon-space, but the existing fixtures use standard JSON
formatting.
Implements TC-4127
Assisted-by: Claude Code
Signed-off-by: Ruben Romero Montes <rromerom@redhat.com>
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.
Summary
HashMap.put()collision ingetFinalPackagesVersionsForModule()that dropped transitive dependencies when multiple parent module versions remapped to the same MVS-selected versionput()withmerge()usingLinkedHashSetto combine children lists while deduplicatingImplements TC-4127
Test plan
Test_Golang_MvS_Enabled_Preserves_All_Transitive_Dependenciespasses (138 components)Test_Golang_MvS_Logic_Disabledpasses (5 opencensus versions disabled, 1 enabled)test_the_provideStack+test_the_provideComponenttests pass🤖 Generated with Claude Code