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
c39c35f9
Commit
c39c35f9
authored
Dec 06, 2020
by
Philip Cunningham
Committed by
Luke Duncalfe
Dec 06, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Return NONE when DastSiteValidation does not exist
Alternative to PENDING_VALIDATION when no validation.
parent
a3c102b8
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
24 additions
and
5 deletions
+24
-5
doc/api/graphql/reference/gitlab_schema.graphql
doc/api/graphql/reference/gitlab_schema.graphql
+5
-0
doc/api/graphql/reference/gitlab_schema.json
doc/api/graphql/reference/gitlab_schema.json
+6
-0
doc/api/graphql/reference/index.md
doc/api/graphql/reference/index.md
+1
-0
ee/app/graphql/types/dast_site_profile_validation_status_enum.rb
...graphql/types/dast_site_profile_validation_status_enum.rb
+1
-0
ee/app/models/dast_site_profile.rb
ee/app/models/dast_site_profile.rb
+1
-1
ee/app/models/dast_site_validation.rb
ee/app/models/dast_site_validation.rb
+1
-0
ee/changelogs/unreleased/philipcunningham-make-dast-site-validation-state-nullable.yml
...ipcunningham-make-dast-site-validation-state-nullable.yml
+5
-0
ee/spec/models/dast_site_profile_spec.rb
ee/spec/models/dast_site_profile_spec.rb
+2
-2
ee/spec/requests/api/graphql/project/dast_site_profile_spec.rb
...ec/requests/api/graphql/project/dast_site_profile_spec.rb
+2
-2
No files found.
doc/api/graphql/reference/gitlab_schema.graphql
View file @
c39c35f9
...
...
@@ -5247,6 +5247,11 @@ enum DastSiteProfileValidationStatusEnum {
"""
INPROGRESS_VALIDATION
"""
No
site
validation
exists
"""
NONE
"""
Site
validation
process
finished
successfully
"""
...
...
doc/api/graphql/reference/gitlab_schema.json
View file @
c39c35f9
...
...
@@ -14391,6 +14391,12 @@
"inputFields": null,
"interfaces": null,
"enumValues": [
{
"name": "NONE",
"description": "No site validation exists",
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "PENDING_VALIDATION",
"description": "Site validation process has not started",
doc/api/graphql/reference/index.md
View file @
c39c35f9
...
...
@@ -4007,6 +4007,7 @@ Status of a container repository.
| ----- | ----------- |
|
`FAILED_VALIDATION`
| Site validation process finished but failed |
|
`INPROGRESS_VALIDATION`
| Site validation process is in progress |
|
`NONE`
| No site validation exists |
|
`PASSED_VALIDATION`
| Site validation process finished successfully |
|
`PENDING_VALIDATION`
| Site validation process has not started |
...
...
ee/app/graphql/types/dast_site_profile_validation_status_enum.rb
View file @
c39c35f9
...
...
@@ -2,6 +2,7 @@
module
Types
class
DastSiteProfileValidationStatusEnum
<
BaseEnum
value
'NONE'
,
value:
DastSiteValidation
::
NONE_STATE
,
description:
'No site validation exists'
value
'PENDING_VALIDATION'
,
value:
'pending'
,
description:
'Site validation process has not started'
value
'INPROGRESS_VALIDATION'
,
value:
'inprogress'
,
description:
'Site validation process is in progress'
value
'PASSED_VALIDATION'
,
value:
'passed'
,
description:
'Site validation process finished successfully'
...
...
ee/app/models/dast_site_profile.rb
View file @
c39c35f9
...
...
@@ -15,7 +15,7 @@ class DastSiteProfile < ApplicationRecord
delegate
:dast_site_validation
,
to: :dast_site
,
allow_nil:
true
def
status
return
DastSiteValidation
::
INITIAL
_STATE
unless
dast_site_validation
return
DastSiteValidation
::
NONE
_STATE
unless
dast_site_validation
dast_site_validation
.
state
end
...
...
ee/app/models/dast_site_validation.rb
View file @
c39c35f9
...
...
@@ -27,6 +27,7 @@ class DastSiteValidation < ApplicationRecord
"
#{
url_base
}
/
#{
url_path
}
"
end
NONE_STATE
=
'none'
INITIAL_STATE
=
'pending'
state_machine
:state
,
initial:
INITIAL_STATE
.
to_sym
do
...
...
ee/changelogs/unreleased/philipcunningham-make-dast-site-validation-state-nullable.yml
0 → 100644
View file @
c39c35f9
---
title
:
Return NONE for GraphQL DastSiteValidation type status when there is no DAST site validation
merge_request
:
48751
author
:
type
:
changed
ee/spec/models/dast_site_profile_spec.rb
View file @
c39c35f9
...
...
@@ -74,12 +74,12 @@ RSpec.describe DastSiteProfile, type: :model do
describe
'#status'
do
context
'when dast_site_validation association does not exist'
do
it
'is
pending
'
do
it
'is
none
'
do
subject
.
dast_site
.
update!
(
dast_site_validation_id:
nil
)
aggregate_failures
do
expect
(
subject
.
dast_site_validation
).
to
be_nil
expect
(
subject
.
status
).
to
eq
(
'
pending
'
)
expect
(
subject
.
status
).
to
eq
(
'
none
'
)
end
end
end
...
...
ee/spec/requests/api/graphql/project/dast_site_profile_spec.rb
View file @
c39c35f9
...
...
@@ -93,10 +93,10 @@ RSpec.describe 'Query.project(fullPath).dastSiteProfile' do
end
context
'when there is no associated dast_site_validation'
do
it
'returns a
pending
validation status'
do
it
'returns a
none
validation status'
do
dast_site_profile
.
dast_site_validation
.
destroy!
expect
(
dast_site_profile_response
[
'validationStatus'
]).
to
eq
(
'
PENDING_VALIDATION
'
)
expect
(
dast_site_profile_response
[
'validationStatus'
]).
to
eq
(
'
NONE
'
)
end
end
end
...
...
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