diff --git a/.rubocop_todo/capybara/visibility_matcher.yml b/.rubocop_todo/capybara/visibility_matcher.yml index 9a2a85a7cf8a0a4adc7d90bf356e1c667d59a546..e354dd7196b88390e595f3c6e138872a4ef4c1d8 100644 --- a/.rubocop_todo/capybara/visibility_matcher.yml +++ b/.rubocop_todo/capybara/visibility_matcher.yml @@ -34,7 +34,6 @@ Capybara/VisibilityMatcher: - 'spec/features/merge_request/user_views_diffs_commit_spec.rb' - 'spec/features/merge_request/user_views_diffs_spec.rb' - 'spec/features/projects/blobs/blob_show_spec.rb' - - 'spec/features/projects/blobs/user_follows_pipeline_suggest_nudge_spec.rb' - 'spec/features/projects/ci/lint_spec.rb' - 'spec/features/projects/commit/comments/user_adds_comment_spec.rb' - 'spec/features/projects/commits/multi_view_diff_spec.rb' diff --git a/.rubocop_todo/layout/line_length.yml b/.rubocop_todo/layout/line_length.yml index 898088c9021f48fc7233a59e1879c49d7383bced..92c772b8a8d743bb2403677902985086da5fd610 100644 --- a/.rubocop_todo/layout/line_length.yml +++ b/.rubocop_todo/layout/line_length.yml @@ -3117,7 +3117,6 @@ Layout/LineLength: - 'spec/features/projects/blobs/blob_show_spec.rb' - 'spec/features/projects/blobs/edit_spec.rb' - 'spec/features/projects/blobs/shortcuts_blob_spec.rb' - - 'spec/features/projects/blobs/user_follows_pipeline_suggest_nudge_spec.rb' - 'spec/features/projects/blobs/user_views_pipeline_editor_button_spec.rb' - 'spec/features/projects/ci/editor_spec.rb' - 'spec/features/projects/commit/cherry_pick_spec.rb' diff --git a/app/assets/javascripts/blob/filepath_form/components/filepath_form.vue b/app/assets/javascripts/blob/filepath_form/components/filepath_form.vue index 7a3e31a642bbe77b50e76a5d34b703cfc17c52db..9cd69e923ef4ad5e0ef98e61fde7b673db35abc3 100644 --- a/app/assets/javascripts/blob/filepath_form/components/filepath_form.vue +++ b/app/assets/javascripts/blob/filepath_form/components/filepath_form.vue @@ -21,11 +21,6 @@ export default { type: Object, required: true, }, - suggestCiYmlData: { - type: Object, - required: false, - default: undefined, - }, }, data() { return { @@ -56,7 +51,6 @@ export default { :filename="filename" :templates="templates" :initial-template="initialTemplate" - :suggest-ci-yml-data="suggestCiYmlData" @selected="onTemplateSelected" /> </div> diff --git a/app/assets/javascripts/blob/filepath_form/components/template_selector.vue b/app/assets/javascripts/blob/filepath_form/components/template_selector.vue index e9f54639fdd459a8f64429ec2f665d11b39b75af..e5a7d34264feb51ebbbb74e1ad0da1e61a25d2a6 100644 --- a/app/assets/javascripts/blob/filepath_form/components/template_selector.vue +++ b/app/assets/javascripts/blob/filepath_form/components/template_selector.vue @@ -1,6 +1,5 @@ <script> import { GlCollapsibleListbox } from '@gitlab/ui'; -import SuggestGitlabCiYml from '~/blob/suggest_gitlab_ci_yml/components/popover.vue'; import { __ } from '~/locale'; import { DEFAULT_CI_CONFIG_PATH, CI_CONFIG_PATH_EXTENSION } from '~/lib/utils/constants'; @@ -34,7 +33,6 @@ const templateSelectors = [ export default { name: 'TemplateSelector', components: { - SuggestGitlabCiYml, GlCollapsibleListbox, }, props: { @@ -51,11 +49,6 @@ export default { required: false, default: undefined, }, - suggestCiYmlData: { - type: Object, - required: false, - default: undefined, - }, }, data() { return { @@ -97,9 +90,6 @@ export default { showDropdown() { return this.activeType && this.templateItems.length > 0; }, - showPopover() { - return this.activeType?.key === 'gitlab_ci_ymls' && this.suggestCiYmlData; - }, }, beforeMount() { if (this.activeType) this.applyTemplate(this.initialTemplate); @@ -135,14 +125,6 @@ export default { </script> <template> <div v-if="showDropdown"> - <suggest-gitlab-ci-yml - v-if="showPopover" - target="template-selector" - :track-label="suggestCiYmlData.trackLabel" - :dismiss-key="suggestCiYmlData.dismissKey" - :merge-request-path="suggestCiYmlData.mergeRequestPath" - :human-access="suggestCiYmlData.humanAccess" - /> <gl-collapsible-listbox id="template-selector" searchable diff --git a/app/assets/javascripts/blob/filepath_form/index.js b/app/assets/javascripts/blob/filepath_form/index.js index bcb285ddf34b8a37a312974d49beb2aed5d8c5a9..f351cbe783e05d3b77d9fc6c9f5b4b226083e19d 100644 --- a/app/assets/javascripts/blob/filepath_form/index.js +++ b/app/assets/javascripts/blob/filepath_form/index.js @@ -1,13 +1,6 @@ import Vue from 'vue'; import FilepathForm from './components/filepath_form.vue'; -const getPopoverData = (el) => ({ - trackLabel: el.dataset.trackLabel, - dismissKey: el.dataset.dismissKey, - mergeRequestPath: el.dataset.mergeRequestPath, - humanAccess: el.dataset.humanAccess, -}); - const getInputOptions = (el) => { const { testid, qa_selector: qaSelector, ...options } = JSON.parse(el.dataset.inputOptions); return { @@ -19,15 +12,11 @@ const getInputOptions = (el) => { export default ({ onTemplateSelected }) => { const el = document.getElementById('js-template-selectors-menu'); - const suggestCiYmlEl = document.querySelector('.js-suggest-gitlab-ci-yml'); - const suggestCiYmlData = suggestCiYmlEl ? getPopoverData(suggestCiYmlEl) : undefined; - return new Vue({ el, render(h) { return h(FilepathForm, { props: { - suggestCiYmlData, inputOptions: getInputOptions(el), templates: JSON.parse(el.dataset.templates), initialTemplate: el.dataset.selected, diff --git a/app/assets/javascripts/blob/filepath_form_mediator.js b/app/assets/javascripts/blob/filepath_form_mediator.js index c26b8ea842b9bd660e87b54b548aebdba8b3e2c0..af9c9ee669f7cef030d16956814171f07fbd385b 100644 --- a/app/assets/javascripts/blob/filepath_form_mediator.js +++ b/app/assets/javascripts/blob/filepath_form_mediator.js @@ -1,7 +1,6 @@ import $ from 'jquery'; import Api from '~/api'; -import initPopover from '~/blob/suggest_gitlab_ci_yml'; import { createAlert } from '~/alert'; import { __, sprintf } from '~/locale'; import toast from '~/vue_shared/plugins/global_toast'; @@ -33,7 +32,6 @@ export default class FilepathFormMediator { selectTemplateFile(template, type, clearSelectedTemplate, stopLoading) { const self = this; - const suggestCommitChanges = document.querySelector('.js-suggest-gitlab-ci-yml-commit-changes'); this.fetchFileTemplate(type.type, template.key, template) .then((file) => { @@ -50,10 +48,6 @@ export default class FilepathFormMediator { }, }, }); - - if (suggestCommitChanges) { - initPopover(suggestCommitChanges); - } }) .catch((err) => createAlert({ diff --git a/app/assets/javascripts/blob/pipeline_tour_success_modal.vue b/app/assets/javascripts/blob/pipeline_tour_success_modal.vue deleted file mode 100644 index 0cc75d28e0b976e280fe02663e7d58c5dc97d181..0000000000000000000000000000000000000000 --- a/app/assets/javascripts/blob/pipeline_tour_success_modal.vue +++ /dev/null @@ -1,143 +0,0 @@ -<script> -import { GlModal, GlSprintf, GlLink, GlButton } from '@gitlab/ui'; -import { getCookie, removeCookie } from '~/lib/utils/common_utils'; -import { __, s__ } from '~/locale'; -import Tracking from '~/tracking'; - -const trackingMixin = Tracking.mixin(); - -export default { - beginnerLink: - 'https://about.gitlab.com/blog/2018/01/22/a-beginners-guide-to-continuous-integration/', - goToTrackValuePipelines: 10, - goToTrackValueMergeRequest: 20, - trackEvent: 'click_button', - components: { - GlModal, - GlSprintf, - GlButton, - GlLink, - }, - mixins: [trackingMixin], - props: { - goToPipelinesPath: { - type: String, - required: true, - }, - projectMergeRequestsPath: { - type: String, - required: false, - default: '', - }, - commitCookie: { - type: String, - required: true, - }, - humanAccess: { - type: String, - required: true, - }, - exampleLink: { - type: String, - required: true, - }, - codeQualityLink: { - type: String, - required: true, - }, - }, - data() { - return { - trackLabel: 'congratulate_first_pipeline', - }; - }, - computed: { - tracking() { - return { - label: this.trackLabel, - property: this.humanAccess, - }; - }, - goToMergeRequestPath() { - return this.commitCookiePath || this.projectMergeRequestsPath; - }, - commitCookiePath() { - const cookieVal = getCookie(this.commitCookie); - - if (cookieVal !== 'true') return cookieVal; - return ''; - }, - }, - i18n: { - modalTitle: __("That's it, well done!"), - pipelinesButton: s__('MR widget|See your pipeline in action'), - mergeRequestButton: s__('MR widget|Back to the merge request'), - bodyMessage: s__( - `MR widget|The pipeline will test your code on every commit. A %{codeQualityLinkStart}code quality report%{codeQualityLinkEnd} will appear in your merge requests to warn you about potential code degradations.`, - ), - helpMessage: s__( - `MR widget|Take a look at our %{beginnerLinkStart}Beginner's Guide to Continuous Integration%{beginnerLinkEnd} and our %{exampleLinkStart}examples of GitLab CI/CD%{exampleLinkEnd} to learn more.`, - ), - }, - mounted() { - this.track(); - this.disableModalFromRenderingAgain(); - }, - methods: { - disableModalFromRenderingAgain() { - removeCookie(this.commitCookie); - }, - }, -}; -</script> -<template> - <gl-modal visible size="sm" modal-id="success-pipeline-modal-id-not-used"> - <template #modal-title> - {{ $options.i18n.modalTitle }} - <gl-emoji class="gl-vertical-align-baseline gl-reset-font-size gl-mr-1" data-name="tada" /> - </template> - <p> - <gl-sprintf :message="$options.i18n.bodyMessage"> - <template #codeQualityLink="{ content }"> - <gl-link :href="codeQualityLink" target="_blank">{{ content }}</gl-link> - </template> - </gl-sprintf> - </p> - <gl-sprintf :message="$options.i18n.helpMessage"> - <template #beginnerLink="{ content }"> - <gl-link :href="$options.beginnerLink" target="_blank"> - {{ content }} - </gl-link> - </template> - <template #exampleLink="{ content }"> - <gl-link :href="exampleLink" target="_blank"> - {{ content }} - </gl-link> - </template> - </gl-sprintf> - <template #modal-footer> - <gl-button - v-if="projectMergeRequestsPath" - ref="goToMergeRequest" - :href="goToMergeRequestPath" - :data-track-property="humanAccess" - :data-track-value="$options.goToTrackValueMergeRequest" - :data-track-action="$options.trackEvent" - :data-track-label="trackLabel" - > - {{ $options.i18n.mergeRequestButton }} - </gl-button> - <gl-button - ref="goToPipelines" - :href="goToPipelinesPath" - variant="confirm" - :data-track-property="humanAccess" - :data-track-value="$options.goToTrackValuePipelines" - :data-track-action="$options.trackEvent" - :data-track-label="trackLabel" - > - {{ $options.i18n.pipelinesButton }} - </gl-button> - </template> - </gl-modal> -</template> diff --git a/app/assets/javascripts/blob/suggest_gitlab_ci_yml/components/popover.vue b/app/assets/javascripts/blob/suggest_gitlab_ci_yml/components/popover.vue deleted file mode 100644 index 8d37d272e502cd5a1f42e8d3cdab588062e9d93e..0000000000000000000000000000000000000000 --- a/app/assets/javascripts/blob/suggest_gitlab_ci_yml/components/popover.vue +++ /dev/null @@ -1,142 +0,0 @@ -<script> -import { GlPopover, GlSprintf, GlButton } from '@gitlab/ui'; -import { parseBoolean, scrollToElement, setCookie, getCookie } from '~/lib/utils/common_utils'; -import { s__ } from '~/locale'; -import Tracking from '~/tracking'; - -const trackingMixin = Tracking.mixin(); - -const popoverStates = { - suggest_gitlab_ci_yml: { - title: s__(`suggestPipeline|1/2: Choose a template`), - content: s__( - `suggestPipeline|We’re adding a GitLab CI configuration file to add a pipeline to the project. You could create it manually, but we recommend that you start with a GitLab template that works out of the box.`, - ), - footer: s__( - `suggestPipeline|Choose %{boldStart}Code Quality%{boldEnd} to add a pipeline that tests the quality of your code.`, - ), - }, - suggest_commit_first_project_gitlab_ci_yml: { - title: s__(`suggestPipeline|2/2: Commit your changes`), - content: s__( - `suggestPipeline|The template is ready! You can now commit it to create your first pipeline.`, - ), - }, -}; - -export default { - name: 'SuggestGitlabCiYml', - dismissTrackValue: 10, - clickTrackValue: 'click_button', - components: { - GlPopover, - GlSprintf, - GlButton, - }, - mixins: [trackingMixin], - props: { - target: { - type: String, - required: true, - }, - trackLabel: { - type: String, - required: true, - }, - dismissKey: { - type: String, - required: true, - }, - humanAccess: { - type: String, - required: true, - }, - mergeRequestPath: { - type: String, - required: true, - }, - }, - data() { - return { - popoverDismissed: parseBoolean(getCookie(`${this.trackLabel}_${this.dismissKey}`)), - tracking: { - label: this.trackLabel, - property: this.humanAccess, - }, - }; - }, - computed: { - suggestTitle() { - return popoverStates[this.trackLabel].title || ''; - }, - suggestContent() { - return popoverStates[this.trackLabel].content || ''; - }, - suggestFooter() { - return popoverStates[this.trackLabel].footer || ''; - }, - emoji() { - return popoverStates[this.trackLabel].emoji || ''; - }, - dismissCookieName() { - return `${this.trackLabel}_${this.dismissKey}`; - }, - }, - mounted() { - if ( - this.trackLabel === 'suggest_commit_first_project_gitlab_ci_yml' && - !this.popoverDismissed - ) { - scrollToElement(document.querySelector(this.target)); - } - - this.trackOnShow(); - }, - methods: { - onDismiss() { - this.popoverDismissed = true; - setCookie(this.dismissCookieName, this.popoverDismissed); - }, - trackOnShow() { - if (!this.popoverDismissed) this.track(); - }, - }, -}; -</script> - -<template> - <gl-popover - v-if="!popoverDismissed" - show - :target="target" - placement="right" - container="viewport" - :css-classes="['suggest-gitlab-ci-yml', 'ml-4']" - > - <template #title> - <span>{{ suggestTitle }}</span> - <span class="ml-auto"> - <gl-button - :aria-label="__('Close')" - class="btn-blank" - name="dismiss" - icon="close" - :data-track-property="humanAccess" - :data-track-value="$options.dismissTrackValue" - :data-track-action="$options.clickTrackValue" - :data-track-label="trackLabel" - @click="onDismiss" - /> - </span> - </template> - - <gl-sprintf :message="suggestContent" /> - <div class="mt-3"> - <gl-sprintf :message="suggestFooter"> - <template #bold="{ content }"> - <strong> {{ content }} </strong> - </template> - </gl-sprintf> - </div> - </gl-popover> -</template> diff --git a/app/assets/javascripts/blob/suggest_gitlab_ci_yml/index.js b/app/assets/javascripts/blob/suggest_gitlab_ci_yml/index.js deleted file mode 100644 index d0dd80932ccce949f3456a66cf2af9ac74cdac53..0000000000000000000000000000000000000000 --- a/app/assets/javascripts/blob/suggest_gitlab_ci_yml/index.js +++ /dev/null @@ -1,18 +0,0 @@ -import Vue from 'vue'; -import Popover from './components/popover.vue'; - -export default (el) => - new Vue({ - el, - render(createElement) { - return createElement(Popover, { - props: { - target: el.dataset.target, - trackLabel: el.dataset.trackLabel, - dismissKey: el.dataset.dismissKey, - mergeRequestPath: el.dataset.mergeRequestPath, - humanAccess: el.dataset.humanAccess, - }, - }); - }, - }); diff --git a/app/assets/javascripts/blob_edit/blob_bundle.js b/app/assets/javascripts/blob_edit/blob_bundle.js index be96c83aea2bd5741d70f1b99cd7c6534a7352d0..d84bcd5ae9732c73778cafc12d854f855cacf4eb 100644 --- a/app/assets/javascripts/blob_edit/blob_bundle.js +++ b/app/assets/javascripts/blob_edit/blob_bundle.js @@ -1,36 +1,7 @@ import $ from 'jquery'; import { createAlert } from '~/alert'; -import { setCookie } from '~/lib/utils/common_utils'; -import Tracking from '~/tracking'; import NewCommitForm from '../new_commit_form'; -const initPopovers = () => { - const suggestEl = document.querySelector('.js-suggest-gitlab-ci-yml'); - - if (suggestEl) { - const commitButton = document.querySelector('#commit-changes'); - if (commitButton) { - const { dismissKey, humanAccess } = suggestEl.dataset; - const urlParams = new URLSearchParams(window.location.search); - const mergeRequestPath = urlParams.get('mr_path') || true; - - const commitCookieName = `suggest_gitlab_ci_yml_commit_${dismissKey}`; - const commitTrackLabel = 'suggest_gitlab_ci_yml_commit_changes'; - const commitTrackValue = '20'; - - commitButton.addEventListener('click', () => { - setCookie(commitCookieName, mergeRequestPath); - - Tracking.event(undefined, 'click_button', { - label: commitTrackLabel, - property: humanAccess, - value: commitTrackValue, - }); - }); - } - } -}; - export default () => { const editBlobForm = $('.js-edit-blob-form'); @@ -59,7 +30,6 @@ export default () => { isMarkdown, previewMarkdownPath, }); - initPopovers(); }) .catch((e) => createAlert({ diff --git a/app/assets/javascripts/pages/projects/blob/show/index.js b/app/assets/javascripts/pages/projects/blob/show/index.js index 399ea1cc2577e42f42efe7f4b73e0093daf68e8d..c47a6f17969a1f997b808c8f564506c1fc1f67c5 100644 --- a/app/assets/javascripts/pages/projects/blob/show/index.js +++ b/app/assets/javascripts/pages/projects/blob/show/index.js @@ -5,7 +5,6 @@ import VueApollo from 'vue-apollo'; import VueRouter from 'vue-router'; import { provideWebIdeLink } from 'ee_else_ce/pages/projects/shared/web_ide_link/provide_web_ide_link'; import TableOfContents from '~/blob/components/table_contents.vue'; -import PipelineTourSuccessModal from '~/blob/pipeline_tour_success_modal.vue'; import { BlobViewer, initAuxiliaryViewer } from '~/blob/viewer/index'; import GpgBadges from '~/gpg_badges'; import createDefaultClient from '~/lib/graphql'; @@ -191,22 +190,6 @@ if (codeNavEl && !viewBlobEl) { ); } -const successPipelineEl = document.querySelector('.js-success-pipeline-modal'); - -if (successPipelineEl) { - // eslint-disable-next-line no-new - new Vue({ - el: successPipelineEl, - render(createElement) { - return createElement(PipelineTourSuccessModal, { - props: { - ...successPipelineEl.dataset, - }, - }); - }, - }); -} - const tableContentsEl = document.querySelector('.js-table-contents'); if (tableContentsEl) { diff --git a/app/helpers/blob_helper.rb b/app/helpers/blob_helper.rb index 62bc943e57c781a7d68e75779b5013a63416523f..a0fb5246ac0da56ef37dfb519c5b841a429213da 100644 --- a/app/helpers/blob_helper.rb +++ b/app/helpers/blob_helper.rb @@ -300,20 +300,6 @@ def edit_button_tag(blob, common_classes, text, edit_path, project, ref) end end - def show_suggest_pipeline_creation_celebration? - @project.ci_config_path_or_default == @blob.path && - @blob.auxiliary_viewer&.valid?(project: @project, sha: @commit.sha, user: current_user) && - cookies[suggest_pipeline_commit_cookie_name].present? - end - - def suggest_pipeline_commit_cookie_name - "suggest_gitlab_ci_yml_commit_#{@project.id}" - end - - def human_access - @project.team.human_max_access(current_user&.id).try(:downcase) - end - def vue_blob_app_data(project, blob, ref) { blob_path: blob.path, diff --git a/app/helpers/suggest_pipeline_helper.rb b/app/helpers/suggest_pipeline_helper.rb deleted file mode 100644 index f0a12f0e268c77490b2bca53addce3d5cb177bc7..0000000000000000000000000000000000000000 --- a/app/helpers/suggest_pipeline_helper.rb +++ /dev/null @@ -1,7 +0,0 @@ -# frozen_string_literal: true - -module SuggestPipelineHelper - def should_suggest_gitlab_ci_yml? - current_user && params[:suggest_gitlab_ci_yml] == 'true' - end -end diff --git a/app/views/projects/blob/_editor.html.haml b/app/views/projects/blob/_editor.html.haml index a08d17a3efafecbab8373d6c83e04c1c7a2e7ec0..0e13cafb86f94685e3b4c7dd24d897e99db074bc 100644 --- a/app/views/projects/blob/_editor.html.haml +++ b/app/views/projects/blob/_editor.html.haml @@ -17,13 +17,8 @@ = render 'filepath_form', input_options: input_options - if current_action?(:new, :create) - - input_options = { id: 'file_name', name: 'file_name', value: params[:file_name] || (should_suggest_gitlab_ci_yml? ? '.gitlab-ci.yml' : ''), required: true, placeholder: "Filename", testid: 'file-name-field', class: 'new-file-name js-file-path-name-input' } + - input_options = { id: 'file_name', name: 'file_name', value: params[:file_name] || '', required: true, placeholder: "Filename", testid: 'file-name-field', class: 'new-file-name js-file-path-name-input' } = render 'filepath_form', input_options: input_options - - if should_suggest_gitlab_ci_yml? - .js-suggest-gitlab-ci-yml{ data: { track_label: 'suggest_gitlab_ci_yml', - merge_request_path: params[:mr_path], - dismiss_key: @project.id, - human_access: human_access } } - if Feature.enabled?(:source_editor_toolbar, current_user) #editor-toolbar diff --git a/app/views/projects/blob/_pipeline_tour_success.html.haml b/app/views/projects/blob/_pipeline_tour_success.html.haml deleted file mode 100644 index be2654c9b86da0a253f74ab72664a1e2ac7549c2..0000000000000000000000000000000000000000 --- a/app/views/projects/blob/_pipeline_tour_success.html.haml +++ /dev/null @@ -1,6 +0,0 @@ -.js-success-pipeline-modal{ data: { 'commit-cookie': suggest_pipeline_commit_cookie_name, - 'go-to-pipelines-path': project_pipelines_path(@project), - 'project-merge-requests-path': project_merge_requests_path(@project), - 'example-link': help_page_path('ci/examples/index'), - 'code-quality-link': help_page_path('ci/testing/code_quality'), - 'human-access': @project.team.human_max_access(current_user&.id) } } diff --git a/app/views/projects/blob/new.html.haml b/app/views/projects/blob/new.html.haml index 81b2715b228e1959776c706226611c94efa49a8b..40c7589d69a99a54040c5a6942b885775d20f0b7 100644 --- a/app/views/projects/blob/new.html.haml +++ b/app/views/projects/blob/new.html.haml @@ -12,9 +12,3 @@ = hidden_field_tag 'content', '', id: 'file-content' = render 'projects/commit_button', ref: @ref, cancel_path: project_tree_path(@project, @id) - - if should_suggest_gitlab_ci_yml? - .js-suggest-gitlab-ci-yml-commit-changes{ data: { target: '#commit-changes', - merge_request_path: params[:mr_path], - track_label: 'suggest_commit_first_project_gitlab_ci_yml', - dismiss_key: @project.id, - human_access: human_access } } diff --git a/app/views/projects/blob/show.html.haml b/app/views/projects/blob/show.html.haml index e8b0f2a6c6fc9241bd7ba8e287279388978fe980..7318e2fbdbebaffc71b5d32e25ad48ea8c25c6ef 100644 --- a/app/views/projects/blob/show.html.haml +++ b/app/views/projects/blob/show.html.haml @@ -13,7 +13,6 @@ #tree-holder.tree-holder.gl-pt-4 = render 'blob', blob: @blob -= render partial: 'pipeline_tour_success' if show_suggest_pipeline_creation_celebration? = render 'shared/web_ide_path' -# https://gitlab.com/gitlab-org/gitlab/-/issues/408388#note_1578533983 diff --git a/app/views/projects/merge_requests/_widget.html.haml b/app/views/projects/merge_requests/_widget.html.haml index e2a1eb4bd9fb48aad789082be6e18f3b44821d2b..38f46108bd0d36a53648deda013b8af3aa8b046b 100644 --- a/app/views/projects/merge_requests/_widget.html.haml +++ b/app/views/projects/merge_requests/_widget.html.haml @@ -16,7 +16,6 @@ window.gl.mrWidgetData.license_compliance_docs_path = '#{help_page_path('user/compliance/license_scanning_of_cyclonedx_files')}'; window.gl.mrWidgetData.eligible_approvers_docs_path = '#{help_page_path('user/project/merge_requests/approvals/rules.md', anchor: 'eligible-approvers')}'; window.gl.mrWidgetData.approvals_help_path = '#{help_page_path("user/project/merge_requests/approvals/index.md")}'; - window.gl.mrWidgetData.pipelines_empty_svg_path = '#{image_path('illustrations/empty-state/empty-pipeline-md.svg')}'; window.gl.mrWidgetData.codequality_help_path = '#{help_page_path("user/project/merge_requests/code_quality", anchor: "code-quality-reports")}'; window.gl.mrWidgetData.false_positive_doc_url = '#{help_page_path('user/application_security/vulnerabilities/index')}'; window.gl.mrWidgetData.can_view_false_positive = '#{@merge_request.project.licensed_feature_available?(:sast_fp_reduction).to_s}'; diff --git a/config/events/20210915205040_default_generic.yml b/config/events/20210915205040_default_generic.yml deleted file mode 100644 index 191664fc75f3f10effe0cc9b39ade68e88951399..0000000000000000000000000000000000000000 --- a/config/events/20210915205040_default_generic.yml +++ /dev/null @@ -1,20 +0,0 @@ -description: "Show a congratulation on first pipeline" -category: default -action: generic -label_description: "`congratulate_first_pipeline`" -property_description: "`[admin | maintainer | developer | owner]`" -value_description: "" -extra_properties: -identifiers: -product_section: growth -product_stage: growth -product_group: group::expansion -milestone: "12.10" -introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/28378 -distributions: -- ce -- ee -tiers: -- free -- premium -- ultimate diff --git a/config/events/20211215022206_default_congratulate_first_pipeline_click_button.yml b/config/events/20211215022206_default_congratulate_first_pipeline_click_button.yml deleted file mode 100644 index 0072d7707e0583b158af5df5707a48a53b9d775d..0000000000000000000000000000000000000000 --- a/config/events/20211215022206_default_congratulate_first_pipeline_click_button.yml +++ /dev/null @@ -1,20 +0,0 @@ -description: "Go to pipeline on pipeline celebration" -category: default -action: click_button -label_description: "`congratulate_first_pipeline`" -property_description: "`[admin | maintainer | developer | owner]`" -value_description: "`10`" -extra_properties: -identifiers: -product_section: growth -product_stage: growth -product_group: group::expansion -milestone: "12.10" -introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/28378 -distributions: -- ce -- ee -tiers: -- free -- premium -- ultimate diff --git a/config/events/20211215022206_default_suggest_commit_first_project_gitlab_ci_yml__click_button.yml b/config/events/20211215022206_default_suggest_commit_first_project_gitlab_ci_yml__click_button.yml deleted file mode 100644 index 5bbf93e14afe5749cabb485d25dd14fc628de965..0000000000000000000000000000000000000000 --- a/config/events/20211215022206_default_suggest_commit_first_project_gitlab_ci_yml__click_button.yml +++ /dev/null @@ -1,20 +0,0 @@ -description: "Dismiss GitLab CI suggestion popover" -category: default -action: click_button -label_description: "[ `suggest_commit_first_project_gitlab_ci_yml` ]" -property_description: "`[admin | maintainer | developer | owner]`" -value_description: "`10`" -extra_properties: -identifiers: -product_section: growth -product_stage: growth -product_group: group::expansion -milestone: "12.10" -introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/26105 -distributions: -- ce -- ee -tiers: -- free -- premium -- ultimate diff --git a/locale/gitlab.pot b/locale/gitlab.pot index 82fcee6119877bea15224cb6152003dabe3edfec..d5ab5389916fa31a4a60fb8c8c2ccfa53dc31bbe 100644 --- a/locale/gitlab.pot +++ b/locale/gitlab.pot @@ -29701,18 +29701,6 @@ msgstr "" msgid "MLExperimentTracking|Delete experiment?" msgstr "" -msgid "MR widget|Back to the merge request" -msgstr "" - -msgid "MR widget|See your pipeline in action" -msgstr "" - -msgid "MR widget|Take a look at our %{beginnerLinkStart}Beginner's Guide to Continuous Integration%{beginnerLinkEnd} and our %{exampleLinkStart}examples of GitLab CI/CD%{exampleLinkEnd} to learn more." -msgstr "" - -msgid "MR widget|The pipeline will test your code on every commit. A %{codeQualityLinkStart}code quality report%{codeQualityLinkEnd} will appear in your merge requests to warn you about potential code degradations." -msgstr "" - msgid "MRApprovals|Approvals" msgstr "" @@ -49725,9 +49713,6 @@ msgstr "" msgid "That's OK, I don't want to renew" msgstr "" -msgid "That's it, well done!" -msgstr "" - msgid "The %{plan_name} is no longer available to purchase. For more information about how this will impact you, check our %{faq_link_start}frequently asked questions%{faq_link_end}." msgstr "" @@ -60268,21 +60253,6 @@ msgstr "" msgid "success" msgstr "" -msgid "suggestPipeline|1/2: Choose a template" -msgstr "" - -msgid "suggestPipeline|2/2: Commit your changes" -msgstr "" - -msgid "suggestPipeline|Choose %{boldStart}Code Quality%{boldEnd} to add a pipeline that tests the quality of your code." -msgstr "" - -msgid "suggestPipeline|The template is ready! You can now commit it to create your first pipeline." -msgstr "" - -msgid "suggestPipeline|We’re adding a GitLab CI configuration file to add a pipeline to the project. You could create it manually, but we recommend that you start with a GitLab template that works out of the box." -msgstr "" - msgid "supported SSH public key." msgstr "" diff --git a/spec/features/projects/blobs/user_follows_pipeline_suggest_nudge_spec.rb b/spec/features/projects/blobs/user_follows_pipeline_suggest_nudge_spec.rb deleted file mode 100644 index cc819ccb5b963cbdecbe50862f2201c3e6e69c2b..0000000000000000000000000000000000000000 --- a/spec/features/projects/blobs/user_follows_pipeline_suggest_nudge_spec.rb +++ /dev/null @@ -1,62 +0,0 @@ -# frozen_string_literal: true - -require 'spec_helper' - -RSpec.describe 'User follows pipeline suggest nudge spec when feature is enabled', :js, feature_category: :source_code_management do - include CookieHelper - - let(:project) { create(:project, :empty_repo) } - let(:user) { project.first_owner } - - describe 'viewing the new blob page' do - before do - sign_in(user) - end - - context 'when the page is loaded from the link using the suggest_gitlab_ci_yml param' do - before do - visit namespace_project_new_blob_path(namespace_id: project.namespace, project_id: project, id: 'master', suggest_gitlab_ci_yml: 'true') - end - - it 'pre-fills .gitlab-ci.yml for file name' do - file_name = page.find_by_id('file_name') - - expect(file_name.value).to have_content('.gitlab-ci.yml') - end - - it 'displays suggest_gitlab_ci_yml popover' do - popover_selector = '.suggest-gitlab-ci-yml' - - expect(page).to have_css(popover_selector, visible: true) - - page.within(popover_selector) do - expect(page).to have_content('1/2: Choose a template') - end - end - - it 'sets the commit cookie when the Commit button is clicked' do - click_button 'Commit changes' - - expect(get_cookie("suggest_gitlab_ci_yml_commit_#{project.id}")).to be_present - end - end - - context 'when the page is visited without the param' do - before do - visit namespace_project_new_blob_path(namespace_id: project.namespace, project_id: project, id: 'master') - end - - it 'does not pre-fill .gitlab-ci.yml for file name' do - file_name = page.find_by_id('file_name') - - expect(file_name.value).not_to have_content('.gitlab-ci.yml') - end - - it 'does not display suggest_gitlab_ci_yml popover' do - popover_selector = '.b-popover.suggest-gitlab-ci-yml' - - expect(page).not_to have_css(popover_selector, visible: true) - end - end - end -end diff --git a/spec/frontend/blob/filepath_form/components/mock_data.js b/spec/frontend/blob/filepath_form/components/mock_data.js index fc19d6f18870ff277bcc008e53b7cf38696db402..3704cfd1dfd23b1943000cb643b4784040e9272d 100644 --- a/spec/frontend/blob/filepath_form/components/mock_data.js +++ b/spec/frontend/blob/filepath_form/components/mock_data.js @@ -1,10 +1,3 @@ -export const SuggestCiYmlData = { - trackLabel: 'suggest_gitlab_ci_yml', - dismissKey: '10', - mergeRequestPath: 'mr_path', - humanAccess: 'owner', -}; - export const Templates = { licenses: { Other: [ diff --git a/spec/frontend/blob/filepath_form/components/template_selector_spec.js b/spec/frontend/blob/filepath_form/components/template_selector_spec.js index b1419320e1e973e806893e3ee533df9188590114..8c59000c265b524a4b508fba56d3ea99a5991bdb 100644 --- a/spec/frontend/blob/filepath_form/components/template_selector_spec.js +++ b/spec/frontend/blob/filepath_form/components/template_selector_spec.js @@ -2,14 +2,12 @@ import { GlCollapsibleListbox } from '@gitlab/ui'; import { shallowMount } from '@vue/test-utils'; import { nextTick } from 'vue'; import TemplateSelector from '~/blob/filepath_form/components/template_selector.vue'; -import SuggestGitlabCiYml from '~/blob/suggest_gitlab_ci_yml/components/popover.vue'; -import { Templates as TemplatesMock, SuggestCiYmlData as SuggestCiYmlDataMock } from './mock_data'; +import { Templates as TemplatesMock } from './mock_data'; describe('Template Selector component', () => { let wrapper; const findListbox = () => wrapper.findComponent(GlCollapsibleListbox); - const findSuggestCiYmlPopover = () => wrapper.findComponent(SuggestGitlabCiYml); const findDisplayedTemplates = () => findListbox() .props('items') @@ -39,10 +37,6 @@ describe('Template Selector component', () => { it('does not render listbox', () => { expect(findListbox().exists()).toBe(false); }); - - it('does not render suggest-ci-yml popover', () => { - expect(findSuggestCiYmlPopover().exists()).toBe(false); - }); }); describe.each` @@ -62,26 +56,6 @@ describe('Template Selector component', () => { expect(findListbox().props('searchPlaceholder')).toBe('Filter'); expect(findDisplayedTemplates()).toEqual(getTemplateKeysFromMock(key)); }); - - it('does not render suggest-ci-yml popover', () => { - expect(findSuggestCiYmlPopover().exists()).toBe(false); - }); - }); - - describe('when filename input is .gitlab-ci.yml with suggestCiYmlData prop', () => { - beforeEach(() => { - createComponent({ filename: '.gitlab-ci.yml', suggestCiYmlData: SuggestCiYmlDataMock }); - }); - - it('renders listbox with correct props', () => { - expect(findListbox().exists()).toBe(true); - expect(findListbox().props('toggleText')).toBe('Apply a template'); - expect(findListbox().props('searchPlaceholder')).toBe('Filter'); - }); - - it('renders suggest-ci-yml popover', () => { - expect(findSuggestCiYmlPopover().exists()).toBe(true); - }); }); describe('has filename that matches template pattern', () => { diff --git a/spec/frontend/blob/pipeline_tour_success_mock_data.js b/spec/frontend/blob/pipeline_tour_success_mock_data.js deleted file mode 100644 index dbcba469df5a443a6121590f76d4dfda2107bdff..0000000000000000000000000000000000000000 --- a/spec/frontend/blob/pipeline_tour_success_mock_data.js +++ /dev/null @@ -1,10 +0,0 @@ -const modalProps = { - goToPipelinesPath: 'some_pipeline_path', - projectMergeRequestsPath: 'some_mr_path', - commitCookie: 'some_cookie', - humanAccess: 'maintainer', - exampleLink: '/example', - codeQualityLink: '/code-quality-link', -}; - -export default modalProps; diff --git a/spec/frontend/blob/pipeline_tour_success_modal_spec.js b/spec/frontend/blob/pipeline_tour_success_modal_spec.js deleted file mode 100644 index 84efa6041e412ef18c789f01513be391edaa5b97..0000000000000000000000000000000000000000 --- a/spec/frontend/blob/pipeline_tour_success_modal_spec.js +++ /dev/null @@ -1,127 +0,0 @@ -import { GlSprintf, GlModal, GlLink } from '@gitlab/ui'; -import { shallowMount } from '@vue/test-utils'; -import Cookies from '~/lib/utils/cookies'; -import { stubComponent } from 'helpers/stub_component'; -import { mockTracking, triggerEvent, unmockTracking } from 'helpers/tracking_helper'; -import pipelineTourSuccess from '~/blob/pipeline_tour_success_modal.vue'; -import modalProps from './pipeline_tour_success_mock_data'; - -describe('PipelineTourSuccessModal', () => { - let wrapper; - let cookieSpy; - let trackingSpy; - - const GlEmoji = { template: '<img/>' }; - const createComponent = () => { - wrapper = shallowMount(pipelineTourSuccess, { - propsData: modalProps, - stubs: { - GlModal: stubComponent(GlModal, { - template: ` - <div> - <slot name="modal-title"></slot> - <slot></slot> - <slot name="modal-footer"></slot> - </div>`, - }), - GlSprintf, - GlEmoji, - }, - }); - }; - - beforeEach(() => { - document.body.dataset.page = 'projects:blob:show'; - trackingSpy = mockTracking('_category_', undefined, jest.spyOn); - cookieSpy = jest.spyOn(Cookies, 'remove'); - createComponent(); - }); - - afterEach(() => { - unmockTracking(); - Cookies.remove(modalProps.commitCookie); - }); - - describe('when the commitCookie contains the mr path', () => { - const expectedMrPath = 'expected_mr_path'; - - beforeEach(() => { - Cookies.set(modalProps.commitCookie, expectedMrPath); - createComponent(); - }); - - it('renders the path from the commit cookie for back to the merge request button', () => { - const goToMrBtn = wrapper.findComponent({ ref: 'goToMergeRequest' }); - - expect(goToMrBtn.attributes('href')).toBe(expectedMrPath); - }); - }); - - describe('when the commitCookie does not contain mr path', () => { - const expectedMrPath = modalProps.projectMergeRequestsPath; - - beforeEach(() => { - Cookies.set(modalProps.commitCookie, true); - createComponent(); - }); - - it('renders the path from projectMergeRequestsPath for back to the merge request button', () => { - const goToMrBtn = wrapper.findComponent({ ref: 'goToMergeRequest' }); - - expect(goToMrBtn.attributes('href')).toBe(expectedMrPath); - }); - }); - - it('has expected structure', () => { - const modal = wrapper.findComponent(GlModal); - const sprintf = modal.findComponent(GlSprintf); - const emoji = modal.findComponent(GlEmoji); - - expect(wrapper.text()).toContain("That's it, well done!"); - expect(sprintf.exists()).toBe(true); - expect(emoji.exists()).toBe(true); - }); - - it('renders the link for codeQualityLink', () => { - expect(wrapper.findComponent(GlLink).attributes('href')).toBe('/code-quality-link'); - }); - - it('calls to remove cookie', () => { - wrapper.vm.disableModalFromRenderingAgain(); - - expect(cookieSpy).toHaveBeenCalledWith(modalProps.commitCookie); - }); - - describe('tracking', () => { - it('send event for basic view of modal', () => { - expect(trackingSpy).toHaveBeenCalledWith(undefined, undefined, { - label: 'congratulate_first_pipeline', - property: modalProps.humanAccess, - }); - }); - - it('send an event when go to pipelines is clicked', () => { - trackingSpy = mockTracking('_category_', wrapper.element, jest.spyOn); - const goToBtn = wrapper.findComponent({ ref: 'goToPipelines' }); - triggerEvent(goToBtn.element); - - expect(trackingSpy).toHaveBeenCalledWith('_category_', 'click_button', { - label: 'congratulate_first_pipeline', - property: modalProps.humanAccess, - value: '10', - }); - }); - - it('sends an event when back to the merge request is clicked', () => { - trackingSpy = mockTracking('_category_', wrapper.element, jest.spyOn); - const goToBtn = wrapper.findComponent({ ref: 'goToMergeRequest' }); - triggerEvent(goToBtn.element); - - expect(trackingSpy).toHaveBeenCalledWith('_category_', 'click_button', { - label: 'congratulate_first_pipeline', - property: modalProps.humanAccess, - value: '20', - }); - }); - }); -}); diff --git a/spec/frontend/blob/suggest_gitlab_ci_yml/components/popover_spec.js b/spec/frontend/blob/suggest_gitlab_ci_yml/components/popover_spec.js deleted file mode 100644 index b30b0287a347574653f1817f53961ebf72c51561..0000000000000000000000000000000000000000 --- a/spec/frontend/blob/suggest_gitlab_ci_yml/components/popover_spec.js +++ /dev/null @@ -1,118 +0,0 @@ -import { GlButton } from '@gitlab/ui'; -import { shallowMount } from '@vue/test-utils'; -import { mockTracking, unmockTracking, triggerEvent } from 'helpers/tracking_helper'; -import Popover from '~/blob/suggest_gitlab_ci_yml/components/popover.vue'; -import * as utils from '~/lib/utils/common_utils'; - -jest.mock('~/lib/utils/common_utils', () => ({ - ...jest.requireActual('~/lib/utils/common_utils'), - scrollToElement: jest.fn(), -})); - -const target = 'gitlab-ci-yml-selector'; -const dismissKey = '99'; -const defaultTrackLabel = 'suggest_gitlab_ci_yml'; -const commitTrackLabel = 'suggest_commit_first_project_gitlab_ci_yml'; - -const dismissCookie = 'suggest_gitlab_ci_yml_99'; -const humanAccess = 'owner'; -const mergeRequestPath = '/some/path'; - -describe('Suggest gitlab-ci.yml Popover', () => { - let wrapper; - - function createWrapper(trackLabel) { - wrapper = shallowMount(Popover, { - propsData: { - target, - trackLabel, - dismissKey, - mergeRequestPath, - humanAccess, - }, - stubs: { - 'gl-popover': { template: '<div><slot name="title"></slot><slot></slot></div>' }, - }, - }); - } - - describe('when no dismiss cookie is set', () => { - beforeEach(() => { - createWrapper(defaultTrackLabel); - }); - - it('sets popoverDismissed to false', () => { - expect(wrapper.vm.popoverDismissed).toEqual(false); - }); - }); - - describe('when the dismiss cookie is set', () => { - beforeEach(() => { - utils.setCookie(dismissCookie, true); - - createWrapper(defaultTrackLabel); - }); - - it('sets popoverDismissed to true', () => { - expect(wrapper.vm.popoverDismissed).toEqual(true); - }); - - afterEach(() => { - utils.removeCookie(dismissCookie); - }); - }); - - describe('tracking', () => { - let trackingSpy; - - beforeEach(() => { - document.body.dataset.page = 'projects:blob:new'; - trackingSpy = mockTracking('_category_', undefined, jest.spyOn); - - createWrapper(commitTrackLabel); - }); - - afterEach(() => { - unmockTracking(); - }); - - it('sends a tracking event with the expected properties for the popover being viewed', () => { - const expectedCategory = undefined; - const expectedAction = undefined; - const expectedLabel = 'suggest_commit_first_project_gitlab_ci_yml'; - const expectedProperty = 'owner'; - - expect(trackingSpy).toHaveBeenCalledWith(expectedCategory, expectedAction, { - label: expectedLabel, - property: expectedProperty, - }); - }); - - it('sends a tracking event when the popover is dismissed', () => { - const expectedLabel = commitTrackLabel; - const expectedAction = 'click_button'; - const expectedProperty = 'owner'; - const expectedValue = '10'; - const dismissButton = wrapper.findComponent(GlButton); - trackingSpy = mockTracking('_category_', wrapper.element, jest.spyOn); - - triggerEvent(dismissButton.element); - - expect(trackingSpy).toHaveBeenCalledWith('_category_', expectedAction, { - label: expectedLabel, - property: expectedProperty, - value: expectedValue, - }); - }); - }); - - describe('when the popover is mounted with the trackLabel of the Confirm button popover at the bottom of the page', () => { - it('calls scrollToElement so that the Confirm button and popover will be in sight', () => { - const scrollToElementSpy = jest.spyOn(utils, 'scrollToElement'); - - createWrapper(commitTrackLabel); - - expect(scrollToElementSpy).toHaveBeenCalled(); - }); - }); -}); diff --git a/spec/frontend/blob_edit/blob_bundle_spec.js b/spec/frontend/blob_edit/blob_bundle_spec.js index f72380f211dd9f32f3ede5698562dfc3370f3009..6ae3d3e41cb26ae72176b11778bbbf5da9529471 100644 --- a/spec/frontend/blob_edit/blob_bundle_spec.js +++ b/spec/frontend/blob_edit/blob_bundle_spec.js @@ -1,6 +1,5 @@ import $ from 'jquery'; import { setHTMLFixture, resetHTMLFixture } from 'helpers/fixtures'; -import { mockTracking, unmockTracking } from 'helpers/tracking_helper'; import waitForPromises from 'helpers/wait_for_promises'; import blobBundle from '~/blob_edit/blob_bundle'; @@ -64,46 +63,6 @@ describe('BlobBundle', () => { }); }); - describe('Suggest Popover', () => { - let trackingSpy; - - beforeEach(() => { - setHTMLFixture(` - <div class="js-edit-blob-form" data-blob-filename="blah" id="target"> - <div class="js-suggest-gitlab-ci-yml" - data-target="#target" - data-track-label="suggest_gitlab_ci_yml" - data-dismiss-key="1" - data-human-access="owner" - data-merge-request-path="path/to/mr"> - <button id='commit-changes' class="js-commit-button"></button> - <button id='cancel-changes'></button> - </div> - </div>`); - - trackingSpy = mockTracking('_category_', $('#commit-changes').element, jest.spyOn); - document.body.dataset.page = 'projects:blob:new'; - - blobBundle(); - }); - - afterEach(() => { - unmockTracking(); - resetHTMLFixture(); - }); - - it('sends a tracking event when the commit button is clicked', () => { - $('#commit-changes').click(); - - expect(trackingSpy).toHaveBeenCalledTimes(1); - expect(trackingSpy).toHaveBeenCalledWith(undefined, 'click_button', { - label: 'suggest_gitlab_ci_yml_commit_changes', - property: 'owner', - value: '20', - }); - }); - }); - describe('Error handling', () => { let message; beforeEach(() => { diff --git a/spec/helpers/blob_helper_spec.rb b/spec/helpers/blob_helper_spec.rb index d09e01c959c93b1208cab3c8aad016f89044d754..c787c163e7235c2bcb4f464d045b2cd3f448f214 100644 --- a/spec/helpers/blob_helper_spec.rb +++ b/spec/helpers/blob_helper_spec.rb @@ -207,83 +207,6 @@ end end end - - describe '#show_suggest_pipeline_creation_celebration?' do - let(:current_user) { create(:user) } - - before do - assign(:project, project) - assign(:blob, blob) - assign(:commit, double('Commit', sha: 'whatever')) - helper.request.cookies["suggest_gitlab_ci_yml_commit_#{project.id}"] = 'true' - allow(helper).to receive(:current_user).and_return(current_user) - end - - context 'when file is a pipeline config file' do - let(:data) { File.read(Rails.root.join('spec/support/gitlab_stubs/gitlab_ci.yml')) } - let(:blob) { fake_blob(path: project.ci_config_path_or_default, data: data) } - - it 'is true' do - expect(helper.show_suggest_pipeline_creation_celebration?).to be_truthy - end - - context 'file is invalid format' do - let(:data) { 'foo' } - - it 'is false' do - expect(helper.show_suggest_pipeline_creation_celebration?).to be_falsey - end - end - - context 'does not use the default ci config' do - before do - project.ci_config_path = 'something_bad' - end - - it 'is false' do - expect(helper.show_suggest_pipeline_creation_celebration?).to be_falsey - end - end - - context 'does not have the needed cookie' do - before do - helper.request.cookies.delete "suggest_gitlab_ci_yml_commit_#{project.id}" - end - - it 'is false' do - expect(helper.show_suggest_pipeline_creation_celebration?).to be_falsey - end - end - - context 'blob does not have auxiliary view' do - before do - allow(blob).to receive(:auxiliary_viewer).and_return(nil) - end - - it 'is false' do - expect(helper.show_suggest_pipeline_creation_celebration?).to be_falsey - end - end - end - - context 'when file is not a pipeline config file' do - let(:blob) { fake_blob(path: 'LICENSE') } - - it 'is false' do - expect(helper.show_suggest_pipeline_creation_celebration?).to be_falsey - end - end - end - end - - describe 'suggest_pipeline_commit_cookie_name' do - let(:project) { create(:project) } - - it 'uses project id to make up the cookie name' do - assign(:project, project) - - expect(helper.suggest_pipeline_commit_cookie_name).to eq "suggest_gitlab_ci_yml_commit_#{project.id}" - end end describe '#ide_edit_path' do diff --git a/spec/support/rspec_order_todo.yml b/spec/support/rspec_order_todo.yml index b97c3755e6f221d5e328e51d8ffade2ed5af0f4a..2b1f7f0bf5d8afe50b05f0d5fc01c1cda1969809 100644 --- a/spec/support/rspec_order_todo.yml +++ b/spec/support/rspec_order_todo.yml @@ -3733,7 +3733,6 @@ - './spec/features/projects/blobs/blob_show_spec.rb' - './spec/features/projects/blobs/edit_spec.rb' - './spec/features/projects/blobs/shortcuts_blob_spec.rb' -- './spec/features/projects/blobs/user_follows_pipeline_suggest_nudge_spec.rb' - './spec/features/projects/blobs/user_views_pipeline_editor_button_spec.rb' - './spec/features/projects/branches/download_buttons_spec.rb' - './spec/features/projects/branches/new_branch_ref_dropdown_spec.rb'