diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-07-26 00:08:32 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-07-26 00:08:32 +0300 |
commit | aadc5da1b1ccba52944e6df0f2173fad5d3fe675 (patch) | |
tree | 3b43f157e9117be6713fc0c79014878e06308c6e /lib/gitlab/ci/reports | |
parent | 0599ea8fb389d70cab67a78e80d61eadc6aeaaff (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib/gitlab/ci/reports')
-rw-r--r-- | lib/gitlab/ci/reports/sbom/component.rb | 19 | ||||
-rw-r--r-- | lib/gitlab/ci/reports/sbom/report.rb | 31 | ||||
-rw-r--r-- | lib/gitlab/ci/reports/sbom/source.rb | 19 |
3 files changed, 69 insertions, 0 deletions
diff --git a/lib/gitlab/ci/reports/sbom/component.rb b/lib/gitlab/ci/reports/sbom/component.rb new file mode 100644 index 00000000000..86b9be274cc --- /dev/null +++ b/lib/gitlab/ci/reports/sbom/component.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +module Gitlab + module Ci + module Reports + module Sbom + class Component + attr_reader :component_type, :name, :version + + def initialize(component = {}) + @component_type = component['type'] + @name = component['name'] + @version = component['version'] + end + end + end + end + end +end diff --git a/lib/gitlab/ci/reports/sbom/report.rb b/lib/gitlab/ci/reports/sbom/report.rb new file mode 100644 index 00000000000..a7edcd20877 --- /dev/null +++ b/lib/gitlab/ci/reports/sbom/report.rb @@ -0,0 +1,31 @@ +# frozen_string_literal: true + +module Gitlab + module Ci + module Reports + module Sbom + class Report + attr_reader :components, :sources, :errors + + def initialize + @components = [] + @errors = [] + @sources = [] + end + + def add_error(error) + errors << error + end + + def add_source(source) + sources << Source.new(source) + end + + def add_component(component) + components << Component.new(component) + end + end + end + end + end +end diff --git a/lib/gitlab/ci/reports/sbom/source.rb b/lib/gitlab/ci/reports/sbom/source.rb new file mode 100644 index 00000000000..60bf30b65a5 --- /dev/null +++ b/lib/gitlab/ci/reports/sbom/source.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +module Gitlab + module Ci + module Reports + module Sbom + class Source + attr_reader :source_type, :data, :fingerprint + + def initialize(source = {}) + @source_type = source['type'] + @data = source['data'] + @fingerprint = source['fingerprint'] + end + end + end + end + end +end |