Skip to content

Commit a6b9f9c

Browse files
authored
Add dependency graph support to remaining ecosystems (#754)
This PR builds off of #746 to add support for ancestral dependencies of the remaining ecosystems supported by CD. The list of ecosystems supporting graph creation can be found here.
1 parent 4e682e6 commit a6b9f9c

File tree

5 files changed

+10
-0
lines changed

5 files changed

+10
-0
lines changed

src/Microsoft.Sbom.Adapters/Adapters/ComponentDetection/CargoComponentExtensions.cs

+2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
namespace Microsoft.Sbom.Adapters.ComponentDetection;
55

6+
using System.Linq;
67
using Microsoft.ComponentDetection.Contracts.TypedComponent;
78
using Microsoft.Sbom.Contracts;
89

@@ -29,5 +30,6 @@ internal static class CargoComponentExtensions
2930
},
3031
FilesAnalyzed = false,
3132
Type = "cargo",
33+
DependOn = component.AncestralReferrers?.FirstOrDefault()?.Id,
3234
};
3335
}

src/Microsoft.Sbom.Adapters/Adapters/ComponentDetection/NpmComponentExtensions.cs

+2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
namespace Microsoft.Sbom.Adapters.ComponentDetection;
55

66
using System;
7+
using System.Linq;
78
using Microsoft.ComponentDetection.Contracts.Internal;
89
using Microsoft.ComponentDetection.Contracts.TypedComponent;
910
using Microsoft.Sbom.Contracts;
@@ -39,6 +40,7 @@ internal static class NpmComponentExtensions
3940
},
4041
FilesAnalyzed = false,
4142
Type = "npm",
43+
DependOn = component.AncestralReferrers?.FirstOrDefault()?.Id,
4244
};
4345

4446
/// <summary>

src/Microsoft.Sbom.Adapters/Adapters/ComponentDetection/PipComponentExtensions.cs

+2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
namespace Microsoft.Sbom.Adapters.ComponentDetection;
55

6+
using System.Linq;
67
using Microsoft.ComponentDetection.Contracts.TypedComponent;
78
using Microsoft.Sbom.Contracts;
89

@@ -29,5 +30,6 @@ internal static class PipComponentExtensions
2930
},
3031
FilesAnalyzed = false,
3132
Type = "python",
33+
DependOn = component.AncestralReferrers?.FirstOrDefault()?.Id,
3234
};
3335
}

src/Microsoft.Sbom.Adapters/Adapters/ComponentDetection/PodComponentExtensions.cs

+2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
namespace Microsoft.Sbom.Adapters.ComponentDetection;
55

6+
using System.Linq;
67
using Microsoft.ComponentDetection.Contracts.TypedComponent;
78
using Microsoft.Sbom.Contracts;
89

@@ -30,5 +31,6 @@ internal static class PodComponentExtensions
3031
},
3132
FilesAnalyzed = false,
3233
Type = "pod",
34+
DependOn = component.AncestralReferrers?.FirstOrDefault()?.Id,
3335
};
3436
}

src/Microsoft.Sbom.Adapters/Adapters/ComponentDetection/RubyGemsComponentExtensions.cs

+2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
namespace Microsoft.Sbom.Adapters.ComponentDetection;
55

6+
using System.Linq;
67
using Microsoft.ComponentDetection.Contracts.TypedComponent;
78
using Microsoft.Sbom.Contracts;
89

@@ -32,5 +33,6 @@ internal static class RubyGemsComponentExtensions
3233
},
3334
FilesAnalyzed = false,
3435
Type = "ruby",
36+
DependOn = component.AncestralReferrers?.FirstOrDefault()?.Id,
3537
};
3638
}

0 commit comments

Comments
 (0)