summaryrefslogtreecommitdiff
path: root/app/models
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2019-11-19 12:06:00 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2019-11-19 12:06:00 +0000
commitb570d73ecd31e2ca9cf8c2f1adb056edf2869477 (patch)
tree0b8aa67eab6da552d8499f1fdcf9a7495dcf1379 /app/models
parent34b3567c97ecc0f317adae04e10e4d7d8c8830db (diff)
downloadgitlab-ce-b570d73ecd31e2ca9cf8c2f1adb056edf2869477.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/models')
-rw-r--r--app/models/ci/pipeline.rb6
-rw-r--r--app/models/concerns/issuable.rb1
-rw-r--r--app/models/concerns/issuable_states.rb23
-rw-r--r--app/models/issue.rb5
-rw-r--r--app/models/merge_request.rb3
5 files changed, 7 insertions, 31 deletions
diff --git a/app/models/ci/pipeline.rb b/app/models/ci/pipeline.rb
index f730b949ee9..4f71d52d469 100644
--- a/app/models/ci/pipeline.rb
+++ b/app/models/ci/pipeline.rb
@@ -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
diff --git a/app/models/concerns/issuable.rb b/app/models/concerns/issuable.rb
index 01cd1e0224b..6ea12e1cd59 100644
--- a/app/models/concerns/issuable.rb
+++ b/app/models/concerns/issuable.rb
@@ -23,7 +23,6 @@ module Issuable
include Sortable
include CreatedAtFilterable
include UpdatedAtFilterable
- include IssuableStates
include ClosedAtFilterable
include VersionedDescription
diff --git a/app/models/concerns/issuable_states.rb b/app/models/concerns/issuable_states.rb
deleted file mode 100644
index f0b9f0d1f3a..00000000000
--- a/app/models/concerns/issuable_states.rb
+++ /dev/null
@@ -1,23 +0,0 @@
-# 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
diff --git a/app/models/issue.rb b/app/models/issue.rb
index 948cadc34e5..6461edbe5d5 100644
--- a/app/models/issue.rb
+++ b/app/models/issue.rb
@@ -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?
diff --git a/app/models/merge_request.rb b/app/models/merge_request.rb
index a8c15ef2028..399fc030d24 100644
--- a/app/models/merge_request.rb
+++ b/app/models/merge_request.rb
@@ -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