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
f68b51aa
Commit
f68b51aa
authored
Aug 31, 2020
by
lauraMon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updates docs for consistency
* Changes description * Removes destroyable field
parent
72a8a9e0
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
8 additions
and
86 deletions
+8
-86
app/graphql/types/ci/pipeline_type.rb
app/graphql/types/ci/pipeline_type.rb
+2
-6
doc/api/graphql/reference/gitlab_schema.graphql
doc/api/graphql/reference/gitlab_schema.graphql
+2
-7
doc/api/graphql/reference/gitlab_schema.json
doc/api/graphql/reference/gitlab_schema.json
+2
-20
doc/api/graphql/reference/index.md
doc/api/graphql/reference/index.md
+2
-3
spec/requests/api/graphql/ci/pipeline_spec.rb
spec/requests/api/graphql/ci/pipeline_spec.rb
+0
-50
No files found.
app/graphql/types/ci/pipeline_type.rb
View file @
f68b51aa
...
...
@@ -49,17 +49,13 @@ module Types
description:
'Pipeline user'
,
resolve:
->
(
pipeline
,
_args
,
_context
)
{
Gitlab
::
Graphql
::
Loaders
::
BatchModelLoader
.
new
(
User
,
pipeline
.
user_id
).
find
}
field
:retryable
,
GraphQL
::
BOOLEAN_TYPE
,
description:
'Specifies if a pipeline
is retryable
'
,
description:
'Specifies if a pipeline
can be retried
'
,
method: :retryable?
,
null:
false
field
:cancelable
,
GraphQL
::
BOOLEAN_TYPE
,
description:
'Specifies if a pipeline
is cancelable
'
,
description:
'Specifies if a pipeline
can be canceled
'
,
method: :cancelable?
,
null:
false
field
:destroyable
,
GraphQL
::
BOOLEAN_TYPE
,
description:
'Specifies if a pipeline can be destroyed'
,
null:
false
,
resolve:
->
(
pipeline
,
_args
,
context
)
{
Ability
.
allowed?
(
context
[
:current_user
],
:destroy_pipeline
,
pipeline
)
}
end
end
end
...
...
doc/api/graphql/reference/gitlab_schema.graphql
View file @
f68b51aa
...
...
@@ -10698,7 +10698,7 @@ type Pipeline {
beforeSha
:
String
"""
Specifies
if
a
pipeline
is
cancelable
Specifies
if
a
pipeline
can
be
canceled
"""
cancelable
:
Boolean
!
...
...
@@ -10724,11 +10724,6 @@ type Pipeline {
"""
createdAt
:
Time
!
"""
Specifies
if
a
pipeline
can
be
destroyed
"""
destroyable
:
Boolean
!
"""
Detailed
status
of
the
pipeline
"""
...
...
@@ -10755,7 +10750,7 @@ type Pipeline {
iid
:
String
!
"""
Specifies
if
a
pipeline
is
retryable
Specifies
if
a
pipeline
can
be
retried
"""
retryable
:
Boolean
!
...
...
doc/api/graphql/reference/gitlab_schema.json
View file @
f68b51aa
...
...
@@ -32017,7 +32017,7 @@
},
{
"name": "cancelable",
"description": "Specifies if a pipeline
is cancelable
",
"description": "Specifies if a pipeline
can be canceled
",
"args": [
],
...
...
@@ -32093,24 +32093,6 @@
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "destroyable",
"description": "Specifies if a pipeline can be destroyed",
"args": [
],
"type": {
"kind": "NON_NULL",
"name": null,
"ofType": {
"kind": "SCALAR",
"name": "Boolean",
"ofType": null
}
},
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "detailedStatus",
"description": "Detailed status of the pipeline",
...
...
@@ -32195,7 +32177,7 @@
},
{
"name": "retryable",
"description": "Specifies if a pipeline
is retryable
",
"description": "Specifies if a pipeline
can be retried
",
"args": [
],
doc/api/graphql/reference/index.md
View file @
f68b51aa
...
...
@@ -1650,18 +1650,17 @@ Information about pagination in a connection.
| Name | Type | Description |
| --- | ---- | ---------- |
|
`beforeSha`
| String | Base SHA of the source branch |
|
`cancelable`
| Boolean! | Specifies if a pipeline
is cancelable
|
|
`cancelable`
| Boolean! | Specifies if a pipeline
can be canceled
|
|
`committedAt`
| Time | Timestamp of the pipeline's commit |
|
`configSource`
| PipelineConfigSourceEnum | Config source of the pipeline (UNKNOWN_SOURCE, REPOSITORY_SOURCE, AUTO_DEVOPS_SOURCE, WEBIDE_SOURCE, REMOTE_SOURCE, EXTERNAL_PROJECT_SOURCE, BRIDGE_SOURCE, PARAMETER_SOURCE) |
|
`coverage`
| Float | Coverage percentage |
|
`createdAt`
| Time! | Timestamp of the pipeline's creation |
|
`destroyable`
| Boolean! | Specifies if a pipeline can be destroyed |
|
`detailedStatus`
| DetailedStatus! | Detailed status of the pipeline |
|
`duration`
| Int | Duration of the pipeline in seconds |
|
`finishedAt`
| Time | Timestamp of the pipeline's completion |
|
`id`
| ID! | ID of the pipeline |
|
`iid`
| String! | Internal ID of the pipeline |
|
`retryable`
| Boolean! | Specifies if a pipeline
is retryable
|
|
`retryable`
| Boolean! | Specifies if a pipeline
can be retried
|
|
`securityReportSummary`
| SecurityReportSummary | Vulnerability and scanned resource counts for each security scanner of the pipeline |
|
`sha`
| String! | SHA of the pipeline's commit |
|
`startedAt`
| Time | Timestamp when the pipeline was started |
...
...
spec/requests/api/graphql/ci/pipeline_spec.rb
deleted
100644 → 0
View file @
72a8a9e0
# frozen_string_literal: true
require
'spec_helper'
RSpec
.
describe
'destroyable'
do
include
GraphqlHelpers
let_it_be
(
:project
)
{
create
(
:project
)
}
let_it_be
(
:user
)
{
create
(
:user
)
}
let_it_be
(
:project_owner
)
{
project
.
owner
}
let_it_be
(
:pipeline
)
{
create
(
:ci_pipeline
,
project:
project
)
}
let
(
:query
)
do
%(
query {
project(fullPath: "#{project.full_path}") {
pipeline(iid: "#{pipeline.iid}") {
destroyable
}
}
}
)
end
let
(
:pipeline_graphql_data
)
{
graphql_data
.
dig
(
'project'
,
'pipeline'
,
'destroyable'
)
}
context
'when user does not have the permission'
do
before
do
project
.
add_developer
(
user
)
post_graphql
(
query
,
current_user:
user
)
end
it
'returns false'
do
allow
(
Ability
).
to
receive
(
:allowed?
).
with
(
user
,
:destroy_pipline
,
pipeline
).
and_return
(
false
)
expect
(
pipeline_graphql_data
).
to
be
(
false
)
end
end
context
'when user is owner and therefore has the permission'
do
before
do
post_graphql
(
query
,
current_user:
project_owner
)
end
it
'returns true'
do
allow
(
Ability
).
to
receive
(
:allowed?
).
with
(
project_owner
,
:destroy_pipline
,
pipeline
).
and_return
(
true
)
expect
(
pipeline_graphql_data
).
to
be
(
true
)
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