Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
84de927c
Commit
84de927c
authored
Nov 02, 2020
by
Yevgeny Name
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add message for missing license when using coverage fuzzing
parent
11e5fcac
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
65 additions
and
0 deletions
+65
-0
changelogs/unreleased/add_msg_for_missing_license_covfuzz.yml
...gelogs/unreleased/add_msg_for_missing_license_covfuzz.yml
+5
-0
ee/spec/lib/gitlab/ci/templates/coverage_fuzzing_gitlab_ci_yaml_spec.rb
...tlab/ci/templates/coverage_fuzzing_gitlab_ci_yaml_spec.rb
+52
-0
lib/gitlab/ci/templates/Security/Coverage-Fuzzing.gitlab-ci.yml
...tlab/ci/templates/Security/Coverage-Fuzzing.gitlab-ci.yml
+8
-0
No files found.
changelogs/unreleased/add_msg_for_missing_license_covfuzz.yml
0 → 100644
View file @
84de927c
---
title
:
Show error in pipeline when Coverage Fuzzing not licensed
merge_request
:
46652
author
:
type
:
changed
ee/spec/lib/gitlab/ci/templates/coverage_fuzzing_gitlab_ci_yaml_spec.rb
0 → 100644
View file @
84de927c
# frozen_string_literal: true
require
'spec_helper'
RSpec
.
describe
'Coverage-Fuzzing.gitlab-ci.yml'
do
subject
(
:template
)
{
Gitlab
::
Template
::
GitlabCiYmlTemplate
.
find
(
'Coverage-Fuzzing'
)
}
describe
'the created pipeline'
do
let
(
:user
)
{
create
(
:admin
)
}
let
(
:default_branch
)
{
'master'
}
let
(
:project
)
{
create
(
:project
,
:custom_repo
,
files:
{
'README.txt'
=>
''
})
}
let
(
:service
)
{
Ci
::
CreatePipelineService
.
new
(
project
,
user
,
ref:
'master'
)
}
let
(
:pipeline
)
{
service
.
execute!
(
:push
)
}
let
(
:build_names
)
{
pipeline
.
builds
.
pluck
(
:name
)
}
before
do
stub_ci_pipeline_yaml_file
(
template
.
content
)
allow_any_instance_of
(
Ci
::
BuildScheduleWorker
).
to
receive
(
:perform
).
and_return
(
true
)
allow
(
project
).
to
receive
(
:default_branch
).
and_return
(
default_branch
)
end
context
'when project has no license'
do
it
'includes job to display error'
do
expect
(
build_names
).
to
match_array
(
%w[coverage_fuzzing_unlicensed]
)
end
end
context
'when project has Ultimate license'
do
let
(
:license
)
{
create
(
:license
,
plan:
License
::
ULTIMATE_PLAN
)
}
before
do
allow
(
License
).
to
receive
(
:current
).
and_return
(
license
)
end
context
'by default'
do
it
'includes no job'
do
expect
{
pipeline
}.
to
raise_error
(
Ci
::
CreatePipelineService
::
CreateError
)
end
end
context
'when COVFUZZ_DISABLED=1'
do
before
do
create
(
:ci_variable
,
project:
project
,
key:
'COVFUZZ_DISABLED'
,
value:
'1'
)
end
it
'includes no jobs'
do
expect
{
pipeline
}.
to
raise_error
(
Ci
::
CreatePipelineService
::
CreateError
)
end
end
end
end
end
lib/gitlab/ci/templates/Security/Coverage-Fuzzing.gitlab-ci.yml
View file @
84de927c
...
...
@@ -11,6 +11,14 @@ variables:
COVFUZZ_URL_PREFIX
:
"
https://gitlab.com/gitlab-org/security-products/analyzers/gitlab-cov-fuzz/-/raw"
coverage_fuzzing_unlicensed
:
stage
:
test
allow_failure
:
true
rules
:
-
if
:
$GITLAB_FEATURES !~ /\bcoverage_fuzzing\b/ && $COVFUZZ_DISABLED ==
null
script
:
-
echo "ERROR Your GitLab project is missing licensing for Coverage Fuzzing" && exit
1
.fuzz_base
:
stage
:
fuzz
allow_failure
:
true
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment