diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-06-13 21:11:14 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-06-13 21:11:14 +0300 |
commit | 4a064b8dc0bf350b1b3000698042b49113e758d1 (patch) | |
tree | c6db9e3d9fbe1c6368aa024ae0fea1fcebd10e8c /app | |
parent | effc12bf9dac4bf1e48f1397c25e0381ac1bd76f (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app')
5 files changed, 44 insertions, 6 deletions
diff --git a/app/assets/javascripts/google_cloud/databases/service_table.vue b/app/assets/javascripts/google_cloud/databases/service_table.vue index 80bd6ef28fb..f0489ab1f5b 100644 --- a/app/assets/javascripts/google_cloud/databases/service_table.vue +++ b/app/assets/javascripts/google_cloud/databases/service_table.vue @@ -48,7 +48,7 @@ const i18n = { ), }; -const helpUrlSecrets = helpPagePath('ee/ci/secrets'); +const helpUrlSecrets = helpPagePath('ci/secrets/index'); export default { components: { GlAlert, GlButton, GlLink, GlSprintf, GlTable }, diff --git a/app/assets/javascripts/pipelines/components/pipeline_details_header.vue b/app/assets/javascripts/pipelines/components/pipeline_details_header.vue index bf8fc2d27a1..d4cdae5d69c 100644 --- a/app/assets/javascripts/pipelines/components/pipeline_details_header.vue +++ b/app/assets/javascripts/pipelines/components/pipeline_details_header.vue @@ -11,8 +11,9 @@ import { GlSprintf, GlTooltipDirective, } from '@gitlab/ui'; +import { timeIntervalInWords } from '~/lib/utils/datetime_utility'; import { setUrlFragment, redirectTo } from '~/lib/utils/url_utility'; // eslint-disable-line import/no-deprecated -import { __, s__, sprintf } from '~/locale'; +import { __, s__, sprintf, formatNumber } from '~/locale'; import { getIdFromGraphQLId } from '~/graphql_shared/utils'; import ClipboardButton from '~/vue_shared/components/clipboard_button.vue'; import CiBadgeLink from '~/vue_shared/components/ci_badge_link.vue'; @@ -276,9 +277,24 @@ export default { inProgress() { return this.status === 'RUNNING'; }, + duration() { + return this.pipeline?.duration || 0; + }, + durationFormatted() { + return timeIntervalInWords(this.duration); + }, + queuedDuration() { + return this.pipeline?.queuedDuration || 0; + }, inProgressText() { return sprintf(__('In progress, queued for %{queuedDuration} seconds'), { - queuedDuration: this.pipeline?.queuedDuration || 0, + queuedDuration: formatNumber(this.queuedDuration), + }); + }, + durationText() { + return sprintf(__('%{duration}, queued for %{queuedDuration} seconds'), { + duration: this.durationFormatted, + queuedDuration: formatNumber(this.queuedDuration), }); }, canRetryPipeline() { @@ -369,7 +385,13 @@ export default { <template> <div class="gl-my-4"> - <gl-alert v-if="hasError" :title="failure.text" :variant="failure.variant" :dismissible="false"> + <gl-alert + v-if="hasError" + class="gl-mb-4" + :title="failure.text" + :variant="failure.variant" + :dismissible="false" + > <div v-for="(failureMessage, index) in failureMessages" :key="`failure-message-${index}`"> {{ failureMessage }} </div> @@ -538,6 +560,10 @@ export default { <gl-icon name="timer" /> {{ inProgressText }} </span> + <span v-if="duration" class="gl-ml-2" data-testid="pipeline-duration-text"> + <gl-icon name="timer" /> + {{ durationText }} + </span> </div> </div> <div> diff --git a/app/assets/javascripts/pipelines/graphql/queries/get_pipeline_header_data.query.graphql b/app/assets/javascripts/pipelines/graphql/queries/get_pipeline_header_data.query.graphql index 312d71e6e84..eb5643126a2 100644 --- a/app/assets/javascripts/pipelines/graphql/queries/get_pipeline_header_data.query.graphql +++ b/app/assets/javascripts/pipelines/graphql/queries/get_pipeline_header_data.query.graphql @@ -40,6 +40,7 @@ query getPipelineHeaderData($fullPath: ID!, $iid: ID!) { } finishedAt queuedDuration + duration } } } diff --git a/app/controllers/concerns/creates_commit.rb b/app/controllers/concerns/creates_commit.rb index 53bb11090c8..896004045f4 100644 --- a/app/controllers/concerns/creates_commit.rb +++ b/app/controllers/concerns/creates_commit.rb @@ -23,6 +23,8 @@ module CreatesCommit commit_params = @commit_params.merge( start_project: start_project, start_branch: @start_branch, + source_project: @project, + target_project: target_project, branch_name: @branch_name ) diff --git a/app/services/commits/cherry_pick_service.rb b/app/services/commits/cherry_pick_service.rb index 7e982bf7686..2a634c5ec71 100644 --- a/app/services/commits/cherry_pick_service.rb +++ b/app/services/commits/cherry_pick_service.rb @@ -2,9 +2,18 @@ module Commits class CherryPickService < ChangeService + def initialize(*args) + super + + @start_project = params[:target_project] || @project + @source_project = params[:source_project] || @project + end + def create_commit! - commit_change(:cherry_pick).tap do |sha| - track_mr_picking(sha) + Gitlab::Git::CrossRepo.new(@project.repository, @source_project.repository).execute(@commit.id) do + commit_change(:cherry_pick).tap do |sha| + track_mr_picking(sha) + end end end |