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:
Diffstat (limited to 'app')
-rw-r--r--app/assets/javascripts/ci/pipeline_editor/components/ui/pipeline_editor_empty_state.vue41
-rw-r--r--app/finders/issues_finder.rb2
-rw-r--r--app/helpers/ci/pipeline_editor_helper.rb2
-rw-r--r--app/models/projects/branch_rule.rb7
-rw-r--r--app/services/projects/import_export/relation_export_service.rb10
-rw-r--r--app/workers/project_export_worker.rb2
-rw-r--r--app/workers/projects/import_export/create_relation_exports_worker.rb4
-rw-r--r--app/workers/projects/import_export/relation_export_worker.rb6
8 files changed, 39 insertions, 35 deletions
diff --git a/app/assets/javascripts/ci/pipeline_editor/components/ui/pipeline_editor_empty_state.vue b/app/assets/javascripts/ci/pipeline_editor/components/ui/pipeline_editor_empty_state.vue
index 90402a89280..7f927498fa1 100644
--- a/app/assets/javascripts/ci/pipeline_editor/components/ui/pipeline_editor_empty_state.vue
+++ b/app/assets/javascripts/ci/pipeline_editor/components/ui/pipeline_editor_empty_state.vue
@@ -1,5 +1,5 @@
<script>
-import { GlButton, GlSprintf } from '@gitlab/ui';
+import { GlButton, GlSprintf, GlEmptyState } from '@gitlab/ui';
import { __ } from '~/locale';
import PipelineEditorFileNav from '~/ci/pipeline_editor/components/file_nav/pipeline_editor_file_nav.vue';
@@ -7,6 +7,7 @@ export default {
components: {
GlButton,
GlSprintf,
+ GlEmptyState,
PipelineEditorFileNav,
},
i18n: {
@@ -40,24 +41,22 @@ export default {
<template>
<div>
<pipeline-editor-file-nav v-on="$listeners" />
- <div class="gl-display-flex gl-flex-direction-column gl-align-items-center gl-mt-11">
- <img :src="emptyStateIllustrationPath" />
- <div
- v-if="usesExternalConfig"
- class="gl-display-flex gl-flex-direction-column gl-align-items-center"
- >
- <h1 class="gl-font-size-h1">{{ $options.i18n.externalCiNote }}</h1>
- <p class="gl-mt-3">{{ $options.i18n.externalCiInstructions }}</p>
- </div>
- <div v-else class="gl-display-flex gl-flex-direction-column gl-align-items-center">
- <h1 class="gl-font-size-h1">{{ $options.i18n.title }}</h1>
- <p class="gl-mt-3">
- <gl-sprintf :message="$options.i18n.body">
- <template #code="{ content }">
- <code>{{ content }}</code>
- </template>
- </gl-sprintf>
- </p>
+ <gl-empty-state
+ v-if="usesExternalConfig"
+ :title="$options.i18n.externalCiNote"
+ :description="$options.i18n.externalCiInstructions"
+ :svg-path="emptyStateIllustrationPath"
+ />
+
+ <gl-empty-state v-else :title="$options.i18n.title" :svg-path="emptyStateIllustrationPath">
+ <template #description>
+ <gl-sprintf :message="$options.i18n.body">
+ <template #code="{ content }">
+ <code>{{ content }}</code>
+ </template>
+ </gl-sprintf>
+ </template>
+ <template #actions>
<gl-button
variant="confirm"
class="gl-mt-3"
@@ -66,7 +65,7 @@ export default {
>
{{ $options.i18n.btnText }}
</gl-button>
- </div>
- </div>
+ </template>
+ </gl-empty-state>
</div>
</template>
diff --git a/app/finders/issues_finder.rb b/app/finders/issues_finder.rb
index b47e8a47a7f..8e7bc5d49c3 100644
--- a/app/finders/issues_finder.rb
+++ b/app/finders/issues_finder.rb
@@ -118,7 +118,7 @@ class IssuesFinder < IssuableFinder
namespaces = if relations.one?
relations.first
else
- Namespace.from_union(relations, remove_duplicates: false)
+ Namespace.from_union(relations)
end
items.in_namespaces(namespaces)
diff --git a/app/helpers/ci/pipeline_editor_helper.rb b/app/helpers/ci/pipeline_editor_helper.rb
index f78a4aeaa49..200bd058c37 100644
--- a/app/helpers/ci/pipeline_editor_helper.rb
+++ b/app/helpers/ci/pipeline_editor_helper.rb
@@ -21,7 +21,7 @@ module Ci
"ci-lint-path" => project_ci_lint_path(project),
"ci-troubleshooting-path" => help_page_path('ci/troubleshooting', anchor: 'common-cicd-issues'),
"default-branch" => project.default_branch_or_main,
- "empty-state-illustration-path" => image_path('illustrations/empty-state/empty-dag-md.svg'),
+ "empty-state-illustration-path" => image_path('illustrations/empty-state/empty-pipeline-md.svg'),
"initial-branch-name" => initial_branch,
"includes-help-page-path" => help_page_path('ci/yaml/includes'),
"lint-help-page-path" => help_page_path('ci/lint', anchor: 'check-cicd-syntax'),
diff --git a/app/models/projects/branch_rule.rb b/app/models/projects/branch_rule.rb
index ae59d24e557..a32e981f791 100644
--- a/app/models/projects/branch_rule.rb
+++ b/app/models/projects/branch_rule.rb
@@ -5,12 +5,13 @@ module Projects
extend Forwardable
attr_reader :project, :protected_branch
+ alias_method :branch_protection, :protected_branch
def_delegators(:protected_branch, :name, :group, :default_branch?, :created_at, :updated_at)
def initialize(project, protected_branch)
- @protected_branch = protected_branch
@project = project
+ @protected_branch = protected_branch
end
def protected?
@@ -22,10 +23,6 @@ module Projects
matching_branches = protected_branch.matching(branch_names)
matching_branches.count
end
-
- def branch_protection
- protected_branch
- end
end
end
diff --git a/app/services/projects/import_export/relation_export_service.rb b/app/services/projects/import_export/relation_export_service.rb
index 33da5b39c20..a38d66e5ff7 100644
--- a/app/services/projects/import_export/relation_export_service.rb
+++ b/app/services/projects/import_export/relation_export_service.rb
@@ -5,10 +5,12 @@ module Projects
class RelationExportService
include Gitlab::ImportExport::CommandLineUtil
- def initialize(relation_export, jid)
+ def initialize(relation_export, user, jid, params = {})
@relation_export = relation_export
+ @user = user
@jid = jid
@logger = Gitlab::Export::Logger.build
+ @params = params
end
def execute
@@ -33,7 +35,7 @@ module Projects
private
- attr_reader :relation_export, :jid, :logger
+ attr_reader :relation_export, :user, :jid, :logger, :params
delegate :relation, :project_export_job, to: :relation_export
delegate :project, to: :project_export_job
@@ -60,7 +62,9 @@ module Projects
Gitlab::ImportExport::Project::RelationSaver.new(
project: project,
shared: shared,
- relation: relation
+ relation: relation,
+ user: user,
+ params: params
)
end
end
diff --git a/app/workers/project_export_worker.rb b/app/workers/project_export_worker.rb
index ee892d43313..1b969844884 100644
--- a/app/workers/project_export_worker.rb
+++ b/app/workers/project_export_worker.rb
@@ -15,6 +15,8 @@ class ProjectExportWorker # rubocop:disable Scalability/IdempotentWorker
def perform(current_user_id, project_id, after_export_strategy = {}, params = {})
current_user = User.find(current_user_id)
+ params.symbolize_keys!
+
project = Project.find(project_id)
export_job = project.export_jobs.safe_find_or_create_by(jid: self.jid)
after_export = build!(after_export_strategy)
diff --git a/app/workers/projects/import_export/create_relation_exports_worker.rb b/app/workers/projects/import_export/create_relation_exports_worker.rb
index 9ca69a5500a..e115c8917b1 100644
--- a/app/workers/projects/import_export/create_relation_exports_worker.rb
+++ b/app/workers/projects/import_export/create_relation_exports_worker.rb
@@ -18,7 +18,7 @@ module Projects
INITIAL_DELAY = 10.seconds
# rubocop: disable CodeReuse/ActiveRecord
- def perform(user_id, project_id, after_export_strategy = {})
+ def perform(user_id, project_id, after_export_strategy = {}, params = {})
project = Project.find_by_id(project_id)
return unless project
@@ -30,7 +30,7 @@ module Projects
end
relation_exports.each do |relation_export|
- RelationExportWorker.with_status.perform_async(relation_export.id)
+ RelationExportWorker.with_status.perform_async(relation_export.id, user_id, params)
end
WaitRelationExportsWorker.perform_in(
diff --git a/app/workers/projects/import_export/relation_export_worker.rb b/app/workers/projects/import_export/relation_export_worker.rb
index 7747d4f4099..dd02c36ef42 100644
--- a/app/workers/projects/import_export/relation_export_worker.rb
+++ b/app/workers/projects/import_export/relation_export_worker.rb
@@ -33,13 +33,15 @@ module Projects
Gitlab::Export::Logger.error(log_payload)
end
- def perform(project_relation_export_id)
+ def perform(project_relation_export_id, user_id, params = {})
+ user = User.find(user_id)
+ params.symbolize_keys!
relation_export = Projects::ImportExport::RelationExport.find(project_relation_export_id)
relation_export.retry! if relation_export.started?
if relation_export.queued?
- Projects::ImportExport::RelationExportService.new(relation_export, jid).execute
+ Projects::ImportExport::RelationExportService.new(relation_export, user, jid, params).execute
end
end
end