summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2023-02-08 09:08:15 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2023-02-08 09:08:15 +0000
commit9ccf40d15a14e9ccf613701ba7e3d5d250961345 (patch)
tree3855ff4af6d2efbf67b956b2665cf054aa1e8a66
parent0812feb16adcf8da1d3555f1d736e7b154fcd046 (diff)
downloadgitlab-ce-9ccf40d15a14e9ccf613701ba7e3d5d250961345.tar.gz
Add latest changes from gitlab-org/gitlab@master
-rw-r--r--GITALY_SERVER_VERSION2
-rw-r--r--GITLAB_METRICS_EXPORTER_VERSION2
-rw-r--r--app/assets/javascripts/diffs/components/tree_list.vue2
-rw-r--r--app/graphql/resolvers/saved_reply_resolver.rb23
-rw-r--r--app/graphql/types/saved_reply_type.rb2
-rw-r--r--app/graphql/types/user_interface.rb5
-rw-r--r--app/models/users/saved_reply.rb4
-rw-r--r--doc/api/graphql/reference/index.md73
-rw-r--r--doc/development/pages/index.md6
-rw-r--r--doc/development/service_ping/metrics_lifecycle.md16
-rw-r--r--doc/development/service_ping/review_guidelines.md2
-rw-r--r--qa/qa/flow/user_onboarding.rb1
-rw-r--r--qa/qa/page/registration/welcome.rb4
-rw-r--r--qa/qa/resource/user.rb6
-rw-r--r--qa/qa/specs/features/browser_ui/1_manage/login/register_spec.rb4
-rw-r--r--spec/graphql/resolvers/saved_reply_resolver_spec.rb40
-rw-r--r--spec/graphql/types/user_type_spec.rb1
-rw-r--r--spec/support/shared_examples/graphql/types/merge_request_interactions_type_shared_examples.rb1
18 files changed, 178 insertions, 16 deletions
diff --git a/GITALY_SERVER_VERSION b/GITALY_SERVER_VERSION
index c416e63c45e..574451662c2 100644
--- a/GITALY_SERVER_VERSION
+++ b/GITALY_SERVER_VERSION
@@ -1 +1 @@
-ac4a86a34094f43541fb68f8e80dd1bc9875e9e6
+4ca70c40dd50e1e3fe6904c05eedca33dcd8b429
diff --git a/GITLAB_METRICS_EXPORTER_VERSION b/GITLAB_METRICS_EXPORTER_VERSION
index 01c8db86a25..99e0127f057 100644
--- a/GITLAB_METRICS_EXPORTER_VERSION
+++ b/GITLAB_METRICS_EXPORTER_VERSION
@@ -1 +1 @@
-27d39b816071e9630436f8bf19740c173594631d
+8317dab17a135879a493ca23e4963c0c58391000
diff --git a/app/assets/javascripts/diffs/components/tree_list.vue b/app/assets/javascripts/diffs/components/tree_list.vue
index 4d0c561e4d5..8bb1872567c 100644
--- a/app/assets/javascripts/diffs/components/tree_list.vue
+++ b/app/assets/javascripts/diffs/components/tree_list.vue
@@ -101,7 +101,7 @@ export default {
</button>
</div>
</div>
- <div :class="{ 'pt-0 tree-list-blobs': !renderTreeList }" class="tree-list-scroll">
+ <div :class="{ 'pt-0 tree-list-blobs': !renderTreeList || search }" class="tree-list-scroll">
<template v-if="filteredTreeList.length">
<file-tree
v-for="file in filteredTreeList"
diff --git a/app/graphql/resolvers/saved_reply_resolver.rb b/app/graphql/resolvers/saved_reply_resolver.rb
new file mode 100644
index 00000000000..96bbc139c96
--- /dev/null
+++ b/app/graphql/resolvers/saved_reply_resolver.rb
@@ -0,0 +1,23 @@
+# frozen_string_literal: true
+
+module Resolvers
+ class SavedReplyResolver < BaseResolver
+ type Types::SavedReplyType, null: true
+
+ alias_method :target, :object
+
+ argument :id, Types::GlobalIDType[::Users::SavedReply],
+ required: true,
+ description: 'ID of a saved reply.'
+
+ def resolve(id:)
+ return unless Feature.enabled?(:saved_replies, current_user)
+
+ saved_reply = ::Users::SavedReply.find_saved_reply(user_id: current_user.id, id: id.model_id)
+
+ return unless saved_reply
+
+ saved_reply
+ end
+ end
+end
diff --git a/app/graphql/types/saved_reply_type.rb b/app/graphql/types/saved_reply_type.rb
index 329f431b10e..8c9f3d19810 100644
--- a/app/graphql/types/saved_reply_type.rb
+++ b/app/graphql/types/saved_reply_type.rb
@@ -4,6 +4,8 @@ module Types
class SavedReplyType < BaseObject
graphql_name 'SavedReply'
+ connection_type_class(Types::CountableConnectionType)
+
authorize :read_saved_replies
field :id, Types::GlobalIDType[::Users::SavedReply],
diff --git a/app/graphql/types/user_interface.rb b/app/graphql/types/user_interface.rb
index a5bed3b9e19..9115b5a4760 100644
--- a/app/graphql/types/user_interface.rb
+++ b/app/graphql/types/user_interface.rb
@@ -137,6 +137,11 @@ module Types
description: 'Saved replies authored by the user. ' \
'Will not return saved replies if `saved_replies` feature flag is disabled.'
+ field :saved_reply,
+ resolver: Resolvers::SavedReplyResolver,
+ description: 'Saved reply authored by the user. ' \
+ 'Will not return saved reply if `saved_replies` feature flag is disabled.'
+
field :gitpod_enabled, GraphQL::Types::Boolean, null: true,
description: 'Whether Gitpod is enabled at the user level.'
diff --git a/app/models/users/saved_reply.rb b/app/models/users/saved_reply.rb
index 61459abe24b..f0ae5445a46 100644
--- a/app/models/users/saved_reply.rb
+++ b/app/models/users/saved_reply.rb
@@ -11,5 +11,9 @@ module Users
length: { maximum: 255 },
uniqueness: { scope: [:user_id] }
validates :content, length: { maximum: 10000 }
+
+ def self.find_saved_reply(user_id:, id:)
+ ::Users::SavedReply.find_by(user_id: user_id, id: id)
+ end
end
end
diff --git a/doc/api/graphql/reference/index.md b/doc/api/graphql/reference/index.md
index 3e1c91040c9..83626d921f8 100644
--- a/doc/api/graphql/reference/index.md
+++ b/doc/api/graphql/reference/index.md
@@ -9535,6 +9535,7 @@ The connection type for [`SavedReply`](#savedreply).
| Name | Type | Description |
| ---- | ---- | ----------- |
+| <a id="savedreplyconnectioncount"></a>`count` | [`Int!`](#int) | Total count of collection. |
| <a id="savedreplyconnectionedges"></a>`edges` | [`[SavedReplyEdge]`](#savedreplyedge) | A list of edges. |
| <a id="savedreplyconnectionnodes"></a>`nodes` | [`[SavedReply]`](#savedreply) | A list of nodes. |
| <a id="savedreplyconnectionpageinfo"></a>`pageInfo` | [`PageInfo!`](#pageinfo) | Information to aid in pagination. |
@@ -15683,6 +15684,18 @@ four standard [pagination arguments](#connection-pagination-arguments):
| <a id="mergerequestassigneereviewrequestedmergerequestsupdatedafter"></a>`updatedAfter` | [`Time`](#time) | Merge requests updated after this timestamp. |
| <a id="mergerequestassigneereviewrequestedmergerequestsupdatedbefore"></a>`updatedBefore` | [`Time`](#time) | Merge requests updated before this timestamp. |
+##### `MergeRequestAssignee.savedReply`
+
+Saved reply authored by the user. Will not return saved reply if `saved_replies` feature flag is disabled.
+
+Returns [`SavedReply`](#savedreply).
+
+###### Arguments
+
+| Name | Type | Description |
+| ---- | ---- | ----------- |
+| <a id="mergerequestassigneesavedreplyid"></a>`id` | [`UsersSavedReplyID!`](#userssavedreplyid) | ID of a saved reply. |
+
##### `MergeRequestAssignee.snippets`
Snippets authored by the user.
@@ -15917,6 +15930,18 @@ four standard [pagination arguments](#connection-pagination-arguments):
| <a id="mergerequestauthorreviewrequestedmergerequestsupdatedafter"></a>`updatedAfter` | [`Time`](#time) | Merge requests updated after this timestamp. |
| <a id="mergerequestauthorreviewrequestedmergerequestsupdatedbefore"></a>`updatedBefore` | [`Time`](#time) | Merge requests updated before this timestamp. |
+##### `MergeRequestAuthor.savedReply`
+
+Saved reply authored by the user. Will not return saved reply if `saved_replies` feature flag is disabled.
+
+Returns [`SavedReply`](#savedreply).
+
+###### Arguments
+
+| Name | Type | Description |
+| ---- | ---- | ----------- |
+| <a id="mergerequestauthorsavedreplyid"></a>`id` | [`UsersSavedReplyID!`](#userssavedreplyid) | ID of a saved reply. |
+
##### `MergeRequestAuthor.snippets`
Snippets authored by the user.
@@ -16170,6 +16195,18 @@ four standard [pagination arguments](#connection-pagination-arguments):
| <a id="mergerequestparticipantreviewrequestedmergerequestsupdatedafter"></a>`updatedAfter` | [`Time`](#time) | Merge requests updated after this timestamp. |
| <a id="mergerequestparticipantreviewrequestedmergerequestsupdatedbefore"></a>`updatedBefore` | [`Time`](#time) | Merge requests updated before this timestamp. |
+##### `MergeRequestParticipant.savedReply`
+
+Saved reply authored by the user. Will not return saved reply if `saved_replies` feature flag is disabled.
+
+Returns [`SavedReply`](#savedreply).
+
+###### Arguments
+
+| Name | Type | Description |
+| ---- | ---- | ----------- |
+| <a id="mergerequestparticipantsavedreplyid"></a>`id` | [`UsersSavedReplyID!`](#userssavedreplyid) | ID of a saved reply. |
+
##### `MergeRequestParticipant.snippets`
Snippets authored by the user.
@@ -16422,6 +16459,18 @@ four standard [pagination arguments](#connection-pagination-arguments):
| <a id="mergerequestreviewerreviewrequestedmergerequestsupdatedafter"></a>`updatedAfter` | [`Time`](#time) | Merge requests updated after this timestamp. |
| <a id="mergerequestreviewerreviewrequestedmergerequestsupdatedbefore"></a>`updatedBefore` | [`Time`](#time) | Merge requests updated before this timestamp. |
+##### `MergeRequestReviewer.savedReply`
+
+Saved reply authored by the user. Will not return saved reply if `saved_replies` feature flag is disabled.
+
+Returns [`SavedReply`](#savedreply).
+
+###### Arguments
+
+| Name | Type | Description |
+| ---- | ---- | ----------- |
+| <a id="mergerequestreviewersavedreplyid"></a>`id` | [`UsersSavedReplyID!`](#userssavedreplyid) | ID of a saved reply. |
+
##### `MergeRequestReviewer.snippets`
Snippets authored by the user.
@@ -20586,6 +20635,18 @@ four standard [pagination arguments](#connection-pagination-arguments):
| <a id="usercorereviewrequestedmergerequestsupdatedafter"></a>`updatedAfter` | [`Time`](#time) | Merge requests updated after this timestamp. |
| <a id="usercorereviewrequestedmergerequestsupdatedbefore"></a>`updatedBefore` | [`Time`](#time) | Merge requests updated before this timestamp. |
+##### `UserCore.savedReply`
+
+Saved reply authored by the user. Will not return saved reply if `saved_replies` feature flag is disabled.
+
+Returns [`SavedReply`](#savedreply).
+
+###### Arguments
+
+| Name | Type | Description |
+| ---- | ---- | ----------- |
+| <a id="usercoresavedreplyid"></a>`id` | [`UsersSavedReplyID!`](#userssavedreplyid) | ID of a saved reply. |
+
##### `UserCore.snippets`
Snippets authored by the user.
@@ -25004,6 +25065,18 @@ four standard [pagination arguments](#connection-pagination-arguments):
| <a id="userreviewrequestedmergerequestsupdatedafter"></a>`updatedAfter` | [`Time`](#time) | Merge requests updated after this timestamp. |
| <a id="userreviewrequestedmergerequestsupdatedbefore"></a>`updatedBefore` | [`Time`](#time) | Merge requests updated before this timestamp. |
+###### `User.savedReply`
+
+Saved reply authored by the user. Will not return saved reply if `saved_replies` feature flag is disabled.
+
+Returns [`SavedReply`](#savedreply).
+
+####### Arguments
+
+| Name | Type | Description |
+| ---- | ---- | ----------- |
+| <a id="usersavedreplyid"></a>`id` | [`UsersSavedReplyID!`](#userssavedreplyid) | ID of a saved reply. |
+
###### `User.snippets`
Snippets authored by the user.
diff --git a/doc/development/pages/index.md b/doc/development/pages/index.md
index 05eeb1965d1..e71d7df642c 100644
--- a/doc/development/pages/index.md
+++ b/doc/development/pages/index.md
@@ -6,11 +6,13 @@ info: To determine the technical writer assigned to the Stage/Group associated w
description: "GitLab's development guidelines for GitLab Pages"
---
-# Getting started with development
+# Contribute to GitLab Pages development
+
+Learn how to configure GitLab Pages so you can help develop the feature.
## Configuring GitLab Pages hostname
-GitLab Pages need a hostname or domain, as each different GitLab Pages site is accessed via a
+GitLab Pages needs a hostname or domain, as each different GitLab Pages site is accessed through a
subdomain. You can set the GitLab Pages hostname:
- [Without wildcard, editing your hosts file](#without-wildcard-editing-your-hosts-file).
diff --git a/doc/development/service_ping/metrics_lifecycle.md b/doc/development/service_ping/metrics_lifecycle.md
index 92c5d2d317d..e8ff27c6cf5 100644
--- a/doc/development/service_ping/metrics_lifecycle.md
+++ b/doc/development/service_ping/metrics_lifecycle.md
@@ -72,14 +72,16 @@ WARNING:
If a metric is not used in Sisense or any other system after 6 months, the
Product Intelligence team marks it as inactive and assigns it to the group owner for review.
-We are working on automating this process. See [this issue](https://gitlab.com/gitlab-org/gitlab/-/issues/338466) for details.
+We are working on automating this process. See [this epic](https://gitlab.com/groups/gitlab-org/-/epics/8988) for details.
Product Intelligence removes metrics from Service Ping if they are not used in any Sisense dashboard.
-For an example of the metric removal process, see this [example issue](https://gitlab.com/gitlab-org/gitlab/-/issues/297029).
+For an example of the metric removal process, see this [example issue](https://gitlab.com/gitlab-org/gitlab/-/issues/388236).
To remove a metric:
+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.
+
1. Check the following YAML files and verify the metric is not used in an aggregate:
- [`config/metrics/aggregates/*.yaml`](https://gitlab.com/gitlab-org/gitlab/-/blob/master/config/metrics/aggregates/)
- [`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:
[GitLab Data Team project](https://gitlab.com/gitlab-data/analytics/-/issues).
Ask for confirmation that the metric is not referred to in any SiSense dashboards and
can be safely removed from Service Ping. Use this
- [example issue](https://gitlab.com/gitlab-data/analytics/-/issues/7539) for guidance.
+ [example issue](https://gitlab.com/gitlab-data/analytics/-/issues/15266) for guidance.
+
+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.
+ Many Service Ping metrics are relied upon for health score and XMAU reporting and unexpected changes to those metrics could break reporting.
1. After you verify the metric can be safely removed,
update the attributes of the metric's YAML definition:
- Set the `status:` to `removed`.
- - Set `removed_by_url:` to the URL of the MR removing the metric
+ - Set `removed_by_url:` to the URL of the issue removing the metric
- Set `milestone_removed:` to the number of the
milestone in which the metric was removed.
@@ -139,6 +144,3 @@ To remove a metric:
1. Remove any other records related to the metric:
- The feature flag YAML file at [`config/feature_flags/*/*.yaml`](https://gitlab.com/gitlab-org/gitlab/-/tree/master/config/feature_flags).
- 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).
-
-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.
- Many Service Ping metrics are relied upon for health score and XMAU reporting and unexpected changes to those metrics could break reporting.
diff --git a/doc/development/service_ping/review_guidelines.md b/doc/development/service_ping/review_guidelines.md
index 70f7f3dca54..9813c9e0b12 100644
--- a/doc/development/service_ping/review_guidelines.md
+++ b/doc/development/service_ping/review_guidelines.md
@@ -68,7 +68,7 @@ are regular backend changes.
Read the [stages file](https://gitlab.com/gitlab-com/www-gitlab-com/blob/master/data/stages.yml).
- Check the file location. Consider the time frame, and if the file should be under `ee`.
- Check the tiers.
-- 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.
+- 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.
- Metrics instrumentations
- Recommend using metrics instrumentation for new metrics, [if possible](metrics_instrumentation.md#support-for-instrumentation-classes).
- Approve the MR, and relabel the MR with `~"product intelligence::approved"`.
diff --git a/qa/qa/flow/user_onboarding.rb b/qa/qa/flow/user_onboarding.rb
index 62397d5641d..8c6a50f251f 100644
--- a/qa/qa/flow/user_onboarding.rb
+++ b/qa/qa/flow/user_onboarding.rb
@@ -10,6 +10,7 @@ module QA
if welcome_page.has_get_started_button?
welcome_page.select_role('Other')
welcome_page.choose_setup_for_company_if_available
+ welcome_page.choose_create_a_new_project_if_available
welcome_page.click_get_started_button
end
end
diff --git a/qa/qa/page/registration/welcome.rb b/qa/qa/page/registration/welcome.rb
index 660b33b4f5b..77cdbe8fd9e 100644
--- a/qa/qa/page/registration/welcome.rb
+++ b/qa/qa/page/registration/welcome.rb
@@ -21,6 +21,10 @@ module QA
# Only implemented in EE
end
+ def choose_create_a_new_project_if_available
+ # Only implemented in EE
+ end
+
def click_get_started_button
Support::Retrier.retry_until do
click_element :get_started_button
diff --git a/qa/qa/resource/user.rb b/qa/qa/resource/user.rb
index 0398509396f..16d0f6ad380 100644
--- a/qa/qa/resource/user.rb
+++ b/qa/qa/resource/user.rb
@@ -12,7 +12,8 @@ module QA
:extern_uid,
:expect_fabrication_success,
:hard_delete_on_api_removal,
- :access_level
+ :access_level,
+ :email_domain
attributes :id,
:name,
@@ -25,6 +26,7 @@ module QA
@hard_delete_on_api_removal = false
@unique_id = SecureRandom.hex(8)
@expect_fabrication_success = true
+ @email_domain = 'example.com'
end
def self.default
@@ -63,7 +65,7 @@ module QA
def email
@email ||= begin
api_email = api_resource&.dig(:email)
- api_email && !api_email.empty? ? api_email : "#{username}@example.com"
+ api_email && !api_email.empty? ? api_email : "#{username}@#{email_domain}"
end
end
diff --git a/qa/qa/specs/features/browser_ui/1_manage/login/register_spec.rb b/qa/qa/specs/features/browser_ui/1_manage/login/register_spec.rb
index e0242008785..c92bea7bf76 100644
--- a/qa/qa/specs/features/browser_ui/1_manage/login/register_spec.rb
+++ b/qa/qa/specs/features/browser_ui/1_manage/login/register_spec.rb
@@ -5,7 +5,9 @@ module QA
it 'allows the user to register and login' do
Runtime::Browser.visit(:gitlab, Page::Main::Login)
- Resource::User.fabricate_via_browser_ui!
+ Resource::User.fabricate_via_browser_ui! do |user_resource|
+ user_resource.email_domain = 'gitlab.com'
+ end
Page::Main::Menu.perform do |menu|
expect(menu).to have_personal_area
diff --git a/spec/graphql/resolvers/saved_reply_resolver_spec.rb b/spec/graphql/resolvers/saved_reply_resolver_spec.rb
new file mode 100644
index 00000000000..f1cb0ca5214
--- /dev/null
+++ b/spec/graphql/resolvers/saved_reply_resolver_spec.rb
@@ -0,0 +1,40 @@
+# frozen_string_literal: true
+
+require 'spec_helper'
+
+RSpec.describe Resolvers::SavedReplyResolver, feature_category: :user_profile do
+ include GraphqlHelpers
+
+ let_it_be(:current_user) { create(:user) }
+ let_it_be(:saved_reply) { create(:saved_reply, user: current_user) }
+
+ describe 'feature flag disabled' do
+ before do
+ stub_feature_flags(saved_replies: false)
+ end
+
+ it 'does not return saved reply' do
+ expect(resolve_saved_reply).to be_nil
+ end
+ end
+
+ describe 'feature flag enabled' do
+ it 'returns users saved reply' do
+ expect(resolve_saved_reply).to eq(saved_reply)
+ end
+
+ it 'returns nil when saved reply is not found' do
+ expect(resolve_saved_reply({ id: 'gid://gitlab/Users::SavedReply/100' })).to be_nil
+ end
+
+ it 'returns nil when saved reply is another users' do
+ other_users_saved_reply = create(:saved_reply, user: create(:user))
+
+ expect(resolve_saved_reply({ id: other_users_saved_reply.to_global_id })).to be_nil
+ end
+ end
+
+ def resolve_saved_reply(args = { id: saved_reply.to_global_id })
+ resolve(described_class, args: args, ctx: { current_user: current_user })
+ end
+end
diff --git a/spec/graphql/types/user_type_spec.rb b/spec/graphql/types/user_type_spec.rb
index 096341b1ba9..a6b5d454b60 100644
--- a/spec/graphql/types/user_type_spec.rb
+++ b/spec/graphql/types/user_type_spec.rb
@@ -46,6 +46,7 @@ RSpec.describe GitlabSchema.types['User'], feature_category: :user_profile do
preferencesGitpodPath
profileEnableGitpodPath
savedReplies
+ savedReply
]
expect(described_class).to have_graphql_fields(*expected_fields)
diff --git a/spec/support/shared_examples/graphql/types/merge_request_interactions_type_shared_examples.rb b/spec/support/shared_examples/graphql/types/merge_request_interactions_type_shared_examples.rb
index 19ceb465383..bb33a7559dc 100644
--- a/spec/support/shared_examples/graphql/types/merge_request_interactions_type_shared_examples.rb
+++ b/spec/support/shared_examples/graphql/types/merge_request_interactions_type_shared_examples.rb
@@ -41,6 +41,7 @@ RSpec.shared_examples "a user type with merge request interaction type" do
preferencesGitpodPath
profileEnableGitpodPath
savedReplies
+ savedReply
]
expect(described_class).to have_graphql_fields(*expected_fields)