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
90411266
Commit
90411266
authored
May 25, 2021
by
Marcel Amirault
Committed by
Robert Speicher
May 25, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow MR pipelines in latest DAST template
parent
50022004
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
4 deletions
+32
-4
ee/spec/lib/gitlab/ci/templates/dast_latest_gitlab_ci_yaml_spec.rb
...ib/gitlab/ci/templates/dast_latest_gitlab_ci_yaml_spec.rb
+25
-0
lib/gitlab/ci/templates/Security/DAST.latest.gitlab-ci.yml
lib/gitlab/ci/templates/Security/DAST.latest.gitlab-ci.yml
+7
-4
No files found.
ee/spec/lib/gitlab/ci/templates/dast_latest_gitlab_ci_yaml_spec.rb
View file @
90411266
...
...
@@ -84,6 +84,31 @@ RSpec.describe 'DAST.latest.gitlab-ci.yml' do
context
'when no specification provided'
do
include_examples
'includes dast job'
end
context
'when pipeline is a merge request pipeline'
do
before
do
create
(
:ci_variable
,
project:
project
,
key:
'CI_MERGE_REQUEST_IID'
,
value:
'1'
)
end
include_examples
'includes dast job'
end
context
'when pipeline is a branch pipeline with no merge request'
do
before
do
create
(
:ci_variable
,
project:
project
,
key:
'CI_COMMIT_BRANCH'
,
value:
'feature-branch'
)
end
include_examples
'includes dast job'
end
context
'when pipeline is a branch pipeline with a merge request'
do
before
do
create
(
:ci_variable
,
project:
project
,
key:
'CI_COMMIT_BRANCH'
,
value:
'feature-branch'
)
create
(
:ci_variable
,
project:
project
,
key:
'CI_OPEN_MERGE_REQUESTS'
,
value:
'true'
)
end
include_examples
'includes no jobs'
end
end
end
...
...
lib/gitlab/ci/templates/Security/DAST.latest.gitlab-ci.yml
View file @
90411266
...
...
@@ -47,10 +47,13 @@ dast:
$REVIEW_DISABLED && $DAST_WEBSITE ==
null
&&
$DAST_API_SPECIFICATION ==
null
when
:
never
-
if
:
$CI_
COMMIT_BRANCH
&&
-
if
:
$CI_
MERGE_REQUEST_IID
&&
$CI_KUBERNETES_ACTIVE &&
$GITLAB_FEATURES =~ /\bdast\b/
-
if
:
$CI_MERGE_REQUEST_IID && ($DAST_WEBSITE || $DAST_API_SPECIFICATION)
-
if
:
$CI_OPEN_MERGE_REQUESTS
when
:
never
-
if
:
$CI_COMMIT_BRANCH &&
$
DAST_WEBSITE
-
if
:
$CI_COMMIT_BRANCH &&
$DAST_API_SPECIFICATION
$
CI_KUBERNETES_ACTIVE &&
$GITLAB_FEATURES =~ /\bdast\b/
-
if
:
$CI_COMMIT_BRANCH && ($DAST_WEBSITE || $DAST_API_SPECIFICATION)
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