Skip to content

Commit 4f4b85e

Browse files
author
GitLab Bot
committed
Add latest changes from gitlab-org/gitlab@master
1 parent 04befb3 commit 4f4b85e

File tree

75 files changed

+764
-500
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

75 files changed

+764
-500
lines changed

.markdownlint.yml

-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ proper-names:
3333
"API",
3434
"Asana",
3535
"Auth0",
36-
"Authentiq",
3736
"Azure",
3837
"Bamboo",
3938
"Bitbucket",

.rubocop.yml

+2
Original file line numberDiff line numberDiff line change
@@ -526,12 +526,14 @@ RSpec/FactoryBot/AvoidCreate:
526526
- 'spec/views/**/*.rb'
527527
- 'spec/components/**/*.rb'
528528
- 'spec/mailers/**/*.rb'
529+
- 'spec/routes/directs/*.rb'
529530
- 'ee/spec/presenters/**/*.rb'
530531
- 'ee/spec/serializers/**/*.rb'
531532
- 'ee/spec/helpers/**/*.rb'
532533
- 'ee/spec/views/**/*.rb'
533534
- 'ee/spec/components/**/*.rb'
534535
- 'ee/spec/mailers/**/*.rb'
536+
- 'ee/spec/routes/directs/*.rb'
535537

536538
RSpec/FactoryBot/StrategyInCallback:
537539
Enabled: true

.rubocop_todo/rspec/invalid_feature_category.yml

-9
Original file line numberDiff line numberDiff line change
@@ -34,16 +34,7 @@ RSpec/InvalidFeatureCategory:
3434
- 'spec/features/monitor_sidebar_link_spec.rb'
3535
- 'spec/features/unsubscribe_links_spec.rb'
3636
- 'spec/features/whats_new_spec.rb'
37-
- 'spec/lib/api/base_spec.rb'
3837
- 'spec/lib/api/helpers_spec.rb'
39-
- 'spec/lib/gitlab/application_context_spec.rb'
40-
- 'spec/lib/gitlab/error_tracking/context_payload_generator_spec.rb'
41-
- 'spec/lib/gitlab/error_tracking_spec.rb'
42-
- 'spec/lib/gitlab/graphql/tracers/logger_tracer_spec.rb'
43-
- 'spec/lib/gitlab/graphql/tracers/metrics_tracer_spec.rb'
44-
- 'spec/lib/gitlab/metrics/background_transaction_spec.rb'
45-
- 'spec/lib/gitlab/sidekiq_middleware/worker_context/client_spec.rb'
46-
- 'spec/lib/gitlab/sidekiq_middleware/worker_context/server_spec.rb'
4738
- 'spec/lib/gitlab/slug/path_spec.rb'
4839
- 'spec/lib/gitlab/utils/strong_memoize_spec.rb'
4940
- 'spec/models/application_setting_spec.rb'

Gemfile

-1
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@ gem 'omniauth-oauth2-generic', '~> 0.2.2'
7171
gem 'omniauth-saml', '~> 2.0.0'
7272
gem 'omniauth-twitter', '~> 1.4'
7373
gem 'omniauth_crowd', '~> 2.4.0', path: 'vendor/gems/omniauth_crowd' # See vendor/gems/omniauth_crowd/README.md
74-
gem 'omniauth-authentiq', '~> 0.3.3'
7574
gem 'omniauth_openid_connect', '~> 0.6.0'
7675
# Locked until Ruby 3.0 upgrade since upgrading will pull in an updated net-smtp gem.
7776
# See https://docs.gitlab.com/ee/development/emails.html#rationale.

Gemfile.checksum

-1
Original file line numberDiff line numberDiff line change
@@ -391,7 +391,6 @@
391391
{"name":"omniauth-alicloud","version":"2.0.1","platform":"ruby","checksum":"b14c425bca02b4d0f73e710ceb62c0f1f8533e0c427c1c495d2b40f87b3f48d3"},
392392
{"name":"omniauth-atlassian-oauth2","version":"0.2.0","platform":"ruby","checksum":"eb07574a188ab8a03376ce288bce86bc2dd4a1382ffa5781cb5e2b7bc15d76c9"},
393393
{"name":"omniauth-auth0","version":"2.0.0","platform":"ruby","checksum":"823769be7883b45b2fa94367c2f6a17f7b3b1333986016089c016d45827da545"},
394-
{"name":"omniauth-authentiq","version":"0.3.3","platform":"ruby","checksum":"11b3791085a130782bf14b0088653beeb085638a9548d7110a57d3cbbb54fb4c"},
395394
{"name":"omniauth-azure-activedirectory-v2","version":"2.0.0","platform":"ruby","checksum":"c484cedd52cd233e3c216c4b3ed667ec07d20e51c550a613b65a0f90fe8ad072"},
396395
{"name":"omniauth-dingtalk-oauth2","version":"1.0.1","platform":"ruby","checksum":"6545670f1c38344eaf960df9750c550a9534f790f888af088761a9e04269139b"},
397396
{"name":"omniauth-facebook","version":"4.0.0","platform":"ruby","checksum":"05ae3565c8fdb38df8dab04eb8ca854ea6c18e81591d3e6598ce101293a2f20f"},

Gemfile.lock

-4
Original file line numberDiff line numberDiff line change
@@ -997,9 +997,6 @@ GEM
997997
omniauth-oauth2 (>= 1.5)
998998
omniauth-auth0 (2.0.0)
999999
omniauth-oauth2 (~> 1.4)
1000-
omniauth-authentiq (0.3.3)
1001-
jwt (>= 1.5)
1002-
omniauth-oauth2 (>= 1.5)
10031000
omniauth-azure-activedirectory-v2 (2.0.0)
10041001
omniauth-oauth2 (~> 1.8)
10051002
omniauth-dingtalk-oauth2 (1.0.1)
@@ -1771,7 +1768,6 @@ DEPENDENCIES
17711768
omniauth-alicloud (~> 2.0.1)
17721769
omniauth-atlassian-oauth2 (~> 0.2.0)
17731770
omniauth-auth0 (~> 2.0.0)
1774-
omniauth-authentiq (~> 0.3.3)
17751771
omniauth-azure-activedirectory-v2 (~> 2.0)
17761772
omniauth-azure-oauth2 (~> 0.0.9)!
17771773
omniauth-cas3 (~> 1.1.4)!
-17.3 KB
Binary file not shown.

app/assets/javascripts/token_access/components/inbound_token_access.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ export default {
116116
return this.targetProjectPath === '';
117117
},
118118
ciJobTokenHelpPage() {
119-
return helpPagePath('ci/jobs/ci_job_token');
119+
return helpPagePath('ci/jobs/ci_job_token#allow-access-to-your-project-with-a-job-token');
120120
},
121121
},
122122
methods: {

app/assets/javascripts/token_access/components/outbound_token_access.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ export default {
114114
return this.targetProjectPath === '';
115115
},
116116
ciJobTokenHelpPage() {
117-
return helpPagePath('ci/jobs/ci_job_token');
117+
return helpPagePath('ci/jobs/ci_job_token#limit-your-projects-job-token-access');
118118
},
119119
},
120120
methods: {

app/assets/javascripts/token_access/components/token_access_app.vue

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ export default {
2020
</script>
2121
<template>
2222
<div>
23-
<outbound-token-access />
24-
<inbound-token-access v-if="inboundTokenAccessEnabled" class="gl-pt-5" />
23+
<inbound-token-access v-if="inboundTokenAccessEnabled" class="gl-pb-5" />
24+
<outbound-token-access class="gl-py-5" />
2525
<opt-in-jwt />
2626
</div>
2727
</template>

app/controllers/omniauth_callbacks_controller.rb

-8
Original file line numberDiff line numberDiff line change
@@ -61,14 +61,6 @@ def cas3
6161
handle_omniauth
6262
end
6363

64-
def authentiq
65-
if params['sid']
66-
handle_service_ticket oauth['provider'], params['sid']
67-
end
68-
69-
handle_omniauth
70-
end
71-
7264
def auth0
7365
if oauth['uid'].blank?
7466
fail_auth0_login

app/helpers/auth_helper.rb

-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ module AuthHelper
55
alicloud
66
atlassian_oauth2
77
auth0
8-
authentiq
98
azure_activedirectory_v2
109
azure_oauth2
1110
bitbucket

app/helpers/timeboxes_routing_helper.rb

-21
This file was deleted.

app/models/concerns/taskable.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ module Taskable
2727
# ignore tasks in code or html comment blocks. HTML blocks
2828
# are ok as we allow tasks inside <detail> blocks
2929
REGEX = %r{
30-
#{::Gitlab::Regex.markdown_code_or_html_comment_blocks}
30+
#{::Gitlab::Regex.markdown_code_or_html_comments}
3131
|
3232
(?<task_item>
3333
#{ITEM_PATTERN}

app/models/namespace.rb

+13
Original file line numberDiff line numberDiff line change
@@ -141,12 +141,14 @@ class Namespace < ApplicationRecord
141141
:npm_package_requests_forwarding,
142142
to: :package_settings
143143

144+
before_save :update_new_emails_created_column, if: -> { emails_disabled_changed? }
144145
before_create :sync_share_with_group_lock_with_parent
145146
before_update :sync_share_with_group_lock_with_parent, if: :parent_changed?
146147
after_update :force_share_with_group_lock_on_descendants, if: -> { saved_change_to_share_with_group_lock? && share_with_group_lock? }
147148
after_update :expire_first_auto_devops_config_cache, if: -> { saved_change_to_auto_devops_enabled? }
148149
after_update :move_dir, if: :saved_change_to_path_or_parent?, unless: -> { is_a?(Namespaces::ProjectNamespace) }
149150
after_destroy :rm_dir
151+
150152
after_save :reload_namespace_details
151153

152154
after_commit :refresh_access_of_projects_invited_groups, on: :update, if: -> { previous_changes.key?('share_with_group_lock') }
@@ -599,6 +601,17 @@ def all_ancestors_have_runner_registration_enabled?
599601

600602
private
601603

604+
def update_new_emails_created_column
605+
return if namespace_settings.nil?
606+
return if namespace_settings.emails_enabled == !emails_disabled
607+
608+
if namespace_settings.persisted?
609+
namespace_settings.update!(emails_enabled: !emails_disabled)
610+
elsif namespace_settings
611+
namespace_settings.emails_enabled = !emails_disabled
612+
end
613+
end
614+
602615
def cluster_enabled_granted?
603616
(Gitlab.com? || Gitlab.dev_or_test_env?) && root_ancestor.cluster_enabled_grant.present?
604617
end

app/models/project.rb

+12
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@ class Project < ApplicationRecord
119119
before_validation :remove_leading_spaces_on_name
120120
after_validation :check_pending_delete
121121
before_save :ensure_runners_token
122+
before_save :update_new_emails_created_column, if: -> { emails_disabled_changed? }
122123

123124
after_create -> { create_or_load_association(:project_feature) }
124125
after_create -> { create_or_load_association(:ci_cd_settings) }
@@ -3388,6 +3389,17 @@ def enabled_package_registry_access_level_by_project_visibility
33883389
ProjectFeature::PRIVATE
33893390
end
33903391
end
3392+
3393+
def update_new_emails_created_column
3394+
return if project_setting.nil?
3395+
return if project_setting.emails_enabled == !emails_disabled
3396+
3397+
if project_setting.persisted?
3398+
project_setting.update!(emails_enabled: !emails_disabled)
3399+
elsif project_setting
3400+
project_setting.emails_enabled = !emails_disabled
3401+
end
3402+
end
33913403
end
33923404

33933405
Project.prepend_mod_with('Project')

config/feature_flags/development/ci_batch_request_for_local_and_project_includes.yml

-8
This file was deleted.

config/gitlab.yml.example

-14
Original file line numberDiff line numberDiff line change
@@ -1072,16 +1072,6 @@ production: &base
10721072
# login_url: '/cas/login',
10731073
# service_validate_url: '/cas/p3/serviceValidate',
10741074
# logout_url: '/cas/logout' } }
1075-
# - { name: 'authentiq',
1076-
# # for client credentials (client ID and secret), go to https://www.authentiq.com/developers
1077-
# app_id: 'YOUR_CLIENT_ID',
1078-
# app_secret: 'YOUR_CLIENT_SECRET',
1079-
# args: {
1080-
# scope: 'aq:name email~rs address aq:push'
1081-
# # callback_url parameter is optional except when 'gitlab.host' in this file is set to 'localhost'
1082-
# # callback_url: 'YOUR_CALLBACK_URL'
1083-
# }
1084-
# }
10851075
# - { name: 'github',
10861076
# app_id: 'YOUR_APP_ID',
10871077
# app_secret: 'YOUR_APP_SECRET',
@@ -1628,10 +1618,6 @@ test:
16281618
client_id: 'YOUR_AUTH0_CLIENT_ID',
16291619
client_secret: 'YOUR_AUTH0_CLIENT_SECRET',
16301620
namespace: 'YOUR_AUTH0_DOMAIN' } }
1631-
- { name: 'authentiq',
1632-
app_id: 'YOUR_CLIENT_ID',
1633-
app_secret: 'YOUR_CLIENT_SECRET',
1634-
args: { scope: 'aq:name email~rs address aq:push' } }
16351621
- { name: 'salesforce',
16361622
app_id: 'YOUR_CLIENT_ID',
16371623
app_secret: 'YOUR_CLIENT_SECRET'

config/routes.rb

+5-3
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,7 @@
299299
# TODO: We don't need the `Gitlab::Routing` module at all as we can use
300300
# the `direct` DSL method of Rails to define url helpers. Move all the
301301
# custom url helpers to use the `direct` DSL method and remove the `Gitlab::Routing`.
302-
# For more information: https://gitlab.com/gitlab-org/gitlab/-/issues/299583
302+
# For more information: https://gitlab.com/groups/gitlab-org/-/epics/9866
303303
Gitlab::Application.routes.set.filter_map { |route| route.name if route.name&.include?('namespace_project') }.each do |name|
304304
new_name = name.sub('namespace_project', 'project')
305305

@@ -315,7 +315,9 @@
315315
root to: "root#index"
316316

317317
get '*unmatched_route', to: 'application#route_not_found', format: false
318-
end
319318

320-
Gitlab::Routing.add_helpers(TimeboxesRoutingHelper)
319+
# Load all custom URLs definitions via `direct' after the last route
320+
# definition.
321+
draw :directs
322+
end
321323
end

config/routes/directs.rb

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# frozen_string_literal: true
2+
3+
# Custom URL definitions for the Community Edition.
4+
5+
draw 'directs/milestone'

config/routes/directs/milestone.rb

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# frozen_string_literal: true
2+
3+
# @!method milestone_path(milestone, options = {})
4+
# @!method milestone_url(milestone, options = {})
5+
direct(:milestone) do |milestone, *args|
6+
if milestone.group_milestone?
7+
[milestone.group, milestone, *args]
8+
elsif milestone.project_milestone?
9+
[milestone.project, milestone, *args]
10+
end
11+
end
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# frozen_string_literal: true
2+
class AddProjectsEmailsEnabledColumn < Gitlab::Database::Migration[2.0]
3+
enable_lock_retries!
4+
def change
5+
add_column :project_settings, :emails_enabled, :boolean, default: true, null: false
6+
end
7+
end
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# frozen_string_literal: true
2+
class AddNamespacesEmailsEnabledColumn < Gitlab::Database::Migration[2.0]
3+
enable_lock_retries!
4+
5+
def change
6+
add_column :namespace_settings, :emails_enabled, :boolean, default: true, null: false
7+
end
8+
end
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# frozen_string_literal: true
2+
class AddNamespacesEmailsEnabledColumnData < Gitlab::Database::Migration[2.0]
3+
disable_ddl_transaction!
4+
restrict_gitlab_migration gitlab_schema: :gitlab_main
5+
6+
MIGRATION = 'AddNamespacesEmailsEnabledColumnData'
7+
DELAY_INTERVAL = 2.minutes.to_i
8+
BATCH_SIZE = 200
9+
MAX_BATCH_SIZE = 1000
10+
SUB_BATCH_SIZE = 20
11+
12+
def up
13+
queue_batched_background_migration(
14+
MIGRATION,
15+
:namespaces,
16+
:id,
17+
job_interval: DELAY_INTERVAL,
18+
batch_size: BATCH_SIZE,
19+
max_batch_size: MAX_BATCH_SIZE,
20+
sub_batch_size: SUB_BATCH_SIZE,
21+
gitlab_schema: :gitlab_main
22+
)
23+
end
24+
25+
def down
26+
delete_batched_background_migration(MIGRATION, :namespaces, :id, [])
27+
end
28+
end
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# frozen_string_literal: true
2+
class AddProjectsEmailsEnabledColumnData < Gitlab::Database::Migration[2.0]
3+
disable_ddl_transaction!
4+
restrict_gitlab_migration gitlab_schema: :gitlab_main
5+
6+
MIGRATION = 'AddProjectsEmailsEnabledColumnData'
7+
DELAY_INTERVAL = 2.minutes.to_i
8+
BATCH_SIZE = 200
9+
MAX_BATCH_SIZE = 1000
10+
SUB_BATCH_SIZE = 20
11+
12+
def up
13+
queue_batched_background_migration(
14+
MIGRATION,
15+
:projects,
16+
:id,
17+
job_interval: DELAY_INTERVAL,
18+
batch_size: BATCH_SIZE,
19+
max_batch_size: MAX_BATCH_SIZE,
20+
sub_batch_size: SUB_BATCH_SIZE,
21+
gitlab_schema: :gitlab_main
22+
)
23+
end
24+
25+
def down
26+
delete_batched_background_migration(MIGRATION, :projects, :id, [])
27+
end
28+
end

db/schema_migrations/20221116134507

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
80504a4700681db9e46d729f4175dc077fae7e1b0235c9178558293b83f7a006

db/schema_migrations/20221116134539

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
dd36d2586454c8799effa598c0a058a6adf332622877eae16dd95d468f9b3958

db/schema_migrations/20221116134611

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
0668760d6df566ac3081bd9fa2a053497da7a7af652225e91831110435166dcb

db/schema_migrations/20221116134633

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
ceaf6a2b15da0dde23ba37f1166aa5135a9dce1abbe9fca81a12a41cc0319fd9

db/structure.sql

+2
Original file line numberDiff line numberDiff line change
@@ -18427,6 +18427,7 @@ CREATE TABLE namespace_settings (
1842718427
runner_registration_enabled boolean DEFAULT true,
1842818428
allow_runner_registration_token boolean DEFAULT true NOT NULL,
1842918429
unique_project_download_limit_alertlist integer[] DEFAULT '{}'::integer[] NOT NULL,
18430+
emails_enabled boolean DEFAULT true NOT NULL,
1843018431
CONSTRAINT check_0ba93c78c7 CHECK ((char_length(default_branch_name) <= 255)),
1843118432
CONSTRAINT namespace_settings_unique_project_download_limit_alertlist_size CHECK ((cardinality(unique_project_download_limit_alertlist) <= 100)),
1843218433
CONSTRAINT namespace_settings_unique_project_download_limit_allowlist_size CHECK ((cardinality(unique_project_download_limit_allowlist) <= 100))
@@ -20752,6 +20753,7 @@ CREATE TABLE project_settings (
2075220753
only_allow_merge_if_all_status_checks_passed boolean DEFAULT false NOT NULL,
2075320754
mirror_branch_regex text,
2075420755
allow_pipeline_trigger_approve_deployment boolean DEFAULT false NOT NULL,
20756+
emails_enabled boolean DEFAULT true NOT NULL,
2075520757
CONSTRAINT check_2981f15877 CHECK ((char_length(jitsu_key) <= 100)),
2075620758
CONSTRAINT check_3a03e7557a CHECK ((char_length(previous_default_branch) <= 4096)),
2075720759
CONSTRAINT check_3ca5cbffe6 CHECK ((char_length(issue_branch_template) <= 255)),

0 commit comments

Comments
 (0)