Skip to content

Commit 41ad919

Browse files
author
GitLab Bot
committed
Add latest changes from gitlab-org/gitlab@master
1 parent 3e8e61e commit 41ad919

File tree

33 files changed

+311
-56
lines changed

33 files changed

+311
-56
lines changed

.gitlab/ci/test-on-gdk/main.gitlab-ci.yml

+4
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,10 @@ include:
3737
- if: $QA_SUITES =~ /Test::Instance::Smoke/
3838
- !reference [.rules:test:manual, rules]
3939

40+
.parallel:
41+
variables:
42+
QA_TESTS: "" # Reset to empty, because parallel run should never pass in specific specs
43+
4044
.gdk-qa-base:
4145
image: ${REGISTRY_HOST}/${REGISTRY_GROUP}/gitlab-build-images/debian-${DEBIAN_VERSION}-ruby-${RUBY_VERSION}:bundler-2.3-git-2.36-lfs-2.9-chrome-${CHROME_VERSION}-docker-${DOCKER_VERSION}-gcloud-383-kubectl-1.23
4246
extends:

app/assets/javascripts/performance_bar/components/detailed_metric.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ export default {
141141
v-if="currentRequest.details && metricDetails"
142142
:id="`peek-view-${metric}`"
143143
class="gl-display-flex gl-align-items-baseline view"
144-
data-qa-selector="detailed_metric_content"
144+
data-testid="detailed-metric-content"
145145
>
146146
<gl-button
147147
v-gl-tooltip.viewport

app/assets/javascripts/performance_bar/components/performance_bar_app.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ export default {
175175
<div
176176
v-if="currentRequest"
177177
class="gl-display-flex container-fluid gl-overflow-x-auto"
178-
data-qa-selector="performance_bar"
178+
data-testid="performance-bar"
179179
>
180180
<div class="gl-display-flex gl-flex-shrink-0 view-performance-container">
181181
<div v-if="hasHost" id="peek-view-host" class="gl-display-flex gl-gap-2 view">

app/assets/javascripts/performance_bar/components/request_selector.vue

+2-2
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,13 @@ export default {
2828
};
2929
</script>
3030
<template>
31-
<div id="peek-request-selector" data-qa-selector="request_dropdown" class="view gl-mr-5">
31+
<div id="peek-request-selector" data-testid="request-dropdown" class="view gl-mr-5">
3232
<gl-form-select v-model="currentRequestId" class="gl-px-3! gl-py-2!">
3333
<option
3434
v-for="request in requests"
3535
:key="request.id"
3636
:value="request.id"
37-
data-qa-selector="request_dropdown_option"
37+
data-testid="request-dropdown-option"
3838
>
3939
{{ request.displayName }}
4040
</option>

app/graphql/mutations/organizations/create.rb

+14-1
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,29 @@ class Create < BaseMutation
2020
required: true,
2121
description: 'Path for the organization.'
2222

23+
argument :description, GraphQL::Types::String,
24+
required: false,
25+
description: 'Description of the organization.'
26+
2327
def resolve(args)
2428
authorize!(:global)
2529

2630
result = ::Organizations::CreateService.new(
2731
current_user: current_user,
28-
params: args
32+
params: create_params(args)
2933
).execute
3034

3135
{ organization: result.payload, errors: result.errors }
3236
end
37+
38+
private
39+
40+
def create_params(params)
41+
return params unless params.key?(:description)
42+
43+
params[:organization_detail_attributes] = { description: params.delete(:description) }
44+
params
45+
end
3346
end
3447
end
3548
end

app/graphql/types/organizations/organization_type.rb

+4-7
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,7 @@ class OrganizationType < BaseObject
1717
field :description,
1818
GraphQL::Types::String,
1919
null: true,
20-
description:
21-
'Description of the organization. `null` until ' \
22-
'[#422078](https://gitlab.com/gitlab-org/gitlab/-/issues/422078) is complete.',
20+
description: 'Description of the organization.',
2321
alpha: { milestone: '16.7' }
2422
field :groups,
2523
Types::GroupType.connection_type,
@@ -47,14 +45,13 @@ class OrganizationType < BaseObject
4745
null: false,
4846
description: 'Path of the organization.',
4947
alpha: { milestone: '16.4' }
50-
field :web_url, GraphQL::Types::String,
48+
field :web_url,
49+
GraphQL::Types::String,
5150
null: false,
5251
description: 'Web URL of the organization.',
5352
alpha: { milestone: '16.6' }
5453

55-
# Returns empty string until https://gitlab.com/gitlab-org/gitlab/-/issues/422078 is complete.
56-
markdown_field :description_html,
57-
null: true
54+
markdown_field :description_html, null: true, alpha: { milestone: '16.7' }, &:organization_detail
5855

5956
# TODO - update to return real avatar url when https://gitlab.com/gitlab-org/gitlab/-/issues/422418 is complete.
6057
def avatar_url

app/models/organizations/organization.rb

+9-5
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ class Organization < ApplicationRecord
1313
has_many :projects
1414

1515
has_one :settings, class_name: "OrganizationSetting"
16+
has_one :organization_detail, inverse_of: :organization, autosave: true
1617

1718
has_many :organization_users, inverse_of: :organization
1819
has_many :users, through: :organization_users, inverse_of: :organizations
@@ -26,10 +27,18 @@ class Organization < ApplicationRecord
2627
'organizations/path': true,
2728
length: { minimum: 2, maximum: 255 }
2829

30+
delegate :description, to: :organization_detail
31+
32+
accepts_nested_attributes_for :organization_detail
33+
2934
def self.default_organization
3035
find_by(id: DEFAULT_ORGANIZATION_ID)
3136
end
3237

38+
def organization_detail
39+
super.presence || build_organization_detail
40+
end
41+
3342
def default?
3443
id == DEFAULT_ORGANIZATION_ID
3544
end
@@ -46,11 +55,6 @@ def web_url(only_path: nil)
4655
Gitlab::UrlBuilder.build(self, only_path: only_path)
4756
end
4857

49-
# TODO - update to return real description when https://gitlab.com/gitlab-org/gitlab/-/issues/422078 is complete.
50-
def description
51-
nil
52-
end
53-
5458
private
5559

5660
def check_if_default_organization
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# frozen_string_literal: true
2+
3+
module Organizations
4+
class OrganizationDetail < ApplicationRecord
5+
include CacheMarkdownField
6+
7+
cache_markdown_field :description
8+
9+
belongs_to :organization, inverse_of: :organization_detail
10+
11+
validates :organization, presence: true
12+
validates :description, length: { maximum: 1024 }
13+
end
14+
end

config/feature_flags/development/use_500_page_size_for_contribution_analytics.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/431595
55
milestone: '16.7'
66
type: development
77
group: group::optimize
8-
default_enabled: false
8+
default_enabled: true

db/docs/organization_details.yml

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
table_name: organization_details
3+
classes:
4+
- Organizations::OrganizationDetail
5+
feature_categories:
6+
- cell
7+
description: Detail about an organization
8+
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/137616
9+
milestone: '16.7'
10+
gitlab_schema: gitlab_main_clusterwide
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# frozen_string_literal: true
2+
3+
class AddWebIdeOauthApplicationToSettings < Gitlab::Database::Migration[2.2]
4+
milestone '16.7'
5+
6+
def change
7+
add_column :application_settings, :web_ide_oauth_application_id, :int, null: true
8+
end
9+
end
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# frozen_string_literal: true
2+
3+
class AddFkWebIdeOauthApplication < Gitlab::Database::Migration[2.2]
4+
milestone '16.7'
5+
disable_ddl_transaction!
6+
7+
INDEX_NAME = 'index_application_settings_web_ide_oauth_application_id'
8+
9+
def up
10+
add_concurrent_index :application_settings, :web_ide_oauth_application_id, name: INDEX_NAME
11+
add_concurrent_foreign_key :application_settings, :oauth_applications,
12+
column: :web_ide_oauth_application_id,
13+
on_delete: :nullify
14+
end
15+
16+
def down
17+
with_lock_retries do
18+
remove_foreign_key :application_settings, column: :web_ide_oauth_application_id
19+
end
20+
remove_concurrent_index_by_name :application_settings, INDEX_NAME
21+
end
22+
end
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# frozen_string_literal: true
2+
3+
class CreateOrganizationDetails < Gitlab::Database::Migration[2.2]
4+
enable_lock_retries!
5+
milestone '16.7'
6+
7+
def change
8+
create_table :organization_details, id: false do |t|
9+
t.references :organization, primary_key: true, default: nil, index: false, foreign_key: { on_delete: :cascade }
10+
t.timestamps_with_timezone null: false
11+
t.integer :cached_markdown_version
12+
t.text :description, limit: 1024
13+
t.text :description_html # rubocop:disable Migration/AddLimitToTextColumns -- It will be limited by description
14+
end
15+
end
16+
end

db/schema_migrations/20231117031416

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

db/schema_migrations/20231117031559

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
57c6bd774242b5fd6383bd393dfc90007f5f7fef21f2c83d3252f19cd1518e78

db/schema_migrations/20231120090305

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
4e1cbdfdfd8aef13db978cb98ce925c7832567fdef1ca8ceb17038ca2a9c921c

db/structure.sql

+22
Original file line numberDiff line numberDiff line change
@@ -12202,6 +12202,7 @@ CREATE TABLE application_settings (
1220212202
update_namespace_name_rate_limit smallint DEFAULT 120 NOT NULL,
1220312203
pre_receive_secret_detection_enabled boolean DEFAULT false NOT NULL,
1220412204
can_create_organization boolean DEFAULT true NOT NULL,
12205+
web_ide_oauth_application_id integer,
1220512206
CONSTRAINT app_settings_container_reg_cleanup_tags_max_list_size_positive CHECK ((container_registry_cleanup_tags_service_max_list_size >= 0)),
1220612207
CONSTRAINT app_settings_container_registry_pre_import_tags_rate_positive CHECK ((container_registry_pre_import_tags_rate >= (0)::numeric)),
1220712208
CONSTRAINT app_settings_dep_proxy_ttl_policies_worker_capacity_positive CHECK ((dependency_proxy_ttl_group_policy_worker_capacity >= 0)),
@@ -19955,6 +19956,16 @@ CREATE SEQUENCE operations_user_lists_id_seq
1995519956

1995619957
ALTER SEQUENCE operations_user_lists_id_seq OWNED BY operations_user_lists.id;
1995719958

19959+
CREATE TABLE organization_details (
19960+
organization_id bigint NOT NULL,
19961+
created_at timestamp with time zone NOT NULL,
19962+
updated_at timestamp with time zone NOT NULL,
19963+
cached_markdown_version integer,
19964+
description text,
19965+
description_html text,
19966+
CONSTRAINT check_71dfb7807f CHECK ((char_length(description) <= 1024))
19967+
);
19968+
1995819969
CREATE TABLE organization_settings (
1995919970
organization_id bigint NOT NULL,
1996019971
created_at timestamp with time zone NOT NULL,
@@ -29188,6 +29199,9 @@ ALTER TABLE ONLY operations_strategies_user_lists
2918829199
ALTER TABLE ONLY operations_user_lists
2918929200
ADD CONSTRAINT operations_user_lists_pkey PRIMARY KEY (id);
2919029201

29202+
ALTER TABLE ONLY organization_details
29203+
ADD CONSTRAINT organization_details_pkey PRIMARY KEY (organization_id);
29204+
2919129205
ALTER TABLE ONLY organization_settings
2919229206
ADD CONSTRAINT organization_settings_pkey PRIMARY KEY (organization_id);
2919329207

@@ -31661,6 +31675,8 @@ CREATE UNIQUE INDEX index_application_settings_on_push_rule_id ON application_se
3166131675

3166231676
CREATE INDEX index_application_settings_on_usage_stats_set_by_user_id ON application_settings USING btree (usage_stats_set_by_user_id);
3166331677

31678+
CREATE INDEX index_application_settings_web_ide_oauth_application_id ON application_settings USING btree (web_ide_oauth_application_id);
31679+
3166431680
CREATE INDEX index_applicationsettings_on_instance_administration_project_id ON application_settings USING btree (instance_administration_project_id);
3166531681

3166631682
CREATE INDEX index_approval_group_rules_groups_on_group_id ON approval_group_rules_groups USING btree (group_id);
@@ -38157,6 +38173,9 @@ ALTER TABLE ONLY cluster_agents
3815738173
ALTER TABLE ONLY protected_tag_create_access_levels
3815838174
ADD CONSTRAINT fk_f7dfda8c51 FOREIGN KEY (protected_tag_id) REFERENCES protected_tags(id) ON DELETE CASCADE;
3815938175

38176+
ALTER TABLE ONLY application_settings
38177+
ADD CONSTRAINT fk_f9867b3540 FOREIGN KEY (web_ide_oauth_application_id) REFERENCES oauth_applications(id) ON DELETE SET NULL;
38178+
3816038179
ALTER TABLE ONLY ci_stages
3816138180
ADD CONSTRAINT fk_fb57e6cc56 FOREIGN KEY (pipeline_id) REFERENCES ci_pipelines(id) ON DELETE CASCADE;
3816238181

@@ -39201,6 +39220,9 @@ ALTER TABLE ONLY alert_management_alert_user_mentions
3920139220
ALTER TABLE ONLY project_daily_statistics
3920239221
ADD CONSTRAINT fk_rails_8e549b272d FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
3920339222

39223+
ALTER TABLE ONLY organization_details
39224+
ADD CONSTRAINT fk_rails_8facb04bef FOREIGN KEY (organization_id) REFERENCES organizations(id) ON DELETE CASCADE;
39225+
3920439226
ALTER TABLE ONLY ci_pipelines_config
3920539227
ADD CONSTRAINT fk_rails_906c9a2533 FOREIGN KEY (pipeline_id) REFERENCES ci_pipelines(id) ON DELETE CASCADE;
3920639228

doc/api/graphql/reference/index.md

+3-2
Original file line numberDiff line numberDiff line change
@@ -5756,6 +5756,7 @@ Input type: `OrganizationCreateInput`
57565756
| Name | Type | Description |
57575757
| ---- | ---- | ----------- |
57585758
| <a id="mutationorganizationcreateclientmutationid"></a>`clientMutationId` | [`String`](#string) | A unique identifier for the client performing the mutation. |
5759+
| <a id="mutationorganizationcreatedescription"></a>`description` | [`String`](#string) | Description of the organization. |
57595760
| <a id="mutationorganizationcreatename"></a>`name` | [`String!`](#string) | Name for the organization. |
57605761
| <a id="mutationorganizationcreatepath"></a>`path` | [`String!`](#string) | Path for the organization. |
57615762

@@ -22833,8 +22834,8 @@ Active period time range for on-call rotation.
2283322834
| Name | Type | Description |
2283422835
| ---- | ---- | ----------- |
2283522836
| <a id="organizationavatarurl"></a>`avatarUrl` **{warning-solid}** | [`String`](#string) | **Introduced** in 16.7. This feature is an Experiment. It can be changed or removed at any time. Avatar URL of the organization. `null` until [#422418](https://gitlab.com/gitlab-org/gitlab/-/issues/422418) is complete. |
22836-
| <a id="organizationdescription"></a>`description` **{warning-solid}** | [`String`](#string) | **Introduced** in 16.7. This feature is an Experiment. It can be changed or removed at any time. Description of the organization. `null` until [#422078](https://gitlab.com/gitlab-org/gitlab/-/issues/422078) is complete. |
22837-
| <a id="organizationdescriptionhtml"></a>`descriptionHtml` | [`String`](#string) | GitLab Flavored Markdown rendering of `description`. |
22837+
| <a id="organizationdescription"></a>`description` **{warning-solid}** | [`String`](#string) | **Introduced** in 16.7. This feature is an Experiment. It can be changed or removed at any time. Description of the organization. |
22838+
| <a id="organizationdescriptionhtml"></a>`descriptionHtml` **{warning-solid}** | [`String`](#string) | **Introduced** in 16.7. This feature is an Experiment. It can be changed or removed at any time. GitLab Flavored Markdown rendering of `description`. |
2283822839
| <a id="organizationid"></a>`id` **{warning-solid}** | [`ID!`](#id) | **Introduced** in 16.4. This feature is an Experiment. It can be changed or removed at any time. ID of the organization. |
2283922840
| <a id="organizationname"></a>`name` **{warning-solid}** | [`String!`](#string) | **Introduced** in 16.4. This feature is an Experiment. It can be changed or removed at any time. Name of the organization. |
2284022841
| <a id="organizationorganizationusers"></a>`organizationUsers` **{warning-solid}** | [`OrganizationUserConnection!`](#organizationuserconnection) | **Introduced** in 16.4. This feature is an Experiment. It can be changed or removed at any time. Users with access to the organization. |

doc/api/projects.md

+3
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,9 @@ When the user is authenticated and `simple` is not set this returns something li
280280
]
281281
```
282282

283+
NOTE:
284+
`last_activity_at` is updated based on [project activity](../user/project/working_with_projects.md#view-project-activity) and [project events](events.md). `updated_at` is updated whenever the project record is changed in the database.
285+
283286
You can filter by [custom attributes](custom_attributes.md) with:
284287

285288
```plaintext

doc/development/ai_features/duo_chat.md

+13-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Use [this snippet](https://gitlab.com/gitlab-org/gitlab/-/snippets/2554994) for
1414
1. [Enable Anthropic API features](index.md#configure-anthropic-access).
1515
1. [Ensure the embedding database is configured](index.md#set-up-the-embedding-database).
1616
1. Ensure that your current branch is up-to-date with `master`.
17-
1. To access the GitLab Duo Chat interface, in the lower-left corner of any page, select **Help** and **Ask GitLab Duo Chat**.
17+
1. Enable the feature in Rails console: `Feature.enable(:tanuki_bot_breadcrumbs_entry_point)`
1818

1919
## Working with GitLab Duo Chat
2020

@@ -85,7 +85,7 @@ gdk start
8585
tail -f log/llm.log
8686
```
8787

88-
## Testing GitLab Duo Chat against real LLMs
88+
## Testing GitLab Duo Chat against real LLMs locally
8989

9090
Because success of answers to user questions in GitLab Duo Chat heavily depends
9191
on toolchain and prompts of each tool, it's common that even a minor change in a
@@ -145,3 +145,14 @@ We therefore need to broadcast messages to multiple clients to keep them in sync
145145

146146
Note that we still broadcast chat messages and currently used tools using the `userId` and `resourceId` as identifier.
147147
However, this is deprecated and should no longer be used. We want to remove `resourceId` on the subscription as part of [this issue](https://gitlab.com/gitlab-org/gitlab/-/issues/420296).
148+
149+
## Testing GitLab Duo Chat in production-like environments
150+
151+
GitLab Duo Chat is enabled in the [Staging](https://staging.gitlab.com) and
152+
[Staging Ref](https://staging-ref.gitlab.com/) GitLab environments.
153+
154+
Because GitLab Duo Chat is currently only available to members of groups in the
155+
Ultimate tier, Staging Ref may be an easier place to test changes as a GitLab
156+
team member because
157+
[you can make yourself an instance Admin in Staging Ref](https://about.gitlab.com/handbook/engineering/infrastructure/environments/staging-ref/#admin-access)
158+
and, as an Admin, easily create licensed groups for testing.

doc/development/database/query_recorder.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ As a rule, merge requests [should not increase query counts](../merge_request_co
1717
This style of test works by counting the number of SQL queries executed by ActiveRecord. First a control count is taken, then you add new records to the database and rerun the count. If the number of queries has significantly increased then an `N+1` queries problem exists.
1818

1919
```ruby
20-
it "avoids N+1 database queries" do
21-
control = ActiveRecord::QueryRecorder.new { visit_some_page }
20+
it "avoids N+1 database queries", :use_sql_query_cache do
21+
control = ActiveRecord::QueryRecorder.new(skip_cached: false) { visit_some_page }
2222
create_list(:issue, 5)
2323
expect { visit_some_page }.to issue_same_number_of_queries_as(control)
2424
end

doc/user/project/import/bitbucket_server.md

+6-2
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,8 @@ The following items are changed when they are imported:
7575

7676
## User assignment
7777

78+
> Importing approvals by email address or username [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/23586) in GitLab 16.7.
79+
7880
Prerequisites:
7981

8082
- Authentication token with administrator access.
@@ -87,8 +89,10 @@ original creator.
8789
The importer creates any new namespaces (groups) if they don't exist. If the namespace is taken, the
8890
repository imports under the namespace of the user who started the import process.
8991

90-
The importer attempts to find reviewers by their email address in the GitLab user database. If they don't exist in GitLab, they cannot be added as reviewers to a
91-
merge request.
92+
The importer attempts to find:
93+
94+
- Reviewers by their email address in the GitLab user database. If they don't exist in GitLab, they are not added as reviewers to a merge request.
95+
- Approvers by username or email. If they don't exist in GitLab, the approval is not added to a merge request.
9296

9397
### User assignment by username
9498

0 commit comments

Comments
 (0)