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
b313d625
Commit
b313d625
authored
Apr 08, 2021
by
Philip Cunningham
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix issue not passing Dast::Profile branch
- Extend service - Fix specs to catch the issue
parent
117584f7
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
12 additions
and
12 deletions
+12
-12
ee/app/services/dast_on_demand_scans/params_create_service.rb
...pp/services/dast_on_demand_scans/params_create_service.rb
+6
-6
ee/spec/graphql/mutations/dast/profiles/create_spec.rb
ee/spec/graphql/mutations/dast/profiles/create_spec.rb
+2
-2
ee/spec/graphql/mutations/dast/profiles/run_spec.rb
ee/spec/graphql/mutations/dast/profiles/run_spec.rb
+1
-1
ee/spec/graphql/mutations/dast/profiles/update_spec.rb
ee/spec/graphql/mutations/dast/profiles/update_spec.rb
+1
-1
ee/spec/services/dast_on_demand_scans/params_create_service_spec.rb
...rvices/dast_on_demand_scans/params_create_service_spec.rb
+2
-2
No files found.
ee/app/services/dast_on_demand_scans/params_create_service.rb
View file @
b313d625
...
...
@@ -25,12 +25,6 @@ module DastOnDemandScans
).
execute
.
present?
end
def
branch
strong_memoize
(
:branch
)
do
params
[
:branch
]
||
container
.
default_branch
end
end
def
dast_profile
strong_memoize
(
:dast_profile
)
do
params
[
:dast_profile
]
...
...
@@ -55,6 +49,12 @@ module DastOnDemandScans
end
end
def
branch
strong_memoize
(
:branch
)
do
dast_profile
&
.
branch_name
||
params
[
:branch
]
||
container
.
default_branch
end
end
def
url_base
strong_memoize
(
:url_base
)
do
DastSiteValidation
.
get_normalized_url_base
(
dast_site
&
.
url
)
...
...
ee/spec/graphql/mutations/dast/profiles/create_spec.rb
View file @
b313d625
...
...
@@ -28,7 +28,7 @@ RSpec.describe Mutations::Dast::Profiles::Create do
full_path:
project
.
full_path
,
name:
name
,
description:
description
,
branch_name:
'orphaned-branch'
,
branch_name:
project
.
default_branch
,
dast_site_profile_id:
dast_site_profile
.
to_global_id
.
to_s
,
dast_scanner_profile_id:
dast_scanner_profile
.
to_global_id
.
to_s
,
run_after_create:
run_after_create
...
...
@@ -62,7 +62,7 @@ RSpec.describe Mutations::Dast::Profiles::Create do
context
'when the feature flag dast_branch_selection is enabled'
do
it
'sets the branch_name'
do
expect
(
subject
[
:dast_profile
].
branch_name
).
to
eq
(
'orphaned-branch'
)
expect
(
subject
[
:dast_profile
].
branch_name
).
to
eq
(
project
.
default_branch
)
end
end
end
...
...
ee/spec/graphql/mutations/dast/profiles/run_spec.rb
View file @
b313d625
...
...
@@ -6,7 +6,7 @@ RSpec.describe Mutations::Dast::Profiles::Run do
let_it_be_with_refind
(
:project
)
{
create
(
:project
,
:repository
)
}
let_it_be
(
:user
)
{
create
(
:user
)
}
let_it_be
(
:dast_profile
)
{
create
(
:dast_profile
,
project:
project
,
branch_name:
'orphaned-branch'
)
}
let_it_be
(
:dast_profile
)
{
create
(
:dast_profile
,
project:
project
,
branch_name:
project
.
default_branch
)
}
let
(
:full_path
)
{
project
.
full_path
}
let
(
:dast_profile_id
)
{
dast_profile
.
to_global_id
}
...
...
ee/spec/graphql/mutations/dast/profiles/update_spec.rb
View file @
b313d625
...
...
@@ -17,7 +17,7 @@ RSpec.describe Mutations::Dast::Profiles::Update do
id:
dast_profile_gid
,
name:
SecureRandom
.
hex
,
description:
SecureRandom
.
hex
,
branch_name:
'orphaned-branch'
,
branch_name:
project
.
default_branch
,
dast_site_profile_id:
global_id_of
(
create
(
:dast_site_profile
,
project:
project
)),
dast_scanner_profile_id:
global_id_of
(
create
(
:dast_scanner_profile
,
project:
project
)),
run_after_update:
run_after_update
...
...
ee/spec/services/dast_on_demand_scans/params_create_service_spec.rb
View file @
b313d625
...
...
@@ -92,7 +92,7 @@ RSpec.describe DastOnDemandScans::ParamsCreateService do
end
context
'when the dast_profile is provided'
do
let_it_be
(
:dast_profile
)
{
create
(
:dast_profile
,
project:
project
,
dast_site_profile:
dast_site_profile
,
dast_scanner_profile:
dast_scanner_profile
)
}
let_it_be
(
:dast_profile
)
{
create
(
:dast_profile
,
project:
project
,
dast_site_profile:
dast_site_profile
,
dast_scanner_profile:
dast_scanner_profile
,
branch_name:
'hello-world'
)
}
let
(
:params
)
{
{
dast_profile:
dast_profile
}
}
...
...
@@ -101,7 +101,7 @@ RSpec.describe DastOnDemandScans::ParamsCreateService do
auth_password_field:
dast_site_profile
.
auth_password_field
,
auth_username:
dast_site_profile
.
auth_username
,
auth_username_field:
dast_site_profile
.
auth_username_field
,
branch:
project
.
default_branch
,
branch:
dast_profile
.
branch_name
,
dast_profile:
dast_profile
,
excluded_urls:
dast_site_profile
.
excluded_urls
.
join
(
','
),
full_scan_enabled:
false
,
...
...
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