diff --git a/app/models/onboarding/progress.rb b/app/models/onboarding/progress.rb index b66288438215aaef71c35229147ecc2946df441d..cad2ae14a87ca2d786a37f044930e36127f91962 100644 --- a/app/models/onboarding/progress.rb +++ b/app/models/onboarding/progress.rb @@ -4,6 +4,9 @@ module Onboarding class Progress < ApplicationRecord self.table_name = 'onboarding_progresses' + include IgnorableColumns + ignore_column :promote_ultimate_features_at, remove_with: '17.0', remove_after: '2024-04-13' + belongs_to :namespace, optional: false validate :namespace_is_root_namespace @@ -32,7 +35,6 @@ class Progress < ApplicationRecord :secure_api_fuzzing_run, :secure_cluster_image_scanning_run, :license_scanning_run, - :promote_ultimate_features, :code_added ].freeze diff --git a/config/feature_flags/experiment/promote_ultimate_features.yml b/config/feature_flags/experiment/promote_ultimate_features.yml deleted file mode 100644 index 5035748401bbb022cd1b8949e5cb8eeb69315337..0000000000000000000000000000000000000000 --- a/config/feature_flags/experiment/promote_ultimate_features.yml +++ /dev/null @@ -1,8 +0,0 @@ ---- -name: promote_ultimate_features -introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/136199 -rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/430868 -milestone: '16.7' -type: experiment -group: group::activation -default_enabled: false diff --git a/ee/app/assets/javascripts/pages/projects/learn_gitlab/components/learn_gitlab_section_link.vue b/ee/app/assets/javascripts/pages/projects/learn_gitlab/components/learn_gitlab_section_link.vue index dd5ccf4503152f257d29162006022724c324aa3d..2fac2a24654f54397036be7ccc098dc4c540ecd6 100644 --- a/ee/app/assets/javascripts/pages/projects/learn_gitlab/components/learn_gitlab_section_link.vue +++ b/ee/app/assets/javascripts/pages/projects/learn_gitlab/components/learn_gitlab_section_link.vue @@ -4,9 +4,8 @@ import { GlLink, GlIcon, GlButton, GlPopover, GlTooltipDirective as GlTooltip } import eventHub from '~/invite_members/event_hub'; import { s__ } from '~/locale'; import { LEARN_GITLAB } from 'ee/invite_members/constants'; -import { ACTION_LABELS, PROMOTE_ULTIMATE_FEATURES } from '../constants'; +import { ACTION_LABELS } from '../constants'; import IncludedInTrialIndicator from './included_in_trial_indicator.vue'; -import PaidFeatureIndicator from './paid_feature_indicator.vue'; export default { name: 'LearnGitlabSectionLink', @@ -16,7 +15,6 @@ export default { GlButton, GlPopover, IncludedInTrialIndicator, - PaidFeatureIndicator, }, directives: { GlTooltip, @@ -25,7 +23,6 @@ export default { contactAdmin: s__('LearnGitlab|Contact your administrator to enable this action.'), viewAdminList: s__('LearnGitlab|View administrator list'), }, - inject: ['promoteUltimateFeatures'], props: { action: { required: true, @@ -48,30 +45,6 @@ export default { popoverText() { return this.value.message || this.$options.i18n.contactAdmin; }, - trackExperiment() { - if (this.actionLabelValue('trialRequired')) { - return PROMOTE_ULTIMATE_FEATURES; - } - - return undefined; - }, - badgeComponent() { - if (this.promoteUltimateFeatures) { - return PaidFeatureIndicator; - } - - return IncludedInTrialIndicator; - }, - badgeOptions() { - if (this.promoteUltimateFeatures) { - return { - planName: this.actionLabelValue('planName'), - trackLabel: this.actionLabelValue('trackLabel'), - }; - } - - return {}; - }, }, methods: { openModalIfIsInviteLink() { @@ -91,12 +64,7 @@ export default { <span v-if="value.completed" class="gl-text-green-500"> <gl-icon name="check-circle-filled" :size="16" data-testid="completed-icon" /> {{ actionLabelValue('title') }} - - <component - :is="badgeComponent" - v-if="actionLabelValue('trialRequired')" - v-bind="badgeOptions" - /> + <included-in-trial-indicator v-if="actionLabelValue('trialRequired')" /> </span> <div v-else-if="value.enabled"> <gl-link @@ -105,16 +73,11 @@ export default { data-testid="uncompleted-learn-gitlab-link" data-track-action="click_link" :data-track-label="actionLabelValue('trackLabel')" - :data-track-experiment="trackExperiment" @click="openModalIfIsInviteLink" >{{ actionLabelValue('title') }}</gl-link > - <component - :is="badgeComponent" - v-if="actionLabelValue('trialRequired')" - v-bind="badgeOptions" - /> + <included-in-trial-indicator v-if="actionLabelValue('trialRequired')" /> </div> <template v-else> <div data-testid="disabled-learn-gitlab-link">{{ actionLabelValue('title') }}</div> diff --git a/ee/app/assets/javascripts/pages/projects/learn_gitlab/components/paid_feature_indicator.vue b/ee/app/assets/javascripts/pages/projects/learn_gitlab/components/paid_feature_indicator.vue deleted file mode 100644 index 0bec440dadb1dfa761051061939ff85a21963e7f..0000000000000000000000000000000000000000 --- a/ee/app/assets/javascripts/pages/projects/learn_gitlab/components/paid_feature_indicator.vue +++ /dev/null @@ -1,55 +0,0 @@ -<script> -import { GlBadge, GlTooltip } from '@gitlab/ui'; -import Tracking from '~/tracking'; -import { s__, sprintf } from '~/locale'; -import { PROMOTE_ULTIMATE_FEATURES } from '../constants'; - -export default { - components: { - GlBadge, - GlTooltip, - }, - i18n: { - tooltip: s__( - 'LearnGitlab|After your 30-day trial, this feature is available on the %{planName} tier only.', - ), - }, - mixins: [Tracking.mixin({ experiment: PROMOTE_ULTIMATE_FEATURES })], - props: { - planName: { - type: String, - required: true, - }, - trackLabel: { - type: String, - required: true, - }, - }, - computed: { - title() { - return sprintf(this.$options.i18n.tooltip, { planName: this.planName }); - }, - }, - methods: { - onShown() { - this.track('render_tooltip', { label: this.trackLabel }); - }, - }, -}; -</script> -<template> - <span> - <gl-tooltip - placement="top" - :target="() => $refs.paidFeatureIndicatorBadge" - :title="title" - @shown="onShown" - /> - - <span ref="paidFeatureIndicatorBadge"> - <gl-badge variant="tier" size="sm" icon="license-sm" icon-size="sm"> - {{ planName }} - </gl-badge> - </span> - </span> -</template> diff --git a/ee/app/assets/javascripts/pages/projects/learn_gitlab/constants/index.js b/ee/app/assets/javascripts/pages/projects/learn_gitlab/constants/index.js index e849a518df3063fcdab49ffea39e05c1608c6c7d..4458ac6ae4ce88e346811b7e80191e21a1d05e37 100644 --- a/ee/app/assets/javascripts/pages/projects/learn_gitlab/constants/index.js +++ b/ee/app/assets/javascripts/pages/projects/learn_gitlab/constants/index.js @@ -51,7 +51,6 @@ export const ACTION_LABELS = { ), trackLabel: 'add_code_owners', trialRequired: true, - planName: s__('BillingPlans|Premium'), section: 'workspace', position: 4, openInNewTab: true, @@ -62,7 +61,6 @@ export const ACTION_LABELS = { description: s__('LearnGitLab|Route code reviews to the right reviewers, every time.'), trackLabel: 'enable_require_merge_approvals', trialRequired: true, - planName: s__('BillingPlans|Premium'), section: 'workspace', position: 5, openInNewTab: true, @@ -89,7 +87,6 @@ export const ACTION_LABELS = { title: s__('LearnGitLab|Scan dependencies for licenses'), trackLabel: 'scan_dependencies_for_licenses', trialRequired: true, - planName: s__('BillingPlans|Ultimate'), section: 'deploy', position: 2, }, @@ -97,7 +94,6 @@ export const ACTION_LABELS = { title: s__('LearnGitLab|Scan dependencies for vulnerabilities'), trackLabel: 'scan_dependencies_for_vulnerabilities', trialRequired: true, - planName: s__('BillingPlans|Ultimate'), section: 'deploy', position: 3, }, @@ -105,7 +101,6 @@ export const ACTION_LABELS = { title: s__('LearnGitLab|Analyze your application for vulnerabilities with DAST'), trackLabel: 'analyze_your_application_for_vulnerabilities_with_dast', trialRequired: true, - planName: s__('BillingPlans|Ultimate'), section: 'deploy', position: 4, }, @@ -139,4 +134,3 @@ export const ACTION_SECTIONS = { }; export const INVITE_MODAL_OPEN_COOKIE = 'confetti_post_signup'; -export const PROMOTE_ULTIMATE_FEATURES = 'promote_ultimate_features'; diff --git a/ee/app/assets/javascripts/pages/projects/learn_gitlab/show/index.js b/ee/app/assets/javascripts/pages/projects/learn_gitlab/show/index.js index 429eed6b881660913e93e56da593776118684158..ab84087446e9133fd77cd6c54ad5aa73602123ca 100644 --- a/ee/app/assets/javascripts/pages/projects/learn_gitlab/show/index.js +++ b/ee/app/assets/javascripts/pages/projects/learn_gitlab/show/index.js @@ -16,9 +16,6 @@ function initLearnGitlab() { return new Vue({ el, - provide: { - promoteUltimateFeatures: project.promoteUltimateFeatures, - }, render(createElement) { return createElement(LearnGitlab, { props: { actions, sections, project }, diff --git a/ee/app/helpers/projects/learn_gitlab_helper.rb b/ee/app/helpers/projects/learn_gitlab_helper.rb index 89d11413a653dd7b63c40eec66499f611ea2fa95..01766a40c1bf98537914fa4db8159f1592ba46ac 100644 --- a/ee/app/helpers/projects/learn_gitlab_helper.rb +++ b/ee/app/helpers/projects/learn_gitlab_helper.rb @@ -73,8 +73,7 @@ def onboarding_sections_data def onboarding_project_data(project) { - name: project.name, - promote_ultimate_features: promote_ultimate_features?(project.root_ancestor) + name: project.name } end @@ -121,13 +120,5 @@ def deploy_section_action_urls(project) secure_dast_run: project_security_configuration_path(project, anchor: 'dast') } end - - def promote_ultimate_features?(group) - return unless group.trial_active? - - experiment(:promote_ultimate_features, group: group) do |e| - e.candidate { group.onboarding_progress&.promote_ultimate_features_at.present? } - end.run - end end end diff --git a/ee/app/services/registrations/base_namespace_create_service.rb b/ee/app/services/registrations/base_namespace_create_service.rb index fb302a433ac010b54e9a44bd476d67d2a9bc9eb9..80fe07b912c43380c7c8be10dd17936e954aa336 100644 --- a/ee/app/services/registrations/base_namespace_create_service.rb +++ b/ee/app/services/registrations/base_namespace_create_service.rb @@ -17,7 +17,6 @@ def initialize(user, params = {}) def after_successful_group_creation(group_track_action:) Gitlab::Tracking.event(self.class.name, group_track_action, namespace: group, user: user) ::Onboarding::Progress.onboard(group) - ::Onboarding::ProgressService.new(group).execute(action: :promote_ultimate_features) experiment(:phone_verification_for_low_risk_users, user: user).track(:assignment, namespace: group) diff --git a/ee/spec/features/registrations/combined_registration_spec.rb b/ee/spec/features/registrations/combined_registration_spec.rb index 62a2fa88746555de6fa10081fc0dc66a90804b7c..1c182f2d10a3883168b3ab88d44f2fb5cce787fe 100644 --- a/ee/spec/features/registrations/combined_registration_spec.rb +++ b/ee/spec/features/registrations/combined_registration_spec.rb @@ -9,7 +9,7 @@ before do # https://gitlab.com/gitlab-org/gitlab/-/issues/340302 - allow(Gitlab::QueryLimiting::Transaction).to receive(:threshold).and_return(158) + allow(Gitlab::QueryLimiting::Transaction).to receive(:threshold).and_return(154) # Stubbed not to break query budget. Should be safe as the query only happens on SaaS and the result is cached allow(Gitlab::Com).to receive(:gitlab_com_group_member?).and_return(nil) diff --git a/ee/spec/features/registrations/sign_up_with_trial_from_external_site_without_confirmation_spec.rb b/ee/spec/features/registrations/sign_up_with_trial_from_external_site_without_confirmation_spec.rb index 3783ad06c6572e4dacd080a7e697bdbd8137325d..4312a3824c0c0b9f6cd3061afc4c6281140b119d 100644 --- a/ee/spec/features/registrations/sign_up_with_trial_from_external_site_without_confirmation_spec.rb +++ b/ee/spec/features/registrations/sign_up_with_trial_from_external_site_without_confirmation_spec.rb @@ -16,7 +16,7 @@ # The groups_and_projects_controller (on `click_on 'Create project'`) is over # the query limit threshold, so we have to adjust it. # https://gitlab.com/gitlab-org/gitlab/-/issues/340302 - allow(Gitlab::QueryLimiting::Transaction).to receive(:threshold).and_return(169) + allow(Gitlab::QueryLimiting::Transaction).to receive(:threshold).and_return(163) subscription_portal_url = ::Gitlab::Routing.url_helpers.subscription_portal_url diff --git a/ee/spec/features/registrations/start_trial_from_external_site_without_confirmation_spec.rb b/ee/spec/features/registrations/start_trial_from_external_site_without_confirmation_spec.rb index 32d4b618917cb74045af55cdb87c6e8d97786edf..7919636f1a51ffcafbaa322175d696806291ec23 100644 --- a/ee/spec/features/registrations/start_trial_from_external_site_without_confirmation_spec.rb +++ b/ee/spec/features/registrations/start_trial_from_external_site_without_confirmation_spec.rb @@ -15,7 +15,7 @@ # The groups_and_projects_controller (on `click_on 'Create project'`) is over # the query limit threshold, so we have to adjust it. # https://gitlab.com/gitlab-org/gitlab/-/issues/340302 - allow(Gitlab::QueryLimiting::Transaction).to receive(:threshold).and_return(169) + allow(Gitlab::QueryLimiting::Transaction).to receive(:threshold).and_return(163) subscription_portal_url = ::Gitlab::Routing.url_helpers.subscription_portal_url diff --git a/ee/spec/frontend/pages/projects/learn_gitlab/components/__snapshots__/learn_gitlab_spec.js.snap b/ee/spec/frontend/pages/projects/learn_gitlab/components/__snapshots__/learn_gitlab_spec.js.snap index 0a3affb473b66e8821b4ff78bba6c52499a136da..9ce514f33762f37640b520db6df40e71d26ca631 100644 --- a/ee/spec/frontend/pages/projects/learn_gitlab/components/__snapshots__/learn_gitlab_spec.js.snap +++ b/ee/spec/frontend/pages/projects/learn_gitlab/components/__snapshots__/learn_gitlab_spec.js.snap @@ -235,7 +235,6 @@ exports[`Learn GitLab Initial rendering concerns renders correctly 1`] = ` class="gl-link" data-testid="uncompleted-learn-gitlab-link" data-track-action="click_link" - data-track-experiment="promote_ultimate_features" data-track-label="add_code_owners" href="http://example.com/" rel="noopener noreferrer" @@ -263,7 +262,6 @@ exports[`Learn GitLab Initial rendering concerns renders correctly 1`] = ` class="gl-link" data-testid="uncompleted-learn-gitlab-link" data-track-action="click_link" - data-track-experiment="promote_ultimate_features" data-track-label="enable_require_merge_approvals" href="http://example.com/" rel="noopener noreferrer" @@ -320,7 +318,6 @@ exports[`Learn GitLab Initial rendering concerns renders correctly 1`] = ` class="gl-link" data-testid="uncompleted-learn-gitlab-link" data-track-action="click_link" - data-track-experiment="promote_ultimate_features" data-track-label="scan_dependencies_for_licenses" href="https://docs.gitlab.com/ee/foobar/" rel="noopener noreferrer" @@ -348,7 +345,6 @@ exports[`Learn GitLab Initial rendering concerns renders correctly 1`] = ` class="gl-link" data-testid="uncompleted-learn-gitlab-link" data-track-action="click_link" - data-track-experiment="promote_ultimate_features" data-track-label="scan_dependencies_for_vulnerabilities" href="https://docs.gitlab.com/ee/foobar/" rel="noopener noreferrer" @@ -376,7 +372,6 @@ exports[`Learn GitLab Initial rendering concerns renders correctly 1`] = ` class="gl-link" data-testid="uncompleted-learn-gitlab-link" data-track-action="click_link" - data-track-experiment="promote_ultimate_features" data-track-label="analyze_your_application_for_vulnerabilities_with_dast" href="https://docs.gitlab.com/ee/foobar/" rel="noopener noreferrer" diff --git a/ee/spec/frontend/pages/projects/learn_gitlab/components/learn_gitlab_section_link_spec.js b/ee/spec/frontend/pages/projects/learn_gitlab/components/learn_gitlab_section_link_spec.js index ccffb8dd52b958099c547bcf6a6cfd62ea6129f0..9ddc03aa97a58191335b6b8845a8ff22472cbcd0 100644 --- a/ee/spec/frontend/pages/projects/learn_gitlab/components/learn_gitlab_section_link_spec.js +++ b/ee/spec/frontend/pages/projects/learn_gitlab/components/learn_gitlab_section_link_spec.js @@ -2,16 +2,11 @@ import { GlPopover, GlLink } from '@gitlab/ui'; import { mount } from '@vue/test-utils'; import { extendedWrapper } from 'helpers/vue_test_utils_helper'; import { mockTracking, unmockTracking } from 'helpers/tracking_helper'; -import { stubExperiments } from 'helpers/experimentation_helper'; -import { TRACKING_CONTEXT_SCHEMA } from '~/experimentation/constants'; import eventHub from '~/invite_members/event_hub'; import LearnGitlabSectionLink from 'ee/pages/projects/learn_gitlab/components/learn_gitlab_section_link.vue'; -import { ACTION_LABELS, PROMOTE_ULTIMATE_FEATURES } from 'ee/pages/projects/learn_gitlab/constants'; +import { ACTION_LABELS } from 'ee/pages/projects/learn_gitlab/constants'; import { LEARN_GITLAB } from 'ee/invite_members/constants'; import { DOCS_URL_IN_EE_DIR } from 'jh_else_ce/lib/utils/url_utility'; -import IncludedInTrialIndicator from 'ee/pages/projects/learn_gitlab/components/included_in_trial_indicator.vue'; -import PaidFeatureIndicator from 'ee/pages/projects/learn_gitlab/components/paid_feature_indicator.vue'; -import { testProviders } from './mock_data'; const defaultAction = 'gitWrite'; const defaultProps = { @@ -30,10 +25,9 @@ const openInNewTabProps = { describe('Learn GitLab Section Link', () => { let wrapper; - const createWrapper = (action = defaultAction, props = {}, providers = testProviders) => { + const createWrapper = (action = defaultAction, props = {}) => { wrapper = extendedWrapper( mount(LearnGitlabSectionLink, { - provide: { ...providers }, propsData: { action, value: { ...defaultProps, ...props } }, }), ); @@ -44,8 +38,6 @@ describe('Learn GitLab Section Link', () => { const findPopoverTrigger = () => wrapper.findByTestId('contact-admin-popover-trigger'); const findPopover = () => wrapper.findComponent(GlPopover); const findPopoverLink = () => findPopover().findComponent(GlLink); - const findIncludedInTrialIndicator = () => wrapper.findComponent(IncludedInTrialIndicator); - const findPaidFeatureIndicator = () => wrapper.findComponent(PaidFeatureIndicator); it('renders no icon when not completed', () => { createWrapper(undefined, { completed: false }); @@ -163,73 +155,4 @@ describe('Learn GitLab Section Link', () => { unmockTracking(); }); }); - - describe('promote_ultimate_features experiment', () => { - const trackExperimentOptions = (action, variant) => { - const label = ACTION_LABELS[action].trackLabel; - - if (ACTION_LABELS[action].trialRequired) { - return { - label, - context: { - data: { - variant, - experiment: PROMOTE_ULTIMATE_FEATURES, - }, - schema: TRACKING_CONTEXT_SCHEMA, - }, - }; - } - - return { label }; - }; - - it.each` - action | variant - ${'codeAdded'} | ${'control'} - ${'codeAdded'} | ${'candidate'} - ${'codeOwnersEnabled'} | ${'control'} - ${'codeOwnersEnabled'} | ${'candidate'} - `('tracks the click for $action action and $variant variant', ({ action, variant }) => { - createWrapper(action); - - const trackingSpy = mockTracking('_category_', wrapper.element, jest.spyOn); - - stubExperiments({ [PROMOTE_ULTIMATE_FEATURES]: variant }); - - findUncompletedLink().trigger('click'); - - expect(trackingSpy).toHaveBeenCalledWith( - '_category_', - 'click_link', - trackExperimentOptions(action, variant), - ); - - unmockTracking(); - }); - }); - - describe('badge component', () => { - describe('when does not promote ultimate features', () => { - it('renders component', () => { - createWrapper('codeOwnersEnabled', { completed: true }); - - expect(findIncludedInTrialIndicator().exists()).toBe(true); - expect(findPaidFeatureIndicator().exists()).toBe(false); - }); - }); - - describe('when promotes ultimate features', () => { - it('renders component with tracking', () => { - createWrapper('codeOwnersEnabled', { completed: true }, { promoteUltimateFeatures: true }); - - const badgeComponent = findPaidFeatureIndicator(); - - expect(findIncludedInTrialIndicator().exists()).toBe(false); - expect(badgeComponent.exists()).toBe(true); - expect(badgeComponent.props('planName')).toBe(ACTION_LABELS.codeOwnersEnabled.planName); - expect(badgeComponent.props('trackLabel')).toBe(ACTION_LABELS.codeOwnersEnabled.trackLabel); - }); - }); - }); }); diff --git a/ee/spec/frontend/pages/projects/learn_gitlab/components/learn_gitlab_spec.js b/ee/spec/frontend/pages/projects/learn_gitlab/components/learn_gitlab_spec.js index 83006c255c93e033a2145920f77c64edc1292317..5f1897b43e1df53da8cfd4a753b9b724883ba1ec 100644 --- a/ee/spec/frontend/pages/projects/learn_gitlab/components/learn_gitlab_spec.js +++ b/ee/spec/frontend/pages/projects/learn_gitlab/components/learn_gitlab_spec.js @@ -9,7 +9,7 @@ import eventHub from '~/invite_members/event_hub'; import { INVITE_MODAL_OPEN_COOKIE } from 'ee/pages/projects/learn_gitlab/constants'; import { ON_CELEBRATION_TRACK_LABEL } from '~/invite_members/constants'; import eventHubNav from '~/super_sidebar/event_hub'; -import { testProviders, testActions, testSections, testProject } from './mock_data'; +import { testActions, testSections, testProject } from './mock_data'; describe('Learn GitLab', () => { let wrapper; @@ -20,7 +20,6 @@ describe('Learn GitLab', () => { const createWrapper = () => { wrapper = extendedWrapper( mount(LearnGitlab, { - provide: testProviders, propsData: { actions: testActions, sections: testSections, diff --git a/ee/spec/frontend/pages/projects/learn_gitlab/components/mock_data.js b/ee/spec/frontend/pages/projects/learn_gitlab/components/mock_data.js index dc968c2183d72958d70f630cb64d14f1d7360305..fed2d6562278537fd42f69c93a47f30258a93239 100644 --- a/ee/spec/frontend/pages/projects/learn_gitlab/components/mock_data.js +++ b/ee/spec/frontend/pages/projects/learn_gitlab/components/mock_data.js @@ -1,9 +1,5 @@ import { DOCS_URL_IN_EE_DIR } from 'jh_else_ce/lib/utils/url_utility'; -export const testProviders = { - promoteUltimateFeatures: false, -}; - export const testActions = { codeAdded: { url: 'http://example.com/', diff --git a/ee/spec/frontend/pages/projects/learn_gitlab/components/paid_feature_indicator_spec.js b/ee/spec/frontend/pages/projects/learn_gitlab/components/paid_feature_indicator_spec.js deleted file mode 100644 index f39364c31d05891be9e8c21daedab50154e74a6e..0000000000000000000000000000000000000000 --- a/ee/spec/frontend/pages/projects/learn_gitlab/components/paid_feature_indicator_spec.js +++ /dev/null @@ -1,56 +0,0 @@ -import { GlBadge, GlTooltip } from '@gitlab/ui'; -import { shallowMount } from '@vue/test-utils'; -import { mockTracking, unmockTracking } from 'helpers/tracking_helper'; -import PaidFeatureIndicator from 'ee/pages/projects/learn_gitlab/components/paid_feature_indicator.vue'; - -const trackLabel = 'add_code_owners'; - -describe('Paid Feature Indicator', () => { - let wrapper; - - const createWrapper = () => { - wrapper = shallowMount(PaidFeatureIndicator, { - propsData: { - trackLabel, - planName: 'Ultimate', - }, - }); - }; - - const findGlBadge = () => wrapper.findComponent(GlBadge); - const findGlTooltip = () => wrapper.findComponent(GlTooltip); - - beforeEach(() => { - createWrapper(); - }); - - it('renders badge', () => { - expect(findGlBadge().exists()).toBe(true); - expect(findGlBadge().text()).toBe('Ultimate'); - - expect(findGlBadge().props()).toEqual({ - size: 'sm', - variant: 'tier', - icon: 'license-sm', - iconSize: 'sm', - }); - }); - - it('renders tooltip', () => { - expect(findGlTooltip().exists()).toBe(true); - - expect(findGlTooltip().attributes('title')).toBe( - 'After your 30-day trial, this feature is available on the Ultimate tier only.', - ); - }); - - it('tracks badge shown', () => { - const trackingSpy = mockTracking(undefined, wrapper.element, jest.spyOn); - - wrapper.findComponent(GlTooltip).vm.$emit('shown'); - - expect(trackingSpy).toHaveBeenCalledWith(undefined, 'render_tooltip', { label: trackLabel }); - - unmockTracking(); - }); -}); diff --git a/ee/spec/helpers/projects/learn_gitlab_helper_spec.rb b/ee/spec/helpers/projects/learn_gitlab_helper_spec.rb index a97bd318e4db96535ca6347e52f76ceae6e90ccc..33299bde3227535f778f1d88b07fe9a9b3cf76e5 100644 --- a/ee/spec/helpers/projects/learn_gitlab_helper_spec.rb +++ b/ee/spec/helpers/projects/learn_gitlab_helper_spec.rb @@ -53,9 +53,9 @@ it 'has all project data', :aggregate_failures do expect(onboarding_project_data.keys) - .to contain_exactly(:name, :promote_ultimate_features) + .to contain_exactly(:name) - expect(onboarding_project_data.values).to match_array([project.name, nil]) + expect(onboarding_project_data.values).to match_array([project.name]) end end @@ -209,37 +209,5 @@ end end end - - context 'when promote_ultimate_features experiment is enabled' do - let(:onboarding_project_data) do - Gitlab::Json.parse(helper.learn_gitlab_data(project)[:project]).deep_symbolize_keys - end - - where(:experiment_behavior, :active_trial, :datetime, :promote_ultimate_features) do - [ - [:control, false, nil, nil], - [:control, false, 1.day.ago, nil], - [:candidate, false, nil, nil], - [:candidate, false, 1.day.ago, nil], - [:control, true, nil, nil], - [:control, true, 1.day.ago, nil], - [:candidate, true, nil, false], - [:candidate, true, 1.day.ago, true] - ] - end - - with_them do - it 'sets correct value for promote_ultimate_features in onboarding_project_data' do - stub_experiments(promote_ultimate_features: experiment_behavior) - allow(namespace).to receive(:trial_active?).and_return(active_trial) - - allow(namespace.onboarding_progress).to receive(:promote_ultimate_features_at) - .and_return(datetime) - - expect(onboarding_project_data.values) - .to match_array([project.name, promote_ultimate_features]) - end - end - end end end diff --git a/ee/spec/requests/registrations/groups_controller_spec.rb b/ee/spec/requests/registrations/groups_controller_spec.rb index a1c86a728bbe91810b6255cd95bf9d80875c66e0..51406f7d302dd985ecfda3cb8d94fb8ab19bf8ac 100644 --- a/ee/spec/requests/registrations/groups_controller_spec.rb +++ b/ee/spec/requests/registrations/groups_controller_spec.rb @@ -38,7 +38,7 @@ context 'when group and project can be created' do it 'creates a group' do # 204 before creating learn gitlab in worker - allow(Gitlab::QueryLimiting::Transaction).to receive(:threshold).and_return(160) + allow(Gitlab::QueryLimiting::Transaction).to receive(:threshold).and_return(156) expect { post users_sign_up_groups_path, params: params }.to change { Group.count }.by(1) end diff --git a/ee/spec/services/registrations/import_namespace_create_service_spec.rb b/ee/spec/services/registrations/import_namespace_create_service_spec.rb index a22b0011a8aa51c93b262361d201378a449f0b79..a34e3eed5f32140a0c79ac5f019e15928e174a97 100644 --- a/ee/spec/services/registrations/import_namespace_create_service_spec.rb +++ b/ee/spec/services/registrations/import_namespace_create_service_spec.rb @@ -34,13 +34,6 @@ end.to change { Group.count }.by(1).and change { ::Onboarding::Progress.count }.by(1) end - it 'updates promote_ultimate_features_at in the onboarding progress' do - expect(execute).to be_success - - expect(Group.find_by(path: group_params[:path]).onboarding_progress.promote_ultimate_features_at) - .to be_present - end - it 'passes create_event: true to the Groups::CreateService' do added_params = { create_event: true, setup_for_company: nil } diff --git a/ee/spec/services/registrations/standard_namespace_create_service_spec.rb b/ee/spec/services/registrations/standard_namespace_create_service_spec.rb index f95966446d9193376d9b70a49c175e75900dc096..5291d5f8101c887ae562435d42ef255c6c8ce3fc 100644 --- a/ee/spec/services/registrations/standard_namespace_create_service_spec.rb +++ b/ee/spec/services/registrations/standard_namespace_create_service_spec.rb @@ -45,13 +45,6 @@ .by(1).and change { Project.count }.by(1).and change { ::Onboarding::Progress.count }.by(1) end - it 'updates promote_ultimate_features_at in the onboarding progress' do - expect(execute).to be_success - - expect(Group.find_by(path: group_params[:path]).onboarding_progress.promote_ultimate_features_at) - .to be_present - end - it 'passes create_event: true to the Groups::CreateService' do added_params = { create_event: true, setup_for_company: nil } @@ -183,13 +176,6 @@ expect(execute.payload[:project].errors).not_to be_blank end - it 'updates promote_ultimate_features_at in the onboarding progress' do - expect(execute).to be_error - - expect(Group.find_by(path: group_params[:path]).onboarding_progress.promote_ultimate_features_at) - .to be_present - end - it 'selectively tracks events for group and project creation' do expect(execute).to be_error @@ -213,12 +199,6 @@ .and change { ::Onboarding::Progress.count }.by(0).and change { Project.count } end - it 'does not update onboarding progress' do - expect(execute).to be_success - - expect(group.onboarding_progress).to be_nil - end - it 'selectively tracks events group and project creation' do # stub out other tracking calls because it breaks our other tracking assertions allow_next_instance_of(::Projects::CreateService) do |service| diff --git a/ee/spec/support/helpers/saas_registration_helpers.rb b/ee/spec/support/helpers/saas_registration_helpers.rb index df19523abcb8ebb011ba2f147d498846e80a37b1..d3d9e37bf3b917ec6828db53ad7583cd83a9ee7a 100644 --- a/ee/spec/support/helpers/saas_registration_helpers.rb +++ b/ee/spec/support/helpers/saas_registration_helpers.rb @@ -372,7 +372,7 @@ def fills_in_group_and_project_creation_form # The groups_and_projects_controller (on `click_on 'Create project'`) is over # the query limit threshold, so we have to adjust it. # https://gitlab.com/gitlab-org/gitlab/-/issues/404805 - allow(Gitlab::QueryLimiting::Transaction).to receive(:threshold).and_return(176) + allow(Gitlab::QueryLimiting::Transaction).to receive(:threshold).and_return(170) fill_in 'group_name', with: 'Test Group' fill_in 'blank_project_name', with: 'Test Project' diff --git a/locale/gitlab.pot b/locale/gitlab.pot index 8bdd11c1a8c47bb8e22d196342cd83b0ebb9d477..0e7fe4091c31ad544264167c77b95c0dc9ae4331 100644 --- a/locale/gitlab.pot +++ b/locale/gitlab.pot @@ -29065,9 +29065,6 @@ msgstr "" msgid "LearnGitlab|- Included in trial" msgstr "" -msgid "LearnGitlab|After your 30-day trial, this feature is available on the %{planName} tier only." -msgstr "" - msgid "LearnGitlab|Contact your administrator to enable this action." msgstr ""