From 1bcebb67d554d95aa77d4cf42b22e7c96e1c8527 Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Wed, 9 Mar 2022 21:07:04 +0000 Subject: Add latest changes from gitlab-org/gitlab@master --- .gitlab/issue_templates/Feature Flag Roll Out.md | 3 +- GITALY_SERVER_VERSION | 2 +- .../components/alert_management_table.vue | 7 +- app/assets/javascripts/blob_edit/blob_bundle.js | 9 -- .../javascripts/captcha/apollo_captcha_link.js | 2 +- .../captcha/captcha_modal_axios_interceptor.js | 4 +- .../code_quality_walkthrough/components/step.vue | 150 ------------------ .../code_quality_walkthrough/constants.js | 67 -------- .../javascripts/code_quality_walkthrough/index.js | 14 -- .../javascripts/code_quality_walkthrough/utils.js | 39 ----- app/assets/javascripts/jobs/components/job_app.vue | 15 -- app/assets/javascripts/jobs/index.js | 2 - .../components/pipelines_list/empty_state.vue | 48 +----- .../components/pipelines_list/pipelines.vue | 6 - .../pipelines_list/pipelines_status_badge.vue | 23 --- .../javascripts/pipelines/pipelines_index.js | 2 - .../components/states/commits_header.vue | 2 +- app/controllers/groups/deploy_tokens_controller.rb | 3 +- app/controllers/projects/blob_controller.rb | 17 +- app/controllers/projects/pipelines_controller.rb | 17 +- app/helpers/ci/jobs_helper.rb | 3 +- app/helpers/ci/pipelines_helper.rb | 1 - app/presenters/project_presenter.rb | 11 -- app/serializers/pipeline_details_entity.rb | 5 - .../groups/deploy_tokens/create_service.rb | 2 + .../groups/deploy_tokens/destroy_service.rb | 2 + .../groups/deploy_tokens/revoke_service.rb | 16 ++ .../pager_duty/process_webhook_service.rb | 7 +- app/views/projects/blob/new.html.haml | 5 +- app/views/projects/issues/_form.html.haml | 2 +- app/views/projects/pipelines/index.html.haml | 2 +- app/views/shared/issuable/_form.html.haml | 4 +- app/views/shared/issuable/form/_title.html.haml | 6 +- ...uality_walkthrough_commit_ci_file_dismissed.yml | 21 --- ...uality_walkthrough_commit_ci_file_displayed.yml | 21 --- ...052_code_quality_walkthrough_commit_created.yml | 21 --- ...205053_code_quality_walkthrough_cta_clicked.yml | 21 --- ...ality_walkthrough_failed_pipeline_displayed.yml | 21 --- ...ality_walkthrough_failed_pipeline_view_logs.yml | 21 --- ...lity_walkthrough_running_pipeline_dismissed.yml | 21 --- ...lity_walkthrough_running_pipeline_displayed.yml | 21 --- ...lity_walkthrough_success_pipeline_displayed.yml | 21 --- ...lity_walkthrough_success_pipeline_view_logs.yml | 21 --- .../development/new_vulnerability_form.yml | 8 + .../experiment/code_quality_walkthrough.yml | 8 - doc/administration/audit_events.md | 2 + locale/gitlab.pot | 54 +------ spec/controllers/projects/blob_controller_spec.rb | 19 --- .../projects/pipelines_controller_spec.rb | 4 - spec/features/issues/form_spec.rb | 8 + .../components/__snapshots__/step_spec.js.snap | 174 --------------------- .../components/step_spec.js | 156 ------------------ spec/frontend/jobs/components/job_app_spec.js | 1 - spec/frontend/pipelines/pipelines_spec.js | 36 ----- spec/helpers/ci/pipelines_helper_spec.rb | 1 - spec/presenters/project_presenter_spec.rb | 6 - .../groups/deploy_tokens_controller_spec.rb | 40 +++++ spec/serializers/pipeline_details_entity_spec.rb | 14 -- .../groups/deploy_tokens/revoke_service_spec.rb | 28 ++++ 59 files changed, 138 insertions(+), 1129 deletions(-) delete mode 100644 app/assets/javascripts/code_quality_walkthrough/components/step.vue delete mode 100644 app/assets/javascripts/code_quality_walkthrough/constants.js delete mode 100644 app/assets/javascripts/code_quality_walkthrough/index.js delete mode 100644 app/assets/javascripts/code_quality_walkthrough/utils.js create mode 100644 app/services/groups/deploy_tokens/revoke_service.rb delete mode 100644 config/events/20210915205050_code_quality_walkthrough_commit_ci_file_dismissed.yml delete mode 100644 config/events/20210915205051_code_quality_walkthrough_commit_ci_file_displayed.yml delete mode 100644 config/events/20210915205052_code_quality_walkthrough_commit_created.yml delete mode 100644 config/events/20210915205053_code_quality_walkthrough_cta_clicked.yml delete mode 100644 config/events/20210915205054_code_quality_walkthrough_failed_pipeline_displayed.yml delete mode 100644 config/events/20210915205055_code_quality_walkthrough_failed_pipeline_view_logs.yml delete mode 100644 config/events/20210915205056_code_quality_walkthrough_running_pipeline_dismissed.yml delete mode 100644 config/events/20210915205057_code_quality_walkthrough_running_pipeline_displayed.yml delete mode 100644 config/events/20210915205058_code_quality_walkthrough_success_pipeline_displayed.yml delete mode 100644 config/events/20210915205059_code_quality_walkthrough_success_pipeline_view_logs.yml create mode 100644 config/feature_flags/development/new_vulnerability_form.yml delete mode 100644 config/feature_flags/experiment/code_quality_walkthrough.yml delete mode 100644 spec/frontend/code_quality_walkthrough/components/__snapshots__/step_spec.js.snap delete mode 100644 spec/frontend/code_quality_walkthrough/components/step_spec.js create mode 100644 spec/requests/groups/deploy_tokens_controller_spec.rb create mode 100644 spec/services/groups/deploy_tokens/revoke_service_spec.rb diff --git a/.gitlab/issue_templates/Feature Flag Roll Out.md b/.gitlab/issue_templates/Feature Flag Roll Out.md index 590e627df75..3903e30e5ab 100644 --- a/.gitlab/issue_templates/Feature Flag Roll Out.md +++ b/.gitlab/issue_templates/Feature Flag Roll Out.md @@ -89,7 +89,8 @@ _Consider adding links to check for Sentry errors, Production logs for 5xx, 302s - [ ] Ensure that you or a representative in development can be available for at least 2 hours after feature flag updates in production. If a different developer will be covering, or an exception is needed, please inform the oncall SRE by using the `@sre-oncall` Slack alias. - [ ] Ensure that documentation has been updated ([More info](https://docs.gitlab.com/ee/development/documentation/feature_flags.html#features-that-became-enabled-by-default)). -- [ ] Announce on [the feature issue](ISSUE LINK) an estimated time this will be enabled on GitLab.com. +- [ ] Announce on [the feature issue](ISSUE LINK) an estimated time this will be enabled on GitLab.com. +- [ ] Ensure that any breaking changes have been announced following the [release post process](https://about.gitlab.com/handbook/marketing/blog/release-posts/#deprecations-removals-and-breaking-changes) to ensure GitLab customers are aware. - [ ] Notify `#support_gitlab-com` and your team channel ([more guidance when this is necessary in the dev docs](https://docs.gitlab.com/ee/development/feature_flags/controls.html#communicate-the-change)). ### Global rollout on production diff --git a/GITALY_SERVER_VERSION b/GITALY_SERVER_VERSION index 6dc73c70b82..cdf11c7f4d7 100644 --- a/GITALY_SERVER_VERSION +++ b/GITALY_SERVER_VERSION @@ -1 +1 @@ -ebb18ecc514b369fb0958dab95ba803a20c67cd4 +f6ca4c932139d0e6b4407f2ec6251858479382f0 diff --git a/app/assets/javascripts/alert_management/components/alert_management_table.vue b/app/assets/javascripts/alert_management/components/alert_management_table.vue index 84c2b216859..929f5d10956 100644 --- a/app/assets/javascripts/alert_management/components/alert_management_table.vue +++ b/app/assets/javascripts/alert_management/components/alert_management_table.vue @@ -12,8 +12,8 @@ import { GlTooltipDirective, } from '@gitlab/ui'; import getAlertsQuery from '~/graphql_shared/queries/get_alerts.query.graphql'; +import { sortObjectToString } from '~/lib/utils/table_utility'; import { fetchPolicies } from '~/lib/graphql'; -import { convertToSnakeCase } from '~/lib/utils/text_utility'; import { joinPaths, visitUrl } from '~/lib/utils/url_utility'; import { s__, __, n__ } from '~/locale'; import AlertStatus from '~/vue_shared/alert_details/components/alert_status.vue'; @@ -213,11 +213,8 @@ export default { }, methods: { fetchSortedData({ sortBy, sortDesc }) { - const sortingDirection = sortDesc ? 'DESC' : 'ASC'; - const sortingColumn = convertToSnakeCase(sortBy).toUpperCase(); - this.pagination = initialPaginationState; - this.sort = `${sortingColumn}_${sortingDirection}`; + this.sort = sortObjectToString({ sortBy, sortDesc }); }, navigateToAlertDetails({ iid }, index, { metaKey }) { return visitUrl(joinPaths(window.location.pathname, iid, 'details'), metaKey); diff --git a/app/assets/javascripts/blob_edit/blob_bundle.js b/app/assets/javascripts/blob_edit/blob_bundle.js index 5d1c1e15d15..425de914c17 100644 --- a/app/assets/javascripts/blob_edit/blob_bundle.js +++ b/app/assets/javascripts/blob_edit/blob_bundle.js @@ -2,7 +2,6 @@ import $ from 'jquery'; import initPopover from '~/blob/suggest_gitlab_ci_yml'; -import initCodeQualityWalkthrough from '~/code_quality_walkthrough'; import createFlash from '~/flash'; import { disableButtonIfEmptyField, setCookie } from '~/lib/utils/common_utils'; import Tracking from '~/tracking'; @@ -39,13 +38,6 @@ const initPopovers = () => { } }; -const initCodeQualityWalkthroughStep = () => { - const codeQualityWalkthroughEl = document.querySelector('.js-code-quality-walkthrough'); - if (codeQualityWalkthroughEl) { - initCodeQualityWalkthrough(codeQualityWalkthroughEl); - } -}; - export const initUploadForm = () => { const uploadBlobForm = $('.js-upload-blob-form'); if (uploadBlobForm.length) { @@ -84,7 +76,6 @@ export default () => { previewMarkdownPath, }); initPopovers(); - initCodeQualityWalkthroughStep(); }) .catch((e) => createFlash({ diff --git a/app/assets/javascripts/captcha/apollo_captcha_link.js b/app/assets/javascripts/captcha/apollo_captcha_link.js index d63ffaf5f1a..2d154139c7b 100644 --- a/app/assets/javascripts/captcha/apollo_captcha_link.js +++ b/app/assets/javascripts/captcha/apollo_captcha_link.js @@ -12,7 +12,7 @@ export const apolloCaptchaLink = new ApolloLink((operation, forward) => const spamLogId = captchaError.extensions.spam_log_id; return new Observable((observer) => { - import('~/captcha/wait_for_captcha_to_be_solved') + import('jh_else_ce/captcha/wait_for_captcha_to_be_solved') .then(({ waitForCaptchaToBeSolved }) => waitForCaptchaToBeSolved(captchaSiteKey)) .then((captchaResponse) => { // If the captcha was solved correctly, we re-do our action while setting diff --git a/app/assets/javascripts/captcha/captcha_modal_axios_interceptor.js b/app/assets/javascripts/captcha/captcha_modal_axios_interceptor.js index fdab188f6be..19fde2500f1 100644 --- a/app/assets/javascripts/captcha/captcha_modal_axios_interceptor.js +++ b/app/assets/javascripts/captcha/captcha_modal_axios_interceptor.js @@ -9,7 +9,9 @@ function needsCaptchaResponse(err) { const showCaptchaModalAndResubmit = async (axios, data, errConfig) => { // NOTE: We asynchronously import and unbox the module. Since this is included globally, we don't // do a regular import because that would increase the size of the webpack bundle. - const { waitForCaptchaToBeSolved } = await import('~/captcha/wait_for_captcha_to_be_solved'); + const { waitForCaptchaToBeSolved } = await import( + 'jh_else_ce/captcha/wait_for_captcha_to_be_solved' + ); // show the CAPTCHA modal and wait for it to be solved or closed const captchaResponse = await waitForCaptchaToBeSolved(data.captcha_site_key); diff --git a/app/assets/javascripts/code_quality_walkthrough/components/step.vue b/app/assets/javascripts/code_quality_walkthrough/components/step.vue deleted file mode 100644 index 1a23c96b7d6..00000000000 --- a/app/assets/javascripts/code_quality_walkthrough/components/step.vue +++ /dev/null @@ -1,150 +0,0 @@ - - - diff --git a/app/assets/javascripts/code_quality_walkthrough/constants.js b/app/assets/javascripts/code_quality_walkthrough/constants.js deleted file mode 100644 index 011df06b5cc..00000000000 --- a/app/assets/javascripts/code_quality_walkthrough/constants.js +++ /dev/null @@ -1,67 +0,0 @@ -import { s__ } from '~/locale'; - -export const EXPERIMENT_NAME = 'code_quality_walkthrough'; - -export const STEPS = { - commitCiFile: 'commit_ci_file', - runningPipeline: 'running_pipeline', - successPipeline: 'success_pipeline', - failedPipeline: 'failed_pipeline', - troubleshootJob: 'troubleshoot_job', -}; - -export const STEPSTATES = { - [STEPS.commitCiFile]: { - title: s__("codeQualityWalkthrough|Let's start by creating a new CI file."), - body: s__( - 'codeQualityWalkthrough|To begin with code quality, we first need to create a new CI file using our code editor. We added a code quality template in the code editor to help you get started %{emojiStart}wink%{emojiEnd} .%{lineBreak}Take some time to review the template, when you are ready, use the %{strongStart}commit changes%{strongEnd} button at the bottom of the page.', - ), - buttonText: s__('codeQualityWalkthrough|Got it'), - placement: 'right', - offset: 90, - }, - [STEPS.runningPipeline]: { - title: s__( - 'codeQualityWalkthrough|Congrats! Your first pipeline is running %{emojiStart}zap%{emojiEnd}', - ), - body: s__( - "codeQualityWalkthrough|Your pipeline can take a few minutes to run. If you enabled email notifications, you'll receive an email with your pipeline status. In the meantime, why don't you get some coffee? You earned it!", - ), - buttonText: s__('codeQualityWalkthrough|Got it'), - offset: 97, - }, - [STEPS.successPipeline]: { - title: s__( - "codeQualityWalkthrough|Well done! You've just automated your code quality review. %{emojiStart}raised_hands%{emojiEnd}", - ), - body: s__( - 'codeQualityWalkthrough|A code quality job will now run every time you or your team members commit changes to your project. You can view the results of the code quality job in the job logs.', - ), - buttonText: s__('codeQualityWalkthrough|View the logs'), - offset: 98, - }, - [STEPS.failedPipeline]: { - title: s__( - "codeQualityWalkthrough|Something went wrong. %{emojiStart}thinking%{emojiEnd} Let's fix it.", - ), - body: s__( - "codeQualityWalkthrough|Your job failed. No worries - this happens. Let's view the logs, and see how we can fix it.", - ), - buttonText: s__('codeQualityWalkthrough|View the logs'), - offset: 98, - }, - [STEPS.troubleshootJob]: { - title: s__('codeQualityWalkthrough|Troubleshoot your code quality job'), - body: s__( - 'codeQualityWalkthrough|Not sure how to fix your failed job? We have compiled some tips on how to troubleshoot code quality jobs in the documentation.', - ), - buttonText: s__('codeQualityWalkthrough|Read the documentation'), - }, -}; - -export const PIPELINE_STATUSES = { - running: 'running', - successWithWarnings: 'success-with-warnings', - success: 'success', - failed: 'failed', -}; diff --git a/app/assets/javascripts/code_quality_walkthrough/index.js b/app/assets/javascripts/code_quality_walkthrough/index.js deleted file mode 100644 index b0592b8a84b..00000000000 --- a/app/assets/javascripts/code_quality_walkthrough/index.js +++ /dev/null @@ -1,14 +0,0 @@ -import Vue from 'vue'; -import Step from './components/step.vue'; - -export default (el) => - new Vue({ - el, - render(createElement) { - return createElement(Step, { - props: { - step: el.dataset.step, - }, - }); - }, - }); diff --git a/app/assets/javascripts/code_quality_walkthrough/utils.js b/app/assets/javascripts/code_quality_walkthrough/utils.js deleted file mode 100644 index 894ec9a171d..00000000000 --- a/app/assets/javascripts/code_quality_walkthrough/utils.js +++ /dev/null @@ -1,39 +0,0 @@ -import { TRACKING_CONTEXT_SCHEMA } from '~/experimentation/constants'; -import { getExperimentData } from '~/experimentation/utils'; -import { setCookie, getCookie } from '~/lib/utils/common_utils'; -import { getParameterByName } from '~/lib/utils/url_utility'; -import Tracking from '~/tracking'; -import { EXPERIMENT_NAME } from './constants'; - -export function getExperimentSettings() { - return JSON.parse(getCookie(EXPERIMENT_NAME) || '{}'); -} - -export function setExperimentSettings(settings) { - setCookie(EXPERIMENT_NAME, settings); -} - -export function isWalkthroughEnabled() { - return getParameterByName(EXPERIMENT_NAME); -} - -export function track(action) { - const { data } = getExperimentSettings(); - - if (data) { - Tracking.event(EXPERIMENT_NAME, action, { - context: { - schema: TRACKING_CONTEXT_SCHEMA, - data, - }, - }); - } -} - -export function startCodeQualityWalkthrough() { - const data = getExperimentData(EXPERIMENT_NAME); - - if (data) { - setExperimentSettings({ data }); - } -} diff --git a/app/assets/javascripts/jobs/components/job_app.vue b/app/assets/javascripts/jobs/components/job_app.vue index 605172155dc..85fe5ed7e26 100644 --- a/app/assets/javascripts/jobs/components/job_app.vue +++ b/app/assets/javascripts/jobs/components/job_app.vue @@ -3,7 +3,6 @@ import { GlLoadingIcon, GlIcon, GlSafeHtmlDirective as SafeHtml, GlAlert } from import { GlBreakpointInstance as bp } from '@gitlab/ui/dist/utils'; import { throttle, isEmpty } from 'lodash'; import { mapGetters, mapState, mapActions } from 'vuex'; -import CodeQualityWalkthrough from '~/code_quality_walkthrough/components/step.vue'; import { isScrolledToBottom } from '~/lib/utils/scroll_utils'; import { __, sprintf } from '~/locale'; import CiHeader from '~/vue_shared/components/header_ci_component.vue'; @@ -33,7 +32,6 @@ export default { GlLoadingIcon, SharedRunner: () => import('ee_component/jobs/components/shared_runner_limit_block.vue'), GlAlert, - CodeQualityWalkthrough, }, directives: { SafeHtml, @@ -69,11 +67,6 @@ export default { required: false, default: null, }, - codeQualityHelpUrl: { - type: String, - required: false, - default: null, - }, }, computed: { ...mapState([ @@ -123,9 +116,6 @@ export default { return this.shouldRenderCalloutMessage && !this.hasUnmetPrerequisitesFailure; }, - shouldRenderCodeQualityWalkthrough() { - return this.job.status.group === 'failed-with-warnings'; - }, itemName() { return sprintf(__('Job %{jobName}'), { jobName: this.job.name }); }, @@ -224,11 +214,6 @@ export default { >
- diff --git a/app/assets/javascripts/jobs/index.js b/app/assets/javascripts/jobs/index.js index 6e958ea1842..26dd38bbe08 100644 --- a/app/assets/javascripts/jobs/index.js +++ b/app/assets/javascripts/jobs/index.js @@ -14,7 +14,6 @@ const initializeJobPage = (element) => { const { artifactHelpUrl, deploymentHelpUrl, - codeQualityHelpUrl, runnerSettingsUrl, subscriptionsMoreMinutesUrl, endpoint, @@ -39,7 +38,6 @@ const initializeJobPage = (element) => { props: { artifactHelpUrl, deploymentHelpUrl, - codeQualityHelpUrl, runnerSettingsUrl, subscriptionsMoreMinutesUrl, endpoint, 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 bc433db3eb8..0380ba646cc 100644 --- a/app/assets/javascripts/pipelines/components/pipelines_list/empty_state.vue +++ b/app/assets/javascripts/pipelines/components/pipelines_list/empty_state.vue @@ -1,25 +1,15 @@