Commit c75bbec1 authored by Sean Arnold's avatar Sean Arnold

Rename on-call user type to participant

Add to schedule
Update docs
parent 5714cc34
...@@ -10960,6 +10960,11 @@ An ISO 8601-encoded date ...@@ -10960,6 +10960,11 @@ An ISO 8601-encoded date
""" """
scalar ISO8601Date scalar ISO8601Date
"""
Identifier of IncidentManagement::OncallParticipant
"""
scalar IncidentManagementOncallParticipantID
""" """
Describes an incident management on-call rotation Describes an incident management on-call rotation
""" """
...@@ -11007,7 +11012,7 @@ type IncidentManagementOncallRotation { ...@@ -11007,7 +11012,7 @@ type IncidentManagementOncallRotation {
Returns the last _n_ elements from the list. Returns the last _n_ elements from the list.
""" """
last: Int last: Int
): OncallUserTypeConnection ): OncallParticipantTypeConnection
""" """
Start date of the on-call rotation Start date of the on-call rotation
...@@ -11015,6 +11020,41 @@ type IncidentManagementOncallRotation { ...@@ -11015,6 +11020,41 @@ type IncidentManagementOncallRotation {
startsAt: Time startsAt: Time
} }
"""
The connection type for IncidentManagementOncallRotation.
"""
type IncidentManagementOncallRotationConnection {
"""
A list of edges.
"""
edges: [IncidentManagementOncallRotationEdge]
"""
A list of nodes.
"""
nodes: [IncidentManagementOncallRotation]
"""
Information to aid in pagination.
"""
pageInfo: PageInfo!
}
"""
An edge in a connection.
"""
type IncidentManagementOncallRotationEdge {
"""
A cursor for use in pagination.
"""
cursor: String!
"""
The item at the end of the edge.
"""
node: IncidentManagementOncallRotation
}
""" """
Identifier of IncidentManagement::OncallRotation Identifier of IncidentManagement::OncallRotation
""" """
...@@ -11039,6 +11079,31 @@ type IncidentManagementOncallSchedule { ...@@ -11039,6 +11079,31 @@ type IncidentManagementOncallSchedule {
""" """
name: String! name: String!
"""
On-call rotations for the on-call schedule
"""
oncallRotations(
"""
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
): IncidentManagementOncallRotationConnection!
""" """
Time zone of the on-call schedule Time zone of the on-call schedule
""" """
...@@ -15555,6 +15620,66 @@ Identifier of Noteable ...@@ -15555,6 +15620,66 @@ Identifier of Noteable
""" """
scalar NoteableID scalar NoteableID
"""
The rotation participant and color palette
"""
type OncallParticipantType {
"""
The color palette to assign to the on-call user. For example "blue".
"""
colorPalette: String
"""
The color weight to assign to for the on-call user, for example "500". Max 4 chars. For easy identification of the user.
"""
colorWeight: String
"""
ID of the on-call participant
"""
id: IncidentManagementOncallParticipantID!
"""
The user who is participating
"""
user: User!
}
"""
The connection type for OncallParticipantType.
"""
type OncallParticipantTypeConnection {
"""
A list of edges.
"""
edges: [OncallParticipantTypeEdge]
"""
A list of nodes.
"""
nodes: [OncallParticipantType]
"""
Information to aid in pagination.
"""
pageInfo: PageInfo!
}
"""
An edge in a connection.
"""
type OncallParticipantTypeEdge {
"""
A cursor for use in pagination.
"""
cursor: String!
"""
The item at the end of the edge.
"""
node: OncallParticipantType
}
""" """
Autogenerated input type of OncallRotationCreate Autogenerated input type of OncallRotationCreate
""" """
...@@ -15830,61 +15955,6 @@ input OncallUserInputType { ...@@ -15830,61 +15955,6 @@ input OncallUserInputType {
username: String! username: String!
} }
"""
The rotation user and color palette
"""
type OncallUserType {
"""
The color palette to assign to the on-call user. For example "blue".
"""
colorPalette: String
"""
The color weight to assign to for the on-call user, for example "500". Max 4 chars. For easy identification of the user.
"""
colorWeight: String
"""
The user who is participating
"""
user: User!
}
"""
The connection type for OncallUserType.
"""
type OncallUserTypeConnection {
"""
A list of edges.
"""
edges: [OncallUserTypeEdge]
"""
A list of nodes.
"""
nodes: [OncallUserType]
"""
Information to aid in pagination.
"""
pageInfo: PageInfo!
}
"""
An edge in a connection.
"""
type OncallUserTypeEdge {
"""
A cursor for use in pagination.
"""
cursor: String!
"""
The item at the end of the edge.
"""
node: OncallUserType
}
""" """
Represents a package Represents a package
""" """
......
...@@ -1722,7 +1722,7 @@ Describes an incident management on-call rotation. ...@@ -1722,7 +1722,7 @@ Describes an incident management on-call rotation.
| `length` | Int | Time zone of the on-call schedule | | `length` | Int | Time zone of the on-call schedule |
| `lengthUnit` | OncallRotationUnitEnum | Unit of the on-call rotation length | | `lengthUnit` | OncallRotationUnitEnum | Unit of the on-call rotation length |
| `name` | String! | Name of the on-call rotation | | `name` | String! | Name of the on-call rotation |
| `participants` | OncallUserTypeConnection | Participants of the on-call rotation | | `participants` | OncallParticipantTypeConnection | Participants of the on-call rotation |
| `startsAt` | Time | Start date of the on-call rotation | | `startsAt` | Time | Start date of the on-call rotation |
### IncidentManagementOncallSchedule ### IncidentManagementOncallSchedule
...@@ -1734,6 +1734,7 @@ Describes an incident management on-call schedule. ...@@ -1734,6 +1734,7 @@ Describes an incident management on-call schedule.
| `description` | String | Description of the on-call schedule | | `description` | String | Description of the on-call schedule |
| `iid` | ID! | Internal ID of the on-call schedule | | `iid` | ID! | Internal ID of the on-call schedule |
| `name` | String! | Name of the on-call schedule | | `name` | String! | Name of the on-call schedule |
| `oncallRotations` | IncidentManagementOncallRotationConnection! | On-call rotations for the on-call schedule |
| `timezone` | String! | Time zone of the on-call schedule | | `timezone` | String! | Time zone of the on-call schedule |
### InstanceSecurityDashboard ### InstanceSecurityDashboard
...@@ -2390,6 +2391,17 @@ Autogenerated return type of NamespaceIncreaseStorageTemporarily. ...@@ -2390,6 +2391,17 @@ Autogenerated return type of NamespaceIncreaseStorageTemporarily.
| `repositionNote` | Boolean! | Indicates the user can perform `reposition_note` on this resource | | `repositionNote` | Boolean! | Indicates the user can perform `reposition_note` on this resource |
| `resolveNote` | Boolean! | Indicates the user can perform `resolve_note` on this resource | | `resolveNote` | Boolean! | Indicates the user can perform `resolve_note` on this resource |
### OncallParticipantType
The rotation participant and color palette.
| Field | Type | Description |
| ----- | ---- | ----------- |
| `colorPalette` | String | The color palette to assign to the on-call user. For example "blue". |
| `colorWeight` | String | The color weight to assign to for the on-call user, for example "500". Max 4 chars. For easy identification of the user. |
| `id` | IncidentManagementOncallParticipantID! | ID of the on-call participant |
| `user` | User! | The user who is participating |
### OncallRotationCreatePayload ### OncallRotationCreatePayload
Autogenerated return type of OncallRotationCreate. Autogenerated return type of OncallRotationCreate.
...@@ -2430,16 +2442,6 @@ Autogenerated return type of OncallScheduleUpdate. ...@@ -2430,16 +2442,6 @@ Autogenerated return type of OncallScheduleUpdate.
| `errors` | String! => Array | Errors encountered during execution of the mutation. | | `errors` | String! => Array | Errors encountered during execution of the mutation. |
| `oncallSchedule` | IncidentManagementOncallSchedule | The on-call schedule | | `oncallSchedule` | IncidentManagementOncallSchedule | The on-call schedule |
### OncallUserType
The rotation user and color palette.
| Field | Type | Description |
| ----- | ---- | ----------- |
| `colorPalette` | String | The color palette to assign to the on-call user. For example "blue". |
| `colorWeight` | String | The color weight to assign to for the on-call user, for example "500". Max 4 chars. For easy identification of the user. |
| `user` | User! | The user who is participating |
### Package ### Package
Represents a package. Represents a package.
......
...@@ -3,9 +3,14 @@ ...@@ -3,9 +3,14 @@
module Types module Types
module IncidentManagement module IncidentManagement
# rubocop: disable Graphql/AuthorizeTypes # rubocop: disable Graphql/AuthorizeTypes
class OncallUserType < BaseObject class OncallParticipantType < BaseObject
graphql_name 'OncallUserType' graphql_name 'OncallParticipantType'
description 'The rotation user and color palette' description 'The rotation participant and color palette'
field :id,
Types::GlobalIDType[::IncidentManagement::OncallParticipant],
null: false,
description: 'ID of the on-call participant'
field :user, Types::UserType, field :user, Types::UserType,
null: false, null: false,
......
...@@ -34,7 +34,7 @@ module Types ...@@ -34,7 +34,7 @@ module Types
description: 'Unit of the on-call rotation length' description: 'Unit of the on-call rotation length'
field :participants, field :participants,
::Types::IncidentManagement::OncallUserType.connection_type, ::Types::IncidentManagement::OncallParticipantType.connection_type,
null: true, null: true,
description: 'Participants of the on-call rotation' description: 'Participants of the on-call rotation'
......
...@@ -27,6 +27,12 @@ module Types ...@@ -27,6 +27,12 @@ module Types
GraphQL::STRING_TYPE, GraphQL::STRING_TYPE,
null: false, null: false,
description: 'Time zone of the on-call schedule' description: 'Time zone of the on-call schedule'
field :oncall_rotations,
OncallRotationType.connection_type,
null: false,
description: 'On-call rotations for the on-call schedule'
end end
end end
end end
# frozen_string_literal: true
require 'spec_helper'
RSpec.describe GitlabSchema.types['OncallParticipantType'] do
specify { expect(described_class.graphql_name).to eq('OncallParticipantType') }
it 'exposes the expected fields' do
expected_fields = %i[
id
user
color_palette
color_weight
]
expect(described_class).to have_graphql_fields(*expected_fields)
end
end
...@@ -13,6 +13,7 @@ RSpec.describe GitlabSchema.types['IncidentManagementOncallSchedule'] do ...@@ -13,6 +13,7 @@ RSpec.describe GitlabSchema.types['IncidentManagementOncallSchedule'] do
name name
description description
timezone timezone
oncall_rotations
] ]
expect(described_class).to have_graphql_fields(*expected_fields) expect(described_class).to have_graphql_fields(*expected_fields)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment