Skip to content

Commit b1cfb65

Browse files
author
GitLab Bot
committed
Add latest changes from gitlab-org/gitlab@master
1 parent 6387320 commit b1cfb65

File tree

45 files changed

+832
-673
lines changed

Some content is hidden

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

45 files changed

+832
-673
lines changed

DUO_WORKFLOW_EXECUTOR_VERSION

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v0.0.12
1+
v0.0.13

GITALY_SERVER_VERSION

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3f12b41f93ded89c6ee7843526bf5529982250af
1+
6175a5f017f01e11959045c0dc24d9ca237865e6

app/assets/javascripts/environments/environment_details/components/kubernetes/kubernetes_agent_info.vue

-2
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ export default {
3333
methods: {},
3434
i18n: {
3535
agentId: s__('ClusterAgents|Agent ID #%{agentId}'),
36-
neverConnectedText: s__('ClusterAgents|Never'),
3736
},
3837
AGENT_STATUSES,
3938
};
@@ -56,7 +55,6 @@ export default {
5655

5756
<span data-testid="agent-last-used-date">
5857
<time-ago-tooltip v-if="agentLastContact" :time="agentLastContact" />
59-
<span v-else>{{ $options.i18n.neverConnectedText }}</span>
6058
</span>
6159
</div>
6260
</template>

app/controllers/jwks_controller.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ def keys
1111

1212
def payload
1313
[
14-
Rails.application.secrets.openid_connect_signing_key,
14+
Rails.application.credentials.openid_connect_signing_key,
1515
Gitlab::CurrentSettings.ci_jwt_signing_key
1616
].compact.map do |key_data|
1717
OpenSSL::PKey::RSA.new(key_data)

app/models/concerns/base_label.rb

+86
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
# frozen_string_literal: true
2+
3+
module BaseLabel # rubocop:disable Gitlab/BoundedContexts -- existing Label modules/classes are not bounded
4+
extend ActiveSupport::Concern
5+
6+
DEFAULT_COLOR = ::Gitlab::Color.of('#6699cc')
7+
8+
included do
9+
include CacheMarkdownField
10+
include Gitlab::SQL::Pattern
11+
12+
cache_markdown_field :description, pipeline: :single_line
13+
14+
attribute :color, ::Gitlab::Database::Type::Color.new, default: DEFAULT_COLOR
15+
16+
before_validation :strip_whitespace_from_title
17+
18+
validates :color, color: true, presence: true
19+
20+
# Don't allow ',' for label titles
21+
validates :title, presence: true, format: { with: /\A[^,]+\z/ }
22+
validates :title, length: { maximum: 255 }
23+
24+
# Searches for labels with a matching title or description.
25+
#
26+
# This method uses ILIKE on PostgreSQL.
27+
#
28+
# query - The search query as a String.
29+
#
30+
# Returns an ActiveRecord::Relation.
31+
def self.search(query, **options)
32+
# make sure we prevent passing in disallowed columns
33+
search_in = case options[:search_in]
34+
when [:title]
35+
[:title]
36+
when [:description]
37+
[:description]
38+
else
39+
[:title, :description]
40+
end
41+
42+
fuzzy_search(query, search_in)
43+
end
44+
45+
# Override Gitlab::SQL::Pattern.min_chars_for_partial_matching as
46+
# label queries are never global, and so will not use a trigram
47+
# index. That means we can have just one character in the LIKE.
48+
def self.min_chars_for_partial_matching
49+
1
50+
end
51+
52+
def color
53+
super || DEFAULT_COLOR
54+
end
55+
56+
def text_color
57+
color.contrast
58+
end
59+
60+
def title=(value)
61+
if value.blank?
62+
super
63+
else
64+
write_attribute(:title, sanitize_value(value))
65+
end
66+
end
67+
68+
def description=(value)
69+
if value.blank?
70+
super
71+
else
72+
write_attribute(:description, sanitize_value(value))
73+
end
74+
end
75+
76+
private
77+
78+
def sanitize_value(value)
79+
CGI.unescapeHTML(Sanitize.clean(value.to_s))
80+
end
81+
82+
def strip_whitespace_from_title
83+
self[:title] = title&.strip
84+
end
85+
end
86+
end

app/models/label.rb

+1-73
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,27 @@
11
# frozen_string_literal: true
22

33
class Label < ApplicationRecord
4-
include CacheMarkdownField
4+
include BaseLabel
55
include Referable
66
include Subscribable
7-
include Gitlab::SQL::Pattern
87
include OptionallySearch
98
include Sortable
109
include FromUnion
1110
include Presentable
1211
include EachBatch
1312

14-
cache_markdown_field :description, pipeline: :single_line
15-
16-
DEFAULT_COLOR = ::Gitlab::Color.of('#6699cc')
1713
DESCRIPTION_LENGTH_MAX = 512.kilobytes
1814

19-
attribute :color, ::Gitlab::Database::Type::Color.new, default: DEFAULT_COLOR
20-
2115
has_many :lists, dependent: :destroy # rubocop:disable Cop/ActiveRecordDependent
2216
has_many :priorities, class_name: 'LabelPriority'
2317
has_many :label_links, dependent: :destroy # rubocop:disable Cop/ActiveRecordDependent
2418
has_many :issues, through: :label_links, source: :target, source_type: 'Issue'
2519
has_many :merge_requests, through: :label_links, source: :target, source_type: 'MergeRequest'
2620

27-
before_validation :strip_whitespace_from_title
2821
before_destroy :prevent_locked_label_destroy, prepend: true
2922

30-
validates :color, color: true, presence: true
3123
validate :ensure_lock_on_merge_allowed
32-
33-
# Don't allow ',' for label titles
34-
validates :title, presence: true, format: { with: /\A[^,]+\z/ }
3524
validates :title, uniqueness: { scope: [:group_id, :project_id] }
36-
validates :title, length: { maximum: 255 }
3725

3826
# we validate the description against DESCRIPTION_LENGTH_MAX only for labels being created and on updates if
3927
# the description changes to avoid breaking the existing labels which may have their descriptions longer
@@ -182,34 +170,6 @@ def self.ids_on_board(board_id)
182170
on_board(board_id).pluck(:label_id)
183171
end
184172

185-
# Searches for labels with a matching title or description.
186-
#
187-
# This method uses ILIKE on PostgreSQL.
188-
#
189-
# query - The search query as a String.
190-
#
191-
# Returns an ActiveRecord::Relation.
192-
def self.search(query, **options)
193-
# make sure we prevent passing in disallowed columns
194-
search_in = case options[:search_in]
195-
when [:title]
196-
[:title]
197-
when [:description]
198-
[:description]
199-
else
200-
[:title, :description]
201-
end
202-
203-
fuzzy_search(query, search_in)
204-
end
205-
206-
# Override Gitlab::SQL::Pattern.min_chars_for_partial_matching as
207-
# label queries are never global, and so will not use a trigram
208-
# index. That means we can have just one character in the LIKE.
209-
def self.min_chars_for_partial_matching
210-
1
211-
end
212-
213173
def self.on_project_board?(project_id, label_id)
214174
return false if label_id.blank?
215175

@@ -259,30 +219,6 @@ def priority?
259219
priorities.present?
260220
end
261221

262-
def color
263-
super || DEFAULT_COLOR
264-
end
265-
266-
def text_color
267-
color.contrast
268-
end
269-
270-
def title=(value)
271-
if value.blank?
272-
super
273-
else
274-
write_attribute(:title, sanitize_value(value))
275-
end
276-
end
277-
278-
def description=(value)
279-
if value.blank?
280-
super
281-
else
282-
write_attribute(:description, sanitize_value(value))
283-
end
284-
end
285-
286222
##
287223
# Returns the String necessary to reference this Label in Markdown
288224
#
@@ -362,14 +298,6 @@ def label_format_reference(format = :id)
362298
end
363299
end
364300

365-
def sanitize_value(value)
366-
CGI.unescapeHTML(Sanitize.clean(value.to_s))
367-
end
368-
369-
def strip_whitespace_from_title
370-
self[:title] = title&.strip
371-
end
372-
373301
def prevent_locked_label_destroy
374302
return unless lock_on_merge
375303

app/models/project_statistics.rb

+3
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,16 @@
22

33
class ProjectStatistics < ApplicationRecord
44
include CounterAttribute
5+
include IgnorableColumns
56

67
belongs_to :project
78
belongs_to :namespace
89

910
attribute :wiki_size, default: 0
1011
attribute :snippets_size, default: 0
1112

13+
ignore_column :vulnerability_count, remove_with: '17.7', remove_after: '2024-11-15'
14+
1215
counter_attribute :build_artifacts_size
1316
counter_attribute :packages_size
1417

app/models/user.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -95,13 +95,13 @@ class User < ApplicationRecord
9595
attribute :color_mode_id, default: -> { Gitlab::ColorModes::APPLICATION_DEFAULT }
9696

9797
attr_encrypted :otp_secret,
98-
key: Gitlab::Application.secrets.otp_key_base,
98+
key: Gitlab::Application.credentials.otp_key_base,
9999
mode: :per_attribute_iv_and_salt,
100100
insecure_mode: true,
101101
algorithm: 'aes-256-cbc'
102102

103103
devise :two_factor_authenticatable,
104-
otp_secret_encryption_key: Gitlab::Application.secrets.otp_key_base
104+
otp_secret_encryption_key: Gitlab::Application.credentials.otp_key_base
105105

106106
devise :two_factor_backupable, otp_number_of_backup_codes: 10
107107
devise :two_factor_backupable_pbkdf2

app/uploaders/terraform/state_uploader.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ def store_dir
4040
end
4141

4242
def key
43-
OpenSSL::HMAC.digest('SHA256', Gitlab::Application.secrets.db_key_base, project_id.to_s)
43+
OpenSSL::HMAC.digest('SHA256', Gitlab::Application.credentials.db_key_base, project_id.to_s)
4444
end
4545

4646
class << self
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
name: batched_redis_updates_for_kubernetes_agent_events
3+
feature_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/497665
4+
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/168192
5+
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/498416
6+
milestone: '17.5'
7+
group: group::analytics instrumentation
8+
type: beta
9+
default_enabled: false

config/initializers/00_deprecations.rb

-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
deprecators.silenced = silenced
1919

2020
ignored_warnings = [
21-
/`Rails.application.secrets` is deprecated in favor of `Rails.application.credentials`/,
2221
/Your `secret_key_base` is configured in `Rails.application.secrets`, which is deprecated in favor of/,
2322
/Please pass the (coder|class) as a keyword argument/
2423
]

0 commit comments

Comments
 (0)