Skip to content

Commit 35ca7dd

Browse files
author
GitLab Bot
committed
Add latest changes from gitlab-org/gitlab@master
1 parent cbb8628 commit 35ca7dd

File tree

83 files changed

+664
-122
lines changed

Some content is hidden

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

83 files changed

+664
-122
lines changed

.rubocop_todo/gitlab/bounded_contexts.yml

-1
Original file line numberDiff line numberDiff line change
@@ -2553,7 +2553,6 @@ Gitlab/BoundedContexts:
25532553
- 'ee/app/graphql/types/move_type_enum.rb'
25542554
- 'ee/app/graphql/types/negated_iteration_wildcard_id_enum.rb'
25552555
- 'ee/app/graphql/types/path_lock_type.rb'
2556-
- 'ee/app/graphql/types/pending_group_member_type.rb'
25572556
- 'ee/app/graphql/types/permission_types/dast_site_profile.rb'
25582557
- 'ee/app/graphql/types/permission_types/epic.rb'
25592558
- 'ee/app/graphql/types/permission_types/pipeline_security_report_finding.rb'

GITALY_SERVER_VERSION

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
7d588faba97dfbf48c39a3dc600eee66499cf065
1+
af0566ee3ca5075025da8442a44ba7e411caa530

GITLAB_KAS_VERSION

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
449014dfd52c9b1e0f6e8f7b4158e17d20d36971
1+
65cc901765eab78be34876e6aed8b7857de7a5bf

app/assets/javascripts/graphql_shared/possible_types.json

+5
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@
9090
"MemberInterface": [
9191
"GroupMember",
9292
"PendingGroupMember",
93+
"PendingProjectMember",
9394
"ProjectMember"
9495
],
9596
"NoteableInterface": [
@@ -127,6 +128,10 @@
127128
"PypiMetadata",
128129
"TerraformModuleMetadata"
129130
],
131+
"PendingMemberInterface": [
132+
"PendingGroupMember",
133+
"PendingProjectMember"
134+
],
130135
"Registrable": [
131136
"CiSecureFileRegistry",
132137
"ContainerRepositoryRegistry",

app/models/ci/job_token/group_scope_link.rb

+2
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ class GroupScopeLink < Ci::ApplicationRecord
1515
belongs_to :target_group, class_name: '::Group'
1616
belongs_to :added_by, class_name: 'User'
1717

18+
validates :job_token_policies, json_schema: { filename: 'ci_job_token_policies' }, allow_blank: true
19+
1820
scope :with_source, ->(project) { where(source_project: project) }
1921
scope :with_target, ->(group) { where(target_group: group) }
2022

app/models/ci/job_token/project_scope_link.rb

+2
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ class ProjectScopeLink < Ci::ApplicationRecord
1515
belongs_to :target_project, class_name: 'Project'
1616
belongs_to :added_by, class_name: 'User'
1717

18+
validates :job_token_policies, json_schema: { filename: 'ci_job_token_policies' }, allow_blank: true
19+
1820
scope :with_access_direction, ->(direction) { where(direction: direction) }
1921
scope :with_source, ->(project) { where(source_project: project) }
2022
scope :with_target, ->(project) { where(target_project: project) }

app/models/identity.rb

+6-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,12 @@ class Identity < ApplicationRecord
77
belongs_to :user
88

99
validates :provider, presence: true
10-
validates :extern_uid, allow_blank: true, uniqueness: { scope: UniquenessScopes.scopes, case_sensitive: false }
10+
validates :extern_uid, allow_blank: true, uniqueness: {
11+
scope: UniquenessScopes.scopes,
12+
case_sensitive: false,
13+
message: "has already been taken. Please contact your administrator to generate a unique extern_uid / NameID"
14+
}
15+
1116
validates :user, uniqueness: { scope: UniquenessScopes.scopes }
1217

1318
before_save :ensure_normalized_extern_uid, if: :extern_uid_changed?
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-07/schema#",
3+
"description": "Policies that can be assigned to a CI_JOB_TOKEN",
4+
"type": "array",
5+
"items": {
6+
"type": "string",
7+
"enum": [
8+
"admin_container_image",
9+
"admin_secure_files",
10+
"admin_terraform_state",
11+
"build_create_container_image",
12+
"build_destroy_container_image",
13+
"build_download_code",
14+
"build_push_code",
15+
"build_read_container_image",
16+
"create_deployment",
17+
"create_environment",
18+
"create_on_demand_dast_scan",
19+
"create_package",
20+
"create_release",
21+
"destroy_container_image",
22+
"destroy_deployment",
23+
"destroy_environment",
24+
"destroy_package",
25+
"destroy_release",
26+
"read_build",
27+
"read_container_image",
28+
"read_deployment",
29+
"read_environment",
30+
"read_group",
31+
"read_job_artifacts",
32+
"read_pipeline",
33+
"read_project",
34+
"read_release",
35+
"read_secure_files",
36+
"read_terraform_state",
37+
"stop_environment",
38+
"update_deployment",
39+
"update_environment",
40+
"update_pipeline",
41+
"update_release"
42+
]
43+
},
44+
"uniqueItems": true,
45+
"additionalItems": false
46+
}

config/initializers/0_marginalia.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
# matching against the raw SQL, and prepending the comment prevents color
1414
# coding from working in the development log.
1515
Marginalia::Comment.prepend_comment = true if Rails.env.production?
16-
Marginalia::Comment.components = [:application, :correlation_id, :jid, :endpoint_id, :db_config_name,
17-
:console_hostname, :console_username]
16+
Marginalia::Comment.components = [:application, :correlation_id, :jid, :endpoint_id, :db_config_database,
17+
:db_config_name, :console_hostname, :console_username]
1818

1919
# As mentioned in https://github.com/basecamp/marginalia/pull/93/files,
2020
# adding :line has some overhead because a regexp on the backtrace has
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
- title: "`mergeTrainIndex` and `mergeTrainsCount` GraphQL fields deprecated"
2+
# The milestones for the deprecation announcement, and the removal.
3+
removal_milestone: "18.0"
4+
announcement_milestone: "17.5"
5+
# Change breaking_change to false if needed.
6+
breaking_change: true
7+
# The stage and GitLab username of the person reporting the change,
8+
# and a link to the deprecation issue
9+
reporter: rutshah
10+
stage: verify
11+
issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/473759
12+
# Use the impact calculator https://gitlab-com.gitlab.io/gl-infra/breaking-change-impact-calculator/?
13+
impact: low # Can be one of: [critical, high, medium, low]
14+
scope: project # Can be one or a combination of: [instance, group, project]
15+
resolution_role: Developer # Can be one of: [Admin, Owner, Maintainer, Developer]
16+
manual_task: true # Can be true or false. Use this to denote whether a resolution action must be performed manually (true), or if it can be automated by using the API or other automation (false).
17+
body: | # (required) Don't change this line.
18+
The GraphQL field `mergeTrainIndex` and `mergeTrainsCount` in `MergeRequest` are deprecated. To
19+
determine the position of the merge request on the merge train use the
20+
`index` field in `MergeTrainCar` instead. To get the count of MRs in a merge train,
21+
use `count` from `cars` in `MergeTrains::TrainType` instead.
22+
23+
# ==============================
24+
# OPTIONAL END-OF-SUPPORT FIELDS
25+
# ==============================
26+
#
27+
# If an End of Support period applies:
28+
# 1) Share this announcement in the `#spt_managers` Support channel in Slack
29+
# 2) Mention `@gitlab-com/support` in this merge request.
30+
#
31+
# When support for this feature ends, in XX.YY milestone format.
32+
end_of_support_milestone:
33+
# Array of tiers the feature is currently available to,
34+
# like [Free, Silver, Gold, Core, Premium, Ultimate]
35+
tiers:
36+
# Links to documentation and thumbnail image
37+
documentation_url:
38+
image_url:
39+
# Use the youtube thumbnail URL with the structure of https://img.youtube.com/vi/UNIQUEID/hqdefault.jpg
40+
video_url:
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# frozen_string_literal: true
2+
3+
class AddPoliciesToCiProjectScopeLinks < Gitlab::Database::Migration[2.2]
4+
milestone '17.5'
5+
6+
def change
7+
add_column :ci_job_token_project_scope_links, :job_token_policies, :jsonb, default: []
8+
end
9+
end
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# frozen_string_literal: true
2+
3+
class AddPoliciesToCiGroupScopeLinks < Gitlab::Database::Migration[2.2]
4+
milestone '17.5'
5+
6+
def change
7+
add_column :ci_job_token_group_scope_links, :job_token_policies, :jsonb, default: []
8+
end
9+
end
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# frozen_string_literal: true
2+
3+
class CleanupEventsPersonalNamespaceIdGitlabCom < Gitlab::Database::Migration[2.2]
4+
milestone '17.5'
5+
6+
disable_ddl_transaction!
7+
8+
restrict_gitlab_migration gitlab_schema: :gitlab_main
9+
10+
class PersonalNamespace < MigrationRecord
11+
self.table_name = 'namespaces'
12+
end
13+
14+
def up
15+
return unless Gitlab.com_except_jh?
16+
17+
events_model = define_batchable_model('events')
18+
events_model.where.not(personal_namespace_id: nil)
19+
.distinct_each_batch(column: :personal_namespace_id, of: 100) do |batch|
20+
namespace_ids = batch.pluck(:personal_namespace_id)
21+
namespaces_query = PersonalNamespace
22+
.where('events.personal_namespace_id = namespaces.id')
23+
.select(1)
24+
25+
events_model
26+
.where(personal_namespace_id: namespace_ids)
27+
.where('NOT EXISTS (?)', namespaces_query)
28+
.delete_all
29+
end
30+
end
31+
32+
def down
33+
# no-op
34+
end
35+
end
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# frozen_string_literal: true
2+
3+
class AddFkOnEventsPersonalNamespaceIdGitlabCom < Gitlab::Database::Migration[2.2]
4+
milestone '17.5'
5+
6+
disable_ddl_transaction!
7+
8+
def up
9+
return unless Gitlab.com_except_jh?
10+
11+
add_concurrent_foreign_key :events, :namespaces, column: :personal_namespace_id, on_delete: :cascade
12+
end
13+
14+
def down
15+
return unless Gitlab.com_except_jh?
16+
17+
with_lock_retries { remove_foreign_key :events, column: :personal_namespace_id }
18+
end
19+
end

db/schema_migrations/20240920051810

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

db/schema_migrations/20240923131448

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

db/schema_migrations/20241007034738

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

db/schema_migrations/20241007034739

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
289b2660a1297489d0db86008e7ebe732e02ddd4a8f37184d2c2de05b097cfcf

db/structure.sql

+4-2
Original file line numberDiff line numberDiff line change
@@ -8563,7 +8563,8 @@ CREATE TABLE ci_job_token_group_scope_links (
85638563
source_project_id bigint NOT NULL,
85648564
target_group_id bigint NOT NULL,
85658565
added_by_id bigint,
8566-
created_at timestamp with time zone NOT NULL
8566+
created_at timestamp with time zone NOT NULL,
8567+
job_token_policies jsonb DEFAULT '[]'::jsonb
85678568
);
85688569

85698570
CREATE SEQUENCE ci_job_token_group_scope_links_id_seq
@@ -8581,7 +8582,8 @@ CREATE TABLE ci_job_token_project_scope_links (
85818582
target_project_id bigint NOT NULL,
85828583
added_by_id bigint,
85838584
created_at timestamp with time zone NOT NULL,
8584-
direction smallint DEFAULT 0 NOT NULL
8585+
direction smallint DEFAULT 0 NOT NULL,
8586+
job_token_policies jsonb DEFAULT '[]'::jsonb
85858587
);
85868588

85878589
CREATE SEQUENCE ci_job_token_project_scope_links_id_seq

0 commit comments

Comments
 (0)