diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-10-18 19:13:46 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-10-18 19:13:46 +0300 |
commit | 55a3913692e3341124adec08608f87e30c461603 (patch) | |
tree | c387967ee20374b9699fd1f669dd40b9570142e4 | |
parent | f1ed8e540f1755b939a41700f34c136a2b530c19 (diff) |
Add latest changes from gitlab-org/gitlab@16-4-stable-ee
4 files changed, 16 insertions, 3 deletions
diff --git a/app/assets/javascripts/ci/pipeline_schedules/components/table/cells/pipeline_schedule_actions.vue b/app/assets/javascripts/ci/pipeline_schedules/components/table/cells/pipeline_schedule_actions.vue index a56da06f5da..ed7c2bbeb73 100644 --- a/app/assets/javascripts/ci/pipeline_schedules/components/table/cells/pipeline_schedule_actions.vue +++ b/app/assets/javascripts/ci/pipeline_schedules/components/table/cells/pipeline_schedule_actions.vue @@ -34,7 +34,7 @@ export default { return this.schedule.userPermissions.playPipelineSchedule; }, isCurrentUserOwner() { - return this.schedule.owner.username === this.currentUser.username; + return this.schedule.owner?.username === this.currentUser.username; }, canTakeOwnership() { return !this.isCurrentUserOwner && this.schedule.userPermissions.adminPipelineSchedule; diff --git a/app/graphql/types/ci/pipeline_schedule_type.rb b/app/graphql/types/ci/pipeline_schedule_type.rb index e2e3bd8cfbd..cb4d9860fab 100644 --- a/app/graphql/types/ci/pipeline_schedule_type.rb +++ b/app/graphql/types/ci/pipeline_schedule_type.rb @@ -17,7 +17,7 @@ module Types field :description, GraphQL::Types::String, null: true, description: 'Description of the pipeline schedule.' - field :owner, ::Types::UserType, null: false, description: 'Owner of the pipeline schedule.' + field :owner, ::Types::UserType, null: true, description: 'Owner of the pipeline schedule.' field :active, GraphQL::Types::Boolean, null: false, description: 'Indicates if the pipeline schedule is active.' diff --git a/doc/api/graphql/reference/index.md b/doc/api/graphql/reference/index.md index 65736f10ba9..0267d439bb8 100644 --- a/doc/api/graphql/reference/index.md +++ b/doc/api/graphql/reference/index.md @@ -21736,7 +21736,7 @@ Represents a pipeline schedule. | <a id="pipelinescheduleid"></a>`id` | [`ID!`](#id) | ID of the pipeline schedule. | | <a id="pipelineschedulelastpipeline"></a>`lastPipeline` | [`Pipeline`](#pipeline) | Last pipeline object. | | <a id="pipelineschedulenextrunat"></a>`nextRunAt` | [`Time!`](#time) | Time when the next pipeline will run. | -| <a id="pipelinescheduleowner"></a>`owner` | [`UserCore!`](#usercore) | Owner of the pipeline schedule. | +| <a id="pipelinescheduleowner"></a>`owner` | [`UserCore`](#usercore) | Owner of the pipeline schedule. | | <a id="pipelinescheduleproject"></a>`project` | [`Project`](#project) | Project of the pipeline schedule. | | <a id="pipelineschedulerealnextrun"></a>`realNextRun` | [`Time!`](#time) | Time when the next pipeline will run. | | <a id="pipelinescheduleref"></a>`ref` | [`String`](#string) | Ref of the pipeline schedule. | diff --git a/spec/features/projects/pipeline_schedules_spec.rb b/spec/features/projects/pipeline_schedules_spec.rb index 322d25ed052..599f5a1ffb7 100644 --- a/spec/features/projects/pipeline_schedules_spec.rb +++ b/spec/features/projects/pipeline_schedules_spec.rb @@ -29,6 +29,19 @@ RSpec.describe 'Pipeline Schedules', :js, feature_category: :groups_and_projects expect(page).to have_content(s_('PipelineSchedules|Edit pipeline schedule')) end + + context 'when the owner is nil' do + before do + pipeline_schedule.update!(owner_id: nil, description: "#{FFaker::Product.product_name} pipeline schedule") + visit_pipelines_schedules + end + + it 'shows the pipeline' do + within_testid('pipeline-schedule-table-row') do + expect(page).to have_content(pipeline_schedule.description) + end + end + end end describe 'PATCH /projects/pipelines_schedules/:id/edit' do |