summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2022-06-17 09:08:50 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2022-06-17 09:08:50 +0000
commit6bbf310347d4b857b111bc3b54e8a16e2e2e61c7 (patch)
treed09627980dfb232a259f9f0ed00009c083e1f666 /app
parente4476c4a182e5af930799342f681405dc98d6a1c (diff)
downloadgitlab-ce-6bbf310347d4b857b111bc3b54e8a16e2e2e61c7.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app')
-rw-r--r--app/assets/javascripts/persistent_user_callouts.js1
-rw-r--r--app/controllers/oauth/authorizations_controller.rb17
-rw-r--r--app/helpers/nav/new_dropdown_helper.rb2
-rw-r--r--app/models/ci/build.rb6
-rw-r--r--app/models/ci/job_artifact.rb2
-rw-r--r--app/models/ci/pipeline.rb12
-rw-r--r--app/models/users/callout.rb3
-rw-r--r--app/views/projects/mirrors/_ssh_host_keys.html.haml4
-rw-r--r--app/views/projects/usage_quotas/index.html.haml8
-rw-r--r--app/workers/all_queues.yml10
-rw-r--r--app/workers/database/ci_namespace_mirrors_consistency_check_worker.rb2
-rw-r--r--app/workers/database/ci_project_mirrors_consistency_check_worker.rb2
-rw-r--r--app/workers/loose_foreign_keys/cleanup_worker.rb2
-rw-r--r--app/workers/namespaces/process_sync_events_worker.rb2
-rw-r--r--app/workers/projects/process_sync_events_worker.rb2
15 files changed, 51 insertions, 24 deletions
diff --git a/app/assets/javascripts/persistent_user_callouts.js b/app/assets/javascripts/persistent_user_callouts.js
index 58c1e102945..f836921f5e5 100644
--- a/app/assets/javascripts/persistent_user_callouts.js
+++ b/app/assets/javascripts/persistent_user_callouts.js
@@ -15,6 +15,7 @@ const PERSISTENT_USER_CALLOUTS = [
'.js-user-over-limit-free-plan-alert',
'.js-minute-limit-banner',
'.js-submit-license-usage-data-banner',
+ '.js-project-usage-limitations-callout',
];
const initCallouts = () => {
diff --git a/app/controllers/oauth/authorizations_controller.rb b/app/controllers/oauth/authorizations_controller.rb
index 0817813f967..c9c51289d3a 100644
--- a/app/controllers/oauth/authorizations_controller.rb
+++ b/app/controllers/oauth/authorizations_controller.rb
@@ -19,6 +19,9 @@ class Oauth::AuthorizationsController < Doorkeeper::AuthorizationsController
session.delete(:user_return_to)
render "doorkeeper/authorizations/redirect", locals: { redirect_uri: parsed_redirect_uri }, layout: false
else
+ redirect_uri = URI(authorization.authorize.redirect_uri)
+ allow_redirect_uri_form_action(redirect_uri.scheme)
+
render "doorkeeper/authorizations/new"
end
else
@@ -28,6 +31,20 @@ class Oauth::AuthorizationsController < Doorkeeper::AuthorizationsController
private
+ # Chrome blocks redirections if the form-action CSP directive is present
+ # and the redirect location's scheme isn't allow-listed
+ # https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/form-action
+ # https://github.com/w3c/webappsec-csp/issues/8
+ def allow_redirect_uri_form_action(redirect_uri_scheme)
+ return unless content_security_policy?
+
+ form_action = request.content_security_policy.form_action
+ return unless form_action
+
+ form_action.push("#{redirect_uri_scheme}:")
+ request.content_security_policy.form_action(*form_action)
+ end
+
def pre_auth_params
# Cannot be achieved with a before_action hook, due to the execution order.
downgrade_scopes! if action_name == 'new'
diff --git a/app/helpers/nav/new_dropdown_helper.rb b/app/helpers/nav/new_dropdown_helper.rb
index 715a5a02b50..469d6c1a7eb 100644
--- a/app/helpers/nav/new_dropdown_helper.rb
+++ b/app/helpers/nav/new_dropdown_helper.rb
@@ -16,7 +16,7 @@ module Nav
menu_sections.push(general_menu_section)
{
- title: _("New..."),
+ title: _("Create new"),
menu_sections: menu_sections.select { |x| x.fetch(:menu_items).any? }
}
end
diff --git a/app/models/ci/build.rb b/app/models/ci/build.rb
index 881f0a6dbe9..e35198ba31f 100644
--- a/app/models/ci/build.rb
+++ b/app/models/ci/build.rb
@@ -137,8 +137,8 @@ module Ci
where('NOT EXISTS (?)', Ci::JobArtifact.select(1).where('ci_builds.id = ci_job_artifacts.job_id').trace)
end
- scope :with_reports, ->(reports_scope) do
- with_existing_job_artifacts(reports_scope)
+ scope :with_artifacts, ->(artifact_scope) do
+ with_existing_job_artifacts(artifact_scope)
.eager_load_job_artifacts
end
@@ -1047,7 +1047,7 @@ module Ci
end
def report_artifacts
- job_artifacts.with_reports
+ job_artifacts.all_reports
end
# Virtual deployment status depending on the environment status.
diff --git a/app/models/ci/job_artifact.rb b/app/models/ci/job_artifact.rb
index b894c206c8d..81943cfa651 100644
--- a/app/models/ci/job_artifact.rb
+++ b/app/models/ci/job_artifact.rb
@@ -152,7 +152,7 @@ module Ci
where(file_type: types)
end
- scope :with_reports, -> do
+ scope :all_reports, -> do
with_file_types(REPORT_TYPES.keys.map(&:to_s))
end
diff --git a/app/models/ci/pipeline.rb b/app/models/ci/pipeline.rb
index e118fc34fc4..5d316906bd3 100644
--- a/app/models/ci/pipeline.rb
+++ b/app/models/ci/pipeline.rb
@@ -342,7 +342,7 @@ module Ci
end
scope :with_reports, -> (reports_scope) do
- where('EXISTS (?)', ::Ci::Build.latest.with_reports(reports_scope).where('ci_pipelines.id=ci_builds.commit_id').select(1))
+ where('EXISTS (?)', ::Ci::Build.latest.with_artifacts(reports_scope).where('ci_pipelines.id=ci_builds.commit_id').select(1))
end
scope :with_only_interruptible_builds, -> do
@@ -696,7 +696,7 @@ module Ci
def latest_report_artifacts
::Gitlab::SafeRequestStore.fetch("pipeline:#{self.id}:latest_report_artifacts") do
::Ci::JobArtifact.where(
- id: job_artifacts.with_reports
+ id: job_artifacts.all_reports
.select('max(ci_job_artifacts.id) as id')
.group(:file_type)
)
@@ -1057,16 +1057,16 @@ module Ci
@latest_builds_with_artifacts ||= builds.latest.with_artifacts_not_expired.to_a
end
- def latest_report_builds(reports_scope = ::Ci::JobArtifact.with_reports)
- builds.latest.with_reports(reports_scope)
+ def latest_report_builds(reports_scope = ::Ci::JobArtifact.all_reports)
+ builds.latest.with_artifacts(reports_scope)
end
def latest_test_report_builds
latest_report_builds(Ci::JobArtifact.test_reports).preload(:project, :metadata)
end
- def latest_report_builds_in_self_and_descendants(reports_scope = ::Ci::JobArtifact.with_reports)
- builds_in_self_and_descendants.with_reports(reports_scope)
+ def latest_report_builds_in_self_and_descendants(reports_scope = ::Ci::JobArtifact.all_reports)
+ builds_in_self_and_descendants.with_artifacts(reports_scope)
end
def builds_with_coverage
diff --git a/app/models/users/callout.rb b/app/models/users/callout.rb
index 96094a33e64..0ecae4d148a 100644
--- a/app/models/users/callout.rb
+++ b/app/models/users/callout.rb
@@ -52,7 +52,8 @@ module Users
minute_limit_banner: 49,
preview_user_over_limit_free_plan_alert: 50, # EE-only
user_reached_limit_free_plan_alert: 51, # EE-only
- submit_license_usage_data_banner: 52 # EE-only
+ submit_license_usage_data_banner: 52, # EE-only
+ personal_project_limitations_banner: 53 # EE-only
}
validates :feature_name,
diff --git a/app/views/projects/mirrors/_ssh_host_keys.html.haml b/app/views/projects/mirrors/_ssh_host_keys.html.haml
index 3abab0281a0..e3fe098c807 100644
--- a/app/views/projects/mirrors/_ssh_host_keys.html.haml
+++ b/app/views/projects/mirrors/_ssh_host_keys.html.haml
@@ -3,7 +3,7 @@
- verified_at = mirror.ssh_known_hosts_verified_at
.form-group.js-ssh-host-keys-section{ class: ('collapse' unless mirror.ssh_mirror_url?) }
- %button.btn.gl-button.btn-inverted.btn-secondary.inline.js-detect-host-keys.gl-mr-3{ type: 'button', data: { qa_selector: 'detect_host_keys' } }
+ = render Pajamas::ButtonComponent.new(button_options: { class: 'js-detect-host-keys gl-mr-3', data: { qa_selector: 'detect_host_keys' } }) do
= gl_loading_icon(inline: true, css_class: 'js-spinner gl-display-none gl-mr-2')
= _('Detect host keys')
.fingerprint-ssh-info.js-fingerprint-ssh-info.gl-mt-3.gl-mb-3{ class: ('collapse' unless mirror.ssh_mirror_url?) }
@@ -23,7 +23,7 @@
#{time_ago_in_words(verified_at)} ago
.js-ssh-hosts-advanced.inline
- %button.btn.gl-button.btn-default.btn-show-advanced.show-advanced{ type: 'button' }
+ = render Pajamas::ButtonComponent.new(button_options: { class: 'btn-show-advanced show-advanced' }) do
%span.label-show
= _('Input host keys manually')
%span.label-hide
diff --git a/app/views/projects/usage_quotas/index.html.haml b/app/views/projects/usage_quotas/index.html.haml
index b2c2394235a..74c54cc888d 100644
--- a/app/views/projects/usage_quotas/index.html.haml
+++ b/app/views/projects/usage_quotas/index.html.haml
@@ -1,5 +1,13 @@
- page_title s_("UsageQuota|Usage")
+- presenter_class = Namespaces::FreeUserCap::Projects::UsageQuotaLimitationsBannerPresenter
+- usage_quota_limits_banner_presenter = presenter_class.new(@project, current_user: current_user)
+
+- if usage_quota_limits_banner_presenter.visible?
+ = render Pajamas::AlertComponent.new(**usage_quota_limits_banner_presenter.alert_component_attributes) do |c|
+ - c.body do
+ = usage_quota_limits_banner_presenter.body_text
+
= render Pajamas::AlertComponent.new(title: _('Repository usage recalculation started'),
variant: :info,
alert_options: { class: 'js-recalculation-started-alert gl-mt-4 gl-mb-5 gl-display-none' }) do |c|
diff --git a/app/workers/all_queues.yml b/app/workers/all_queues.yml
index c1a4ea3a3d0..ab75abff9ba 100644
--- a/app/workers/all_queues.yml
+++ b/app/workers/all_queues.yml
@@ -320,7 +320,7 @@
:tags: []
- :name: cronjob:database_ci_namespace_mirrors_consistency_check
:worker_name: Database::CiNamespaceMirrorsConsistencyCheckWorker
- :feature_category: :sharding
+ :feature_category: :pods
:has_external_dependencies: false
:urgency: :low
:resource_boundary: :unknown
@@ -329,7 +329,7 @@
:tags: []
- :name: cronjob:database_ci_project_mirrors_consistency_check
:worker_name: Database::CiProjectMirrorsConsistencyCheckWorker
- :feature_category: :sharding
+ :feature_category: :pods
:has_external_dependencies: false
:urgency: :low
:resource_boundary: :unknown
@@ -455,7 +455,7 @@
:tags: []
- :name: cronjob:loose_foreign_keys_cleanup
:worker_name: LooseForeignKeys::CleanupWorker
- :feature_category: :sharding
+ :feature_category: :pods
:has_external_dependencies: false
:urgency: :low
:resource_boundary: :unknown
@@ -2625,7 +2625,7 @@
:tags: []
- :name: namespaces_process_sync_events
:worker_name: Namespaces::ProcessSyncEventsWorker
- :feature_category: :sharding
+ :feature_category: :pods
:has_external_dependencies: false
:urgency: :high
:resource_boundary: :unknown
@@ -2814,7 +2814,7 @@
:tags: []
- :name: projects_process_sync_events
:worker_name: Projects::ProcessSyncEventsWorker
- :feature_category: :sharding
+ :feature_category: :pods
:has_external_dependencies: false
:urgency: :high
:resource_boundary: :unknown
diff --git a/app/workers/database/ci_namespace_mirrors_consistency_check_worker.rb b/app/workers/database/ci_namespace_mirrors_consistency_check_worker.rb
index 8a4ee77cb70..8918dca372d 100644
--- a/app/workers/database/ci_namespace_mirrors_consistency_check_worker.rb
+++ b/app/workers/database/ci_namespace_mirrors_consistency_check_worker.rb
@@ -6,7 +6,7 @@ module Database
include CronjobQueue # rubocop: disable Scalability/CronWorkerContext
sidekiq_options retry: false
- feature_category :sharding
+ feature_category :pods
data_consistency :sticky
idempotent!
diff --git a/app/workers/database/ci_project_mirrors_consistency_check_worker.rb b/app/workers/database/ci_project_mirrors_consistency_check_worker.rb
index d461ded088a..5f10310f8d6 100644
--- a/app/workers/database/ci_project_mirrors_consistency_check_worker.rb
+++ b/app/workers/database/ci_project_mirrors_consistency_check_worker.rb
@@ -6,7 +6,7 @@ module Database
include CronjobQueue # rubocop: disable Scalability/CronWorkerContext
sidekiq_options retry: false
- feature_category :sharding
+ feature_category :pods
data_consistency :sticky
idempotent!
diff --git a/app/workers/loose_foreign_keys/cleanup_worker.rb b/app/workers/loose_foreign_keys/cleanup_worker.rb
index ecece92ec1b..0d04c503fbf 100644
--- a/app/workers/loose_foreign_keys/cleanup_worker.rb
+++ b/app/workers/loose_foreign_keys/cleanup_worker.rb
@@ -7,7 +7,7 @@ module LooseForeignKeys
include CronjobQueue # rubocop: disable Scalability/CronWorkerContext
sidekiq_options retry: false
- feature_category :sharding
+ feature_category :pods
data_consistency :always
idempotent!
diff --git a/app/workers/namespaces/process_sync_events_worker.rb b/app/workers/namespaces/process_sync_events_worker.rb
index ea28fcd8720..36c4ab2058d 100644
--- a/app/workers/namespaces/process_sync_events_worker.rb
+++ b/app/workers/namespaces/process_sync_events_worker.rb
@@ -9,7 +9,7 @@ module Namespaces
data_consistency :always
- feature_category :sharding
+ feature_category :pods
urgency :high
idempotent!
diff --git a/app/workers/projects/process_sync_events_worker.rb b/app/workers/projects/process_sync_events_worker.rb
index 6b6b4e3db7f..92322a9ea99 100644
--- a/app/workers/projects/process_sync_events_worker.rb
+++ b/app/workers/projects/process_sync_events_worker.rb
@@ -9,7 +9,7 @@ module Projects
data_consistency :always
- feature_category :sharding
+ feature_category :pods
urgency :high
idempotent!