Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2022-05-26 09:08:37 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2022-05-26 09:08:37 +0300
commit864dae0d98424b463501c21eda1b633c14956fa9 (patch)
tree9340f7dad0a32f7e8c8a3b5ad723fbf0de26c3ba /app
parent47ef8c6c530ee1cac0e1046b098755ec949da894 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app')
-rw-r--r--app/assets/javascripts/work_items/components/work_item_detail.vue2
-rw-r--r--app/assets/javascripts/work_items/components/work_item_links/work_item_links.vue6
-rw-r--r--app/controllers/projects/work_items_controller.rb1
-rw-r--r--app/models/ci/bridge.rb22
-rw-r--r--app/workers/all_queues.yml18
-rw-r--r--app/workers/issue_placement_worker.rb71
-rw-r--r--app/workers/issue_rebalancing_worker.rb56
7 files changed, 12 insertions, 164 deletions
diff --git a/app/assets/javascripts/work_items/components/work_item_detail.vue b/app/assets/javascripts/work_items/components/work_item_detail.vue
index 418c465d820..0d588746362 100644
--- a/app/assets/javascripts/work_items/components/work_item_detail.vue
+++ b/app/assets/javascripts/work_items/components/work_item_detail.vue
@@ -121,7 +121,7 @@ export default {
@error="error = $event"
@updated="$emit('workItemUpdated')"
/>
- <work-item-links :work-item-id="workItem.id" />
+ <work-item-links v-if="glFeatures.workItemsHierarchy" :work-item-id="workItem.id" />
</template>
</section>
</template>
diff --git a/app/assets/javascripts/work_items/components/work_item_links/work_item_links.vue b/app/assets/javascripts/work_items/components/work_item_links/work_item_links.vue
index 6124e669cb3..df3326083af 100644
--- a/app/assets/javascripts/work_items/components/work_item_links/work_item_links.vue
+++ b/app/assets/javascripts/work_items/components/work_item_links/work_item_links.vue
@@ -30,6 +30,11 @@ export default {
toggleIcon() {
return this.isOpen ? 'angle-up' : 'angle-down';
},
+ toggleLabel() {
+ return this.isOpen
+ ? s__('WorkItem|Collapse child items')
+ : s__('WorkItem|Expand child items');
+ },
},
methods: {
toggle() {
@@ -60,6 +65,7 @@ export default {
<gl-button
category="tertiary"
:icon="toggleIcon"
+ :aria-label="toggleLabel"
data-testid="toggle-links"
@click="toggle"
/>
diff --git a/app/controllers/projects/work_items_controller.rb b/app/controllers/projects/work_items_controller.rb
index de3168dd415..6db83a19d43 100644
--- a/app/controllers/projects/work_items_controller.rb
+++ b/app/controllers/projects/work_items_controller.rb
@@ -4,6 +4,7 @@ class Projects::WorkItemsController < Projects::ApplicationController
before_action do
push_force_frontend_feature_flag(:work_items, project&.work_items_feature_flag_enabled?)
push_frontend_feature_flag(:work_item_assignees)
+ push_frontend_feature_flag(:work_items_hierarchy, project)
end
feature_category :team_planning
diff --git a/app/models/ci/bridge.rb b/app/models/ci/bridge.rb
index a06b920342c..13af5b1f8d1 100644
--- a/app/models/ci/bridge.rb
+++ b/app/models/ci/bridge.rb
@@ -215,14 +215,10 @@ module Ci
end
def downstream_variables
- if ::Feature.enabled?(:ci_trigger_forward_variables, project)
- calculate_downstream_variables
- .reverse # variables priority
- .uniq { |var| var[:key] } # only one variable key to pass
- .reverse
- else
- legacy_downstream_variables
- end
+ calculate_downstream_variables
+ .reverse # variables priority
+ .uniq { |var| var[:key] } # only one variable key to pass
+ .reverse
end
def target_revision_ref
@@ -268,16 +264,6 @@ module Ci
}
end
- def legacy_downstream_variables
- variables = scoped_variables.concat(pipeline.persisted_variables)
-
- variables.to_runner_variables.yield_self do |all_variables|
- yaml_variables.to_a.map do |hash|
- { key: hash[:key], value: ::ExpandVariables.expand(hash[:value], all_variables) }
- end
- end
- end
-
def calculate_downstream_variables
expand_variables = scoped_variables
.concat(pipeline.persisted_variables)
diff --git a/app/workers/all_queues.yml b/app/workers/all_queues.yml
index c2836c04a4d..475a65f3399 100644
--- a/app/workers/all_queues.yml
+++ b/app/workers/all_queues.yml
@@ -2416,24 +2416,6 @@
:weight: 1
:idempotent: true
:tags: []
-- :name: issue_placement
- :worker_name: IssuePlacementWorker
- :feature_category: :team_planning
- :has_external_dependencies:
- :urgency: :high
- :resource_boundary: :cpu
- :weight: 2
- :idempotent: true
- :tags: []
-- :name: issue_rebalancing
- :worker_name: IssueRebalancingWorker
- :feature_category: :team_planning
- :has_external_dependencies:
- :urgency: :low
- :resource_boundary: :unknown
- :weight: 1
- :idempotent: true
- :tags: []
- :name: issues_placement
:worker_name: Issues::PlacementWorker
:feature_category: :team_planning
diff --git a/app/workers/issue_placement_worker.rb b/app/workers/issue_placement_worker.rb
deleted file mode 100644
index 26dec221f45..00000000000
--- a/app/workers/issue_placement_worker.rb
+++ /dev/null
@@ -1,71 +0,0 @@
-# frozen_string_literal: true
-
-# DEPRECATED. Will be removed in 14.7 https://gitlab.com/gitlab-org/gitlab/-/merge_requests/72803
-# Please use Issues::PlacementWorker instead
-#
-# todo: remove this worker and it's queue definition from all_queues after Issues::PlacementWorker is deployed
-# We want to keep it for one release in case some jobs are already scheduled in the old queue so we need the worker
-# to be available to finish those. All new jobs will be queued into the new queue.
-class IssuePlacementWorker
- include ApplicationWorker
-
- data_consistency :always
-
- sidekiq_options retry: 3
-
- idempotent!
- deduplicate :until_executed, including_scheduled: true
- feature_category :team_planning
- urgency :high
- worker_resource_boundary :cpu
- weight 2
-
- # Move at most the most recent 100 issues
- QUERY_LIMIT = 100
-
- # rubocop: disable CodeReuse/ActiveRecord
- def perform(issue_id, project_id = nil)
- issue = find_issue(issue_id, project_id)
- return unless issue
-
- # Temporary disable moving null elements because of performance problems
- # For more information check https://gitlab.com/gitlab-com/gl-infra/production/-/issues/4321
- return if issue.blocked_for_repositioning?
-
- # Move the oldest 100 unpositioned items to the end.
- # This is to deal with out-of-order execution of the worker,
- # while preserving creation order.
- to_place = Issue
- .relative_positioning_query_base(issue)
- .with_null_relative_position
- .order({ created_at: :asc }, { id: :asc })
- .limit(QUERY_LIMIT + 1)
- .to_a
-
- leftover = to_place.pop if to_place.count > QUERY_LIMIT
-
- Issue.move_nulls_to_end(to_place)
- Issues::BaseService.new(project: nil).rebalance_if_needed(to_place.max_by(&:relative_position))
- Issues::PlacementWorker.perform_async(nil, leftover.project_id) if leftover.present?
- rescue RelativePositioning::NoSpaceLeft => e
- Gitlab::ErrorTracking.log_exception(e, issue_id: issue_id, project_id: project_id)
- Issues::RebalancingWorker.perform_async(nil, *root_namespace_id_to_rebalance(issue, project_id))
- end
-
- def find_issue(issue_id, project_id)
- return Issue.id_in(issue_id).take if issue_id
-
- project = Project.id_in(project_id).take
- return unless project
-
- project.issues.take
- end
- # rubocop: enable CodeReuse/ActiveRecord
-
- private
-
- def root_namespace_id_to_rebalance(issue, project_id)
- project_id = project_id.presence || issue.project_id
- Project.find(project_id)&.self_or_root_group_ids
- end
-end
diff --git a/app/workers/issue_rebalancing_worker.rb b/app/workers/issue_rebalancing_worker.rb
deleted file mode 100644
index 73edb2eb653..00000000000
--- a/app/workers/issue_rebalancing_worker.rb
+++ /dev/null
@@ -1,56 +0,0 @@
-# frozen_string_literal: true
-
-# DEPRECATED. Will be removed in 14.7 https://gitlab.com/gitlab-org/gitlab/-/merge_requests/72803
-# Please use Issues::RebalancingWorker instead
-#
-# todo: remove this worker and it's queue definition from all_queues after Issue::RebalancingWorker is released.
-# We want to keep it for one release in case some jobs are already scheduled in the old queue so we need the worker
-# to be available to finish those. All new jobs will be queued into the new queue.
-class IssueRebalancingWorker
- include ApplicationWorker
-
- data_consistency :always
-
- sidekiq_options retry: 3
-
- idempotent!
- urgency :low
- feature_category :team_planning
- deduplicate :until_executed, including_scheduled: true
-
- def perform(ignore = nil, project_id = nil, root_namespace_id = nil)
- # we need to have exactly one of the project_id and root_namespace_id params be non-nil
- raise ArgumentError, "Expected only one of the params project_id: #{project_id} and root_namespace_id: #{root_namespace_id}" if project_id && root_namespace_id
- return if project_id.nil? && root_namespace_id.nil?
- return if ::Gitlab::Issues::Rebalancing::State.rebalance_recently_finished?(project_id, root_namespace_id)
-
- # pull the projects collection to be rebalanced either the project if namespace is not a group(i.e. user namesapce)
- # or the root namespace, this also makes the worker backward compatible with previous version where a project_id was
- # passed as the param
- projects_to_rebalance = projects_collection(project_id, root_namespace_id)
-
- # something might have happened with the namespace between scheduling the worker and actually running it,
- # maybe it was removed.
- if projects_to_rebalance.blank?
- Gitlab::ErrorTracking.log_exception(
- ArgumentError.new("Projects to be rebalanced not found for arguments: project_id #{project_id}, root_namespace_id: #{root_namespace_id}"),
- { project_id: project_id, root_namespace_id: root_namespace_id })
-
- return
- end
-
- Issues::RelativePositionRebalancingService.new(projects_to_rebalance).execute
- rescue Issues::RelativePositionRebalancingService::TooManyConcurrentRebalances => e
- Gitlab::ErrorTracking.log_exception(e, root_namespace_id: root_namespace_id, project_id: project_id)
- end
-
- private
-
- def projects_collection(project_id, root_namespace_id)
- # we can have either project_id(older version) or project_id if project is part of a user namespace and not a group
- # or root_namespace_id(newer version) never both.
- return Project.id_in([project_id]) if project_id
-
- Namespace.find_by_id(root_namespace_id)&.all_projects
- end
-end