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
abd0cce6
Commit
abd0cce6
authored
Aug 02, 2021
by
Vasilii Iakliushin
Committed by
Henri Philipps
Aug 02, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix the automatic merge conflict
parent
28630614
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
9 additions
and
33 deletions
+9
-33
app/models/concerns/enums/ci/pipeline.rb
app/models/concerns/enums/ci/pipeline.rb
+5
-2
ee/app/services/app_sec/dast/site_validations/runner_service.rb
.../services/app_sec/dast/site_validations/runner_service.rb
+1
-1
ee/spec/services/app_sec/dast/site_validations/runner_service_spec.rb
...ices/app_sec/dast/site_validations/runner_service_spec.rb
+3
-1
lib/gitlab/ci/pipeline/chain/command.rb
lib/gitlab/ci/pipeline/chain/command.rb
+0
-4
spec/lib/gitlab/ci/pipeline/chain/command_spec.rb
spec/lib/gitlab/ci/pipeline/chain/command_spec.rb
+0
-25
No files found.
app/models/concerns/enums/ci/pipeline.rb
View file @
abd0cce6
...
@@ -37,7 +37,8 @@ module Enums
...
@@ -37,7 +37,8 @@ module Enums
merge_request_event:
10
,
merge_request_event:
10
,
external_pull_request_event:
11
,
external_pull_request_event:
11
,
parent_pipeline:
12
,
parent_pipeline:
12
,
ondemand_dast_scan:
13
ondemand_dast_scan:
13
,
ondemand_dast_validation:
14
}
}
end
end
...
@@ -48,8 +49,10 @@ module Enums
...
@@ -48,8 +49,10 @@ module Enums
# parent pipeline. It's up to the parent to affect the ref CI status
# parent pipeline. It's up to the parent to affect the ref CI status
# - when an ondemand_dast_scan pipeline runs it is for testing purpose and should
# - when an ondemand_dast_scan pipeline runs it is for testing purpose and should
# not affect the ref CI status.
# not affect the ref CI status.
# - when an ondemand_dast_validation pipeline runs it is for validating a DAST site
# profile and should not affect the ref CI status.
def
self
.
dangling_sources
def
self
.
dangling_sources
sources
.
slice
(
:webide
,
:parent_pipeline
,
:ondemand_dast_scan
)
sources
.
slice
(
:webide
,
:parent_pipeline
,
:ondemand_dast_scan
,
:ondemand_dast_validation
)
end
end
# CI sources are those pipeline events that affect the CI status of the ref
# CI sources are those pipeline events that affect the CI status of the ref
...
...
ee/app/services/app_sec/dast/site_validations/runner_service.rb
View file @
abd0cce6
...
@@ -8,7 +8,7 @@ module AppSec
...
@@ -8,7 +8,7 @@ module AppSec
return
ServiceResponse
.
error
(
message:
_
(
'Insufficient permissions'
))
unless
allowed?
return
ServiceResponse
.
error
(
message:
_
(
'Insufficient permissions'
))
unless
allowed?
service
=
Ci
::
CreatePipelineService
.
new
(
project
,
current_user
,
ref:
project
.
default_branch_or_main
)
service
=
Ci
::
CreatePipelineService
.
new
(
project
,
current_user
,
ref:
project
.
default_branch_or_main
)
result
=
service
.
execute
(
:ondemand_dast_
sca
n
,
content:
ci_configuration
.
to_yaml
,
variables_attributes:
dast_site_validation_variables
)
result
=
service
.
execute
(
:ondemand_dast_
validatio
n
,
content:
ci_configuration
.
to_yaml
,
variables_attributes:
dast_site_validation_variables
)
if
result
.
success?
if
result
.
success?
ServiceResponse
.
success
(
payload:
dast_site_validation
)
ServiceResponse
.
success
(
payload:
dast_site_validation
)
...
...
ee/spec/services/app_sec/dast/site_validations/runner_service_spec.rb
View file @
abd0cce6
...
@@ -39,8 +39,10 @@ RSpec.describe AppSec::Dast::SiteValidations::RunnerService do
...
@@ -39,8 +39,10 @@ RSpec.describe AppSec::Dast::SiteValidations::RunnerService do
expect
(
subject
).
to
have_attributes
(
status: :success
,
payload:
dast_site_validation
)
expect
(
subject
).
to
have_attributes
(
status: :success
,
payload:
dast_site_validation
)
end
end
it
'creates a ci_pipeline with
ci_pipeline_variables'
do
it
'creates a ci_pipeline with
an appropriate source'
,
:aggregate_failures
do
expect
{
subject
}.
to
change
{
Ci
::
Pipeline
.
count
}.
by
(
1
)
expect
{
subject
}.
to
change
{
Ci
::
Pipeline
.
count
}.
by
(
1
)
expect
(
Ci
::
Pipeline
.
last
.
source
).
to
eq
(
'ondemand_dast_validation'
)
end
end
it
'makes the correct variables available to the ci_build'
do
it
'makes the correct variables available to the ci_build'
do
...
...
lib/gitlab/ci/pipeline/chain/command.rb
View file @
abd0cce6
...
@@ -107,10 +107,6 @@ module Gitlab
...
@@ -107,10 +107,6 @@ module Gitlab
.
increment
(
reason:
(
reason
||
:unknown_failure
).
to_s
)
.
increment
(
reason:
(
reason
||
:unknown_failure
).
to_s
)
end
end
def
dangling_build?
%i[ondemand_dast_scan webide]
.
include?
(
source
)
end
private
private
# Verifies that origin_ref is a fully qualified tag reference (refs/tags/<tag-name>)
# Verifies that origin_ref is a fully qualified tag reference (refs/tags/<tag-name>)
...
...
spec/lib/gitlab/ci/pipeline/chain/command_spec.rb
View file @
abd0cce6
...
@@ -295,31 +295,6 @@ RSpec.describe Gitlab::Ci::Pipeline::Chain::Command do
...
@@ -295,31 +295,6 @@ RSpec.describe Gitlab::Ci::Pipeline::Chain::Command do
end
end
end
end
describe
'#dangling_build?'
do
let
(
:project
)
{
create
(
:project
,
:repository
)
}
let
(
:command
)
{
described_class
.
new
(
project:
project
,
source:
source
)
}
subject
{
command
.
dangling_build?
}
context
'when source is :webide'
do
let
(
:source
)
{
:webide
}
it
{
is_expected
.
to
eq
(
true
)
}
end
context
'when source is :ondemand_dast_scan'
do
let
(
:source
)
{
:ondemand_dast_scan
}
it
{
is_expected
.
to
eq
(
true
)
}
end
context
'when source something else'
do
let
(
:source
)
{
:web
}
it
{
is_expected
.
to
eq
(
false
)
}
end
end
describe
'#creates_child_pipeline?'
do
describe
'#creates_child_pipeline?'
do
let
(
:command
)
{
described_class
.
new
(
bridge:
bridge
)
}
let
(
:command
)
{
described_class
.
new
(
bridge:
bridge
)
}
...
...
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