From 69f0d90aad454a2b8f3c4e2f2ca31886a14a8642 Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Mon, 1 Mar 2021 18:11:21 +0000 Subject: [PATCH] Add latest changes from gitlab-org/gitlab@master --- .../cycle_analytics/components/base.vue | 288 ++++++++++++++++++ .../cycle_analytics/cycle_analytics_bundle.js | 156 ---------- .../javascripts/cycle_analytics/index.js | 32 ++ .../import_groups/components/import_table.vue | 76 ++++- .../projects/cycle_analytics/show/index.js | 2 +- .../pages/projects/milestones/edit/index.js | 4 +- .../pipelines_list/pipeline_triggerer.vue | 12 +- .../pipelines_list/pipeline_url.vue | 12 +- .../pipelines_list/pipelines_table.vue | 78 ++--- .../pipelines_list/pipelines_table_row.vue | 12 +- .../components/pipelines_list/time_ago.vue | 41 +-- .../assignees/issuable_assignees.vue | 9 +- .../assignees/sidebar_assignees_widget.vue | 20 +- .../assignees/uncollapsed_assignee_list.vue | 2 +- .../reviewers/uncollapsed_reviewer_list.vue | 16 +- .../components/sidebar_editable_item.vue | 2 +- .../queries/sidebarDetailsMR.query.graphql | 7 + .../sidebar/services/sidebar_service.js | 15 +- .../javascripts/sidebar/sidebar_mediator.js | 1 + .../sidebar/multiselect_dropdown.vue | 11 +- .../page_bundles/cycle_analytics.scss | 32 -- .../projects/pipelines_controller.rb | 1 + app/helpers/issuables_helper.rb | 3 +- app/models/merge_request.rb | 9 +- .../project_services/prometheus_service.rb | 12 +- app/serializers/merge_request_user_entity.rb | 12 +- app/services/merge_requests/build_service.rb | 16 +- .../cycle_analytics/_empty_stage.html.haml | 7 - .../cycle_analytics/_no_access.html.haml | 7 - .../projects/cycle_analytics/show.html.haml | 66 +--- .../_configuration_banner.html.haml | 6 +- .../services/prometheus/_help.html.haml | 2 +- .../_configuration_banner.html.haml | 6 +- .../settings/operations/_prometheus.html.haml | 2 +- ...-change-prefilled-mr-title-description.yml | 5 + .../300617-aqualls-prometheus-settings.yml | 5 + .../ajk-reviewer-widget-approved.yml | 5 + ...at-auto-enable-admin-mode-rake-runtime.yml | 5 + .../development/new_pipelines_table.yml | 8 + doc/api/graphql/reference/index.md | 2 + doc/ci/troubleshooting.md | 4 +- doc/ci/yaml/README.md | 282 ++++++++--------- doc/ci/yaml/script.md | 31 ++ doc/development/pipelines.md | 2 +- doc/user/group/index.md | 4 +- .../project/merge_requests/code_quality.md | 2 +- .../merge_requests/creating_merge_requests.md | 15 +- .../project/merge_requests/getting_started.md | 7 + doc/user/project/merge_requests/index.md | 31 +- lib/api/helpers/services_helpers.rb | 2 +- lib/bulk_imports/pipeline.rb | 2 + lib/gitlab/auth/current_user_mode.rb | 7 +- locale/gitlab.pot | 60 +++- .../user_sees_merge_request_pipelines_spec.rb | 1 + .../projects/pipelines/pipelines_spec.rb | 1 + .../components/import_table_spec.js | 39 ++- .../pipelines/pipelines_table_spec.js | 75 +++-- spec/frontend/pipelines/time_ago_spec.js | 14 +- .../uncollapsed_reviewer_list_spec.js | 18 +- spec/frontend/sidebar/user_data_mock.js | 1 + .../components/multiselect_dropdown_spec.js | 4 + .../prometheus_service_spec.rb | 10 +- .../merge_request_user_entity_spec.rb | 53 +++- .../merge_requests/build_service_spec.rb | 123 ++++++-- spec/tasks/admin_mode_spec.rb | 32 ++ .../operations/show.html.haml_spec.rb | 4 +- 66 files changed, 1193 insertions(+), 638 deletions(-) create mode 100644 app/assets/javascripts/cycle_analytics/components/base.vue delete mode 100644 app/assets/javascripts/cycle_analytics/cycle_analytics_bundle.js create mode 100644 app/assets/javascripts/cycle_analytics/index.js create mode 100644 app/assets/javascripts/sidebar/queries/sidebarDetailsMR.query.graphql delete mode 100644 app/views/projects/cycle_analytics/_empty_stage.html.haml delete mode 100644 app/views/projects/cycle_analytics/_no_access.html.haml create mode 100644 changelogs/unreleased/300479-change-prefilled-mr-title-description.yml create mode 100644 changelogs/unreleased/300617-aqualls-prometheus-settings.yml create mode 100644 changelogs/unreleased/ajk-reviewer-widget-approved.yml create mode 100644 changelogs/unreleased/feat-auto-enable-admin-mode-rake-runtime.yml create mode 100644 config/feature_flags/development/new_pipelines_table.yml create mode 100644 spec/tasks/admin_mode_spec.rb diff --git a/app/assets/javascripts/cycle_analytics/components/base.vue b/app/assets/javascripts/cycle_analytics/components/base.vue new file mode 100644 index 00000000000..df77d641e21 --- /dev/null +++ b/app/assets/javascripts/cycle_analytics/components/base.vue @@ -0,0 +1,288 @@ + + diff --git a/app/assets/javascripts/cycle_analytics/cycle_analytics_bundle.js b/app/assets/javascripts/cycle_analytics/cycle_analytics_bundle.js deleted file mode 100644 index 847820c965f..00000000000 --- a/app/assets/javascripts/cycle_analytics/cycle_analytics_bundle.js +++ /dev/null @@ -1,156 +0,0 @@ -// This is a true violation of @gitlab/no-runtime-template-compiler, as it -// relies on app/views/projects/cycle_analytics/show.html.haml for its -// template. -/* eslint-disable @gitlab/no-runtime-template-compiler */ -import { GlEmptyState, GlLoadingIcon } from '@gitlab/ui'; -import $ from 'jquery'; -import Cookies from 'js-cookie'; -import Vue from 'vue'; -import { __ } from '~/locale'; -import { deprecatedCreateFlash as Flash } from '../flash'; -import Translate from '../vue_shared/translate'; -import banner from './components/banner.vue'; -import stageCodeComponent from './components/stage_code_component.vue'; -import stageComponent from './components/stage_component.vue'; -import stageNavItem from './components/stage_nav_item.vue'; -import stageReviewComponent from './components/stage_review_component.vue'; -import stageStagingComponent from './components/stage_staging_component.vue'; -import stageTestComponent from './components/stage_test_component.vue'; -import CycleAnalyticsService from './cycle_analytics_service'; -import CycleAnalyticsStore from './cycle_analytics_store'; - -Vue.use(Translate); - -export default () => { - const OVERVIEW_DIALOG_COOKIE = 'cycle_analytics_help_dismissed'; - const cycleAnalyticsEl = document.querySelector('#cycle-analytics'); - - // eslint-disable-next-line no-new - new Vue({ - el: '#cycle-analytics', - name: 'CycleAnalytics', - components: { - GlEmptyState, - GlLoadingIcon, - banner, - 'stage-issue-component': stageComponent, - 'stage-plan-component': stageComponent, - 'stage-code-component': stageCodeComponent, - 'stage-test-component': stageTestComponent, - 'stage-review-component': stageReviewComponent, - 'stage-staging-component': stageStagingComponent, - 'stage-production-component': stageComponent, - 'stage-nav-item': stageNavItem, - }, - data() { - return { - store: CycleAnalyticsStore, - state: CycleAnalyticsStore.state, - isLoading: false, - isLoadingStage: false, - isEmptyStage: false, - hasError: false, - startDate: 30, - isOverviewDialogDismissed: Cookies.get(OVERVIEW_DIALOG_COOKIE), - service: this.createCycleAnalyticsService(cycleAnalyticsEl.dataset.requestPath), - }; - }, - computed: { - currentStage() { - return this.store.currentActiveStage(); - }, - }, - created() { - // Conditional check placed here to prevent this method from being called on the - // new Value Stream Analytics page (i.e. the new page will be initialized blank and only - // after a group is selected the cycle analyitcs data will be fetched). Once the - // old (current) page has been removed this entire created method as well as the - // variable itself can be completely removed. - // Follow up issue: https://gitlab.com/gitlab-org/gitlab-foss/issues/64490 - if (cycleAnalyticsEl.dataset.requestPath) this.fetchCycleAnalyticsData(); - }, - methods: { - handleError() { - this.store.setErrorState(true); - return new Flash(__('There was an error while fetching value stream analytics data.')); - }, - initDropdown() { - const $dropdown = $('.js-ca-dropdown'); - const $label = $dropdown.find('.dropdown-label'); - - // eslint-disable-next-line @gitlab/no-global-event-off - $dropdown - .find('li a') - .off('click') - .on('click', (e) => { - e.preventDefault(); - const $target = $(e.currentTarget); - this.startDate = $target.data('value'); - - $label.text($target.text().trim()); - this.fetchCycleAnalyticsData({ startDate: this.startDate }); - }); - }, - fetchCycleAnalyticsData(options) { - const fetchOptions = options || { startDate: this.startDate }; - - this.isLoading = true; - - this.service - .fetchCycleAnalyticsData(fetchOptions) - .then((response) => { - this.store.setCycleAnalyticsData(response); - this.selectDefaultStage(); - this.initDropdown(); - this.isLoading = false; - }) - .catch(() => { - this.handleError(); - this.isLoading = false; - }); - }, - selectDefaultStage() { - const stage = this.state.stages[0]; - this.selectStage(stage); - }, - selectStage(stage) { - if (this.isLoadingStage) return; - if (this.currentStage === stage) return; - - if (!stage.isUserAllowed) { - this.store.setActiveStage(stage); - return; - } - - this.isLoadingStage = true; - this.store.setStageEvents([], stage); - this.store.setActiveStage(stage); - - this.service - .fetchStageData({ - stage, - startDate: this.startDate, - projectIds: this.selectedProjectIds, - }) - .then((response) => { - this.isEmptyStage = !response.events.length; - this.store.setStageEvents(response.events, stage); - this.isLoadingStage = false; - }) - .catch(() => { - this.isEmptyStage = true; - this.isLoadingStage = false; - }); - }, - dismissOverviewDialog() { - this.isOverviewDialogDismissed = true; - Cookies.set(OVERVIEW_DIALOG_COOKIE, '1', { expires: 365 }); - }, - createCycleAnalyticsService(requestPath) { - return new CycleAnalyticsService({ - requestPath, - }); - }, - }, - }); -}; diff --git a/app/assets/javascripts/cycle_analytics/index.js b/app/assets/javascripts/cycle_analytics/index.js new file mode 100644 index 00000000000..42d6700fae1 --- /dev/null +++ b/app/assets/javascripts/cycle_analytics/index.js @@ -0,0 +1,32 @@ +import Vue from 'vue'; +import Translate from '../vue_shared/translate'; +import CycleAnalytics from './components/base.vue'; +import CycleAnalyticsService from './cycle_analytics_service'; +import CycleAnalyticsStore from './cycle_analytics_store'; + +Vue.use(Translate); + +const createCycleAnalyticsService = (requestPath) => + new CycleAnalyticsService({ + requestPath, + }); + +export default () => { + const el = document.querySelector('#js-cycle-analytics'); + const { noAccessSvgPath, noDataSvgPath } = el.dataset; + + // eslint-disable-next-line no-new + new Vue({ + el, + name: 'CycleAnalytics', + render: (createElement) => + createElement(CycleAnalytics, { + props: { + noDataSvgPath, + noAccessSvgPath, + store: CycleAnalyticsStore, + service: createCycleAnalyticsService(el.dataset.requestPath), + }, + }), + }); +}; diff --git a/app/assets/javascripts/import_entities/import_groups/components/import_table.vue b/app/assets/javascripts/import_entities/import_groups/components/import_table.vue index d0a0a3463c0..f337520b0db 100644 --- a/app/assets/javascripts/import_entities/import_groups/components/import_table.vue +++ b/app/assets/javascripts/import_entities/import_groups/components/import_table.vue @@ -1,13 +1,15 @@ diff --git a/app/assets/javascripts/pages/projects/cycle_analytics/show/index.js b/app/assets/javascripts/pages/projects/cycle_analytics/show/index.js index df58e9dd072..255d05b39be 100644 --- a/app/assets/javascripts/pages/projects/cycle_analytics/show/index.js +++ b/app/assets/javascripts/pages/projects/cycle_analytics/show/index.js @@ -1,3 +1,3 @@ -import initCycleAnalytics from '~/cycle_analytics/cycle_analytics_bundle'; +import initCycleAnalytics from '~/cycle_analytics'; document.addEventListener('DOMContentLoaded', initCycleAnalytics); diff --git a/app/assets/javascripts/pages/projects/milestones/edit/index.js b/app/assets/javascripts/pages/projects/milestones/edit/index.js index 9a4ebf9890d..4f8514a9a1d 100644 --- a/app/assets/javascripts/pages/projects/milestones/edit/index.js +++ b/app/assets/javascripts/pages/projects/milestones/edit/index.js @@ -1,3 +1,3 @@ -import initForm from '../../../../shared/milestones/form'; +import initForm from '~/shared/milestones/form'; -document.addEventListener('DOMContentLoaded', () => initForm()); +initForm(); diff --git a/app/assets/javascripts/pipelines/components/pipelines_list/pipeline_triggerer.vue b/app/assets/javascripts/pipelines/components/pipelines_list/pipeline_triggerer.vue index 6ac60727f23..6955b27cb22 100644 --- a/app/assets/javascripts/pipelines/components/pipelines_list/pipeline_triggerer.vue +++ b/app/assets/javascripts/pipelines/components/pipelines_list/pipeline_triggerer.vue @@ -1,10 +1,12 @@