Skip to content

Commit 52cabe1

Browse files
author
GitLab Bot
committed
Add latest changes from gitlab-org/gitlab@master
1 parent 78c64b0 commit 52cabe1

File tree

62 files changed

+1029
-623
lines changed

Some content is hidden

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

62 files changed

+1029
-623
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# frozen_string_literal: true
2+
3+
module Mutations
4+
module Todos
5+
class DeleteAllDone < ::Mutations::BaseMutation
6+
graphql_name 'TodoDeleteAllDone'
7+
8+
def resolve
9+
verify_rate_limit!
10+
11+
delete_until = Time.now.utc.to_datetime.to_s
12+
13+
::Todos::DeleteAllDoneWorker.perform_async(current_user.id, delete_until) # rubocop:disable CodeReuse/Worker -- we need to do this asynchronously
14+
15+
{
16+
message: format(_('Your request has succeeded. Results will be visible in a couple of minutes.')),
17+
errors: []
18+
}
19+
end
20+
21+
private
22+
23+
def verify_rate_limit!
24+
return unless Gitlab::ApplicationRateLimiter.throttled?(:delete_all_todos, scope: [current_user])
25+
26+
raise_resource_not_available_error!('This endpoint has been requested too many times. Try again later.')
27+
end
28+
end
29+
end
30+
end

app/graphql/types/mutation_type.rb

+1
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,7 @@ class MutationType < BaseObject
153153
mount_mutation Mutations::Todos::SnoozeMany, experiment: { milestone: '17.9' }
154154
mount_mutation Mutations::Todos::UnsnoozeMany, experiment: { milestone: '17.9' }
155155
mount_mutation Mutations::Todos::DeleteMany, experiment: { milestone: '17.11' }
156+
mount_mutation Mutations::Todos::DeleteAllDone, experiment: { milestone: '17.11' }
156157
mount_mutation Mutations::Snippets::Destroy
157158
mount_mutation Mutations::Snippets::Update
158159
mount_mutation Mutations::Snippets::Create

app/models/concerns/integrations/base_data_fields.rb

+3-1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ module BaseDataFields
55
extend ActiveSupport::Concern
66

77
included do
8+
include Gitlab::EncryptedAttribute
9+
810
belongs_to :integration, inverse_of: self.table_name.to_sym, foreign_key: :integration_id, optional: true
911

1012
belongs_to :instance_integration,
@@ -21,7 +23,7 @@ module BaseDataFields
2123
class_methods do
2224
def encryption_options
2325
{
24-
key: Settings.attr_encrypted_db_key_base_32,
26+
key: :db_key_base_32,
2527
encode: true,
2628
mode: :per_attribute_iv,
2729
algorithm: 'aes-256-gcm'

app/models/note.rb

+8-1
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,9 @@ class Note < ApplicationRecord
6464
# Attribute used to determine whether keep_around_commits will be skipped for diff notes.
6565
attr_accessor :skip_keep_around_commits
6666

67+
# Attribute used to skip updates of `updated_at` for the noteable when it could impact database health.
68+
attr_accessor :skip_touch_noteable
69+
6770
attribute :system, default: false
6871

6972
attr_spammable :note, spam_description: true
@@ -183,7 +186,7 @@ class Note < ApplicationRecord
183186
# https://gitlab.com/gitlab-org/gitlab/-/issues/367923
184187
before_create :set_internal_flag
185188
after_save :keep_around_commit, if: :for_project_noteable?, unless: -> { importing? || skip_keep_around_commits }
186-
after_save :touch_noteable, unless: :importing?
189+
after_save :touch_noteable, if: :touch_noteable?
187190
after_commit :notify_after_create, on: :create
188191
after_commit :notify_after_destroy, on: :destroy
189192

@@ -715,6 +718,10 @@ def attribute_names_for_serialization
715718

716719
private
717720

721+
def touch_noteable?
722+
!importing? && !skip_touch_noteable
723+
end
724+
718725
def trigger_note_subscription?
719726
for_issue? && noteable
720727
end

app/models/todo.rb

+2
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,8 @@ class Todo < ApplicationRecord
5858
SSH_KEY_EXPIRING_SOON
5959
].freeze
6060

61+
BATCH_DELETE_SIZE = 100
62+
6163
belongs_to :author, class_name: "User"
6264
belongs_to :note
6365
belongs_to :project

app/serializers/access_token_entity_base.rb

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

33
# rubocop: disable Gitlab/NamespacedClass
4-
class AccessTokenEntityBase < API::Entities::PersonalAccessToken
4+
class AccessTokenEntityBase < API::Entities::PersonalAccessTokenWithLastUsedIps
55
expose :expired?, as: :expired
66
expose :expires_soon?, as: :expires_soon
77
end

app/workers/all_queues.yml

+10
Original file line numberDiff line numberDiff line change
@@ -2684,6 +2684,16 @@
26842684
:idempotent: true
26852685
:tags: []
26862686
:queue_namespace: :terraform
2687+
- :name: todos_destroyer:todos_delete_all_done
2688+
:worker_name: Todos::DeleteAllDoneWorker
2689+
:feature_category: :notifications
2690+
:has_external_dependencies: false
2691+
:urgency: :low
2692+
:resource_boundary: :unknown
2693+
:weight: 1
2694+
:idempotent: true
2695+
:tags: []
2696+
:queue_namespace: :todos_destroyer
26872697
- :name: todos_destroyer:todos_destroyer_confidential_issue
26882698
:worker_name: TodosDestroyer::ConfidentialIssueWorker
26892699
:feature_category: :notifications
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# frozen_string_literal: true
2+
3+
module Todos
4+
class DeleteAllDoneWorker
5+
include ApplicationWorker
6+
include Gitlab::ExclusiveLeaseHelpers
7+
include EachBatch
8+
9+
data_consistency :sticky
10+
idempotent!
11+
12+
sidekiq_options retry: true
13+
include TodosDestroyerQueue
14+
15+
LOCK_TIMEOUT = 1.hour
16+
BATCH_DELETE_SIZE = 10_000
17+
SUB_BATCH_DELETE_SIZE = 100
18+
SLEEP_INTERVAL = 100
19+
MAX_RUNTIME = 2.minutes
20+
21+
def perform(user_id, time)
22+
runtime_limiter = Gitlab::Metrics::RuntimeLimiter.new(MAX_RUNTIME)
23+
delete_until = time.to_datetime
24+
pause_ms = SLEEP_INTERVAL
25+
# rubocop: disable CodeReuse/ActiveRecord -- we need to keep the logic in the worker
26+
in_lock("#{self.class.name.underscore}_#{user_id}", ttl: LOCK_TIMEOUT, retries: 0) do
27+
Todo.where(user_id: user_id)
28+
.with_state(:done)
29+
.each_batch(of: BATCH_DELETE_SIZE) do |batch|
30+
batch.each_batch(of: SUB_BATCH_DELETE_SIZE) do |sub_batch|
31+
sql = <<~SQL
32+
WITH sub_batch AS MATERIALIZED (
33+
#{sub_batch.select(:id, :updated_at).limit(SUB_BATCH_DELETE_SIZE).to_sql}
34+
), filtered_relation AS MATERIALIZED (
35+
SELECT id FROM sub_batch WHERE updated_at < '#{delete_until.to_fs(:db)}' LIMIT #{SUB_BATCH_DELETE_SIZE}
36+
)
37+
DELETE FROM todos WHERE id IN (SELECT id FROM filtered_relation)
38+
SQL
39+
40+
Todo.connection.exec_query(sql)
41+
42+
sleep(pause_ms * 0.001) # Avoid hitting the database too hard
43+
end
44+
45+
next unless runtime_limiter.over_time?
46+
47+
self.class.perform_in(MAX_RUNTIME, user_id, time)
48+
49+
break
50+
end
51+
end
52+
# rubocop: enable CodeReuse/ActiveRecord
53+
end
54+
end
55+
end

config/sidekiq_queues.yml

+2
Original file line numberDiff line numberDiff line change
@@ -1013,6 +1013,8 @@
10131013
- 1
10141014
- - vulnerabilities_process_bulk_dismissed_events
10151015
- 1
1016+
- - vulnerabilities_process_bulk_redetected_events
1017+
- 1
10161018
- - vulnerabilities_process_transfer_events
10171019
- 1
10181020
- - vulnerabilities_remove_all_vulnerabilities

doc/administration/backup_restore/backup_gitlab.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1119,7 +1119,7 @@ For self-compiled installations:
11191119
If you are using [a managed identity](../object_storage.md#azure-workload-and-managed-identities), omit `azure_storage_access_key`:
11201120

11211121
```ruby
1122-
gitlab_rails['object_store']['connection'] = {
1122+
gitlab_rails['backup_upload_connection'] = {
11231123
'provider' => 'AzureRM',
11241124
'azure_storage_account_name' => '<AZURE STORAGE ACCOUNT NAME>',
11251125
'azure_storage_domain' => '<AZURE STORAGE DOMAIN>' # Optional

doc/api/graphql/reference/_index.md

+26-3
Original file line numberDiff line numberDiff line change
@@ -10977,6 +10977,28 @@ Input type: `TodoCreateInput`
1097710977
| <a id="mutationtodocreateerrors"></a>`errors` | [`[String!]!`](#string) | Errors encountered during execution of the mutation. |
1097810978
| <a id="mutationtodocreatetodo"></a>`todo` | [`Todo`](#todo) | To-do item created. |
1097910979

10980+
### `Mutation.todoDeleteAllDone`
10981+
10982+
{{< details >}}
10983+
**Introduced** in GitLab 17.11.
10984+
**Status**: Experiment.
10985+
{{< /details >}}
10986+
10987+
Input type: `TodoDeleteAllDoneInput`
10988+
10989+
#### Arguments
10990+
10991+
| Name | Type | Description |
10992+
| ---- | ---- | ----------- |
10993+
| <a id="mutationtododeletealldoneclientmutationid"></a>`clientMutationId` | [`String`](#string) | A unique identifier for the client performing the mutation. |
10994+
10995+
#### Fields
10996+
10997+
| Name | Type | Description |
10998+
| ---- | ---- | ----------- |
10999+
| <a id="mutationtododeletealldoneclientmutationid"></a>`clientMutationId` | [`String`](#string) | A unique identifier for the client performing the mutation. |
11000+
| <a id="mutationtododeletealldoneerrors"></a>`errors` | [`[String!]!`](#string) | Errors encountered during execution of the mutation. |
11001+
1098011002
### `Mutation.todoDeleteMany`
1098111003

1098211004
{{< details >}}
@@ -43313,9 +43335,10 @@ Types of add-ons.
4331343335

4331443336
| Value | Description |
4331543337
| ----- | ----------- |
43316-
| <a id="gitlabsubscriptionsaddontypecode_suggestions"></a>`CODE_SUGGESTIONS` | GitLab Duo Pro seat add-on. |
43317-
| <a id="gitlabsubscriptionsaddontypeduo_amazon_q"></a>`DUO_AMAZON_Q` | GitLab Duo with Amazon Q seat add-on. |
43318-
| <a id="gitlabsubscriptionsaddontypeduo_enterprise"></a>`DUO_ENTERPRISE` | GitLab Duo Enterprise seat add-on. |
43338+
| <a id="gitlabsubscriptionsaddontypecode_suggestions"></a>`CODE_SUGGESTIONS` | GitLab Duo Pro add-on. |
43339+
| <a id="gitlabsubscriptionsaddontypeduo_amazon_q"></a>`DUO_AMAZON_Q` | GitLab Duo with Amazon Q add-on. |
43340+
| <a id="gitlabsubscriptionsaddontypeduo_enterprise"></a>`DUO_ENTERPRISE` | GitLab Duo Enterprise add-on. |
43341+
| <a id="gitlabsubscriptionsaddontypeduo_nano"></a>`DUO_NANO` {{< icon name="warning-solid" >}} | **Introduced** in GitLab 18.0. **Status**: Experiment. GitLab Duo Nano add-on. |
4331943342

4332043343
### `GitlabSubscriptionsUserRole`
4332143344

doc/api/oauth2.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -414,7 +414,7 @@ detailed flow description.
414414
Resource owner password credentials are disabled for users with
415415
[two-factor authentication](../user/profile/account/two_factor_authentication.md) turned on
416416
and [enterprise users](../user/enterprise_user/_index.md)
417-
with [password authentication disabled for their group](../user/enterprise_user/_index.md#disable-password-authentication-for-enterprise-users).
417+
with [password authentication disabled for their group](../user/enterprise_user/_index.md#disable-authentication-methods).
418418
These users can access the API using [personal access tokens](../user/profile/personal_access_tokens.md)
419419
instead.
420420
{{< /alert >}}

doc/development/documentation/site_architecture/folder_structure.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,9 @@ any stage in the process. The technical writing team reviews all
7171
documentation changes, regardless, and can move content if there is a better
7272
place for it.
7373

74-
## Avoid duplication
74+
## Avoid duplication when possible
7575

76-
Do not include the same information in multiple places.
76+
When possible, do not include the same information in multiple places.
7777
Link to a single source of truth instead.
7878

7979
For example, if you have code in a repository other than the [primary repositories](https://gitlab.com/gitlab-org/technical-writing/docs-gitlab-com/-/blob/main/doc/architecture.md),

doc/development/documentation/styleguide/_index.md

+7-6
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,10 @@ The GitLab documentation is the SSoT for all product information related to impl
2525
use, and troubleshooting. The documentation evolves continuously. It is updated with
2626
new products and features, and with improvements for clarity, accuracy, and completeness.
2727

28-
This policy prevents information silos, making it easier to find information
29-
about GitLab products. It also informs decisions about the kinds of content
30-
included in the documentation.
28+
This policy:
29+
30+
- Prevents information silos and makes it easier to find information about GitLab products.
31+
- Does not mean that content cannot be duplicated in multiple places in the documentation.
3132

3233
## Topic types
3334

@@ -869,10 +870,10 @@ If you use consecutive numbers, you must disable Markdown rule `029`:
869870

870871
## Links
871872

872-
Links help the docs adhere to the
873-
[single source of truth](#documentation-is-the-single-source-of-truth-ssot) principle.
873+
Links are an important way to help readers find what they need.
874874

875-
However, you should avoid putting too many links on any page. Too many links can hinder readability.
875+
However, most content is found by searching, and you should avoid putting too many links on any page.
876+
Too many links can hinder readability.
876877

877878
- Do not duplicate links on the same page. For example, on **Page A**, do not link to **Page B** multiple times.
878879
- Do not use links in headings. Headings that contain links cause errors.

doc/development/documentation/topic_types/tutorial.md

+1-3
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,7 @@ In general, you might consider using a tutorial when:
2020
tutorial describes. If they can't replicate it exactly, they should be able
2121
to replicate something similar.
2222
- Tutorials do not introduce new features.
23-
- Tutorials do not need to adhere to the Single Source of Truth tenet. While it's not
24-
ideal to duplicate content that is available elsewhere, it's worse to force the reader to
25-
leave the page to find what they need.
23+
- Tutorials can include information that's also available elsewhere on the docs site.
2624

2725
## Tutorial filename and location
2826

doc/user/duo_amazon_q/_index.md

+2-4
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@ title: GitLab Duo with Amazon Q
1010
- Tier: Ultimate
1111
- Add-on: GitLab Duo with Amazon Q
1212
- Offering: GitLab Self-Managed
13-
- Status: Preview/Beta
1413

1514
{{< /details >}}
1615

1716
{{< history >}}
1817

1918
- Introduced as [beta](../../policy/development_stages_support.md#beta) in GitLab 17.7 [with a flag](../../administration/feature_flags.md) named `amazon_q_integration`. Disabled by default.
2019
- Feature flag `amazon_q_integration` removed in GitLab 17.8.
20+
- Generally available in GitLab 17.11.
2121

2222
{{< /history >}}
2323

@@ -30,12 +30,10 @@ If you have a GitLab Duo Pro or Duo Enterprise add-on, this feature is not avail
3030
At Re:Invent 2024, Amazon announced the GitLab Duo with Amazon Q integration.
3131
With this integration, you can automate tasks and increase productivity.
3232

33-
Select GitLab customers have been invited to a test GitLab instance
34-
so they can start to experiment right away.
35-
3633
## Set up GitLab Duo with Amazon Q
3734

3835
To access GitLab Duo with Amazon Q, request [access to a lab environment](https://about.gitlab.com/partners/technology-partners/aws/#interest).
36+
3937
Alternately, if you have GitLab 17.8 or later, you can
4038
[set it up on your GitLab Self-Managed instance](setup.md).
4139

doc/user/duo_amazon_q/setup.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@ title: Set up GitLab Duo with Amazon Q
1010
- Tier: Ultimate
1111
- Add-on: GitLab Duo with Amazon Q
1212
- Offering: GitLab Self-Managed
13-
- Status: Preview/Beta
1413

1514
{{< /details >}}
1615

1716
{{< history >}}
1817

1918
- Introduced as an [experiment](../../policy/development_stages_support.md#experiment) in GitLab 17.7 [with a flag](../../administration/feature_flags.md) named `amazon_q_integration`. Disabled by default.
2019
- Feature flag `amazon_q_integration` removed in GitLab 17.8.
20+
- Generally available in GitLab 17.11.
2121

2222
{{< /history >}}
2323

doc/user/enterprise_user/_index.md

+7-2
Original file line numberDiff line numberDiff line change
@@ -307,9 +307,14 @@ includes users' email addresses.
307307

308308
Changing an enterprise user's primary email to an email from a non-verified domain automatically removes the enterprise badge from the account. This does not alter any account roles or permissions for the user, but does limit the group Owner's ability to manage this account.
309309

310-
### Disable password authentication for enterprise users
310+
### Disable authentication methods
311311

312-
A top-level group Owner can [disable password authentication for enterprise users](../group/saml_sso/_index.md#disable-password-authentication-for-enterprise-users).
312+
A top-level group Owner can disable specific authentication methods to reduce the security footprint.
313+
314+
Within the top-level group, the Owner can:
315+
316+
- [Disable password authentication](../group/saml_sso/_index.md#disable-password-authentication-for-enterprise-users).
317+
- [Disable personal access tokens](../../user/profile/personal_access_tokens.md#disable-personal-access-tokens-for-enterprise-users).
313318

314319
## Related topics
315320

0 commit comments

Comments
 (0)