@@ -398,10 +398,10 @@ func TestRenderPathToComponent(t *testing.T) {
398398 t .Run ("Everything works as expeted with a non empty component list" , func (t * testing.T ) {
399399 // Create a chain of actual components (all with pkg: prefix) to have a path with edges
400400 components := []models.ComponentDependency {
401- {ComponentID : utils . Ptr ( "ROOT" ) , DependencyID : "artifact:test-artifact" , Dependency : models.Component {ID : "artifact:test-artifact" }}, // root --> artifact
402- {ComponentID : utils . Ptr ( "artifact:test-artifact" ) , DependencyID : "sbom:test@test-artifact" , Dependency : models.Component {ID : "sbom:test@test-artifact" }}, // artifact -> sbom
403- {ComponentID : utils . Ptr ( "sbom:test@test-artifact" ) , DependencyID : "pkg:npm/root-dep@1.0.0" , Dependency : models.Component {ID : "pkg:npm/root-dep@1.0.0" }}, // sbom -> root-dep (component)
404- {ComponentID : utils . Ptr ( "pkg:npm/root-dep@1.0.0" ) , DependencyID : "pkg:npm/test-package@1.0.0" , Dependency : models.Component {ID : "pkg:npm/test-package@1.0.0" }}, // root-dep -> test-package (component)
401+ {ComponentID : "ROOT" , DependencyID : "artifact:test-artifact" , Dependency : models.Component {ID : "artifact:test-artifact" }}, // root --> artifact
402+ {ComponentID : "artifact:test-artifact" , DependencyID : "sbom:test@test-artifact" , Dependency : models.Component {ID : "sbom:test@test-artifact" }}, // artifact -> sbom
403+ {ComponentID : "sbom:test@test-artifact" , DependencyID : "pkg:npm/root-dep@1.0.0" , Dependency : models.Component {ID : "pkg:npm/root-dep@1.0.0" }}, // sbom -> root-dep (component)
404+ {ComponentID : "pkg:npm/root-dep@1.0.0" , DependencyID : "pkg:npm/test-package@1.0.0" , Dependency : models.Component {ID : "pkg:npm/test-package@1.0.0" }}, // root-dep -> test-package (component)
405405 }
406406 componentRepository := mocks .NewComponentRepository (t )
407407 componentRepository .On ("LoadComponents" , mock .Anything , mock .Anything , mock .Anything , mock .Anything ).Return (components , nil )
@@ -423,10 +423,10 @@ func TestRenderPathToComponent(t *testing.T) {
423423 t .Run ("should escape @ symbols" , func (t * testing.T ) {
424424 // Create a chain of actual components to verify @ escaping in mermaid output
425425 components := []models.ComponentDependency {
426- {ComponentID : utils . Ptr ( "ROOT" ) , DependencyID : "artifact:test-artifact" , Dependency : models.Component {ID : "artifact:test-artifact" }}, // root --> artifact
427- {ComponentID : utils . Ptr ( "artifact:test-artifact" ) , DependencyID : "sbom:test@test-artifact" , Dependency : models.Component {ID : "sbom:test@test-artifact" }}, // artifact -> sbom
428- {ComponentID : utils . Ptr ( "sbom:test@test-artifact" ) , DependencyID : "pkg:npm/root-dep@1.0.0" , Dependency : models.Component {ID : "pkg:npm/root-dep@1.0.0" }}, // sbom -> root-dep (component)
429- {ComponentID : utils . Ptr ( "pkg:npm/root-dep@1.0.0" ) , DependencyID : "pkg:npm/test-package@1.0.0" , Dependency : models.Component {ID : "pkg:npm/test-package@1.0.0" }}, // root-dep -> test-package (component)
426+ {ComponentID : "ROOT" , DependencyID : "artifact:test-artifact" , Dependency : models.Component {ID : "artifact:test-artifact" }}, // root --> artifact
427+ {ComponentID : "artifact:test-artifact" , DependencyID : "sbom:test@test-artifact" , Dependency : models.Component {ID : "sbom:test@test-artifact" }}, // artifact -> sbom
428+ {ComponentID : "sbom:test@test-artifact" , DependencyID : "pkg:npm/root-dep@1.0.0" , Dependency : models.Component {ID : "pkg:npm/root-dep@1.0.0" }}, // sbom -> root-dep (component)
429+ {ComponentID : "pkg:npm/root-dep@1.0.0" , DependencyID : "pkg:npm/test-package@1.0.0" , Dependency : models.Component {ID : "pkg:npm/test-package@1.0.0" }}, // root-dep -> test-package (component)
430430 }
431431 componentRepository := mocks .NewComponentRepository (t )
432432 componentRepository .On ("LoadComponents" , mock .Anything , mock .Anything , mock .Anything , mock .Anything ).Return (components , nil )
@@ -452,9 +452,9 @@ func TestRenderPathToComponent(t *testing.T) {
452452 // The graph requires an artifact and sbom info-source node above the component
453453 // so that FindAllComponentOnlyPathsToPURL can terminate the BFS correctly.
454454 components := []models.ComponentDependency {
455- {ComponentID : utils . Ptr ( "ROOT" ) , DependencyID : "artifact:test-artifact" , Dependency : models.Component {ID : "artifact:test-artifact" }},
456- {ComponentID : utils . Ptr ( "artifact:test-artifact" ) , DependencyID : "sbom:test@test-artifact" , Dependency : models.Component {ID : "sbom:test@test-artifact" }},
457- {ComponentID : utils . Ptr ( "sbom:test@test-artifact" ) , DependencyID : "pkg:npm/single@1.0.0" , Dependency : models.Component {ID : "pkg:npm/single@1.0.0" }},
455+ {ComponentID : "ROOT" , DependencyID : "artifact:test-artifact" , Dependency : models.Component {ID : "artifact:test-artifact" }},
456+ {ComponentID : "artifact:test-artifact" , DependencyID : "sbom:test@test-artifact" , Dependency : models.Component {ID : "sbom:test@test-artifact" }},
457+ {ComponentID : "sbom:test@test-artifact" , DependencyID : "pkg:npm/single@1.0.0" , Dependency : models.Component {ID : "pkg:npm/single@1.0.0" }},
458458 }
459459 componentRepository := mocks .NewComponentRepository (t )
460460 componentRepository .On ("LoadComponents" , mock .Anything , mock .Anything , mock .Anything , mock .Anything ).Return (components , nil )
@@ -711,12 +711,12 @@ func TestTicketContentBitwiseReproducibility(t *testing.T) {
711711 // Previously, map iteration randomness caused the two path edges to appear
712712 // in non-deterministic order in the Mermaid output.
713713 components := []models.ComponentDependency {
714- {ComponentID : utils . Ptr ( "ROOT" ) , DependencyID : "artifact:art" , Dependency : models.Component {ID : "artifact:art" }},
715- {ComponentID : utils . Ptr ( "artifact:art" ) , DependencyID : "sbom:s@art" , Dependency : models.Component {ID : "sbom:s@art" }},
716- {ComponentID : utils . Ptr ( "sbom:s@art" ) , DependencyID : "pkg:npm/route-b@1.0" , Dependency : models.Component {ID : "pkg:npm/route-b@1.0" }},
717- {ComponentID : utils . Ptr ( "sbom:s@art" ) , DependencyID : "pkg:npm/route-a@1.0" , Dependency : models.Component {ID : "pkg:npm/route-a@1.0" }},
718- {ComponentID : utils . Ptr ( "pkg:npm/route-a@1.0" ) , DependencyID : "pkg:npm/target@1.0" , Dependency : models.Component {ID : "pkg:npm/target@1.0" }},
719- {ComponentID : utils . Ptr ( "pkg:npm/route-b@1.0" ) , DependencyID : "pkg:npm/target@1.0" , Dependency : models.Component {ID : "pkg:npm/target@1.0" }},
714+ {ComponentID : "ROOT" , DependencyID : "artifact:art" , Dependency : models.Component {ID : "artifact:art" }},
715+ {ComponentID : "artifact:art" , DependencyID : "sbom:s@art" , Dependency : models.Component {ID : "sbom:s@art" }},
716+ {ComponentID : "sbom:s@art" , DependencyID : "pkg:npm/route-b@1.0" , Dependency : models.Component {ID : "pkg:npm/route-b@1.0" }},
717+ {ComponentID : "sbom:s@art" , DependencyID : "pkg:npm/route-a@1.0" , Dependency : models.Component {ID : "pkg:npm/route-a@1.0" }},
718+ {ComponentID : "pkg:npm/route-a@1.0" , DependencyID : "pkg:npm/target@1.0" , Dependency : models.Component {ID : "pkg:npm/target@1.0" }},
719+ {ComponentID : "pkg:npm/route-b@1.0" , DependencyID : "pkg:npm/target@1.0" , Dependency : models.Component {ID : "pkg:npm/target@1.0" }},
720720 }
721721
722722 assetID := uuid .New ()
0 commit comments