Skip to content

Commit 9ccf40d

Browse files
author
GitLab Bot
committed
Add latest changes from gitlab-org/gitlab@master
1 parent 0812feb commit 9ccf40d

File tree

18 files changed

+178
-16
lines changed

18 files changed

+178
-16
lines changed

GITALY_SERVER_VERSION

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
ac4a86a34094f43541fb68f8e80dd1bc9875e9e6
1+
4ca70c40dd50e1e3fe6904c05eedca33dcd8b429

GITLAB_METRICS_EXPORTER_VERSION

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
27d39b816071e9630436f8bf19740c173594631d
1+
8317dab17a135879a493ca23e4963c0c58391000

app/assets/javascripts/diffs/components/tree_list.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ export default {
101101
</button>
102102
</div>
103103
</div>
104-
<div :class="{ 'pt-0 tree-list-blobs': !renderTreeList }" class="tree-list-scroll">
104+
<div :class="{ 'pt-0 tree-list-blobs': !renderTreeList || search }" class="tree-list-scroll">
105105
<template v-if="filteredTreeList.length">
106106
<file-tree
107107
v-for="file in filteredTreeList"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# frozen_string_literal: true
2+
3+
module Resolvers
4+
class SavedReplyResolver < BaseResolver
5+
type Types::SavedReplyType, null: true
6+
7+
alias_method :target, :object
8+
9+
argument :id, Types::GlobalIDType[::Users::SavedReply],
10+
required: true,
11+
description: 'ID of a saved reply.'
12+
13+
def resolve(id:)
14+
return unless Feature.enabled?(:saved_replies, current_user)
15+
16+
saved_reply = ::Users::SavedReply.find_saved_reply(user_id: current_user.id, id: id.model_id)
17+
18+
return unless saved_reply
19+
20+
saved_reply
21+
end
22+
end
23+
end

app/graphql/types/saved_reply_type.rb

+2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ module Types
44
class SavedReplyType < BaseObject
55
graphql_name 'SavedReply'
66

7+
connection_type_class(Types::CountableConnectionType)
8+
79
authorize :read_saved_replies
810

911
field :id, Types::GlobalIDType[::Users::SavedReply],

app/graphql/types/user_interface.rb

+5
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,11 @@ module UserInterface
137137
description: 'Saved replies authored by the user. ' \
138138
'Will not return saved replies if `saved_replies` feature flag is disabled.'
139139

140+
field :saved_reply,
141+
resolver: Resolvers::SavedReplyResolver,
142+
description: 'Saved reply authored by the user. ' \
143+
'Will not return saved reply if `saved_replies` feature flag is disabled.'
144+
140145
field :gitpod_enabled, GraphQL::Types::Boolean, null: true,
141146
description: 'Whether Gitpod is enabled at the user level.'
142147

app/models/users/saved_reply.rb

+4
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,9 @@ class SavedReply < ApplicationRecord
1111
length: { maximum: 255 },
1212
uniqueness: { scope: [:user_id] }
1313
validates :content, length: { maximum: 10000 }
14+
15+
def self.find_saved_reply(user_id:, id:)
16+
::Users::SavedReply.find_by(user_id: user_id, id: id)
17+
end
1418
end
1519
end

doc/api/graphql/reference/index.md

+73
Original file line numberDiff line numberDiff line change
@@ -9535,6 +9535,7 @@ The connection type for [`SavedReply`](#savedreply).
95359535

95369536
| Name | Type | Description |
95379537
| ---- | ---- | ----------- |
9538+
| <a id="savedreplyconnectioncount"></a>`count` | [`Int!`](#int) | Total count of collection. |
95389539
| <a id="savedreplyconnectionedges"></a>`edges` | [`[SavedReplyEdge]`](#savedreplyedge) | A list of edges. |
95399540
| <a id="savedreplyconnectionnodes"></a>`nodes` | [`[SavedReply]`](#savedreply) | A list of nodes. |
95409541
| <a id="savedreplyconnectionpageinfo"></a>`pageInfo` | [`PageInfo!`](#pageinfo) | Information to aid in pagination. |
@@ -15683,6 +15684,18 @@ four standard [pagination arguments](#connection-pagination-arguments):
1568315684
| <a id="mergerequestassigneereviewrequestedmergerequestsupdatedafter"></a>`updatedAfter` | [`Time`](#time) | Merge requests updated after this timestamp. |
1568415685
| <a id="mergerequestassigneereviewrequestedmergerequestsupdatedbefore"></a>`updatedBefore` | [`Time`](#time) | Merge requests updated before this timestamp. |
1568515686

15687+
##### `MergeRequestAssignee.savedReply`
15688+
15689+
Saved reply authored by the user. Will not return saved reply if `saved_replies` feature flag is disabled.
15690+
15691+
Returns [`SavedReply`](#savedreply).
15692+
15693+
###### Arguments
15694+
15695+
| Name | Type | Description |
15696+
| ---- | ---- | ----------- |
15697+
| <a id="mergerequestassigneesavedreplyid"></a>`id` | [`UsersSavedReplyID!`](#userssavedreplyid) | ID of a saved reply. |
15698+
1568615699
##### `MergeRequestAssignee.snippets`
1568715700

1568815701
Snippets authored by the user.
@@ -15917,6 +15930,18 @@ four standard [pagination arguments](#connection-pagination-arguments):
1591715930
| <a id="mergerequestauthorreviewrequestedmergerequestsupdatedafter"></a>`updatedAfter` | [`Time`](#time) | Merge requests updated after this timestamp. |
1591815931
| <a id="mergerequestauthorreviewrequestedmergerequestsupdatedbefore"></a>`updatedBefore` | [`Time`](#time) | Merge requests updated before this timestamp. |
1591915932

15933+
##### `MergeRequestAuthor.savedReply`
15934+
15935+
Saved reply authored by the user. Will not return saved reply if `saved_replies` feature flag is disabled.
15936+
15937+
Returns [`SavedReply`](#savedreply).
15938+
15939+
###### Arguments
15940+
15941+
| Name | Type | Description |
15942+
| ---- | ---- | ----------- |
15943+
| <a id="mergerequestauthorsavedreplyid"></a>`id` | [`UsersSavedReplyID!`](#userssavedreplyid) | ID of a saved reply. |
15944+
1592015945
##### `MergeRequestAuthor.snippets`
1592115946

1592215947
Snippets authored by the user.
@@ -16170,6 +16195,18 @@ four standard [pagination arguments](#connection-pagination-arguments):
1617016195
| <a id="mergerequestparticipantreviewrequestedmergerequestsupdatedafter"></a>`updatedAfter` | [`Time`](#time) | Merge requests updated after this timestamp. |
1617116196
| <a id="mergerequestparticipantreviewrequestedmergerequestsupdatedbefore"></a>`updatedBefore` | [`Time`](#time) | Merge requests updated before this timestamp. |
1617216197

16198+
##### `MergeRequestParticipant.savedReply`
16199+
16200+
Saved reply authored by the user. Will not return saved reply if `saved_replies` feature flag is disabled.
16201+
16202+
Returns [`SavedReply`](#savedreply).
16203+
16204+
###### Arguments
16205+
16206+
| Name | Type | Description |
16207+
| ---- | ---- | ----------- |
16208+
| <a id="mergerequestparticipantsavedreplyid"></a>`id` | [`UsersSavedReplyID!`](#userssavedreplyid) | ID of a saved reply. |
16209+
1617316210
##### `MergeRequestParticipant.snippets`
1617416211

1617516212
Snippets authored by the user.
@@ -16422,6 +16459,18 @@ four standard [pagination arguments](#connection-pagination-arguments):
1642216459
| <a id="mergerequestreviewerreviewrequestedmergerequestsupdatedafter"></a>`updatedAfter` | [`Time`](#time) | Merge requests updated after this timestamp. |
1642316460
| <a id="mergerequestreviewerreviewrequestedmergerequestsupdatedbefore"></a>`updatedBefore` | [`Time`](#time) | Merge requests updated before this timestamp. |
1642416461

16462+
##### `MergeRequestReviewer.savedReply`
16463+
16464+
Saved reply authored by the user. Will not return saved reply if `saved_replies` feature flag is disabled.
16465+
16466+
Returns [`SavedReply`](#savedreply).
16467+
16468+
###### Arguments
16469+
16470+
| Name | Type | Description |
16471+
| ---- | ---- | ----------- |
16472+
| <a id="mergerequestreviewersavedreplyid"></a>`id` | [`UsersSavedReplyID!`](#userssavedreplyid) | ID of a saved reply. |
16473+
1642516474
##### `MergeRequestReviewer.snippets`
1642616475

1642716476
Snippets authored by the user.
@@ -20586,6 +20635,18 @@ four standard [pagination arguments](#connection-pagination-arguments):
2058620635
| <a id="usercorereviewrequestedmergerequestsupdatedafter"></a>`updatedAfter` | [`Time`](#time) | Merge requests updated after this timestamp. |
2058720636
| <a id="usercorereviewrequestedmergerequestsupdatedbefore"></a>`updatedBefore` | [`Time`](#time) | Merge requests updated before this timestamp. |
2058820637

20638+
##### `UserCore.savedReply`
20639+
20640+
Saved reply authored by the user. Will not return saved reply if `saved_replies` feature flag is disabled.
20641+
20642+
Returns [`SavedReply`](#savedreply).
20643+
20644+
###### Arguments
20645+
20646+
| Name | Type | Description |
20647+
| ---- | ---- | ----------- |
20648+
| <a id="usercoresavedreplyid"></a>`id` | [`UsersSavedReplyID!`](#userssavedreplyid) | ID of a saved reply. |
20649+
2058920650
##### `UserCore.snippets`
2059020651

2059120652
Snippets authored by the user.
@@ -25004,6 +25065,18 @@ four standard [pagination arguments](#connection-pagination-arguments):
2500425065
| <a id="userreviewrequestedmergerequestsupdatedafter"></a>`updatedAfter` | [`Time`](#time) | Merge requests updated after this timestamp. |
2500525066
| <a id="userreviewrequestedmergerequestsupdatedbefore"></a>`updatedBefore` | [`Time`](#time) | Merge requests updated before this timestamp. |
2500625067

25068+
###### `User.savedReply`
25069+
25070+
Saved reply authored by the user. Will not return saved reply if `saved_replies` feature flag is disabled.
25071+
25072+
Returns [`SavedReply`](#savedreply).
25073+
25074+
####### Arguments
25075+
25076+
| Name | Type | Description |
25077+
| ---- | ---- | ----------- |
25078+
| <a id="usersavedreplyid"></a>`id` | [`UsersSavedReplyID!`](#userssavedreplyid) | ID of a saved reply. |
25079+
2500725080
###### `User.snippets`
2500825081

2500925082
Snippets authored by the user.

doc/development/pages/index.md

+4-2
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,13 @@ info: To determine the technical writer assigned to the Stage/Group associated w
66
description: "GitLab's development guidelines for GitLab Pages"
77
---
88

9-
# Getting started with development
9+
# Contribute to GitLab Pages development
10+
11+
Learn how to configure GitLab Pages so you can help develop the feature.
1012

1113
## Configuring GitLab Pages hostname
1214

13-
GitLab Pages need a hostname or domain, as each different GitLab Pages site is accessed via a
15+
GitLab Pages needs a hostname or domain, as each different GitLab Pages site is accessed through a
1416
subdomain. You can set the GitLab Pages hostname:
1517

1618
- [Without wildcard, editing your hosts file](#without-wildcard-editing-your-hosts-file).

doc/development/service_ping/metrics_lifecycle.md

+9-7
Original file line numberDiff line numberDiff line change
@@ -72,14 +72,16 @@ WARNING:
7272
If a metric is not used in Sisense or any other system after 6 months, the
7373
Product Intelligence team marks it as inactive and assigns it to the group owner for review.
7474

75-
We are working on automating this process. See [this issue](https://gitlab.com/gitlab-org/gitlab/-/issues/338466) for details.
75+
We are working on automating this process. See [this epic](https://gitlab.com/groups/gitlab-org/-/epics/8988) for details.
7676

7777
Product Intelligence removes metrics from Service Ping if they are not used in any Sisense dashboard.
7878

79-
For an example of the metric removal process, see this [example issue](https://gitlab.com/gitlab-org/gitlab/-/issues/297029).
79+
For an example of the metric removal process, see this [example issue](https://gitlab.com/gitlab-org/gitlab/-/issues/388236).
8080

8181
To remove a metric:
8282

83+
1. Create an issue for removing the metric if none exists yet. The issue needs to outline why the metric should be deleted. You can use this issue to document the removal process.
84+
8385
1. Check the following YAML files and verify the metric is not used in an aggregate:
8486
- [`config/metrics/aggregates/*.yaml`](https://gitlab.com/gitlab-org/gitlab/-/blob/master/config/metrics/aggregates/)
8587
- [`ee/config/metrics/aggregates/*.yaml`](https://gitlab.com/gitlab-org/gitlab/-/blob/master/ee/config/metrics/aggregates/)
@@ -111,13 +113,16 @@ To remove a metric:
111113
[GitLab Data Team project](https://gitlab.com/gitlab-data/analytics/-/issues).
112114
Ask for confirmation that the metric is not referred to in any SiSense dashboards and
113115
can be safely removed from Service Ping. Use this
114-
[example issue](https://gitlab.com/gitlab-data/analytics/-/issues/7539) for guidance.
116+
[example issue](https://gitlab.com/gitlab-data/analytics/-/issues/15266) for guidance.
117+
118+
1. Notify the Customer Success Ops team (`@csops-team`), Analytics Engineers (`@gitlab-data/analytics-engineers`), and Product Analysts (`@gitlab-data/product-analysts`) by `@` mentioning those groups in a comment in the issue regarding the deletion of the metric.
119+
Many Service Ping metrics are relied upon for health score and XMAU reporting and unexpected changes to those metrics could break reporting.
115120

116121
1. After you verify the metric can be safely removed,
117122
update the attributes of the metric's YAML definition:
118123

119124
- Set the `status:` to `removed`.
120-
- Set `removed_by_url:` to the URL of the MR removing the metric
125+
- Set `removed_by_url:` to the URL of the issue removing the metric
121126
- Set `milestone_removed:` to the number of the
122127
milestone in which the metric was removed.
123128

@@ -139,6 +144,3 @@ To remove a metric:
139144
1. Remove any other records related to the metric:
140145
- The feature flag YAML file at [`config/feature_flags/*/*.yaml`](https://gitlab.com/gitlab-org/gitlab/-/tree/master/config/feature_flags).
141146
- The entry in the known events YAML file at [`lib/gitlab/usage_data_counters/known_events/*.yaml`](https://gitlab.com/gitlab-org/gitlab/-/tree/master/lib/gitlab/usage_data_counters/known_events).
142-
143-
1. Notify the Customer Success Ops team (`@csops-team`), Analytics Engineers (`@gitlab-data/analytics-engineers`), and Product Analysts (`@gitlab-data/product-analysts`) by `@` mentioning those groups in a comment on the MR.
144-
Many Service Ping metrics are relied upon for health score and XMAU reporting and unexpected changes to those metrics could break reporting.

doc/development/service_ping/review_guidelines.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ are regular backend changes.
6868
Read the [stages file](https://gitlab.com/gitlab-com/www-gitlab-com/blob/master/data/stages.yml).
6969
- Check the file location. Consider the time frame, and if the file should be under `ee`.
7070
- Check the tiers.
71-
- If a metric was changed or removed: Make sure the MR author notified the Customer Success Ops team (`@csops-team`), Analytics Engineers (`@gitlab-data/analytics-engineers`), and Product Analysts (`@gitlab-data/product-analysts`) by `@` mentioning those groups in a comment on the MR.
71+
- If a metric was changed or removed: Make sure the MR author notified the Customer Success Ops team (`@csops-team`), Analytics Engineers (`@gitlab-data/analytics-engineers`), and Product Analysts (`@gitlab-data/product-analysts`) by `@` mentioning those groups in a comment on the issue for the MR and all of these groups have acknowledged the removal.
7272
- Metrics instrumentations
7373
- Recommend using metrics instrumentation for new metrics, [if possible](metrics_instrumentation.md#support-for-instrumentation-classes).
7474
- Approve the MR, and relabel the MR with `~"product intelligence::approved"`.

qa/qa/flow/user_onboarding.rb

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ def onboard_user
1010
if welcome_page.has_get_started_button?
1111
welcome_page.select_role('Other')
1212
welcome_page.choose_setup_for_company_if_available
13+
welcome_page.choose_create_a_new_project_if_available
1314
welcome_page.click_get_started_button
1415
end
1516
end

qa/qa/page/registration/welcome.rb

+4
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@ def choose_setup_for_company_if_available
2121
# Only implemented in EE
2222
end
2323

24+
def choose_create_a_new_project_if_available
25+
# Only implemented in EE
26+
end
27+
2428
def click_get_started_button
2529
Support::Retrier.retry_until do
2630
click_element :get_started_button

qa/qa/resource/user.rb

+4-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ class User < Base
1212
:extern_uid,
1313
:expect_fabrication_success,
1414
:hard_delete_on_api_removal,
15-
:access_level
15+
:access_level,
16+
:email_domain
1617

1718
attributes :id,
1819
:name,
@@ -25,6 +26,7 @@ def initialize
2526
@hard_delete_on_api_removal = false
2627
@unique_id = SecureRandom.hex(8)
2728
@expect_fabrication_success = true
29+
@email_domain = 'example.com'
2830
end
2931

3032
def self.default
@@ -63,7 +65,7 @@ def last_name
6365
def email
6466
@email ||= begin
6567
api_email = api_resource&.dig(:email)
66-
api_email && !api_email.empty? ? api_email : "#{username}@example.com"
68+
api_email && !api_email.empty? ? api_email : "#{username}@#{email_domain}"
6769
end
6870
end
6971

qa/qa/specs/features/browser_ui/1_manage/login/register_spec.rb

+3-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@ module QA
55
it 'allows the user to register and login' do
66
Runtime::Browser.visit(:gitlab, Page::Main::Login)
77

8-
Resource::User.fabricate_via_browser_ui!
8+
Resource::User.fabricate_via_browser_ui! do |user_resource|
9+
user_resource.email_domain = 'gitlab.com'
10+
end
911

1012
Page::Main::Menu.perform do |menu|
1113
expect(menu).to have_personal_area
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# frozen_string_literal: true
2+
3+
require 'spec_helper'
4+
5+
RSpec.describe Resolvers::SavedReplyResolver, feature_category: :user_profile do
6+
include GraphqlHelpers
7+
8+
let_it_be(:current_user) { create(:user) }
9+
let_it_be(:saved_reply) { create(:saved_reply, user: current_user) }
10+
11+
describe 'feature flag disabled' do
12+
before do
13+
stub_feature_flags(saved_replies: false)
14+
end
15+
16+
it 'does not return saved reply' do
17+
expect(resolve_saved_reply).to be_nil
18+
end
19+
end
20+
21+
describe 'feature flag enabled' do
22+
it 'returns users saved reply' do
23+
expect(resolve_saved_reply).to eq(saved_reply)
24+
end
25+
26+
it 'returns nil when saved reply is not found' do
27+
expect(resolve_saved_reply({ id: 'gid://gitlab/Users::SavedReply/100' })).to be_nil
28+
end
29+
30+
it 'returns nil when saved reply is another users' do
31+
other_users_saved_reply = create(:saved_reply, user: create(:user))
32+
33+
expect(resolve_saved_reply({ id: other_users_saved_reply.to_global_id })).to be_nil
34+
end
35+
end
36+
37+
def resolve_saved_reply(args = { id: saved_reply.to_global_id })
38+
resolve(described_class, args: args, ctx: { current_user: current_user })
39+
end
40+
end

spec/graphql/types/user_type_spec.rb

+1
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
preferencesGitpodPath
4747
profileEnableGitpodPath
4848
savedReplies
49+
savedReply
4950
]
5051

5152
expect(described_class).to have_graphql_fields(*expected_fields)

spec/support/shared_examples/graphql/types/merge_request_interactions_type_shared_examples.rb

+1
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
preferencesGitpodPath
4242
profileEnableGitpodPath
4343
savedReplies
44+
savedReply
4445
]
4546

4647
expect(described_class).to have_graphql_fields(*expected_fields)

0 commit comments

Comments
 (0)