diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2019-12-06 21:07:44 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2019-12-06 21:07:44 +0300 |
commit | e1867c38fc5a4b931b4b2256d4909182e94f1051 (patch) | |
tree | 3047b637f7f9a31e74c62d3fe054b24c95e3534e /app | |
parent | 63894d59abd34f76f399d755012cdcd32c5b1103 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app')
-rw-r--r-- | app/assets/javascripts/error_tracking_settings/components/error_tracking_form.vue | 10 | ||||
-rw-r--r-- | app/controllers/projects/raw_controller.rb | 6 | ||||
-rw-r--r-- | app/finders/pipelines_finder.rb | 8 | ||||
-rw-r--r-- | app/helpers/blob_helper.rb | 19 | ||||
-rw-r--r-- | app/models/ci/pipeline.rb | 5 | ||||
-rw-r--r-- | app/models/concerns/ci/processable.rb | 2 | ||||
-rw-r--r-- | app/services/ci/retry_pipeline_service.rb | 14 |
7 files changed, 56 insertions, 8 deletions
diff --git a/app/assets/javascripts/error_tracking_settings/components/error_tracking_form.vue b/app/assets/javascripts/error_tracking_settings/components/error_tracking_form.vue index d86116aa315..9f77fe8cd59 100644 --- a/app/assets/javascripts/error_tracking_settings/components/error_tracking_form.vue +++ b/app/assets/javascripts/error_tracking_settings/components/error_tracking_form.vue @@ -32,12 +32,16 @@ export default { placeholder="https://mysentryserver.com" @input="updateApiHost" /> + <p class="form-text text-muted"> + {{ + s__( + "ErrorTracking|If you self-host Sentry, enter the full URL of your Sentry instance. If you're using Sentry's hosted solution, enter https://sentry.io", + ) + }} + </p> <!-- eslint-enable @gitlab/vue-i18n/no-bare-attribute-strings --> </div> </div> - <p class="form-text text-muted"> - {{ s__('ErrorTracking|Find your hostname in your Sentry account settings page') }} - </p> </div> <div class="form-group" :class="{ 'gl-show-field-errors': connectError }"> <label class="label-bold" for="error-tracking-token"> diff --git a/app/controllers/projects/raw_controller.rb b/app/controllers/projects/raw_controller.rb index 985587268c5..f39d98be516 100644 --- a/app/controllers/projects/raw_controller.rb +++ b/app/controllers/projects/raw_controller.rb @@ -4,11 +4,15 @@ class Projects::RawController < Projects::ApplicationController include ExtractsPath include SendsBlob + include StaticObjectExternalStorage + + prepend_before_action(only: [:show]) { authenticate_sessionless_user!(:blob) } before_action :require_non_empty_project before_action :assign_ref_vars before_action :authorize_download_code! - before_action :show_rate_limit, only: [:show] + before_action :show_rate_limit, only: [:show], unless: :external_storage_request? + before_action :redirect_to_external_storage, only: :show, if: :static_objects_external_storage_enabled? def show @blob = @repository.blob_at(@commit.id, @path) diff --git a/app/finders/pipelines_finder.rb b/app/finders/pipelines_finder.rb index 092a805f275..5a0d53d9683 100644 --- a/app/finders/pipelines_finder.rb +++ b/app/finders/pipelines_finder.rb @@ -25,6 +25,7 @@ class PipelinesFinder items = by_name(items) items = by_username(items) items = by_yaml_errors(items) + items = by_updated_at(items) sort_items(items) end @@ -128,6 +129,13 @@ class PipelinesFinder end # rubocop: enable CodeReuse/ActiveRecord + def by_updated_at(items) + items = items.updated_before(params[:updated_before]) if params[:updated_before].present? + items = items.updated_after(params[:updated_after]) if params[:updated_after].present? + + items + end + # rubocop: disable CodeReuse/ActiveRecord def sort_items(items) order_by = if ALLOWED_INDEXED_COLUMNS.include?(params[:order_by]) diff --git a/app/helpers/blob_helper.rb b/app/helpers/blob_helper.rb index 659f9778892..656e6039dbd 100644 --- a/app/helpers/blob_helper.rb +++ b/app/helpers/blob_helper.rb @@ -215,14 +215,29 @@ module BlobHelper return if blob.binary? || blob.stored_externally? title = _('Open raw') - link_to icon('file-code-o'), blob_raw_path, class: 'btn btn-sm has-tooltip', target: '_blank', rel: 'noopener noreferrer', title: title, data: { container: 'body' } + link_to sprite_icon('doc-code'), + external_storage_url_or_path(blob_raw_path), + class: 'btn btn-sm has-tooltip', + target: '_blank', + rel: 'noopener noreferrer', + aria: { label: title }, + title: title, + data: { container: 'body' } end def download_blob_button(blob) return if blob.empty? title = _('Download') - link_to sprite_icon('download'), blob_raw_path(inline: false), download: @path, class: 'btn btn-sm has-tooltip', target: '_blank', rel: 'noopener noreferrer', title: title, data: { container: 'body' } + link_to sprite_icon('download'), + external_storage_url_or_path(blob_raw_path(inline: false)), + download: @path, + class: 'btn btn-sm has-tooltip', + target: '_blank', + rel: 'noopener noreferrer', + aria: { label: title }, + title: title, + data: { container: 'body' } end def blob_render_error_reason(viewer) diff --git a/app/models/ci/pipeline.rb b/app/models/ci/pipeline.rb index c3292d7524e..0b1d17a9e12 100644 --- a/app/models/ci/pipeline.rb +++ b/app/models/ci/pipeline.rb @@ -14,6 +14,7 @@ module Ci include HasRef include ShaAttribute include FromUnion + include UpdatedAtFilterable sha_attribute :source_sha sha_attribute :target_sha @@ -811,6 +812,10 @@ module Ci @persistent_ref ||= PersistentRef.new(pipeline: self) end + def find_successful_build_ids_by_names(names) + statuses.latest.success.where(name: names).pluck(:id) + end + private def pipeline_data diff --git a/app/models/concerns/ci/processable.rb b/app/models/concerns/ci/processable.rb index ed0087f34d4..c229358ad17 100644 --- a/app/models/concerns/ci/processable.rb +++ b/app/models/concerns/ci/processable.rb @@ -14,6 +14,8 @@ module Ci has_many :needs, class_name: 'Ci::BuildNeed', foreign_key: :build_id, inverse_of: :build accepts_nested_attributes_for :needs + + scope :preload_needs, -> { preload(:needs) } end def schedulable? diff --git a/app/services/ci/retry_pipeline_service.rb b/app/services/ci/retry_pipeline_service.rb index 1f747aac98f..7d01de9ee68 100644 --- a/app/services/ci/retry_pipeline_service.rb +++ b/app/services/ci/retry_pipeline_service.rb @@ -9,13 +9,23 @@ module Ci raise Gitlab::Access::AccessDeniedError end - pipeline.retryable_builds.find_each do |build| + needs = Set.new + + pipeline.retryable_builds.preload_needs.find_each do |build| next unless can?(current_user, :update_build, build) Ci::RetryBuildService.new(project, current_user) .reprocess!(build) + + needs += build.needs.map(&:name) end + # In a DAG, the dependencies may have already completed. Figure out + # which builds have succeeded and use them to update the pipeline. If we don't + # do this, then builds will be stuck in the created state since their dependencies + # will never run. + completed_build_ids = pipeline.find_successful_build_ids_by_names(needs) if needs.any? + pipeline.builds.latest.skipped.find_each do |skipped| retry_optimistic_lock(skipped) { |build| build.process } end @@ -26,7 +36,7 @@ module Ci Ci::ProcessPipelineService .new(pipeline) - .execute + .execute(completed_build_ids) end end end |