diff options
-rw-r--r-- | app/assets/javascripts/security_configuration/components/training_provider_list.vue | 24 | ||||
-rw-r--r-- | app/assets/javascripts/security_configuration/constants.js | 2 | ||||
-rw-r--r-- | config/feature_flags/development/json_limited_encoder.yml | 8 | ||||
-rw-r--r-- | config/feature_flags/development/roadmap_settings.yml | 2 | ||||
-rw-r--r-- | data/deprecations/14-8-gitaly-remove-per-repository-election.yml | 19 | ||||
-rw-r--r-- | doc/development/integrations/img/copy_cookies.png | bin | 44311 -> 0 bytes | |||
-rw-r--r-- | doc/development/integrations/img/copy_curl.png | bin | 60175 -> 0 bytes | |||
-rw-r--r-- | doc/development/integrations/jira_connect.md | 24 | ||||
-rw-r--r-- | doc/update/deprecations.md | 9 | ||||
-rw-r--r-- | doc/user/group/index.md | 2 | ||||
-rw-r--r-- | lib/gitlab/json.rb | 2 | ||||
-rw-r--r-- | qa/qa/specs/features/browser_ui/3_create/web_ide/open_fork_in_web_ide_spec.rb | 6 | ||||
-rw-r--r-- | spec/frontend/security_configuration/components/training_provider_list_spec.js | 35 | ||||
-rw-r--r-- | spec/lib/gitlab/json_spec.rb | 10 |
14 files changed, 94 insertions, 49 deletions
diff --git a/app/assets/javascripts/security_configuration/components/training_provider_list.vue b/app/assets/javascripts/security_configuration/components/training_provider_list.vue index 7a4c0205569..dea94503e62 100644 --- a/app/assets/javascripts/security_configuration/components/training_provider_list.vue +++ b/app/assets/javascripts/security_configuration/components/training_provider_list.vue @@ -1,7 +1,12 @@ <script> import { GlAlert, GlCard, GlToggle, GlLink, GlSkeletonLoader } from '@gitlab/ui'; import * as Sentry from '@sentry/browser'; +import Tracking from '~/tracking'; import { __ } from '~/locale'; +import { + TRACK_TOGGLE_TRAINING_PROVIDER_ACTION, + TRACK_TOGGLE_TRAINING_PROVIDER_LABEL, +} from '~/security_configuration/constants'; import dismissUserCalloutMutation from '~/graphql_shared/mutations/dismiss_user_callout.mutation.graphql'; import securityTrainingProvidersQuery from '../graphql/security_training_providers.query.graphql'; import configureSecurityTrainingProvidersMutation from '../graphql/configure_security_training_providers.mutation.graphql'; @@ -23,6 +28,7 @@ export default { GlLink, GlSkeletonLoader, }, + mixins: [Tracking.mixin()], inject: ['projectFullPath'], apollo: { securityTrainingProviders: { @@ -93,9 +99,14 @@ export default { .filter(({ isEnabled }) => isEnabled) .map(({ id }) => id); - this.storeEnabledProviders(toggledProviders, enabledProviderIds); + const { isEnabled: selectedProviderIsEnabled } = toggledProviders.find( + (provider) => provider.id === selectedProviderId, + ); + + this.trackProviderToggle(selectedProviderId, selectedProviderIsEnabled); + this.storeEnabledProviders(enabledProviderIds); }, - async storeEnabledProviders(toggledProviders, enabledProviderIds) { + async storeEnabledProviders(enabledProviderIds) { this.toggleLoading = true; try { @@ -125,6 +136,15 @@ export default { this.toggleLoading = false; } }, + trackProviderToggle(providerId, providerIsEnabled) { + this.track(TRACK_TOGGLE_TRAINING_PROVIDER_ACTION, { + label: TRACK_TOGGLE_TRAINING_PROVIDER_LABEL, + property: providerId, + extra: { + providerIsEnabled, + }, + }); + }, }, i18n, }; diff --git a/app/assets/javascripts/security_configuration/constants.js b/app/assets/javascripts/security_configuration/constants.js new file mode 100644 index 00000000000..dc76436e91d --- /dev/null +++ b/app/assets/javascripts/security_configuration/constants.js @@ -0,0 +1,2 @@ +export const TRACK_TOGGLE_TRAINING_PROVIDER_ACTION = 'toggle_security_training_provider'; +export const TRACK_TOGGLE_TRAINING_PROVIDER_LABEL = 'update_security_training_provider'; diff --git a/config/feature_flags/development/json_limited_encoder.yml b/config/feature_flags/development/json_limited_encoder.yml deleted file mode 100644 index 346013230a3..00000000000 --- a/config/feature_flags/development/json_limited_encoder.yml +++ /dev/null @@ -1,8 +0,0 @@ ---- -name: json_limited_encoder -introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/38687 -rollout_issue_url: -milestone: '13.3' -type: development -group: group::source code -default_enabled: true diff --git a/config/feature_flags/development/roadmap_settings.yml b/config/feature_flags/development/roadmap_settings.yml index a9a4fc12755..78704a90d06 100644 --- a/config/feature_flags/development/roadmap_settings.yml +++ b/config/feature_flags/development/roadmap_settings.yml @@ -5,4 +5,4 @@ rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/350830 milestone: '14.8' type: development group: group::product planning -default_enabled: false +default_enabled: true diff --git a/data/deprecations/14-8-gitaly-remove-per-repository-election.yml b/data/deprecations/14-8-gitaly-remove-per-repository-election.yml new file mode 100644 index 00000000000..334da51c4a0 --- /dev/null +++ b/data/deprecations/14-8-gitaly-remove-per-repository-election.yml @@ -0,0 +1,19 @@ +- name: "Configurable Gitaly `per_repository` election strategy" # The name of the feature to be deprecated + announcement_milestone: "14.8" # The milestone when this feature was first announced as deprecated. + announcement_date: "2022-02-22" # The date of the milestone release when this feature was first announced as deprecated. This should almost always be the 22nd of a month (YYYY-MM-22), unless you did an out of band blog post. + removal_milestone: "14.9" # The milestone when this feature is planned to be removed + removal_date: "2022-03-22" # The date of the milestone release when this feature is planned to be removed. This should almost always be the 22nd of a month (YYYY-MM-22), unless you did an out of band blog post. + breaking_change: false # If this deprecation is a breaking change, set this value to true + reporter: mjwood # GitLab username of the person reporting the deprecation + body: | # Do not modify this line, instead modify the lines below. + Configuring the `per_repository` Gitaly election strategy is [deprecated](https://gitlab.com/gitlab-org/gitlab/-/issues/352612). + `per_repository` has been the only option since GitLab 14.0. + + This change is part of regular maintenance to keep our codebase clean. +# The following items are not published on the docs page, but may be used in the future. + stage: # (optional - may be required in the future) String value of the stage that the feature was created in. e.g., Growth + tiers: # (optional - may be required in the future) An array of tiers that the feature is available in currently. e.g., [Free, Silver, Gold, Core, Premium, Ultimate] + issue_url: "https://gitlab.com/gitlab-org/gitlab/-/issues/352612" # (optional) This is a link to the deprecation issue in GitLab + documentation_url: # (optional) This is a link to the current documentation page + image_url: # (optional) This is a link to a thumbnail image depicting the feature + video_url: # (optional) Use the youtube thumbnail URL with the structure of https://img.youtube.com/vi/UNIQUEID/hqdefault.jpg diff --git a/doc/development/integrations/img/copy_cookies.png b/doc/development/integrations/img/copy_cookies.png Binary files differdeleted file mode 100644 index 21575987173..00000000000 --- a/doc/development/integrations/img/copy_cookies.png +++ /dev/null diff --git a/doc/development/integrations/img/copy_curl.png b/doc/development/integrations/img/copy_curl.png Binary files differdeleted file mode 100644 index 9fa871efbd5..00000000000 --- a/doc/development/integrations/img/copy_curl.png +++ /dev/null diff --git a/doc/development/integrations/jira_connect.md b/doc/development/integrations/jira_connect.md index fc7204fdd5a..cfa1fdba699 100644 --- a/doc/development/integrations/jira_connect.md +++ b/doc/development/integrations/jira_connect.md @@ -65,27 +65,3 @@ If the app install failed, you might need to delete `jira_connect_installations` 1. Open the [database console](https://gitlab.com/gitlab-org/gitlab-development-kit/-/blob/main/doc/howto/postgresql.md#access-postgresql). 1. Run `TRUNCATE TABLE jira_connect_installations CASCADE;`. - -## Add a namespace - -To add a [namespace](../../user/group/index.md#namespaces) to Jira: - -1. Make sure you are logged in on your GitLab development instance. -1. On the GitLab app page in Jira, click **Get started**. -1. Open your browser's developer tools and navigate to the **Network** tab. -1. Try to add the namespace in Jira. -1. If the request fails with 401 "not authorized", copy the request as a cURL command - and paste it in your terminal. - - ![Example Vulnerability](img/copy_curl.png) - -1. Go to your development instance (usually at: <http://localhost:3000>), open developer - tools, navigate to the Network tab and reload the page. -1. Copy all cookies from the first request. - - ![Example Vulnerability](img/copy_cookies.png) - -1. Append the cookies to the cURL command in your terminal: - `--cookies "<cookies from the request>"`. -1. Submit the cURL request. -1. If the response is `{"success":true}`, the namespace was added. diff --git a/doc/update/deprecations.md b/doc/update/deprecations.md index 49eba783e21..3211faa8682 100644 --- a/doc/update/deprecations.md +++ b/doc/update/deprecations.md @@ -727,6 +727,15 @@ The `merged_by` field in the [merge request API](https://docs.gitlab.com/ee/api/ ## 14.8 +### Configurable Gitaly `per_repository` election strategy + +Configuring the `per_repository` Gitaly election strategy is [deprecated](https://gitlab.com/gitlab-org/gitlab/-/issues/352612). +`per_repository` has been the only option since GitLab 14.0. + +This change is part of regular maintenance to keep our codebase clean. + +**Planned removal milestone: 14.9 (2022-03-22)** + ### Container Network and Host Security WARNING: diff --git a/doc/user/group/index.md b/doc/user/group/index.md index 3b3ffe4747c..adfc0ddf7ed 100644 --- a/doc/user/group/index.md +++ b/doc/user/group/index.md @@ -637,7 +637,7 @@ To restrict group access by IP address: 1. Go to the group's **Settings > General** page. 1. Expand the **Permissions and group features** section. -1. In the **Allow access to the following IP addresses** field, enter IP address ranges in CIDR notation. +1. In the **Allow access to the following IP addresses** field, enter IPv4 or IPv6 address ranges in CIDR notation. 1. Select **Save changes**. ![Domain restriction by IP address](img/restrict-by-ip.gif) diff --git a/lib/gitlab/json.rb b/lib/gitlab/json.rb index c26ccb5c80d..3d6b2ae8008 100644 --- a/lib/gitlab/json.rb +++ b/lib/gitlab/json.rb @@ -248,8 +248,6 @@ module Gitlab # @return [String] # @raise [LimitExceeded] if the resulting json string is bigger than the specified limit def self.encode(object, limit: 25.megabytes) - return ::Gitlab::Json.dump(object) unless Feature.enabled?(:json_limited_encoder, default_enabled: :yaml) - buffer = StringIO.new buffer_size = 0 diff --git a/qa/qa/specs/features/browser_ui/3_create/web_ide/open_fork_in_web_ide_spec.rb b/qa/qa/specs/features/browser_ui/3_create/web_ide/open_fork_in_web_ide_spec.rb index 758aae9f729..e9d8e35478f 100644 --- a/qa/qa/specs/features/browser_ui/3_create/web_ide/open_fork_in_web_ide_spec.rb +++ b/qa/qa/specs/features/browser_ui/3_create/web_ide/open_fork_in_web_ide_spec.rb @@ -11,7 +11,7 @@ module QA end context 'when a user does not have permissions to commit to the project' do - let(:user) { Resource::User.fabricate_or_use(Runtime::Env.gitlab_qa_username_1, Runtime::Env.gitlab_qa_password_1) } + let(:user) { Resource::User.fabricate_or_use(Runtime::Env.gitlab_qa_username_6, Runtime::Env.gitlab_qa_password_6) } context 'when no fork is present' do it 'suggests to create a fork when a user clicks Web IDE in the main project', testcase: 'https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/347823' do @@ -45,6 +45,10 @@ module QA submit_merge_request_upstream end + + after do + fork_project.project.remove_via_api! + end end def submit_merge_request_upstream diff --git a/spec/frontend/security_configuration/components/training_provider_list_spec.js b/spec/frontend/security_configuration/components/training_provider_list_spec.js index ef850c33d6e..ea5df9ca550 100644 --- a/spec/frontend/security_configuration/components/training_provider_list_spec.js +++ b/spec/frontend/security_configuration/components/training_provider_list_spec.js @@ -4,6 +4,11 @@ import { shallowMount } from '@vue/test-utils'; import Vue from 'vue'; import VueApollo from 'vue-apollo'; import createMockApollo from 'helpers/mock_apollo_helper'; +import { mockTracking, unmockTracking } from 'helpers/tracking_helper'; +import { + TRACK_TOGGLE_TRAINING_PROVIDER_ACTION, + TRACK_TOGGLE_TRAINING_PROVIDER_LABEL, +} from '~/security_configuration/constants'; import TrainingProviderList from '~/security_configuration/components/training_provider_list.vue'; import securityTrainingProvidersQuery from '~/security_configuration/graphql/security_training_providers.query.graphql'; import configureSecurityTrainingProvidersMutation from '~/security_configuration/graphql/configure_security_training_providers.mutation.graphql'; @@ -197,6 +202,36 @@ describe('TrainingProviderList component', () => { ); }); }); + + describe('metrics', () => { + let trackingSpy; + + beforeEach(() => { + trackingSpy = mockTracking(undefined, wrapper.element, jest.spyOn); + }); + + afterEach(() => { + unmockTracking(); + }); + + it('tracks when a provider gets toggled', () => { + expect(trackingSpy).not.toHaveBeenCalled(); + + toggleFirstProvider(); + + // Note: Ideally we also want to test that the tracking event is called correctly when a + // provider gets disabled, but that's a bit tricky to do with the current implementation + // Once https://gitlab.com/gitlab-org/gitlab/-/issues/348985 and https://gitlab.com/gitlab-org/gitlab/-/merge_requests/79492 + // are merged this will be much easer to do and should be tackled then. + expect(trackingSpy).toHaveBeenCalledWith(undefined, TRACK_TOGGLE_TRAINING_PROVIDER_ACTION, { + property: securityTrainingProviders[0].id, + label: TRACK_TOGGLE_TRAINING_PROVIDER_LABEL, + extra: { + providerIsEnabled: true, + }, + }); + }); + }); }); describe('with errors', () => { diff --git a/spec/lib/gitlab/json_spec.rb b/spec/lib/gitlab/json_spec.rb index f9f57752b0a..8f846cdfab9 100644 --- a/spec/lib/gitlab/json_spec.rb +++ b/spec/lib/gitlab/json_spec.rb @@ -440,15 +440,5 @@ RSpec.describe Gitlab::Json do expect(subject.size).to eq(10001) end end - - context 'when json_limited_encoder is disabled' do - let(:obj) { [{ test: true }] * 1000 } - - it 'does not raise an error' do - stub_feature_flags(json_limited_encoder: false) - - expect { subject }.not_to raise_error - end - end end end |