diff --git a/app/assets/javascripts/pipelines/components/pipelines_list/empty_state.vue b/app/assets/javascripts/pipelines/components/pipelines_list/empty_state.vue index cd6f7427fd6b3689fa02bae9bfcc612958181bfa..bc433db3eb87471983f1418ff1836ea3af128b3b 100644 --- a/app/assets/javascripts/pipelines/components/pipelines_list/empty_state.vue +++ b/app/assets/javascripts/pipelines/components/pipelines_list/empty_state.vue @@ -2,20 +2,12 @@ import { GlEmptyState, GlButton } from '@gitlab/ui'; import { startCodeQualityWalkthrough, track } from '~/code_quality_walkthrough/utils'; import GitlabExperiment from '~/experimentation/components/gitlab_experiment.vue'; -import ExperimentTracking from '~/experimentation/experiment_tracking'; import { getExperimentData } from '~/experimentation/utils'; -import { helpPagePath } from '~/helpers/help_page_helper'; import { s__ } from '~/locale'; import PipelinesCiTemplates from './pipelines_ci_templates.vue'; export default { i18n: { - title: s__('Pipelines|Build with confidence'), - description: s__(`Pipelines|GitLab CI/CD can automatically build, - test, and deploy your code. Let GitLab take care of time - consuming tasks, so you can spend more time creating.`), - aboutRunnersBtnText: s__('Pipelines|Learn about Runners'), - installRunnersBtnText: s__('Pipelines|Install GitLab Runners'), codeQualityTitle: s__('Pipelines|Improve code quality with GitLab CI/CD'), codeQualityDescription: s__(`Pipelines|To keep your codebase simple, readable, and accessible to contributors, use GitLab CI/CD @@ -56,15 +48,9 @@ export default { }, }, computed: { - ciHelpPagePath() { - return helpPagePath('ci/quick_start/index.md'); - }, isCodeQualityExperimentActive() { return this.canSetCi && Boolean(getExperimentData('code_quality_walkthrough')); }, - isCiRunnerTemplatesExperimentActive() { - return this.canSetCi && Boolean(getExperimentData('ci_runner_templates')); - }, }, mounted() { startCodeQualityWalkthrough(); @@ -73,10 +59,6 @@ export default { trackClick() { track('cta_clicked'); }, - trackCiRunnerTemplatesClick(action) { - const tracking = new ExperimentTracking('ci_runner_templates'); - tracking.event(action); - }, }, }; </script> @@ -98,33 +80,6 @@ export default { </gl-empty-state> </template> </gitlab-experiment> - <gitlab-experiment v-else-if="isCiRunnerTemplatesExperimentActive" name="ci_runner_templates"> - <template #control><pipelines-ci-templates /></template> - <template #candidate> - <gl-empty-state - :title="$options.i18n.title" - :svg-path="emptyStateSvgPath" - :description="$options.i18n.description" - > - <template #actions> - <gl-button - :href="ciRunnerSettingsPath" - variant="confirm" - @click="trackCiRunnerTemplatesClick('install_runners_button_clicked')" - > - {{ $options.i18n.installRunnersBtnText }} - </gl-button> - <gl-button - :href="ciHelpPagePath" - variant="default" - @click="trackCiRunnerTemplatesClick('learn_button_clicked')" - > - {{ $options.i18n.aboutRunnersBtnText }} - </gl-button> - </template> - </gl-empty-state> - </template> - </gitlab-experiment> <pipelines-ci-templates v-else-if="canSetCi" :ci-runner-settings-path="ciRunnerSettingsPath" diff --git a/app/assets/javascripts/vue_shared/components/runner_aws_deployments/constants.js b/app/assets/javascripts/vue_shared/components/runner_aws_deployments/constants.js index 46361c6eb32f0c588d9aea46414854989cc9173a..e10ad8bafaa9b1099a558c413051de4690fb68b0 100644 --- a/app/assets/javascripts/vue_shared/components/runner_aws_deployments/constants.js +++ b/app/assets/javascripts/vue_shared/components/runner_aws_deployments/constants.js @@ -1,7 +1,5 @@ import { s__, sprintf } from '~/locale'; -export const EXPERIMENT_NAME = 'ci_runner_templates'; - export const README_URL = 'https://gitlab.com/guided-explorations/aws/gitlab-runner-autoscaling-aws-asg/-/blob/main/easybuttons.md'; diff --git a/app/assets/javascripts/vue_shared/components/runner_aws_deployments/runner_aws_deployments_modal.vue b/app/assets/javascripts/vue_shared/components/runner_aws_deployments/runner_aws_deployments_modal.vue index 57cc25caa25d5c5e6245b05721315f7d39d1fc44..811176821e2476579ff2b25b69840812889d892c 100644 --- a/app/assets/javascripts/vue_shared/components/runner_aws_deployments/runner_aws_deployments_modal.vue +++ b/app/assets/javascripts/vue_shared/components/runner_aws_deployments/runner_aws_deployments_modal.vue @@ -1,16 +1,10 @@ <script> import { GlModal, GlSprintf, GlLink } from '@gitlab/ui'; import awsCloudFormationImageUrl from 'images/aws-cloud-formation.png'; -import ExperimentTracking from '~/experimentation/experiment_tracking'; +import Tracking from '~/tracking'; import { getBaseURL, objectToQuery } from '~/lib/utils/url_utility'; import { __, s__ } from '~/locale'; -import { - EXPERIMENT_NAME, - README_URL, - CF_BASE_URL, - TEMPLATES_BASE_URL, - EASY_BUTTONS, -} from './constants'; +import { README_URL, CF_BASE_URL, TEMPLATES_BASE_URL, EASY_BUTTONS } from './constants'; export default { components: { @@ -18,6 +12,7 @@ export default { GlSprintf, GlLink, }, + mixins: [Tracking.mixin()], props: { modalId: { type: String, @@ -39,8 +34,9 @@ export default { return CF_BASE_URL + objectToQuery(params); }, trackCiRunnerTemplatesClick(stackName) { - const tracking = new ExperimentTracking(EXPERIMENT_NAME); - tracking.event(`template_clicked_${stackName}`); + this.track('template_clicked', { + label: stackName, + }); }, }, i18n: { diff --git a/app/controllers/projects/pipelines_controller.rb b/app/controllers/projects/pipelines_controller.rb index b6090fa2548352aa72fa30cbab6f6b1706f83275..310b8d1d477ef4e2bb0d1289839b3205f1f7d238 100644 --- a/app/controllers/projects/pipelines_controller.rb +++ b/app/controllers/projects/pipelines_controller.rb @@ -52,7 +52,6 @@ def index respond_to do |format| format.html do enable_code_quality_walkthrough_experiment - enable_ci_runner_templates_experiment enable_runners_availability_section_experiment end format.json do @@ -320,19 +319,6 @@ def enable_code_quality_walkthrough_experiment end end - def enable_ci_runner_templates_experiment - experiment(:ci_runner_templates, namespace: project.root_ancestor) do |e| - e.exclude! unless current_user - e.exclude! unless can?(current_user, :create_pipeline, project) - e.exclude! if @pipelines_count.to_i > 0 - e.exclude! if helpers.has_gitlab_ci?(project) - - e.control {} - e.candidate {} - e.publish_to_database - end - end - def enable_runners_availability_section_experiment return unless current_user return unless can?(current_user, :create_pipeline, project) diff --git a/config/feature_flags/experiment/ci_runner_templates.yml b/config/feature_flags/experiment/ci_runner_templates.yml deleted file mode 100644 index e791581f67a6975d827039322b626d8dd229de42..0000000000000000000000000000000000000000 --- a/config/feature_flags/experiment/ci_runner_templates.yml +++ /dev/null @@ -1,8 +0,0 @@ ---- -name: ci_runner_templates -introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/58357 -rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/326725 -milestone: "14.0" -type: experiment -group: group::activation -default_enabled: false diff --git a/locale/gitlab.pot b/locale/gitlab.pot index 63bea8bad49792642e6ed7aa5dd803d756d98838..581e1f8bd0b8d6c741d1446e4921f399765f0a92 100644 --- a/locale/gitlab.pot +++ b/locale/gitlab.pot @@ -27011,18 +27011,12 @@ msgstr "" msgid "Pipelines|Install GitLab Runner" msgstr "" -msgid "Pipelines|Install GitLab Runners" -msgstr "" - msgid "Pipelines|It is recommended the code is reviewed thoroughly before running this pipeline with the parent project's CI resource." msgstr "" msgid "Pipelines|Last Used" msgstr "" -msgid "Pipelines|Learn about Runners" -msgstr "" - msgid "Pipelines|Learn the basics of pipelines and .yml files" msgstr "" diff --git a/spec/controllers/projects/pipelines_controller_spec.rb b/spec/controllers/projects/pipelines_controller_spec.rb index 15783fd990dedc842f9ef6d053e99b0a6201f072..283d7b496745f8051662d9a7ed9fde49778e3345 100644 --- a/spec/controllers/projects/pipelines_controller_spec.rb +++ b/spec/controllers/projects/pipelines_controller_spec.rb @@ -296,10 +296,6 @@ def action it_behaves_like 'tracks assignment and records the subject', :code_quality_walkthrough, :namespace end - context 'ci_runner_templates experiment' do - it_behaves_like 'tracks assignment and records the subject', :ci_runner_templates, :namespace - end - context 'runners_availability_section experiment' do it_behaves_like 'tracks assignment and records the subject', :runners_availability_section, :namespace end diff --git a/spec/frontend/pipelines/pipelines_spec.js b/spec/frontend/pipelines/pipelines_spec.js index c024730570c9cba61cc1de54bb0a92e8d242f780..1c84e20c9e18795b93396e9257c506867075cd4e 100644 --- a/spec/frontend/pipelines/pipelines_spec.js +++ b/spec/frontend/pipelines/pipelines_spec.js @@ -586,44 +586,6 @@ describe('Pipelines', () => { }); }); - describe('when the ci_runner_templates experiment is active', () => { - beforeAll(() => { - getExperimentData.mockImplementation((name) => name === 'ci_runner_templates'); - }); - - describe('the control state', () => { - beforeAll(() => { - getExperimentVariant.mockReturnValue('control'); - }); - - it('renders the CI/CD templates', () => { - expect(wrapper.findComponent(PipelinesCiTemplates).exists()).toBe(true); - }); - }); - - describe('the candidate state', () => { - beforeAll(() => { - getExperimentVariant.mockReturnValue('candidate'); - }); - - it('renders two buttons', () => { - expect(findEmptyState().findAllComponents(GlButton).length).toBe(2); - expect(findEmptyState().findAllComponents(GlButton).at(0).text()).toBe( - 'Install GitLab Runners', - ); - expect(findEmptyState().findAllComponents(GlButton).at(0).attributes('href')).toBe( - paths.ciRunnerSettingsPath, - ); - expect(findEmptyState().findAllComponents(GlButton).at(1).text()).toBe( - 'Learn about Runners', - ); - expect(findEmptyState().findAllComponents(GlButton).at(1).attributes('href')).toBe( - '/help/ci/quick_start/index.md', - ); - }); - }); - }); - it('does not render filtered search', () => { expect(findFilteredSearch().exists()).toBe(false); }); diff --git a/spec/frontend/vue_shared/components/runner_aws_deployments/runner_aws_deployments_modal_spec.js b/spec/frontend/vue_shared/components/runner_aws_deployments/runner_aws_deployments_modal_spec.js index ad692a38e655cc15786f052a00bd668d133432fa..940ab05814cd7f2c97db40deee4eaff76ca094e1 100644 --- a/spec/frontend/vue_shared/components/runner_aws_deployments/runner_aws_deployments_modal_spec.js +++ b/spec/frontend/vue_shared/components/runner_aws_deployments/runner_aws_deployments_modal_spec.js @@ -1,19 +1,17 @@ import { GlLink } from '@gitlab/ui'; import { shallowMount } from '@vue/test-utils'; -import ExperimentTracking from '~/experimentation/experiment_tracking'; import { getBaseURL } from '~/lib/utils/url_utility'; +import { mockTracking } from 'helpers/tracking_helper'; import { - EXPERIMENT_NAME, CF_BASE_URL, TEMPLATES_BASE_URL, EASY_BUTTONS, } from '~/vue_shared/components/runner_aws_deployments/constants'; import RunnerAwsDeploymentsModal from '~/vue_shared/components/runner_aws_deployments/runner_aws_deployments_modal.vue'; -jest.mock('~/experimentation/experiment_tracking'); - describe('RunnerAwsDeploymentsModal', () => { let wrapper; + let trackingSpy; const findEasyButtons = () => wrapper.findAllComponents(GlLink); @@ -65,12 +63,14 @@ describe('RunnerAwsDeploymentsModal', () => { }); it('should track an event when clicked', () => { + trackingSpy = mockTracking(undefined, wrapper.element, jest.spyOn); + findFirstButton().vm.$emit('click'); - expect(ExperimentTracking).toHaveBeenCalledWith(EXPERIMENT_NAME); - expect(ExperimentTracking.prototype.event).toHaveBeenCalledWith( - `template_clicked_${EASY_BUTTONS[0].stackName}`, - ); + expect(trackingSpy).toHaveBeenCalledTimes(1); + expect(trackingSpy).toHaveBeenCalledWith(undefined, 'template_clicked', { + label: EASY_BUTTONS[0].stackName, + }); }); }); });