diff options
-rw-r--r-- | .gitlab/ci/gitlab-com/danger-review.gitlab-ci.yml | 2 | ||||
-rw-r--r-- | app/models/label.rb | 5 | ||||
-rw-r--r-- | app/services/boards/base_item_move_service.rb | 11 | ||||
-rw-r--r-- | config/feature_flags/development/apollo_boards.yml | 2 | ||||
-rw-r--r-- | db/migrate/20231229112819_add_finished_at_index_for_p_ci_finished_build_ch_sync_events.rb | 20 | ||||
-rw-r--r-- | db/schema_migrations/20231229112819 | 1 | ||||
-rw-r--r-- | db/structure.sql | 2 | ||||
-rw-r--r-- | doc/administration/audit_event_streaming/index.md | 7 | ||||
-rw-r--r-- | doc/user/product_analytics/index.md | 50 | ||||
-rw-r--r-- | spec/models/label_spec.rb | 14 | ||||
-rw-r--r-- | spec/support/shared_examples/services/boards/issues_move_service_shared_examples.rb | 8 |
11 files changed, 46 insertions, 76 deletions
diff --git a/.gitlab/ci/gitlab-com/danger-review.gitlab-ci.yml b/.gitlab/ci/gitlab-com/danger-review.gitlab-ci.yml index ad7cc2f44c0..3d2a9466312 100644 --- a/.gitlab/ci/gitlab-com/danger-review.gitlab-ci.yml +++ b/.gitlab/ci/gitlab-com/danger-review.gitlab-ci.yml @@ -1,6 +1,6 @@ include: - project: gitlab-org/quality/pipeline-common - ref: 8.2.0 + ref: 8.3.0 file: - /ci/danger-review.yml diff --git a/app/models/label.rb b/app/models/label.rb index d0d278b68fd..8fff42abd58 100644 --- a/app/models/label.rb +++ b/app/models/label.rb @@ -46,7 +46,6 @@ class Label < ApplicationRecord scope :with_lists_and_board, -> { joins(lists: :board).merge(List.movable) } scope :with_lock_on_merge, -> { where(lock_on_merge: true) } scope :on_project_boards, ->(project_id) { with_lists_and_board.where(boards: { project_id: project_id }) } - scope :on_board, ->(board_id) { with_lists_and_board.where(boards: { id: board_id }) } scope :order_name_asc, -> { reorder(title: :asc) } scope :order_name_desc, -> { reorder(title: :desc) } scope :subscribed_by, ->(user_id) { joins(:subscriptions).where(subscriptions: { user_id: user_id, subscribed: true }) } @@ -152,10 +151,6 @@ class Label < ApplicationRecord nil end - def self.ids_on_board(board_id) - on_board(board_id).pluck(:label_id) - end - # Searches for labels with a matching title or description. # # This method uses ILIKE on PostgreSQL. diff --git a/app/services/boards/base_item_move_service.rb b/app/services/boards/base_item_move_service.rb index c9da889c536..7d202da96ce 100644 --- a/app/services/boards/base_item_move_service.rb +++ b/app/services/boards/base_item_move_service.rb @@ -84,20 +84,11 @@ module Boards end def remove_label_ids - label_ids = - if moving_to_list.movable? - moving_from_list.label_id - else - board_label_ids - end + label_ids = moving_to_list.movable? ? moving_from_list.label_id : [] Array(label_ids).compact end - def board_label_ids - ::Label.ids_on_board(board.id) - end - def move_params_from_list_position(position) if position == LIST_END_POSITION { move_before_id: moving_to_list_items_relation.reverse_order.pick(:id), move_after_id: nil } diff --git a/config/feature_flags/development/apollo_boards.yml b/config/feature_flags/development/apollo_boards.yml index d95e60bf4ea..09b37f4d2ed 100644 --- a/config/feature_flags/development/apollo_boards.yml +++ b/config/feature_flags/development/apollo_boards.yml @@ -5,4 +5,4 @@ rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/381210 milestone: '15.6' type: development group: group::product planning -default_enabled: false +default_enabled: true diff --git a/db/migrate/20231229112819_add_finished_at_index_for_p_ci_finished_build_ch_sync_events.rb b/db/migrate/20231229112819_add_finished_at_index_for_p_ci_finished_build_ch_sync_events.rb new file mode 100644 index 00000000000..f52c1abcd49 --- /dev/null +++ b/db/migrate/20231229112819_add_finished_at_index_for_p_ci_finished_build_ch_sync_events.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +class AddFinishedAtIndexForPCiFinishedBuildChSyncEvents < Gitlab::Database::Migration[2.2] + include Gitlab::Database::PartitioningMigrationHelpers + + disable_ddl_transaction! + milestone '16.8' + + INDEX_NAME = :index_p_ci_finished_build_ch_sync_events_finished_at + TABLE_NAME = :p_ci_finished_build_ch_sync_events + COLUMNS = [:partition, :build_finished_at] + + def up + add_concurrent_partitioned_index(TABLE_NAME, COLUMNS, name: INDEX_NAME) + end + + def down + remove_concurrent_partitioned_index_by_name(TABLE_NAME, INDEX_NAME) + end +end diff --git a/db/schema_migrations/20231229112819 b/db/schema_migrations/20231229112819 new file mode 100644 index 00000000000..5b183bf6ac7 --- /dev/null +++ b/db/schema_migrations/20231229112819 @@ -0,0 +1 @@ +8afd047b9b3b3f71aad56617592f3657b0da6bae22bf20ff58d9d2cc84c90c14
\ No newline at end of file diff --git a/db/structure.sql b/db/structure.sql index d77b4ab5c20..6c74e5949be 100644 --- a/db/structure.sql +++ b/db/structure.sql @@ -33965,6 +33965,8 @@ CREATE UNIQUE INDEX index_organizations_on_unique_name_per_group ON customer_rel CREATE INDEX index_p_catalog_resource_sync_events_on_id_where_pending ON ONLY p_catalog_resource_sync_events USING btree (id) WHERE (status = 1); +CREATE INDEX index_p_ci_finished_build_ch_sync_events_finished_at ON ONLY p_ci_finished_build_ch_sync_events USING btree (partition, build_finished_at); + CREATE UNIQUE INDEX index_p_ci_job_annotations_on_partition_id_job_id_name ON ONLY p_ci_job_annotations USING btree (partition_id, job_id, name); CREATE INDEX index_p_ci_runner_machine_builds_on_runner_machine_id ON ONLY p_ci_runner_machine_builds USING btree (runner_machine_id); diff --git a/doc/administration/audit_event_streaming/index.md b/doc/administration/audit_event_streaming/index.md index 71ae33b3d87..2cfe71cd4a5 100644 --- a/doc/administration/audit_event_streaming/index.md +++ b/doc/administration/audit_event_streaming/index.md @@ -589,11 +589,8 @@ To delete Google Cloud Logging streaming destinations to an instance: ### AWS S3 destinations -> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/138245) in GitLab 16.7 [with a flag](../feature_flags.md) named `allow_streaming_instance_audit_events_to_amazon_s3`. Disabled by default. - -FLAG: -On self-managed GitLab, by default this feature is not available. To enable the feature, an administrator can [enable the feature flag](../feature_flags.md) named -`allow_streaming_instance_audit_events_to_amazon_s3`. On GitLab.com, this feature is not available. +> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/138245) in GitLab 16.7 [with a flag](../feature_flags.md) named `allow_streaming_instance_audit_events_to_amazon_s3`. Disabled by default. +> - [Feature flag `allow_streaming_instance_audit_events_to_amazon_s3`](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/137391) removed in GitLab 16.8. Manage AWS S3 destinations for entire instance. diff --git a/doc/user/product_analytics/index.md b/doc/user/product_analytics/index.md index 4f2d6da0e24..1a628cf9d15 100644 --- a/doc/user/product_analytics/index.md +++ b/doc/user/product_analytics/index.md @@ -4,7 +4,7 @@ group: Product Analytics info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments --- -# Product analytics **(ULTIMATE ALL EXPERIMENT)** +# Product analytics **(ULTIMATE SAAS BETA)** > - Introduced in GitLab 15.4 as an [Experiment](../../policy/experiment-beta-support.md#experiment) feature [with a flag](../../administration/feature_flags.md) named `cube_api_proxy`. Disabled by default. > - `cube_api_proxy` revised to only reference the [Product Analytics API](../../api/product_analytics.md) in GitLab 15.6. @@ -12,11 +12,8 @@ info: To determine the technical writer assigned to the Stage/Group associated w > - `product_analytics_internal_preview` replaced with `product_analytics_dashboards` in GitLab 15.11. > - Snowplow integration [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/398253) in GitLab 15.11 [with a flag](../../administration/feature_flags.md) named `product_analytics_snowplow_support`. Disabled by default. > - Snowplow integration feature flag `product_analytics_snowplow_support` [removed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/130228) in GitLab 16.4. - -FLAG: -On self-managed GitLab, by default this feature is not available. To make it available per project or for your entire instance, an administrator can [enable the feature flag](../../administration/feature_flags.md) named `product_analytics_dashboards`. -On GitLab.com, this feature is not available. -This feature is not ready for production use. +> - [Moved](https://gitlab.com/gitlab-org/gitlab/-/issues/414865) from GitLab self-managed to GitLab.com in 16.7. +> - Enabled in GitLab 16.7 as a [Beta](../../policy/experiment-beta-support.md#beta) feature. This page is a work in progress, and we're updating the information as we add more features. For more information, see the [group direction page](https://about.gitlab.com/direction/monitor/product-analytics/). @@ -65,22 +62,23 @@ flowchart TB > - `cube_api_proxy` removed and replaced with `product_analytics_internal_preview` in GitLab 15.10. > - `product_analytics_internal_preview` replaced with `product_analytics_dashboards` in GitLab 15.11. -FLAG: -On self-managed GitLab, by default this feature is not available. To make it available per project or for your entire instance, an administrator can [enable the feature flags](../../administration/feature_flags.md) named `product_analytics_dashboards`, `product_analytics_admin_settings`, and `combined_analytics_dashboards`. -On GitLab.com, this feature is not available. -This feature is not ready for production use. - -To track events in your project applications on a self-managed instance, -you must enable and configure product analytics. +To track events in your project's applications on GitLab.com, +you must enable and configure Product Analytics. Prerequisites: -- You must be an administrator of a self-managed GitLab instance. +- You must be an Owner of the group you wish to enable Product Analytics for. + +### Group-level settings -1. On the left sidebar, at the bottom, select **Admin Area**. +NOTE: +These group-level settings are available for top-level groups and cascade to all projects that belong to the group. + +1. On the left sidebar, select **Search or go to** and find your group. 1. Select **Settings > General**. -1. Expand the **Analytics** tab and find the **Product analytics** section. -1. Select **Enable product analytics** and enter the configuration values. +1. Expand the **Permissions and group features** section. +1. Check **Use Experiment and Beta features** checkbox. +1. Check **Use product analytics** checkbox. 1. Select **Save changes**. ### Project-level settings @@ -90,7 +88,6 @@ have a different configured product analytics instance for your project. Prerequisites: -- Product analytics must be enabled at the instance-level. - You must have at least the Maintainer role for the project or group the project belongs to. - The project must be in a group namespace. @@ -111,18 +108,6 @@ To onboard a project: 1. Select **Set up product analytics**. Your instance is being created, and the project onboarded. -### Onboard an internal project - -GitLab team members can enable Product Analytics on their internal projects on GitLab.com (Ultimate) during the experiment phase. - -1. Send a message to the Product Analytics team (`#g_analyze_product_analytics`) informing them of the repository to be enabled. -1. Using ChatOps, enable both the `product_analytics_dashboards` and `combined_analytics_dashboards`: - - ```plaintext - /chatops run feature set product_analytics_dashboards true --project=FULLPATH_TO_PROJECT - /chatops run feature set combined_analytics_dashboards true --project=FULLPATH_TO_PROJECT - ``` - ## Instrument your application To instrument code to collect data, use one or more of the existing SDKs: @@ -138,11 +123,6 @@ To instrument code to collect data, use one or more of the existing SDKs: > - Introduced in GitLab 15.5 behind the [feature flag](../../administration/feature_flags.md) named `product_analytics_internal_preview`. Disabled by default. > - `product_analytics_internal_preview` replaced with `product_analytics_dashboards` in GitLab 15.11. -FLAG: -On self-managed GitLab, by default this feature is not available. To make it available per project or for your entire instance, an administrator can [enable the feature flag](../../administration/feature_flags.md) named `product_analytics_dashboards`. -On GitLab.com, this feature is not available. -This feature is not ready for production use. - Product analytics dashboards are a subset of dashboards under [Analytics dashboards](../analytics/analytics_dashboards.md). Specifically product analytics dashboards and visualizations make use of the `cube_analytics` data type. diff --git a/spec/models/label_spec.rb b/spec/models/label_spec.rb index 4862b0b0453..2c73178ee63 100644 --- a/spec/models/label_spec.rb +++ b/spec/models/label_spec.rb @@ -208,20 +208,6 @@ RSpec.describe Label, feature_category: :team_planning do end describe 'scopes' do - describe '.on_board' do - let(:board) { create(:board, project: project) } - let!(:list1) { create(:list, board: board, label: development) } - let!(:list2) { create(:list, board: board, label: testing) } - - let!(:development) { create(:label, project: project, name: 'Development') } - let!(:testing) { create(:label, project: project, name: 'Testing') } - let!(:regression) { create(:label, project: project, name: 'Regression') } - - it 'returns only the board labels' do - expect(described_class.on_board(board.id)).to match_array([development, testing]) - end - end - describe '.with_lock_on_merge' do let(:label) { create(:label, project: project, name: 'Label') } let(:label_locked) { create(:label, project: project, name: 'Label locked', lock_on_merge: true) } diff --git a/spec/support/shared_examples/services/boards/issues_move_service_shared_examples.rb b/spec/support/shared_examples/services/boards/issues_move_service_shared_examples.rb index 9d016e4830e..38c0670880d 100644 --- a/spec/support/shared_examples/services/boards/issues_move_service_shared_examples.rb +++ b/spec/support/shared_examples/services/boards/issues_move_service_shared_examples.rb @@ -43,11 +43,11 @@ RSpec.shared_examples 'issues move service' do |group| described_class.new(parent, user, params).execute(issue) end - it 'removes all list-labels from boards and close the issue' do + it 'does not change labels and close the issue' do described_class.new(parent, user, params).execute(issue) issue.reload - expect(issue.labels).to contain_exactly(bug, regression) + expect(issue.labels).to contain_exactly(bug, development, testing, regression) expect(issue).to be_closed end end @@ -59,13 +59,11 @@ RSpec.shared_examples 'issues move service' do |group| let(:issue) { create(:labeled_issue, project: project, labels: [bug, development, testing, regression], milestone: milestone) } let(:params) { { board_id: board1.id, from_list_id: list2.id, to_list_id: backlog.id } } - it_behaves_like 'updating timestamps' - it 'keeps labels and milestone' do described_class.new(parent, user, params).execute(issue) issue.reload - expect(issue.labels).to contain_exactly(bug, regression) + expect(issue.labels).to contain_exactly(bug, development, testing, regression) expect(issue.milestone).to eq(milestone) end end |