diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-08-18 18:10:33 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-08-18 18:10:33 +0300 |
commit | d9e07a155e65cd4a7d2a1e0f10cd200a6b57371e (patch) | |
tree | 74c8de74729a462db976287c0b709c754dce5b6f /lib/gitlab | |
parent | f10eb9ebaefb0d6ff4ee7552dbf127dc70aaf27d (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib/gitlab')
-rw-r--r-- | lib/gitlab/background_migration/backfill_designs_relative_position.rb | 49 | ||||
-rw-r--r-- | lib/gitlab/ci/features.rb | 4 | ||||
-rw-r--r-- | lib/gitlab/usage_data.rb | 2 | ||||
-rw-r--r-- | lib/gitlab/usage_data_counters/track_unique_actions.rb | 2 |
4 files changed, 7 insertions, 50 deletions
diff --git a/lib/gitlab/background_migration/backfill_designs_relative_position.rb b/lib/gitlab/background_migration/backfill_designs_relative_position.rb index 4cfaa899eef..efbb1b950ad 100644 --- a/lib/gitlab/background_migration/backfill_designs_relative_position.rb +++ b/lib/gitlab/background_migration/backfill_designs_relative_position.rb @@ -2,52 +2,13 @@ module Gitlab module BackgroundMigration - # Backfill `relative_position` column in `design_management_designs` table + # This migration is not needed anymore and was disabled, because we're now + # also backfilling design positions immediately before moving a design. + # + # See https://gitlab.com/gitlab-org/gitlab/-/merge_requests/39555 class BackfillDesignsRelativePosition - # Define the issue model - class Issue < ActiveRecord::Base - self.table_name = 'issues' - end - - # Define the design model - class Design < ActiveRecord::Base - include RelativePositioning if defined?(RelativePositioning) - - self.table_name = 'design_management_designs' - - def self.relative_positioning_query_base(design) - where(issue_id: design.issue_id) - end - - def self.relative_positioning_parent_column - :issue_id - end - - def self.move_nulls_to_start(designs) - if defined?(super) - super(designs) - else - logger.error "BackfillDesignsRelativePosition failed because move_nulls_to_start is no longer included in the RelativePositioning concern" - end - end - end - def perform(issue_ids) - issue_ids.each do |issue_id| - migrate_issue(issue_id) - end - end - - private - - def migrate_issue(issue_id) - issue = Issue.find_by(id: issue_id) - return unless issue - - designs = Design.where(issue_id: issue.id).order(:id) - return unless designs.any? - - Design.move_nulls_to_start(designs) + # no-op end end end diff --git a/lib/gitlab/ci/features.rb b/lib/gitlab/ci/features.rb index 5d0e1e4fd01..38767acf716 100644 --- a/lib/gitlab/ci/features.rb +++ b/lib/gitlab/ci/features.rb @@ -57,7 +57,7 @@ module Gitlab end def self.ci_if_parenthesis_enabled? - ::Feature.enabled?(:ci_if_parenthesis_enabled) + ::Feature.enabled?(:ci_if_parenthesis_enabled, default_enabled: true) end def self.allow_to_create_merge_request_pipelines_in_target_project?(target_project) @@ -65,7 +65,7 @@ module Gitlab end def self.ci_plan_needs_size_limit?(project) - ::Feature.enabled?(:ci_plan_needs_size_limit, project) + ::Feature.enabled?(:ci_plan_needs_size_limit, project, default_enabled: true) end def self.job_entry_matches_all_keys? diff --git a/lib/gitlab/usage_data.rb b/lib/gitlab/usage_data.rb index f2a7da73120..f6914389637 100644 --- a/lib/gitlab/usage_data.rb +++ b/lib/gitlab/usage_data.rb @@ -604,8 +604,6 @@ module Gitlab end def action_monthly_active_users(time_period) - return {} unless Feature.enabled?(Gitlab::UsageDataCounters::TrackUniqueActions::FEATURE_FLAG) - counter = Gitlab::UsageDataCounters::TrackUniqueActions project_count = redis_usage_data do diff --git a/lib/gitlab/usage_data_counters/track_unique_actions.rb b/lib/gitlab/usage_data_counters/track_unique_actions.rb index b7948b07251..0df982572a4 100644 --- a/lib/gitlab/usage_data_counters/track_unique_actions.rb +++ b/lib/gitlab/usage_data_counters/track_unique_actions.rb @@ -4,7 +4,6 @@ module Gitlab module UsageDataCounters module TrackUniqueActions KEY_EXPIRY_LENGTH = 29.days - FEATURE_FLAG = :track_unique_actions WIKI_ACTION = :wiki_action DESIGN_ACTION = :design_action @@ -29,7 +28,6 @@ module Gitlab class << self def track_event(event_action:, event_target:, author_id:, time: Time.zone.now) return unless Gitlab::CurrentSettings.usage_ping_enabled - return unless Feature.enabled?(FEATURE_FLAG) return unless valid_target?(event_target) return unless valid_action?(event_action) |