Skip to content
Snippets Groups Projects
Commit b570d73e authored by GitLab Bot's avatar GitLab Bot
Browse files

Add latest changes from gitlab-org/gitlab@master

parent 34b3567c
No related branches found
No related tags found
No related merge requests found
Showing
with 93 additions and 42 deletions
Loading
Loading
@@ -188,6 +188,7 @@ module ProjectsHelper
"cross-project:#{can?(current_user, :read_cross_project)}",
max_project_member_access_cache_key(project),
pipeline_status,
Gitlab::I18n.locale,
'v2.6'
]
 
Loading
Loading
Loading
Loading
@@ -599,12 +599,6 @@ module Ci
project.notes.for_commit_id(sha)
end
 
# rubocop: disable CodeReuse/ServiceClass
def process!(trigger_build_ids = nil)
Ci::ProcessPipelineService.new(project, user).execute(self, trigger_build_ids)
end
# rubocop: enable CodeReuse/ServiceClass
def update_status
retry_optimistic_lock(self) do
new_status = latest_builds_status.to_s
Loading
Loading
Loading
Loading
@@ -23,7 +23,6 @@ module Issuable
include Sortable
include CreatedAtFilterable
include UpdatedAtFilterable
include IssuableStates
include ClosedAtFilterable
include VersionedDescription
 
Loading
Loading
# frozen_string_literal: true
module IssuableStates
extend ActiveSupport::Concern
# The state:string column is being migrated to state_id:integer column
# This is a temporary hook to keep state column in sync until it is removed.
# Check https: https://gitlab.com/gitlab-org/gitlab/issues/33814 for more information
# The state column can be safely removed after 2019-10-27
included do
before_save :sync_issuable_deprecated_state
end
def sync_issuable_deprecated_state
return if self.is_a?(Epic)
return unless respond_to?(:state)
return if state_id.nil?
deprecated_state = self.class.available_states.key(state_id)
self.write_attribute(:state, deprecated_state)
end
end
Loading
Loading
@@ -66,7 +66,10 @@ class Issue < ApplicationRecord
scope :public_only, -> { where(confidential: false) }
scope :confidential_only, -> { where(confidential: true) }
 
scope :counts_by_state, -> { reorder(nil).group(:state).count }
scope :counts_by_state, -> { reorder(nil).group(:state_id).count }
# Only remove after 2019-12-22 and with %12.7
self.ignored_columns += %i[state]
 
after_commit :expire_etag_cache
after_save :ensure_metrics, unless: :imported?
Loading
Loading
Loading
Loading
@@ -228,6 +228,9 @@ class MergeRequest < ApplicationRecord
with_state(:opened).where(auto_merge_enabled: true)
end
 
# Only remove after 2019-12-22 and with %12.7
self.ignored_columns += %i[state]
after_save :keep_around_commit
 
alias_attribute :project, :target_project
Loading
Loading
Loading
Loading
@@ -58,6 +58,7 @@ class ReleasePresenter < Gitlab::View::Presenter::Delegated
end
 
def release_edit_page_available?
::Feature.enabled?(:release_edit_page, project, default_enabled: true)
::Feature.enabled?(:release_edit_page, project, default_enabled: true) &&
can?(current_user, :update_release, release)
end
end
# frozen_string_literal: true
 
class AnalyticsMergeRequestEntity < AnalyticsIssueEntity
expose :state
expose :state do |object|
MergeRequest.available_states.key(object[:state_id])
end
 
expose :url do |object|
url_to(:namespace_project_merge_request, object)
Loading
Loading
Loading
Loading
@@ -57,7 +57,9 @@ module Ci
cancel_pending_pipelines if project.auto_cancel_pending_pipelines?
pipeline_created_counter.increment(source: source)
 
pipeline.process!
Ci::ProcessPipelineService
.new(pipeline)
.execute
end
end
 
Loading
Loading
# frozen_string_literal: true
 
module Ci
class ProcessPipelineService < BaseService
class ProcessPipelineService
include Gitlab::Utils::StrongMemoize
 
attr_reader :pipeline
 
def execute(pipeline, trigger_build_ids = nil)
def initialize(pipeline)
@pipeline = pipeline
end
 
def execute(trigger_build_ids = nil)
update_retried
 
success = process_stages_without_needs
Loading
Loading
@@ -72,7 +74,7 @@ module Ci
 
def process_build(build, current_status)
Gitlab::OptimisticLocking.retry_lock(build) do |subject|
Ci::ProcessBuildService.new(project, @user)
Ci::ProcessBuildService.new(project, build.user)
.execute(subject, current_status)
end
end
Loading
Loading
@@ -129,5 +131,9 @@ module Ci
.update_all(retried: true) if latest_statuses.any?
end
# rubocop: enable CodeReuse/ActiveRecord
def project
pipeline.project
end
end
end
Loading
Loading
@@ -24,7 +24,9 @@ module Ci
.new(project, current_user)
.close_all(pipeline)
 
pipeline.process!
Ci::ProcessPipelineService
.new(pipeline)
.execute
end
end
end
Loading
Loading
@@ -397,7 +397,7 @@ class IssuableBaseService < BaseService
end
 
def update_project_counter_caches?(issuable)
issuable.state_changed?
issuable.state_id_changed?
end
 
def parent
Loading
Loading
Loading
Loading
@@ -11,7 +11,9 @@ class PipelineProcessWorker
# rubocop: disable CodeReuse/ActiveRecord
def perform(pipeline_id, build_ids = nil)
Ci::Pipeline.find_by(id: pipeline_id).try do |pipeline|
pipeline.process!(build_ids)
Ci::ProcessPipelineService
.new(pipeline)
.execute(build_ids)
end
end
# rubocop: enable CodeReuse/ActiveRecord
Loading
Loading
---
title: Creates DB tables for storing mentioned users, groups, projects referenced
in a note or issuable description
merge_request: 18316
author:
type: added
---
title: Add link color to design comments
merge_request: 20302
author:
type: fixed
---
title: Remove Release edit url for users not allowed to update a release
merge_request: 20136
author:
type: fixed
---
title: Fix projects list to show info in user's locale
merge_request: 20015
author: Arun Kumar Mohan
type: fixed
Loading
Loading
@@ -93,7 +93,7 @@ tables:
- updated_at
- description
- milestone_id
- state
- state_id
- updated_by_id
- weight
- due_date
Loading
Loading
@@ -174,7 +174,7 @@ tables:
- created_at
- updated_at
- milestone_id
- state
- state_id
- merge_status
- target_project_id
- updated_by_id
Loading
Loading
# frozen_string_literal: true
class CreateIssueUserMentions < ActiveRecord::Migration[5.2]
DOWNTIME = false
def change
create_table :issue_user_mentions do |t|
t.references :issue, type: :integer, index: false, null: false, foreign_key: { on_delete: :cascade }
t.references :note, type: :integer,
index: { where: 'note_id IS NOT NULL', unique: true }, null: true, foreign_key: { on_delete: :cascade }
t.integer :mentioned_users_ids, array: true
t.integer :mentioned_projects_ids, array: true
t.integer :mentioned_groups_ids, array: true
end
add_index :issue_user_mentions, [:issue_id], where: 'note_id is null', unique: true, name: 'issue_user_mentions_on_issue_id_index'
add_index :issue_user_mentions, [:issue_id, :note_id], unique: true, name: 'issue_user_mentions_on_issue_id_and_note_id_index'
end
end
# frozen_string_literal: true
class CreateMergeRequestUserMentions < ActiveRecord::Migration[5.2]
DOWNTIME = false
def change
create_table :merge_request_user_mentions do |t|
t.references :merge_request, type: :integer, index: false, null: false, foreign_key: { on_delete: :cascade }
t.references :note, type: :integer,
index: { where: 'note_id IS NOT NULL', unique: true }, null: true, foreign_key: { on_delete: :cascade }
t.integer :mentioned_users_ids, array: true
t.integer :mentioned_projects_ids, array: true
t.integer :mentioned_groups_ids, array: true
end
add_index :merge_request_user_mentions, [:merge_request_id], where: 'note_id is null', unique: true, name: 'merge_request_user_mentions_on_mr_id_index'
add_index :merge_request_user_mentions, [:merge_request_id, :note_id], unique: true, name: 'merge_request_user_mentions_on_mr_id_and_note_id_index'
end
end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment