Skip to content
代码片段 群组 项目
提交 606a59ff 编辑于 作者: Vitali Tatarintev's avatar Vitali Tatarintev
浏览文件

Merge branch 'sy-allow-more-shifts-per-request' into 'master'

Expose enough shifts records to fill an on-call schedule

See merge request gitlab-org/gitlab!55801
No related branches found
No related tags found
无相关合并请求
...@@ -3,6 +3,8 @@ ...@@ -3,6 +3,8 @@
module Types module Types
module IncidentManagement module IncidentManagement
class OncallRotationType < BaseObject class OncallRotationType < BaseObject
MAX_SHIFTS_FOR_TIMEFRAME = 350
graphql_name 'IncidentManagementOncallRotation' graphql_name 'IncidentManagementOncallRotation'
description 'Describes an incident management on-call rotation' description 'Describes an incident management on-call rotation'
...@@ -52,6 +54,7 @@ class OncallRotationType < BaseObject ...@@ -52,6 +54,7 @@ class OncallRotationType < BaseObject
::Types::IncidentManagement::OncallShiftType.connection_type, ::Types::IncidentManagement::OncallShiftType.connection_type,
null: true, null: true,
description: 'Blocks of time for which a participant is on-call within a given time frame. Time frame cannot exceed one month.', description: 'Blocks of time for which a participant is on-call within a given time frame. Time frame cannot exceed one month.',
max_page_size: MAX_SHIFTS_FOR_TIMEFRAME,
resolver: ::Resolvers::IncidentManagement::OncallShiftsResolver resolver: ::Resolvers::IncidentManagement::OncallShiftsResolver
end end
end end
......
...@@ -22,4 +22,9 @@ ...@@ -22,4 +22,9 @@
expect(described_class).to have_graphql_fields(*expected_fields) expect(described_class).to have_graphql_fields(*expected_fields)
end end
it 'returns enough records to cover 2 weeks of hour-long shifts' do
expect(described_class::MAX_SHIFTS_FOR_TIMEFRAME).to be > 14 * 24 # 14 days * 24 hours
expect(described_class).to have_graphql_field(:shifts, max_page_size: described_class::MAX_SHIFTS_FOR_TIMEFRAME)
end
end end
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册