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
af318c1b
Commit
af318c1b
authored
Nov 12, 2020
by
Vitali Tatarintev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add IncidentManagementOncallSchedule GraphQL type
Describe a new type for IncidentManagement::OncallSchedule
parent
1405470c
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
431 additions
and
0 deletions
+431
-0
doc/api/graphql/reference/gitlab_schema.graphql
doc/api/graphql/reference/gitlab_schema.graphql
+85
-0
doc/api/graphql/reference/gitlab_schema.json
doc/api/graphql/reference/gitlab_schema.json
+246
-0
doc/api/graphql/reference/index.md
doc/api/graphql/reference/index.md
+12
-0
ee/app/graphql/ee/types/project_type.rb
ee/app/graphql/ee/types/project_type.rb
+5
-0
ee/app/graphql/types/incident_management/oncall_schedule_type.rb
...graphql/types/incident_management/oncall_schedule_type.rb
+32
-0
ee/app/policies/ee/project_policy.rb
ee/app/policies/ee/project_policy.rb
+1
-0
ee/app/policies/incident_management/oncall_schedule_policy.rb
...pp/policies/incident_management/oncall_schedule_policy.rb
+7
-0
ee/spec/graphql/types/incident_management/oncall_schedule_type_spec.rb
...ql/types/incident_management/oncall_schedule_type_spec.rb
+20
-0
ee/spec/policies/incident_management/oncall_schedule_policy_spec.rb
...licies/incident_management/oncall_schedule_policy_spec.rb
+23
-0
No files found.
doc/api/graphql/reference/gitlab_schema.graphql
View file @
af318c1b
...
...
@@ -10134,6 +10134,66 @@ An ISO 8601-encoded date
"""
scalar
ISO8601Date
"""
Describes an incident management on-call schedule
"""
type
IncidentManagementOncallSchedule
{
"""
Description
of
the
on
-
call
schedule
"""
description
:
String
"""
Internal
ID
of
the
on
-
call
schedule
"""
iid
:
ID
!
"""
Name
of
the
on
-
call
schedule
"""
name
:
String
!
"""
Time
zone
of
the
on
-
call
schedule
"""
timezone
:
String
!
}
"""
The connection type for IncidentManagementOncallSchedule.
"""
type
IncidentManagementOncallScheduleConnection
{
"""
A
list
of
edges
.
"""
edges
:
[
IncidentManagementOncallScheduleEdge
]
"""
A
list
of
nodes
.
"""
nodes
:
[
IncidentManagementOncallSchedule
]
"""
Information
to
aid
in
pagination
.
"""
pageInfo
:
PageInfo
!
}
"""
An edge in a connection.
"""
type
IncidentManagementOncallScheduleEdge
{
"""
A
cursor
for
use
in
pagination
.
"""
cursor
:
String
!
"""
The
item
at
the
end
of
the
edge
.
"""
node
:
IncidentManagementOncallSchedule
}
type
InstanceSecurityDashboard
{
"""
Projects
selected
in
Instance
Security
Dashboard
...
...
@@ -15537,6 +15597,31 @@ type Project {
"""
importStatus
:
String
"""
Incident
Management
On
-
call
schedules
of
the
project
"""
incidentManagementOncallSchedules
(
"""
Returns
the
elements
in
the
list
that
come
after
the
specified
cursor
.
"""
after
:
String
"""
Returns
the
elements
in
the
list
that
come
before
the
specified
cursor
.
"""
before
:
String
"""
Returns
the
first
_n_
elements
from
the
list
.
"""
first
:
Int
"""
Returns
the
last
_n_
elements
from
the
list
.
"""
last
:
Int
):
IncidentManagementOncallScheduleConnection
"""
A
single
issue
of
the
project
"""
...
...
doc/api/graphql/reference/gitlab_schema.json
View file @
af318c1b
...
...
@@ -27740,6 +27740,199 @@
"enumValues": null,
"possibleTypes": null
},
{
"kind": "OBJECT",
"name": "IncidentManagementOncallSchedule",
"description": "Describes an incident management on-call schedule",
"fields": [
{
"name": "description",
"description": "Description of the on-call schedule",
"args": [
],
"type": {
"kind": "SCALAR",
"name": "String",
"ofType": null
},
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "iid",
"description": "Internal ID of the on-call schedule",
"args": [
],
"type": {
"kind": "NON_NULL",
"name": null,
"ofType": {
"kind": "SCALAR",
"name": "ID",
"ofType": null
}
},
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "name",
"description": "Name of the on-call schedule",
"args": [
],
"type": {
"kind": "NON_NULL",
"name": null,
"ofType": {
"kind": "SCALAR",
"name": "String",
"ofType": null
}
},
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "timezone",
"description": "Time zone of the on-call schedule",
"args": [
],
"type": {
"kind": "NON_NULL",
"name": null,
"ofType": {
"kind": "SCALAR",
"name": "String",
"ofType": null
}
},
"isDeprecated": false,
"deprecationReason": null
}
],
"inputFields": null,
"interfaces": [
],
"enumValues": null,
"possibleTypes": null
},
{
"kind": "OBJECT",
"name": "IncidentManagementOncallScheduleConnection",
"description": "The connection type for IncidentManagementOncallSchedule.",
"fields": [
{
"name": "edges",
"description": "A list of edges.",
"args": [
],
"type": {
"kind": "LIST",
"name": null,
"ofType": {
"kind": "OBJECT",
"name": "IncidentManagementOncallScheduleEdge",
"ofType": null
}
},
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "nodes",
"description": "A list of nodes.",
"args": [
],
"type": {
"kind": "LIST",
"name": null,
"ofType": {
"kind": "OBJECT",
"name": "IncidentManagementOncallSchedule",
"ofType": null
}
},
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "pageInfo",
"description": "Information to aid in pagination.",
"args": [
],
"type": {
"kind": "NON_NULL",
"name": null,
"ofType": {
"kind": "OBJECT",
"name": "PageInfo",
"ofType": null
}
},
"isDeprecated": false,
"deprecationReason": null
}
],
"inputFields": null,
"interfaces": [
],
"enumValues": null,
"possibleTypes": null
},
{
"kind": "OBJECT",
"name": "IncidentManagementOncallScheduleEdge",
"description": "An edge in a connection.",
"fields": [
{
"name": "cursor",
"description": "A cursor for use in pagination.",
"args": [
],
"type": {
"kind": "NON_NULL",
"name": null,
"ofType": {
"kind": "SCALAR",
"name": "String",
"ofType": null
}
},
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "node",
"description": "The item at the end of the edge.",
"args": [
],
"type": {
"kind": "OBJECT",
"name": "IncidentManagementOncallSchedule",
"ofType": null
},
"isDeprecated": false,
"deprecationReason": null
}
],
"inputFields": null,
"interfaces": [
],
"enumValues": null,
"possibleTypes": null
},
{
"kind": "OBJECT",
"name": "InstanceSecurityDashboard",
...
...
@@ -45737,6 +45930,59 @@
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "incidentManagementOncallSchedules",
"description": "Incident Management On-call schedules of the project",
"args": [
{
"name": "after",
"description": "Returns the elements in the list that come after the specified cursor.",
"type": {
"kind": "SCALAR",
"name": "String",
"ofType": null
},
"defaultValue": null
},
{
"name": "before",
"description": "Returns the elements in the list that come before the specified cursor.",
"type": {
"kind": "SCALAR",
"name": "String",
"ofType": null
},
"defaultValue": null
},
{
"name": "first",
"description": "Returns the first _n_ elements from the list.",
"type": {
"kind": "SCALAR",
"name": "Int",
"ofType": null
},
"defaultValue": null
},
{
"name": "last",
"description": "Returns the last _n_ elements from the list.",
"type": {
"kind": "SCALAR",
"name": "Int",
"ofType": null
},
"defaultValue": null
}
],
"type": {
"kind": "OBJECT",
"name": "IncidentManagementOncallScheduleConnection",
"ofType": null
},
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "issue",
"description": "A single issue of the project",
doc/api/graphql/reference/index.md
View file @
af318c1b
...
...
@@ -1563,6 +1563,17 @@ Autogenerated return type of HttpIntegrationUpdate.
|
`errors`
| String! => Array | Errors encountered during execution of the mutation. |
|
`integration`
| AlertManagementHttpIntegration | The HTTP integration |
### IncidentManagementOncallSchedule
Describes an incident management on-call schedule.
| Field | Type | Description |
| ----- | ---- | ----------- |
|
`description`
| String | Description of the on-call schedule |
|
`iid`
| ID! | Internal ID of the on-call schedule |
|
`name`
| String! | Name of the on-call schedule |
|
`timezone`
| String! | Time zone of the on-call schedule |
### InstanceSecurityDashboard
| Field | Type | Description |
...
...
@@ -2351,6 +2362,7 @@ Autogenerated return type of PipelineRetry.
|
`httpUrlToRepo`
| String | URL to connect to the project via HTTPS |
|
`id`
| ID! | ID of the project |
|
`importStatus`
| String | Status of import background job of the project |
|
`incidentManagementOncallSchedules`
| IncidentManagementOncallScheduleConnection | Incident Management On-call schedules of the project |
|
`issue`
| Issue | A single issue of the project |
|
`issueStatusCounts`
| IssueStatusCountsType | Counts of issues by status for the project |
|
`issues`
| IssueConnection | Issues of the project |
...
...
ee/app/graphql/ee/types/project_type.rb
View file @
af318c1b
...
...
@@ -148,6 +148,11 @@ module EE
description:
'Code coverage summary associated with the project'
,
resolver:
::
Resolvers
::
Ci
::
CodeCoverageSummaryResolver
field
:incident_management_oncall_schedules
,
::
Types
::
IncidentManagement
::
OncallScheduleType
.
connection_type
,
null:
true
,
description:
'Incident Management On-call schedules of the project'
def
self
.
sast_ci_configuration
(
project
)
::
Security
::
CiConfiguration
::
SastParserService
.
new
(
project
).
configuration
end
...
...
ee/app/graphql/types/incident_management/oncall_schedule_type.rb
0 → 100644
View file @
af318c1b
# frozen_string_literal: true
module
Types
module
IncidentManagement
class
OncallScheduleType
<
BaseObject
graphql_name
'IncidentManagementOncallSchedule'
description
'Describes an incident management on-call schedule'
authorize
:read_incident_management_oncall_schedule
field
:iid
,
GraphQL
::
ID_TYPE
,
null:
false
,
description:
'Internal ID of the on-call schedule'
field
:name
,
GraphQL
::
STRING_TYPE
,
null:
false
,
description:
'Name of the on-call schedule'
field
:description
,
GraphQL
::
STRING_TYPE
,
null:
true
,
description:
'Description of the on-call schedule'
field
:timezone
,
GraphQL
::
STRING_TYPE
,
null:
false
,
description:
'Time zone of the on-call schedule'
end
end
end
ee/app/policies/ee/project_policy.rb
View file @
af318c1b
...
...
@@ -241,6 +241,7 @@ module EE
enable
:modify_auto_fix_setting
enable
:modify_merge_request_author_setting
enable
:modify_merge_request_committer_setting
enable
:read_incident_management_oncall_schedule
end
rule
{
license_scanning_enabled
&
can?
(
:maintainer_access
)
}.
enable
:admin_software_license_policy
...
...
ee/app/policies/incident_management/oncall_schedule_policy.rb
0 → 100644
View file @
af318c1b
# frozen_string_literal: true
module
IncidentManagement
class
OncallSchedulePolicy
<
::
BasePolicy
delegate
{
@subject
.
project
}
end
end
ee/spec/graphql/types/incident_management/oncall_schedule_type_spec.rb
0 → 100644
View file @
af318c1b
# frozen_string_literal: true
require
'spec_helper'
RSpec
.
describe
GitlabSchema
.
types
[
'IncidentManagementOncallSchedule'
]
do
specify
{
expect
(
described_class
.
graphql_name
).
to
eq
(
'IncidentManagementOncallSchedule'
)
}
specify
{
expect
(
described_class
).
to
require_graphql_authorizations
(
:read_incident_management_oncall_schedule
)
}
it
'exposes the expected fields'
do
expected_fields
=
%i[
iid
name
description
timezone
]
expect
(
described_class
).
to
have_graphql_fields
(
*
expected_fields
)
end
end
ee/spec/policies/incident_management/oncall_schedule_policy_spec.rb
0 → 100644
View file @
af318c1b
# frozen_string_literal: true
require
'spec_helper'
RSpec
.
describe
IncidentManagement
::
OncallSchedulePolicy
do
let_it_be
(
:project
)
{
create
(
:project
)
}
let_it_be
(
:user
)
{
create
(
:user
)
}
let_it_be
(
:oncall_schedule
)
{
create
(
:incident_management_oncall_schedule
,
project:
project
)
}
subject
(
:policy
)
{
described_class
.
new
(
user
,
oncall_schedule
)
}
describe
'rules'
do
it
{
is_expected
.
to
be_disallowed
:read_incident_management_oncall_schedule
}
context
'when maintainer'
do
before
do
project
.
add_maintainer
(
user
)
end
it
{
is_expected
.
to
be_allowed
:read_incident_management_oncall_schedule
}
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