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
d18e6abe
Commit
d18e6abe
authored
Dec 16, 2020
by
Craig Smith
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove dast_unlicensed job
parent
864f2e0b
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
9 additions
and
97 deletions
+9
-97
changelogs/unreleased/remove_dast_unlicensed_290958.yml
changelogs/unreleased/remove_dast_unlicensed_290958.yml
+5
-0
ee/spec/lib/gitlab/ci/templates/Jobs/dast_default_branch_gitlab_ci_yaml_spec.rb
...templates/Jobs/dast_default_branch_gitlab_ci_yaml_spec.rb
+2
-2
ee/spec/lib/gitlab/ci/templates/dast_gitlab_ci_yaml_spec.rb
ee/spec/lib/gitlab/ci/templates/dast_gitlab_ci_yaml_spec.rb
+2
-66
lib/gitlab/ci/templates/Security/DAST.gitlab-ci.yml
lib/gitlab/ci/templates/Security/DAST.gitlab-ci.yml
+0
-29
No files found.
changelogs/unreleased/remove_dast_unlicensed_290958.yml
0 → 100644
View file @
d18e6abe
---
title
:
Remove dast_unlicensed job
merge_request
:
50129
author
:
type
:
changed
ee/spec/lib/gitlab/ci/templates/Jobs/dast_default_branch_gitlab_ci_yaml_spec.rb
View file @
d18e6abe
...
...
@@ -47,8 +47,8 @@ RSpec.describe 'Jobs/DAST-Default-Branch-Deploy.gitlab-ci.yml' do
end
context
'when project has no license'
do
it
'includes
dast_unlicensed job
'
do
expect
(
build_names
).
to
match_array
(
%w(placeholder
dast_unlicensed
)
)
it
'includes
no DAST jobs
'
do
expect
(
build_names
).
to
match_array
(
%w(placeholder)
)
end
end
...
...
ee/spec/lib/gitlab/ci/templates/dast_gitlab_ci_yaml_spec.rb
View file @
d18e6abe
...
...
@@ -21,72 +21,8 @@ RSpec.describe 'DAST.gitlab-ci.yml' do
end
context
'when project has no license'
do
let
(
:cluster
)
{
create
(
:cluster
,
:project
,
:provided_by_gcp
,
projects:
[
project
])
}
context
'when k8 is active'
do
before
do
allow
(
cluster
).
to
receive
(
:active?
).
and_return
(
true
)
end
it
'includes dast_unlicensed job'
do
expect
(
build_names
).
to
match_array
(
%w[dast_unlicensed]
)
end
end
context
'when DAST_WEBSITE is active'
do
before
do
create
(
:ci_variable
,
project:
project
,
key:
'DAST_WEBSITE'
,
value:
'http://example.com'
)
end
it
'includes dast_unlicensed job'
do
expect
(
build_names
).
to
match_array
(
%w[dast_unlicensed]
)
end
end
context
'when DAST_API_SPECIFICATION is set'
do
before
do
create
(
:ci_variable
,
project:
project
,
key:
'DAST_API_SPECIFICATION'
,
value:
'http://example/open-api-v2.json'
)
end
it
'includes dast_unlicensed job'
do
expect
(
build_names
).
to
match_array
(
%w[dast_unlicensed]
)
end
end
context
'when DAST_DISABLED'
do
before
do
create
(
:ci_variable
,
project:
project
,
key:
'DAST_DISABLED'
,
value:
'1'
)
end
it
'includes no job'
do
expect
{
pipeline
}.
to
raise_error
(
Ci
::
CreatePipelineService
::
CreateError
)
end
end
context
'when DAST_DISABLED_FOR_DEFAULT_BRANCH and CI_DEFAULT_BRANCH equals CI_COMMIT_REF_NAME'
do
before
do
create
(
:ci_variable
,
project:
project
,
key:
'DAST_DISABLED_FOR_DEFAULT_BRANCH'
,
value:
'1'
)
create
(
:ci_variable
,
project:
project
,
key:
'CI_DEFAULT_BRANCH'
,
value:
'test_branch'
)
create
(
:ci_variable
,
project:
project
,
key:
'CI_COMMIT_REF_NAME'
,
value:
'test_branch'
)
end
it
'includes no job'
do
expect
{
pipeline
}.
to
raise_error
(
Ci
::
CreatePipelineService
::
CreateError
)
end
end
context
'when not on default branch and review disabled and both DAST_WEBSITE and DAST_API_SPECIFICATION are not set'
do
before
do
create
(
:ci_variable
,
project:
project
,
key:
'CI_DEFAULT_BRANCH'
,
value:
'main'
)
create
(
:ci_variable
,
project:
project
,
key:
'CI_COMMIT_REF_NAME'
,
value:
'test_branch'
)
create
(
:ci_variable
,
project:
project
,
key:
'REVIEW_DISABLED'
,
value:
'1'
)
create
(
:ci_variable
,
project:
project
,
key:
'DAST_WEBSITE'
,
value:
nil
)
create
(
:ci_variable
,
project:
project
,
key:
'DAST_API_SPECIFICATION'
,
value:
nil
)
end
it
'includes no job'
do
expect
{
pipeline
}.
to
raise_error
(
Ci
::
CreatePipelineService
::
CreateError
)
end
it
'includes no jobs'
do
expect
{
pipeline
}.
to
raise_error
(
Ci
::
CreatePipelineService
::
CreateError
)
end
end
...
...
lib/gitlab/ci/templates/Security/DAST.gitlab-ci.yml
View file @
d18e6abe
...
...
@@ -49,32 +49,3 @@ dast:
-
if
:
$CI_COMMIT_BRANCH &&
$GITLAB_FEATURES =~ /\bdast\b/ &&
$DAST_API_SPECIFICATION
dast_unlicensed
:
stage
:
dast
allow_failure
:
true
variables
:
GIT_STRATEGY
:
none
rules
:
-
if
:
$DAST_DISABLED
when
:
never
-
if
:
$DAST_DISABLED_FOR_DEFAULT_BRANCH &&
$CI_DEFAULT_BRANCH == $CI_COMMIT_REF_NAME
when
:
never
-
if
:
$CI_DEFAULT_BRANCH != $CI_COMMIT_REF_NAME &&
$REVIEW_DISABLED && $DAST_WEBSITE ==
null
&&
$DAST_API_SPECIFICATION ==
null
when
:
never
-
if
:
$CI_COMMIT_BRANCH &&
$CI_KUBERNETES_ACTIVE &&
$GITLAB_FEATURES !~ /\bdast\b/
-
if
:
$CI_COMMIT_BRANCH &&
$GITLAB_FEATURES !~ /\bdast\b/ &&
$DAST_WEBSITE
-
if
:
$CI_COMMIT_BRANCH &&
$GITLAB_FEATURES !~ /\bdast\b/ &&
$DAST_API_SPECIFICATION
script
:
-
|
echo "Error: Your GitLab project is not licensed for DAST."
-
exit
1
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