diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-12-20 18:16:21 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-12-20 18:16:21 +0300 |
commit | 78f02b73cf6b84de51b8f6381cb6746febd64141 (patch) | |
tree | 6c4f36ba05ea77c8bd1ecff3934c94fb80be63f5 | |
parent | 6cde390d022b50a8a80c0f7d3950771474129562 (diff) |
Add latest changes from gitlab-org/gitlab@master
10 files changed, 163 insertions, 104 deletions
diff --git a/config/metrics/counts_28d/20221213182900_i_code_review_create_mr_monthly.yml b/config/metrics/counts_28d/20221213182900_i_code_review_create_mr_monthly.yml index 740183d7286..860d63f0a6b 100644 --- a/config/metrics/counts_28d/20221213182900_i_code_review_create_mr_monthly.yml +++ b/config/metrics/counts_28d/20221213182900_i_code_review_create_mr_monthly.yml @@ -1,4 +1,5 @@ --- +# This metric used to be implemented as a RedisHLL counter. Therefor, the redis_hll_counters prefix. key_path: redis_hll_counters.code_review.i_code_review_create_mr_monthly description: Count of unique merge requests created per month product_section: dev @@ -9,14 +10,15 @@ status: active milestone: "15.7" introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/106869 time_frame: 28d -data_source: redis_hll +data_source: internal_events data_category: operational -instrumentation_class: RedisHLLMetric performance_indicator_type: - customer_health_score options: events: - - i_code_review_create_mr + - i_code_review_user_create_mr +events: + - name: i_code_review_user_create_mr distribution: - ce - ee diff --git a/config/metrics/counts_7d/20221213183300_i_code_review_create_mr_weekly.yml b/config/metrics/counts_7d/20221213183300_i_code_review_create_mr_weekly.yml index 99dd2788825..b0f4e9b0dca 100644 --- a/config/metrics/counts_7d/20221213183300_i_code_review_create_mr_weekly.yml +++ b/config/metrics/counts_7d/20221213183300_i_code_review_create_mr_weekly.yml @@ -9,13 +9,14 @@ status: active milestone: "15.7" introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/106869 time_frame: 7d -data_source: redis_hll +data_source: internal_events data_category: operational -instrumentation_class: RedisHLLMetric performance_indicator_type: [] options: events: - - i_code_review_create_mr + - i_code_review_user_create_mr +events: + - name: i_code_review_user_create_mr distribution: - ce - ee diff --git a/db/post_migrate/20231204095802_change_i_code_review_create_mr_keys_from_redis_hll_to_redis.rb b/db/post_migrate/20231204095802_change_i_code_review_create_mr_keys_from_redis_hll_to_redis.rb new file mode 100644 index 00000000000..66b5ec0698e --- /dev/null +++ b/db/post_migrate/20231204095802_change_i_code_review_create_mr_keys_from_redis_hll_to_redis.rb @@ -0,0 +1,29 @@ +# frozen_string_literal: true + +class ChangeICodeReviewCreateMrKeysFromRedisHllToRedis < Gitlab::Database::Migration[2.2] + milestone '16.8' + + disable_ddl_transaction! + restrict_gitlab_migration gitlab_schema: :gitlab_main + + REDIS_HLL_PREFIX = '{hll_counters}_i_code_review_create_mr' + REDIS_PREFIX = '{event_counters}_i_code_review_user_create_mr' + + def up + # For each old (redis_hll) counter we find the corresponding target (redis) counter and add + # old value to migrate a metric. If the Redis counter does not exist, it will get created. + # Since the RedisHLL keys expire after 6 weeks, we will migrate 6 keys at the most. + Gitlab::Redis::SharedState.with do |redis| + redis.scan_each(match: "#{REDIS_HLL_PREFIX}-*") do |key| + redis_key = key.sub(REDIS_HLL_PREFIX, REDIS_PREFIX) + redis_hll_value = redis.pfcount(key) + + redis.incrby(redis_key, redis_hll_value) + end + end + end + + def down + # no-op + end +end diff --git a/db/schema_migrations/20231204095802 b/db/schema_migrations/20231204095802 new file mode 100644 index 00000000000..eee6ff01a86 --- /dev/null +++ b/db/schema_migrations/20231204095802 @@ -0,0 +1 @@ +c2fc8e11eb2ac22bd4f37dcabd9468ddfce6285a9b796560c8ce9a21fa0047e1
\ No newline at end of file diff --git a/doc/architecture/blueprints/cells/routing-service.md b/doc/architecture/blueprints/cells/routing-service.md index 9efdbdf3f91..ad09e083fac 100644 --- a/doc/architecture/blueprints/cells/routing-service.md +++ b/doc/architecture/blueprints/cells/routing-service.md @@ -59,20 +59,22 @@ For example: ## Requirements -| Requirement | Description | Priority | -|---------------|-------------------------------------------------------------------|----------| -| Discovery | needs to be able to discover and monitor the health of all Cells. | high | -| Security | only authorized cells can be routed to | high | -| Single domain | e.g. GitLab.com | high | -| Caching | can cache routing information for performance | high | -| [50 ms of increased latency](#low-latency) | | high | -| Path-based | can make routing decision based on path | high | -| Complexity | the routing service should be configuration-driven and small | high | -| Stateless | does not need database, Cells provide all routing information | medium | -| Secrets-based | can make routing decision based on secret (e.g. JWT) | medium | -| Observability | can use existing observability tooling | low | -| Self-managed | can be eventually used by [self-managed](goals.md#self-managed) | low | -| Regional | can route requests to different [regions](goals.md#regions) | low | +| Requirement | Description | Priority | +|--------------------------------------------|-------------------------------------------------------------------|----------| +| Discovery | needs to be able to discover and monitor the health of all Cells. | high | +| Security | only authorized cells can be routed to | high | +| Single domain | for example GitLab.com | high | +| Caching | can cache routing information for performance | high | +| [50 ms of increased latency](#low-latency) | | high | +| Path-based | can make routing decision based on path | high | +| Complexity | the routing service should be configuration-driven and small | high | +| Feature Flags | features can be turned on, off, and % rollout | high | +| Progressive Rollout | We can slowly rollout a change | medium | +| Stateless | does not need database, Cells provide all routing information | medium | +| Secrets-based | can make routing decision based on secret (for example JWT) | medium | +| Observability | can use existing observability tooling | low | +| Self-managed | can be eventually used by [self-managed](goals.md#self-managed) | low | +| Regional | can route requests to different [regions](goals.md#regions) | low | ### Low Latency diff --git a/doc/user/project/web_ide/index.md b/doc/user/project/web_ide/index.md index 49efd463334..5be37bffdfe 100644 --- a/doc/user/project/web_ide/index.md +++ b/doc/user/project/web_ide/index.md @@ -19,55 +19,49 @@ For a more basic implementation, see [Web Editor](../repository/web_editor.md). To pair the Web IDE with a remote development environment, see [remote development](../remote_development/index.md). -## Use the Web IDE +## Open the Web IDE -To open the Web IDE from the GitLab UI: +To open the Web IDE: 1. On the left sidebar, select **Search or go to** and find your project. 1. Use the <kbd>.</kbd> keyboard shortcut. -You can also open the Web IDE from: +### From a file or directory -- A file -- The repository file list -- A merge request +To open the Web IDE from a file or directory: -### From a file or the repository file list - -To open the Web IDE from a file or the repository file list: - -- In the upper right, select **Edit > Open in Web IDE**. +1. On the left sidebar, select **Search or go to** and find your project. +1. Go to your file or directory. +1. Select **Edit > Open in Web IDE**. ### From a merge request To open the Web IDE from a merge request: +1. On the left sidebar, select **Search or go to** and find your project. 1. Go to your merge request. -1. In the upper-right corner, select **Code > Open in Web IDE**. +1. In the upper right, select **Code > Open in Web IDE**. -The Web IDE opens new and modified files in separate tabs and displays changes side by side with the original source. -To optimize loading time, only the top 10 files (by number of lines changed) are opened automatically. +The Web IDE opens new and modified files in separate tabs and displays changes side by side. +To reduce load time, only 10 files with the most lines changed are opened automatically. -In the file tree, any new or modified file in the merge request is indicated by an icon next to the filename. -To view changes to a file, right-click the filename and select **Compare with merge request base**. +In the **Explorer** panel, any new or modified file is indicated +by the merge request icon (**{merge-request}**) next to the file name. +To view changes to a file, right-click the file and select **Compare with merge request base**. -## Open a file in the Web IDE +## Open a file -To open any file by its name: +To open a file by name in the Web IDE: 1. Press <kbd>Command</kbd>+<kbd>P</kbd>. -1. Enter the name of your file. - -## Search across files +1. In the search box, enter the file name. -You can use the Web IDE to search all files in the opened folder. +## Search open files -To search across files: +To search across open files in the Web IDE: 1. Press <kbd>Shift</kbd>+<kbd>Command</kbd>+<kbd>F</kbd>. -1. Enter your search term. - -In the Web IDE, only partial results from opened files are displayed. +1. In the search box, enter your search term. ## View a list of changed files @@ -81,7 +75,7 @@ For more information, see the [VS Code documentation](https://code.visualstudio. ## Restore uncommitted changes -You don't have to manually save any file you modify in the Web IDE. +You do not have to manually save any file you modify in the Web IDE. Modified files are automatically staged and can be [committed](#commit-changes). Uncommitted changes are saved in your browser's local storage and persist even if you close the browser tab or refresh the Web IDE. @@ -93,39 +87,37 @@ To restore uncommitted changes in the Web IDE: 1. In the search box, enter `Local History: Find Entry to Restore`. 1. Select the file that contains the uncommitted changes. -## Upload a new file +## Upload a file -To upload a new file in the Web IDE: +To upload a file in the Web IDE: -1. On the activity bar on the left, select **Explorer** and go to the directory where you want to upload the file. -1. Optional. For a new directory, go to the path where you want to have the directory and do one of the following: - - Right-click the path, and select **New Folder...**. You can create a nested path with `/` (for example, `parentdir/subdir1/subdir2`). - - In the upper right of the **Explorer** panel, select **New Folder...** (**{folder-new}**). -1. Enter the name of the new directory, and press <kbd>Enter</kbd>. -1. Right-click the path, and select **Upload...**. -1. Select the file you want to upload, then select **Open**. You can upload multiple files at once. +1. On the activity bar on the left, select **Explorer** and + go to the directory where you want to upload the file. +1. Optional. To create a new directory, in the upper right of the + **Explorer** panel, select **New Folder** (**{folder-new}**). +1. Right-click the directory and select **Upload**. +1. Select the file you want to upload. -The new file is uploaded and automatically added to the repository. +You can upload multiple files at once. +The new files are uploaded and automatically added to the repository. ## Switch branches -The Web IDE uses the currently selected branch by default. +The Web IDE uses the current branch by default. To switch branches in the Web IDE: 1. On the status bar, in the lower-left corner, select the current branch name. -1. In the search box, start typing the branch name. -1. From the dropdown list, select the branch. +1. Enter or select an existing branch. ## Create a branch To create a branch from the current branch in the Web IDE: 1. On the status bar, in the lower-left corner, select the current branch name. -1. From the dropdown list, select **Create new branch...**. -1. Enter the branch name. -1. Press <kbd>Enter</kbd>. +1. From the dropdown list, select **Create new branch**. +1. Enter the new branch name. -If you don't have write access to the repository, **Create new branch...** is not visible. +If you do not have write access to the repository, **Create new branch** is not visible. ## Commit changes @@ -134,27 +126,24 @@ To commit changes in the Web IDE: 1. On the activity bar on the left, select **Source Control**, or press <kbd>Control</kbd>+<kbd>Shift</kbd>+<kbd>G</kbd>. 1. Enter your commit message. -1. Select **Commit & Push**. -1. Commit to the current branch, or [create a new branch](#create-a-branch). +1. Commit to the current branch or [create a new branch](#create-a-branch). ## Create a merge request -To create a merge request in the Web IDE: +To create a [merge request](../merge_requests/index.md) in the Web IDE: 1. [Commit the changes](#commit-changes). -1. In the pop-up notification in the lower-right corner, select **Create Merge Request**. - A new window opens for you to create the [merge request](../merge_requests/index.md). +1. In the notification in the lower-right corner, select **Create MR**. -To access missed notifications, see [Access notifications](#access-notifications). +For more information, see [View missed notifications](#view-missed-notifications). ## Use the command palette -In the Web IDE, you can access many commands through the command palette. +You can use the command palette to access many commands. To open the command palette and run a command in the Web IDE: 1. Press <kbd>Shift</kbd>+<kbd>Command</kbd>+<kbd>P</kbd>. -1. In the search box, start typing the command name. -1. From the dropdown list, select the command. +1. Enter or select the command. ## Edit settings @@ -168,7 +157,8 @@ In the settings editor, you can search for the settings you want to modify. ## Edit keyboard shortcuts -You can use the keyboard shortcuts editor to view and modify the default keybindings for all available commands. +You can use the keyboard shortcuts editor to view and modify +the default keybindings for all available commands. To open the keyboard shortcuts editor in the Web IDE: - On the top menu bar, select **File > Preferences > Keyboard Shortcuts**, @@ -179,11 +169,13 @@ In the keyboard shortcuts editor, you can search for: - The keybindings you want to change - The commands you want to add or remove keybindings for -Keybindings are based on your keyboard layout. If you change your keyboard layout, existing keybindings are updated automatically. +Keybindings are based on your keyboard layout. +If you change your keyboard layout, existing keybindings are updated automatically. ## Change themes -You can choose between different themes for the Web IDE. The default theme for the Web IDE is **GitLab Dark**. +You can choose between different themes for the Web IDE. +The default theme for the Web IDE is **GitLab Dark**. To change the Web IDE theme: @@ -194,12 +186,13 @@ To change the Web IDE theme: The active color theme is stored in the [user settings](#edit-settings). -## Access notifications +## View missed notifications -When you perform actions in the Web IDE, notifications appear in the lower-right corner. To access missed notifications: +When you perform actions in the Web IDE, notifications appear in the lower-right corner. +To view any notification you might have missed: -1. On the status bar, in the lower-right corner, select the bell (**{notifications}**) for a list of notifications. -1. Select the notification you want to access. +1. On the status bar, in the lower-right corner, select the bell icon (**{notifications}**) for a list of notifications. +1. Select the notification you want to view. <!-- ## Privacy and data collection for extensions @@ -215,7 +208,7 @@ To protect your privacy and data: - Carefully review the permissions requested by an extension before you install the extension. - Keep your extensions up to date to ensure that any security or privacy vulnerabilities are addressed promptly. --> -## Interactive web terminals for the Web IDE **(BETA)** +## Interactive web terminals **(BETA)** WARNING: This feature is in [Beta](../../../policy/experiment-beta-support.md#beta) and subject to change without notice. @@ -228,7 +221,7 @@ When you set up a remote development server in the Web IDE, you can use interact You cannot use interactive web terminals to interact with a runner. However, you can use a terminal to install dependencies and compile and debug code. -For more information about configuring a workspace that supports interactive web terminals, see [remote development](../remote_development/index.md). +For more information, see [Workspaces](../../workspace/index.md). ## Related topics @@ -238,11 +231,15 @@ For more information about configuring a workspace that supports interactive web When working with the Web IDE, you might encounter the following issues. -### Character offset in the Web IDE +### Character offset when typing -When you type in the Web IDE, you might get a four-character offset. To resolve the issue, do one of the following: +When you type in the Web IDE, you might get a four-character offset. +As a workaround: -- Add `"editor.disableMonospaceOptimizations": true` to your settings. -- Modify your `"editor.font"` setting. +1. On the top menu bar, select **File > Preferences > Settings**, + or press <kbd>Command</kbd>+<kbd>,</kbd>. +1. In the upper-right corner, select **Open Settings (JSON)**. +1. In the `settings.json` file, add `"editor.disableMonospaceOptimizations": true` + or modify the `"editor.fontFamily"` setting. For more information, see [VS Code issue 80170](https://github.com/microsoft/vscode/issues/80170). diff --git a/doc/user/project/working_with_projects.md b/doc/user/project/working_with_projects.md index 1c60f3bebf3..c8572be96ab 100644 --- a/doc/user/project/working_with_projects.md +++ b/doc/user/project/working_with_projects.md @@ -61,7 +61,7 @@ Prerequisites: 1. On the left sidebar, select **Search or go to** and find your project. 1. Select **Settings > General**. 1. In the **Project name** text box, enter your project name. See the [limitations on project names](../../user/reserved_names.md). -1. In the **Project description** text box, enter your project description. The description is limited to 500 characters. +1. In the **Project description** text box, enter your project description. The description is limited to 2,000 characters. 1. Under **Project avatar**, to change your project avatar, select **Choose file**. ## Star a project @@ -121,7 +121,7 @@ You can [view projects that are pending deletion](#view-projects-pending-deletio and use the Rails console to [find projects that are pending deletion](#find-projects-that-are-pending-deletion). -### Delete a project immediately +### Delete a project immediately **(PREMIUM ALL)** > - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/191367) in GitLab 14.1. > - Option to delete projects immediately from the Admin Area and as a group setting removed [on GitLab.com](https://gitlab.com/gitlab-org/gitlab/-/issues/393622) and [on self-managed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/119606) in GitLab 16.0. @@ -144,7 +144,7 @@ To immediately delete a project marked for deletion: 1. In the **Delete this project** section, select **Delete project**. 1. On the confirmation dialog, enter the project name and select **Yes, delete project**. -### View projects pending deletion +### View projects pending deletion **(PREMIUM ALL)** > - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/37014) in GitLab 13.3 for Administrators. > - [Tab renamed](https://gitlab.com/gitlab-org/gitlab/-/issues/347468) from **Deleted projects** in GitLab 14.6. diff --git a/lib/gitlab/usage_data_counters/merge_request_activity_unique_counter.rb b/lib/gitlab/usage_data_counters/merge_request_activity_unique_counter.rb index d26b7ce951d..db48095ab74 100644 --- a/lib/gitlab/usage_data_counters/merge_request_activity_unique_counter.rb +++ b/lib/gitlab/usage_data_counters/merge_request_activity_unique_counter.rb @@ -6,7 +6,6 @@ module Gitlab MR_DIFFS_ACTION = 'i_code_review_mr_diffs' MR_DIFFS_SINGLE_FILE_ACTION = 'i_code_review_mr_single_file_diffs' MR_DIFFS_USER_SINGLE_FILE_ACTION = 'i_code_review_user_single_file_diffs' - MR_CREATE_ACTION = 'i_code_review_create_mr' MR_USER_CREATE_ACTION = 'i_code_review_user_create_mr' MR_CLOSE_ACTION = 'i_code_review_user_close_mr' MR_REOPEN_ACTION = 'i_code_review_user_reopen_mr' @@ -64,15 +63,10 @@ module Gitlab end def track_create_mr_action(user:, merge_request:) - track_unique_action_by_merge_request(MR_CREATE_ACTION, merge_request) - - project = merge_request.target_project - Gitlab::InternalEvents.track_event( MR_USER_CREATE_ACTION, user: user, - project: project, - namespace: project.namespace + project: merge_request.target_project ) end diff --git a/spec/lib/gitlab/usage_data_counters/merge_request_activity_unique_counter_spec.rb b/spec/lib/gitlab/usage_data_counters/merge_request_activity_unique_counter_spec.rb index c3a718e669a..5c03ccb0d71 100644 --- a/spec/lib/gitlab/usage_data_counters/merge_request_activity_unique_counter_spec.rb +++ b/spec/lib/gitlab/usage_data_counters/merge_request_activity_unique_counter_spec.rb @@ -55,14 +55,6 @@ RSpec.describe Gitlab::UsageDataCounters::MergeRequestActivityUniqueCounter, :cl let(:merge_request) { create(:merge_request) } let(:target_project) { merge_request.target_project } - it_behaves_like 'a tracked merge request unique event' do - let(:action) { described_class::MR_USER_CREATE_ACTION } - end - - it_behaves_like 'a tracked merge request unique event' do - let(:action) { described_class::MR_CREATE_ACTION } - end - it_behaves_like 'internal event tracking' do let(:event) { described_class::MR_USER_CREATE_ACTION } let(:project) { target_project } diff --git a/spec/migrations/20231204095802_change_i_code_review_create_mr_keys_from_redis_hll_to_redis_spec.rb b/spec/migrations/20231204095802_change_i_code_review_create_mr_keys_from_redis_hll_to_redis_spec.rb new file mode 100644 index 00000000000..38d3af5a525 --- /dev/null +++ b/spec/migrations/20231204095802_change_i_code_review_create_mr_keys_from_redis_hll_to_redis_spec.rb @@ -0,0 +1,41 @@ +# frozen_string_literal: true + +require 'spec_helper' +require_migration! + +RSpec.describe ChangeICodeReviewCreateMrKeysFromRedisHllToRedis, :migration, :clean_gitlab_redis_cache, feature_category: :service_ping do + def set_redis_hll(key, value) + Gitlab::Redis::HLL.add(key: key, value: value, expiry: 6.weeks) + end + + def get_int_from_redis(key) + Gitlab::Redis::SharedState.with { |redis| redis.get(key)&.to_i } + end + + describe "#up" do + before do + set_redis_hll('{hll_counters}_i_code_review_create_mr-2023-16', value: 1) + set_redis_hll('{hll_counters}_i_code_review_create_mr-2023-16', value: 2) + set_redis_hll('{hll_counters}_i_code_review_create_mr-2023-47', value: 3) + set_redis_hll('{hll_counters}_i_code_review_create_mr-2023-48', value: 1) + set_redis_hll('{hll_counters}_i_code_review_create_mr-2023-49', value: 2) + set_redis_hll('{hll_counters}_i_code_review_create_mr-2023-49', value: 4) + set_redis_hll('{hll_counters}_some_other_event-2023-49', value: 7) + end + + it 'migrates all RedisHLL keys for i_code_review_create_mr', :aggregate_failures do + migrate! + + expect(get_int_from_redis('{event_counters}_i_code_review_user_create_mr-2023-16')).to eq(2) + expect(get_int_from_redis('{event_counters}_i_code_review_user_create_mr-2023-47')).to eq(1) + expect(get_int_from_redis('{event_counters}_i_code_review_user_create_mr-2023-48')).to eq(1) + expect(get_int_from_redis('{event_counters}_i_code_review_user_create_mr-2023-49')).to eq(2) + end + + it 'does not not migrate other RedisHLL keys' do + migrate! + + expect(get_int_from_redis('{event_counters}_some_other_event-2023-16')).to be_nil + end + end +end |