Skip to content
GitLab
菜单
为什么选择 GitLab
定价
联系销售
探索
为什么选择 GitLab
定价
联系销售
探索
登录
获取免费试用
主导航
搜索或转到…
项目
GitLab
管理
动态
成员
标记
计划
议题
议题看板
里程碑
迭代
需求
代码
合并请求
仓库
分支
提交
标签
仓库图
比较修订版本
代码片段
锁定的文件
构建
流水线
作业
流水线计划
测试用例
产物
部署
发布
Package registry
容器镜像库
模型注册表
运维
环境
Terraform 模块
监控
事件
服务台
分析
价值流分析
贡献者分析
CI/CD 分析
仓库分析
代码评审分析
议题分析
洞察
模型实验
效能分析
帮助
帮助
支持
GitLab 文档
比较 GitLab 各版本
社区论坛
为极狐GitLab 提交贡献
提交反馈
隐私声明
快捷键
?
新增功能
4
代码片段
群组
项目
显示更多面包屑
gitlab-cn
GitLab
提交
19c0c802
未验证
提交
19c0c802
编辑于
7 months ago
作者:
Alan (Maciej) Paruszewski
提交者:
GitLab
7 months ago
浏览文件
操作
下载
补丁
差异文件
Prevent CS SBOM to be parsed as ready for License Scanning rules
Changelog: fixed EE: true
上级
affa618a
No related branches found
分支 包含提交
No related tags found
标签 包含提交
无相关合并请求
变更
2
隐藏空白变更内容
行内
左右并排
显示
2 个更改的文件
ee/lib/gitlab/license_scanning/pipeline_components.rb
+5
-0
5 个添加, 0 个删除
ee/lib/gitlab/license_scanning/pipeline_components.rb
ee/spec/lib/gitlab/license_scanning/pipeline_components_spec.rb
+8
-0
8 个添加, 0 个删除
...c/lib/gitlab/license_scanning/pipeline_components_spec.rb
有
13 个添加
和
0 个删除
ee/lib/gitlab/license_scanning/pipeline_components.rb
+
5
−
0
浏览文件 @
19c0c802
...
@@ -11,6 +11,7 @@ def fetch
...
@@ -11,6 +11,7 @@ def fetch
pipeline
.
sbom_reports
.
reports
.
flat_map
do
|
sbom_report
|
pipeline
.
sbom_reports
.
reports
.
flat_map
do
|
sbom_report
|
sbom_report
.
components
.
map
do
|
component
|
sbom_report
.
components
.
map
do
|
component
|
next
unless
component
.
purl
next
unless
component
.
purl
next
unless
supported_for_license_scanning?
(
component
.
purl
.
type
)
Hashie
::
Mash
.
new
(
name:
component
.
name
,
purl_type:
component
.
purl
.
type
,
Hashie
::
Mash
.
new
(
name:
component
.
name
,
purl_type:
component
.
purl
.
type
,
version:
component
.
version
,
path:
sbom_report
.
source
&
.
input_file_path
)
version:
component
.
version
,
path:
sbom_report
.
source
&
.
input_file_path
)
...
@@ -21,6 +22,10 @@ def fetch
...
@@ -21,6 +22,10 @@ def fetch
private
private
attr_reader
:pipeline
attr_reader
:pipeline
def
supported_for_license_scanning?
(
purl_type
)
::
Enums
::
Sbom
.
dependency_scanning_purl_type?
(
purl_type
)
end
end
end
end
end
end
end
此差异已折叠。
点击以展开。
ee/spec/lib/gitlab/license_scanning/pipeline_components_spec.rb
+
8
−
0
浏览文件 @
19c0c802
...
@@ -10,6 +10,14 @@
...
@@ -10,6 +10,14 @@
context
'when the pipeline has an sbom report'
do
context
'when the pipeline has an sbom report'
do
let_it_be
(
:pipeline
)
{
create
(
:ee_ci_pipeline
,
:with_cyclonedx_report
,
project:
project
)
}
let_it_be
(
:pipeline
)
{
create
(
:ee_ci_pipeline
,
:with_cyclonedx_report
,
project:
project
)
}
context
'and sbom components are not supported by license scanning'
do
let_it_be
(
:pipeline
)
{
create
(
:ee_ci_pipeline
,
:with_cyclonedx_container_scanning
,
project:
project
)
}
it
'returns an empty list'
do
expect
(
fetch
).
to
be_empty
end
end
context
'and some of the sbom components do not have purl values'
do
context
'and some of the sbom components do not have purl values'
do
it
'returns a list with the expected size'
do
it
'returns a list with the expected size'
do
expected_number_of_components
=
pipeline
.
sbom_reports
.
reports
.
sum
do
|
report
|
expected_number_of_components
=
pipeline
.
sbom_reports
.
reports
.
sum
do
|
report
|
...
...
此差异已折叠。
点击以展开。
预览
0%
加载中
请重试
或
添加新附件
.
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
保存评论
取消
想要评论请
注册
或
登录