diff options
Diffstat (limited to 'app')
21 files changed, 12 insertions, 119 deletions
diff --git a/app/assets/images/ci_favicons/canary/favicon_status_scheduled.ico b/app/assets/images/ci_favicons/canary/favicon_status_scheduled.ico Binary files differdeleted file mode 100644 index 5444b8e41dc..00000000000 --- a/app/assets/images/ci_favicons/canary/favicon_status_scheduled.ico +++ /dev/null diff --git a/app/assets/images/ci_favicons/favicon_status_scheduled.png b/app/assets/images/ci_favicons/favicon_status_scheduled.png Binary files differdeleted file mode 100644 index d198c255fdd..00000000000 --- a/app/assets/images/ci_favicons/favicon_status_scheduled.png +++ /dev/null diff --git a/app/assets/javascripts/lib/utils/datetime_utility.js b/app/assets/javascripts/lib/utils/datetime_utility.js index abfcf1eaf3f..1f66fa811ea 100644 --- a/app/assets/javascripts/lib/utils/datetime_utility.js +++ b/app/assets/javascripts/lib/utils/datetime_utility.js @@ -370,23 +370,3 @@ window.gl.utils = { getTimeago, localTimeAgo, }; - -/** - * Formats milliseconds as timestamp (e.g. 01:02:03). - * - * @param milliseconds - * @returns {string} - */ -export const formatTime = milliseconds => { - const remainingSeconds = Math.floor(milliseconds / 1000) % 60; - const remainingMinutes = Math.floor(milliseconds / 1000 / 60) % 60; - const remainingHours = Math.floor(milliseconds / 1000 / 60 / 60); - let formattedTime = ''; - if (remainingHours < 10) formattedTime += '0'; - formattedTime += `${remainingHours}:`; - if (remainingMinutes < 10) formattedTime += '0'; - formattedTime += `${remainingMinutes}:`; - if (remainingSeconds < 10) formattedTime += '0'; - formattedTime += remainingSeconds; - return formattedTime; -}; diff --git a/app/assets/javascripts/pipelines/components/pipelines_actions.vue b/app/assets/javascripts/pipelines/components/pipelines_actions.vue index 1768c7dc2b3..017dd560621 100644 --- a/app/assets/javascripts/pipelines/components/pipelines_actions.vue +++ b/app/assets/javascripts/pipelines/components/pipelines_actions.vue @@ -1,6 +1,4 @@ <script> -import { s__, sprintf } from '~/locale'; -import { formatTime } from '~/lib/utils/datetime_utility'; import eventHub from '../event_hub'; import icon from '../../vue_shared/components/icon.vue'; import tooltip from '../../vue_shared/directives/tooltip'; @@ -24,17 +22,10 @@ export default { }; }, methods: { - onClickAction(action) { - const confirmationMessage = sprintf(s__("DelayedJobs|Are you sure you want to run %{jobName} immediately? This job will run automatically after it's timer finishes."), { jobName: action.name }); - // https://gitlab.com/gitlab-org/gitlab-ce/issues/52099 - // eslint-disable-next-line no-alert - if (!window.confirm(confirmationMessage)) { - return; - } - + onClickAction(endpoint) { this.isLoading = true; - eventHub.$emit('postAction', action.path); + eventHub.$emit('postAction', endpoint); }, isActionDisabled(action) { @@ -44,11 +35,6 @@ export default { return !action.playable; }, - - remainingTime(action) { - const remainingMilliseconds = new Date(action.scheduled_at).getTime() - Date.now(); - return formatTime(remainingMilliseconds); - }, }, }; </script> @@ -77,24 +63,17 @@ export default { <ul class="dropdown-menu dropdown-menu-right"> <li - v-for="action in actions" - :key="action.path" + v-for="(action, i) in actions" + :key="i" > <button :class="{ disabled: isActionDisabled(action) }" :disabled="isActionDisabled(action)" type="button" class="js-pipeline-action-link no-btn btn" - @click="onClickAction(action)" + @click="onClickAction(action.path)" > {{ action.name }} - <span - v-if="action.scheduled_at" - class="pull-right" - > - <icon name="clock" /> - {{ remainingTime(action) }} - </span> </button> </li> </ul> diff --git a/app/assets/javascripts/pipelines/components/pipelines_table_row.vue b/app/assets/javascripts/pipelines/components/pipelines_table_row.vue index bae6ff43ee4..a39cc265601 100644 --- a/app/assets/javascripts/pipelines/components/pipelines_table_row.vue +++ b/app/assets/javascripts/pipelines/components/pipelines_table_row.vue @@ -59,9 +59,6 @@ export default { }; }, computed: { - actions() { - return [...this.pipeline.details.manual_actions, ...this.pipeline.details.scheduled_actions]; - }, /** * If provided, returns the commit tag. * Needed to render the commit component column. @@ -324,8 +321,8 @@ export default { > <div class="btn-group table-action-buttons"> <pipelines-actions-component - v-if="actions.length > 0" - :actions="actions" + v-if="pipeline.details.manual_actions.length" + :actions="pipeline.details.manual_actions" /> <pipelines-artifacts-component diff --git a/app/assets/stylesheets/framework/buttons.scss b/app/assets/stylesheets/framework/buttons.scss index c4296c7a88a..686ce0c63a4 100644 --- a/app/assets/stylesheets/framework/buttons.scss +++ b/app/assets/stylesheets/framework/buttons.scss @@ -360,10 +360,6 @@ i { color: $gl-text-color-secondary; } - - svg { - fill: $gl-text-color-secondary; - } } .clone-dropdown-btn a { diff --git a/app/assets/stylesheets/framework/icons.scss b/app/assets/stylesheets/framework/icons.scss index abd26e38d18..f002edced8a 100644 --- a/app/assets/stylesheets/framework/icons.scss +++ b/app/assets/stylesheets/framework/icons.scss @@ -64,7 +64,6 @@ } } -.ci-status-icon-scheduled, .ci-status-icon-manual { svg { fill: $gl-text-color; diff --git a/app/assets/stylesheets/pages/pipelines.scss b/app/assets/stylesheets/pages/pipelines.scss index 14395cc59b0..8bb8b83dc5e 100644 --- a/app/assets/stylesheets/pages/pipelines.scss +++ b/app/assets/stylesheets/pages/pipelines.scss @@ -760,7 +760,6 @@ } &.ci-status-icon-canceled, - &.ci-status-icon-scheduled, &.ci-status-icon-disabled, &.ci-status-icon-not-found, &.ci-status-icon-manual { diff --git a/app/assets/stylesheets/pages/status.scss b/app/assets/stylesheets/pages/status.scss index 7d59dd3b5d1..620297e589d 100644 --- a/app/assets/stylesheets/pages/status.scss +++ b/app/assets/stylesheets/pages/status.scss @@ -27,7 +27,6 @@ &.ci-canceled, &.ci-disabled, - &.ci-scheduled, &.ci-manual { color: $gl-text-color; border-color: $gl-text-color; diff --git a/app/controllers/projects/jobs_controller.rb b/app/controllers/projects/jobs_controller.rb index 9c9bbe04947..3f85e442be9 100644 --- a/app/controllers/projects/jobs_controller.rb +++ b/app/controllers/projects/jobs_controller.rb @@ -110,13 +110,6 @@ class Projects::JobsController < Projects::ApplicationController redirect_to build_path(@build) end - def unschedule - return respond_422 unless @build.scheduled? - - @build.unschedule! - redirect_to build_path(@build) - end - def status render json: BuildSerializer .new(project: @project, current_user: @current_user) diff --git a/app/helpers/ci_status_helper.rb b/app/helpers/ci_status_helper.rb index 6f9e2ef78cd..136772e1ec3 100644 --- a/app/helpers/ci_status_helper.rb +++ b/app/helpers/ci_status_helper.rb @@ -20,8 +20,6 @@ module CiStatusHelper 'passed with warnings' when 'manual' 'waiting for manual action' - when 'scheduled' - 'waiting for delayed job' else status end @@ -41,8 +39,6 @@ module CiStatusHelper s_('CiStatusText|passed') when 'manual' s_('CiStatusText|blocked') - when 'scheduled' - s_('CiStatusText|scheduled') else # All states are already being translated inside the detailed statuses: # :running => Gitlab::Ci::Status::Running @@ -87,8 +83,6 @@ module CiStatusHelper 'status_skipped' when 'manual' 'status_manual' - when 'scheduled' - 'status_scheduled' else 'status_canceled' end diff --git a/app/helpers/time_helper.rb b/app/helpers/time_helper.rb index 3e6a301b77d..94044d7b85e 100644 --- a/app/helpers/time_helper.rb +++ b/app/helpers/time_helper.rb @@ -21,17 +21,9 @@ module TimeHelper "#{from.to_s(:short)} - #{to.to_s(:short)}" end - def duration_in_numbers(duration_in_seconds, allow_overflow = false) - if allow_overflow - seconds = duration_in_seconds % 1.minute - minutes = (duration_in_seconds / 1.minute) % (1.hour / 1.minute) - hours = duration_in_seconds / 1.hour + def duration_in_numbers(duration) + time_format = duration < 1.hour ? "%M:%S" : "%H:%M:%S" - "%02d:%02d:%02d" % [hours, minutes, seconds] - else - time_format = duration_in_seconds < 1.hour ? "%M:%S" : "%H:%M:%S" - - Time.at(duration_in_seconds).utc.strftime(time_format) - end + Time.at(duration).utc.strftime(time_format) end end diff --git a/app/presenters/ci/build_presenter.rb b/app/presenters/ci/build_presenter.rb index 33056a809b7..5331cdf632b 100644 --- a/app/presenters/ci/build_presenter.rb +++ b/app/presenters/ci/build_presenter.rb @@ -35,10 +35,6 @@ module Ci "#{subject.name} - #{detailed_status.status_tooltip}" end - def execute_in - scheduled? && scheduled_at && [0, scheduled_at - Time.now].max - end - private def tooltip_for_badge diff --git a/app/presenters/commit_status_presenter.rb b/app/presenters/commit_status_presenter.rb index 29eaad759bb..65e77ea3f92 100644 --- a/app/presenters/commit_status_presenter.rb +++ b/app/presenters/commit_status_presenter.rb @@ -8,8 +8,7 @@ class CommitStatusPresenter < Gitlab::View::Presenter::Delegated stuck_or_timeout_failure: 'There has been a timeout failure or the job got stuck. Check your timeout limits or try again', runner_system_failure: 'There has been a runner system failure, please try again', missing_dependency_failure: 'There has been a missing dependency failure', - runner_unsupported: 'Your runner is outdated, please upgrade your runner', - stale_schedule: 'Delayed job could not be executed by some reason, please try again' + runner_unsupported: 'Your runner is outdated, please upgrade your runner' }.freeze private_constant :CALLOUT_FAILURE_MESSAGES diff --git a/app/serializers/build_action_entity.rb b/app/serializers/build_action_entity.rb index 0db7875aa87..f9da3f63911 100644 --- a/app/serializers/build_action_entity.rb +++ b/app/serializers/build_action_entity.rb @@ -12,11 +12,6 @@ class BuildActionEntity < Grape::Entity end expose :playable?, as: :playable - expose :scheduled_at, if: -> (build) { build.scheduled? } - - expose :unschedule_path, if: -> (build) { build.scheduled? } do |build| - unschedule_project_job_path(build.project, build) - end private diff --git a/app/serializers/job_entity.rb b/app/serializers/job_entity.rb index dd6c2fa1a6d..26b29993fec 100644 --- a/app/serializers/job_entity.rb +++ b/app/serializers/job_entity.rb @@ -25,7 +25,6 @@ class JobEntity < Grape::Entity end expose :playable?, as: :playable - expose :scheduled_at expose :created_at expose :updated_at expose :detailed_status, as: :status, with: DetailedStatusEntity diff --git a/app/serializers/pipeline_details_entity.rb b/app/serializers/pipeline_details_entity.rb index d78ad4af4dc..3b56767f774 100644 --- a/app/serializers/pipeline_details_entity.rb +++ b/app/serializers/pipeline_details_entity.rb @@ -5,6 +5,5 @@ class PipelineDetailsEntity < PipelineEntity expose :ordered_stages, as: :stages, using: StageEntity expose :artifacts, using: BuildArtifactEntity expose :manual_actions, using: BuildActionEntity - expose :scheduled_actions, using: BuildActionEntity end end diff --git a/app/serializers/pipeline_serializer.rb b/app/serializers/pipeline_serializer.rb index 7451433a841..4f31af3c46d 100644 --- a/app/serializers/pipeline_serializer.rb +++ b/app/serializers/pipeline_serializer.rb @@ -13,7 +13,6 @@ class PipelineSerializer < BaseSerializer :cancelable_statuses, :trigger_requests, :manual_actions, - :scheduled_actions, :artifacts, { pending_builds: :project, diff --git a/app/views/projects/ci/builds/_build.html.haml b/app/views/projects/ci/builds/_build.html.haml index 59c297c46a5..44c1453e239 100644 --- a/app/views/projects/ci/builds/_build.html.haml +++ b/app/views/projects/ci/builds/_build.html.haml @@ -47,9 +47,7 @@ %span.badge.badge-info triggered - if job.try(:allow_failure) %span.badge.badge-danger allowed to fail - - if job.schedulable? - %span.badge.badge-info= s_('DelayedJobs|scheduled') - - elsif job.action? + - if job.action? %span.badge.badge-info manual - if pipeline_link @@ -103,24 +101,6 @@ - if job.active? = link_to cancel_project_job_path(job.project, job, return_to: request.original_url), method: :post, title: 'Cancel', class: 'btn btn-build' do = icon('remove', class: 'cred') - - elsif job.scheduled? - .btn-group - .btn.btn-default.has-tooltip{ disabled: true, - title: job.scheduled_at } - = sprite_icon('planning') - = duration_in_numbers(job.execute_in, true) - - confirmation_message = s_("DelayedJobs|Are you sure you want to run %{job_name} immediately? This job will run automatically after it's timer finishes.") % { job_name: job.name } - = link_to play_project_job_path(job.project, job, return_to: request.original_url), - method: :post, - title: s_('DelayedJobs|Start now'), - class: 'btn btn-default btn-build has-tooltip', - data: { confirm: confirmation_message } do - = sprite_icon('play') - = link_to unschedule_project_job_path(job.project, job, return_to: request.original_url), - method: :post, - title: s_('DelayedJobs|Unschedule'), - class: 'btn btn-default btn-build has-tooltip' do - = sprite_icon('time-out') - elsif allow_retry - if job.playable? && !admin && can?(current_user, :update_build, job) = link_to play_project_job_path(job.project, job, return_to: request.original_url), method: :post, title: 'Play', class: 'btn btn-build' do diff --git a/app/views/shared/icons/_icon_status_scheduled.svg b/app/views/shared/icons/_icon_status_scheduled.svg deleted file mode 100644 index ca6e4efce50..00000000000 --- a/app/views/shared/icons/_icon_status_scheduled.svg +++ /dev/null @@ -1 +0,0 @@ -<svg width="14" height="14" viewBox="0 0 14 14" xmlns="http://www.w3.org/2000/svg"><circle cx="7" cy="7" r="7"/><circle fill="#FFF" cx="7" cy="7" r="6"/><g transform="translate(2.75 2.75)" fill-rule="nonzero"><path d="M4.165 7.81a3.644 3.644 0 1 1 0-7.29 3.644 3.644 0 0 1 0 7.29zm0-1.042a2.603 2.603 0 1 0 0-5.206 2.603 2.603 0 0 0 0 5.206z"/><rect x="3.644" y="2.083" width="1.041" height="2.603" rx=".488"/><rect x="3.644" y="3.644" width="2.083" height="1.041" rx=".488"/></g></svg>
\ No newline at end of file diff --git a/app/views/shared/icons/_icon_status_scheduled_borderless.svg b/app/views/shared/icons/_icon_status_scheduled_borderless.svg deleted file mode 100644 index dc38c01d898..00000000000 --- a/app/views/shared/icons/_icon_status_scheduled_borderless.svg +++ /dev/null @@ -1 +0,0 @@ -<svg width="22px" height="22px" viewBox="0 0 22 22" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M6.16 11.55a5.39 5.39 0 1 1 0-10.78 5.39 5.39 0 0 1 0 10.78zm0-1.54a3.85 3.85 0 1 0 0-7.7 3.85 3.85 0 0 0 0 7.7z"/><rect x="5.39" y="3.08" width="1.54" height="3.85" rx=".767"/><rect x="5.39" y="5.39" width="3.08" height="1.54" rx=".767"/></svg>
\ No newline at end of file |