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>2024-01-17 00:06:39 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2024-01-17 00:06:39 +0300
commitd62742b0169769191b32038cf20445a47db3b287 (patch)
tree0b718d822d0b3bffac1973dcff11b56853e664a2 /app
parente18006fc6313b1d04128416cdb5f1533adcdb53e (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app')
-rw-r--r--app/assets/javascripts/editor/schema/ci.json3
-rw-r--r--app/assets/javascripts/usage_quotas/storage/components/dependency_proxy_usage.vue55
-rw-r--r--app/assets/javascripts/usage_quotas/storage/components/namespace_storage_app.vue14
-rw-r--r--app/assets/javascripts/work_items/components/work_item_links/index.js3
-rw-r--r--app/assets/stylesheets/page_bundles/issuable_list.scss2
-rw-r--r--app/controllers/admin/users_controller.rb2
-rw-r--r--app/views/admin/spam_logs/_spam_log.html.haml3
-rw-r--r--app/views/admin/spam_logs/index.html.haml3
-rw-r--r--app/views/layouts/application.html.haml6
-rw-r--r--app/views/projects/issues/_work_item_links.html.haml3
-rw-r--r--app/workers/concerns/git_garbage_collect_methods.rb5
-rw-r--r--app/workers/projects/git_garbage_collect_worker.rb13
-rw-r--r--app/workers/run_pipeline_schedule_worker.rb10
13 files changed, 103 insertions, 19 deletions
diff --git a/app/assets/javascripts/editor/schema/ci.json b/app/assets/javascripts/editor/schema/ci.json
index 3fbd4728cfc..1da224c2174 100644
--- a/app/assets/javascripts/editor/schema/ci.json
+++ b/app/assets/javascripts/editor/schema/ci.json
@@ -1750,6 +1750,9 @@
"project",
"ref"
]
+ },
+ {
+ "$ref": "#/definitions/!reference"
}
]
}
diff --git a/app/assets/javascripts/usage_quotas/storage/components/dependency_proxy_usage.vue b/app/assets/javascripts/usage_quotas/storage/components/dependency_proxy_usage.vue
new file mode 100644
index 00000000000..e1a38c85e33
--- /dev/null
+++ b/app/assets/javascripts/usage_quotas/storage/components/dependency_proxy_usage.vue
@@ -0,0 +1,55 @@
+<script>
+import UsageBanner from '~/vue_shared/components/usage_quotas/usage_banner.vue';
+import { s__ } from '~/locale';
+import NumberToHumanSize from '~/vue_shared/components/number_to_human_size/number_to_human_size.vue';
+import HelpPageLink from '~/vue_shared/components/help_page_link/help_page_link.vue';
+
+export default {
+ name: 'DependencyProxyUsage',
+ components: {
+ NumberToHumanSize,
+ HelpPageLink,
+ UsageBanner,
+ },
+ props: {
+ dependencyProxyTotalSize: {
+ type: Number,
+ required: false,
+ default: 0,
+ },
+ loading: {
+ type: Boolean,
+ required: false,
+ default: false,
+ },
+ },
+ i18n: {
+ dependencyProxy: s__('UsageQuota|Dependency proxy'),
+ storageUsed: s__('UsageQuota|Storage used'),
+ dependencyProxyMessage: s__(
+ 'UsageQuota|Local proxy used for frequently-accessed upstream Docker images.',
+ ),
+ },
+};
+</script>
+<template>
+ <usage-banner :loading="loading">
+ <template #left-primary-text>
+ {{ $options.i18n.dependencyProxy }}
+ </template>
+ <template #left-secondary-text>
+ <div data-testid="dependency-proxy-description">
+ {{ $options.i18n.dependencyProxyMessage }}
+ <help-page-link href="user/packages/dependency_proxy/index">
+ {{ __('More information') }}
+ </help-page-link>
+ </div>
+ </template>
+ <template #right-primary-text>
+ {{ $options.i18n.storageUsed }}
+ </template>
+ <template #right-secondary-text>
+ <number-to-human-size :value="dependencyProxyTotalSize" data-testid="dependency-proxy-size" />
+ </template>
+ </usage-banner>
+</template>
diff --git a/app/assets/javascripts/usage_quotas/storage/components/namespace_storage_app.vue b/app/assets/javascripts/usage_quotas/storage/components/namespace_storage_app.vue
index ddf240fcafa..afb8502434e 100644
--- a/app/assets/javascripts/usage_quotas/storage/components/namespace_storage_app.vue
+++ b/app/assets/javascripts/usage_quotas/storage/components/namespace_storage_app.vue
@@ -1,13 +1,16 @@
<script>
import { GlAlert } from '@gitlab/ui';
import StorageUsageStatistics from 'ee_else_ce/usage_quotas/storage/components/storage_usage_statistics.vue';
+import DependencyProxyUsage from '~/usage_quotas/storage/components/dependency_proxy_usage.vue';
export default {
name: 'NamespaceStorageApp',
components: {
GlAlert,
StorageUsageStatistics,
+ DependencyProxyUsage,
},
+ inject: ['userNamespace'],
props: {
namespaceLoadingError: {
type: Boolean,
@@ -39,6 +42,9 @@ export default {
this.namespace.rootStorageStatistics?.storageSize
);
},
+ dependencyProxyTotalSize() {
+ return this.namespace.rootStorageStatistics?.dependencyProxySize ?? 0;
+ },
},
};
</script>
@@ -61,6 +67,14 @@ export default {
:used-storage="usedStorage"
:loading="isNamespaceStorageStatisticsLoading"
/>
+ <h3 data-testid="breakdown-subtitle">
+ {{ s__('UsageQuota|Storage usage breakdown') }}
+ </h3>
+ <dependency-proxy-usage
+ v-if="!userNamespace"
+ :dependency-proxy-total-size="dependencyProxyTotalSize"
+ :loading="isNamespaceStorageStatisticsLoading"
+ />
<slot name="ee-storage-app"></slot>
</div>
diff --git a/app/assets/javascripts/work_items/components/work_item_links/index.js b/app/assets/javascripts/work_items/components/work_item_links/index.js
index 07aa98a1b44..616dce4d2c0 100644
--- a/app/assets/javascripts/work_items/components/work_item_links/index.js
+++ b/app/assets/javascripts/work_items/components/work_item_links/index.js
@@ -1,5 +1,6 @@
import Vue from 'vue';
import { GlToast } from '@gitlab/ui';
+import { parseBoolean } from '~/lib/utils/common_utils';
import { apolloProvider } from '~/graphql_shared/issuable_client';
import WorkItemLinks from './work_item_links.vue';
@@ -20,6 +21,7 @@ export default function initWorkItemLinks() {
registerPath,
signInPath,
wiReportAbusePath,
+ isGroup,
} = workItemLinksRoot.dataset;
return new Vue({
@@ -34,6 +36,7 @@ export default function initWorkItemLinks() {
registerPath,
signInPath,
reportAbusePath: wiReportAbusePath,
+ isGroup: parseBoolean(isGroup),
},
render: (createElement) =>
createElement(WorkItemLinks, {
diff --git a/app/assets/stylesheets/page_bundles/issuable_list.scss b/app/assets/stylesheets/page_bundles/issuable_list.scss
index 9084bffa951..acf6e54efc8 100644
--- a/app/assets/stylesheets/page_bundles/issuable_list.scss
+++ b/app/assets/stylesheets/page_bundles/issuable_list.scss
@@ -90,7 +90,7 @@
.issuable-list li,
.issuable-info-container .controls {
.avatar-counter {
- @include gl-pl-1
+ @include gl-pl-1;
@include gl-pr-2;
@include gl-h-5;
@include gl-min-w-5;
diff --git a/app/controllers/admin/users_controller.rb b/app/controllers/admin/users_controller.rb
index 3a0618c0d40..906cf212715 100644
--- a/app/controllers/admin/users_controller.rb
+++ b/app/controllers/admin/users_controller.rb
@@ -10,7 +10,7 @@ class Admin::UsersController < Admin::ApplicationController
before_action :set_shared_view_parameters, only: [:show, :projects, :keys]
before_action only: [:index] do
- push_frontend_feature_flag(:simplified_badges)
+ push_frontend_feature_flag(:simplified_badges, current_user)
end
feature_category :user_management
diff --git a/app/views/admin/spam_logs/_spam_log.html.haml b/app/views/admin/spam_logs/_spam_log.html.haml
index 878692438d4..84d62305f2c 100644
--- a/app/views/admin/spam_logs/_spam_log.html.haml
+++ b/app/views/admin/spam_logs/_spam_log.html.haml
@@ -29,9 +29,8 @@
variant: :danger,
method: :delete,
href: admin_spam_log_path(spam_log, remove_user: true),
- button_options: { data: { confirm: _("User %{user_name} will be removed! Are you sure?") % { user_name: user.name }, confirm_btn_variant: 'danger' }, aria: { label: _('Remove user') } }) do
+ button_options: { class: ' gl-mb-3', data: { confirm: _("User %{user_name} will be removed! Are you sure?") % { user_name: user.name }, confirm_btn_variant: 'danger' } }) do
= _('Remove user')
- %td
-# TODO: Remove conditonal once spamcheck supports this https://gitlab.com/gitlab-com/gl-security/engineering-and-research/automation-team/spam/spamcheck/-/issues/190
- if akismet_enabled?
- if spam_log.submitted_as_ham?
diff --git a/app/views/admin/spam_logs/index.html.haml b/app/views/admin/spam_logs/index.html.haml
index 9a0756510ec..4f33a3f4c54 100644
--- a/app/views/admin/spam_logs/index.html.haml
+++ b/app/views/admin/spam_logs/index.html.haml
@@ -15,8 +15,7 @@
%th= _('Title')
%th= _('Description')
%th= _('User Status')
- %th= _('Primary Action')
- %th
+ %th= _('Actions')
= render @spam_logs
= paginate_collection @spam_logs
- else
diff --git a/app/views/layouts/application.html.haml b/app/views/layouts/application.html.haml
index b9257bcedc9..c6cae6dabe1 100644
--- a/app/views/layouts/application.html.haml
+++ b/app/views/layouts/application.html.haml
@@ -1,13 +1,13 @@
- page_classes = page_class << @html_class
- page_classes = [user_application_theme, page_classes.flatten.compact]
- body_classes = [user_tab_width, @body_class, client_class_list, *custom_diff_color_classes]
-- ff_simplified_labels_enabled = Feature.enabled?(:simplified_labels) ? 'ff-simplified-labels-enabled' : ''
-- ff_simplified_badges_class = Feature.enabled?(:simplified_badges) ? 'ff-simplified-badges-enabled' : ''
+- ff_simplified_labels_classes = Feature.enabled?(:simplified_labels, current_user) ? 'ff-simplified-labels-enabled' : ''
+- ff_simplified_badges_classes = Feature.enabled?(:simplified_badges, current_user) ? 'ff-simplified-badges-enabled' : ''
!!! 5
%html{ lang: I18n.locale, class: page_classes }
= render "layouts/head"
- %body{ class: [body_classes, ff_simplified_labels_enabled, ff_simplified_badges_class], data: body_data }
+ %body{ class: [body_classes, ff_simplified_labels_classes, ff_simplified_badges_classes], data: body_data }
= render "layouts/init_auto_complete" if @gfm_form
= render "layouts/init_client_detection_flags"
= render "layouts/visual_review" if review_apps_enabled?
diff --git a/app/views/projects/issues/_work_item_links.html.haml b/app/views/projects/issues/_work_item_links.html.haml
index 7a8f2163bf6..3767fcfbdad 100644
--- a/app/views/projects/issues/_work_item_links.html.haml
+++ b/app/views/projects/issues/_work_item_links.html.haml
@@ -3,4 +3,5 @@
full_path: @project.full_path,
wi: work_items_show_data(@project),
register_path: new_user_registration_path(redirect_to_referer: 'yes'),
- sign_in_path: new_session_path(:user, redirect_to_referer: 'yes') } }
+ sign_in_path: new_session_path(:user, redirect_to_referer: 'yes'),
+ is_group: 'false' } }
diff --git a/app/workers/concerns/git_garbage_collect_methods.rb b/app/workers/concerns/git_garbage_collect_methods.rb
index 718031ec33e..caa29db9b57 100644
--- a/app/workers/concerns/git_garbage_collect_methods.rb
+++ b/app/workers/concerns/git_garbage_collect_methods.rb
@@ -33,6 +33,7 @@ module GitGarbageCollectMethods
before_gitaly_call(task, resource)
gitaly_call(task, resource)
+ after_gitaly_call(task, resource)
# Refresh the branch cache in case garbage collection caused a ref lookup to fail
flush_ref_caches(resource) if gc?(task)
@@ -97,6 +98,10 @@ module GitGarbageCollectMethods
raise Gitlab::Git::CommandError, e
end
+ def after_gitaly_call(task, resource)
+ # no-op
+ end
+
def flush_ref_caches(resource)
resource.repository.expire_branches_cache
resource.repository.branch_names
diff --git a/app/workers/projects/git_garbage_collect_worker.rb b/app/workers/projects/git_garbage_collect_worker.rb
index 8c0100dd05b..32bffc3ab6a 100644
--- a/app/workers/projects/git_garbage_collect_worker.rb
+++ b/app/workers/projects/git_garbage_collect_worker.rb
@@ -25,7 +25,14 @@ module Projects
Gitlab::ErrorTracking.track_exception(e)
end
- cleanup_orphan_lfs_file_references(resource)
+ cleanup_orphan_lfs_file_references(resource) unless reorder_feature_flag?(resource)
+ end
+
+ override :after_gitaly_call
+ def after_gitaly_call(task, resource)
+ return unless gc?(task)
+
+ cleanup_orphan_lfs_file_references(resource) if reorder_feature_flag?(resource)
end
def cleanup_orphan_lfs_file_references(resource)
@@ -45,5 +52,9 @@ module Projects
def stats
[:repository_size, :lfs_objects_size]
end
+
+ def reorder_feature_flag?(resource)
+ Feature.enabled?(:reorder_garbage_collection_calls, resource, type: :gitlab_com_derisk)
+ end
end
end
diff --git a/app/workers/run_pipeline_schedule_worker.rb b/app/workers/run_pipeline_schedule_worker.rb
index 52d825e5421..99d36390aa8 100644
--- a/app/workers/run_pipeline_schedule_worker.rb
+++ b/app/workers/run_pipeline_schedule_worker.rb
@@ -31,19 +31,13 @@ class RunPipelineScheduleWorker # rubocop:disable Scalability/IdempotentWorker
end
def run_pipeline_schedule(schedule, user)
- response = Ci::CreatePipelineService
+ Ci::CreatePipelineService
.new(schedule.project, user, ref: schedule.ref)
.execute(
:schedule,
- save_on_errors: Feature.enabled?(:persist_failed_pipelines_from_schedules, schedule.project),
+ save_on_errors: true,
ignore_skip_ci: true, schedule: schedule
)
-
- return response if response.payload.persisted?
-
- # Remove with FF persist_failed_pipelines_from_schedules enabled, as corrupted yml is not longer logged
- # This is a user operation error such as corrupted .gitlab-ci.yml. Log the error for debugging purpose.
- log_extra_metadata_on_done(:pipeline_creation_error, response.message)
rescue StandardError => e
error(schedule, e)
end