From f276d294878605e289c84beb53032b40c53ba961 Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Mon, 7 Dec 2020 15:09:49 +0000 Subject: [PATCH] Add latest changes from gitlab-org/gitlab@master --- .../merge_request_templates/Documentation.md | 4 +- .../frequent_items/components/app.vue | 2 - .../components/frequent_items_list_item.vue | 12 +- .../frequent_items_search_input.vue | 11 +- .../javascripts/frequent_items/index.js | 5 + .../javascripts/frequent_items/store/index.js | 7 +- .../javascripts/frequent_items/store/state.js | 3 +- .../components/graph/graph_component.vue | 96 +++++++++- .../graph/graph_component_wrapper.vue | 18 +- .../components/graph/linked_pipeline.vue | 53 ++++-- .../graph/linked_pipelines_column.vue | 136 ++++++++++--- .../graph/linked_pipelines_column_legacy.vue | 35 ++-- .../pipelines/components/graph/utils.js | 30 ++- .../graph_shared/linked_graph_wrapper.vue | 7 + .../graph_shared/main_graph_wrapper.vue | 2 +- .../linked_pipelines.fragment.graphql | 17 ++ .../get_pipeline_details.query.graphql | 13 +- .../get_pipeline_header_data.query.graphql | 1 + .../static_site_editor/constants.js | 3 + .../services/submit_content_changes.js | 4 + .../stylesheets/page_bundles/pipeline.scss | 4 + app/models/namespace_onboarding_action.rb | 1 + .../merge_requests/after_create_service.rb | 2 + .../vulnerability_finding_details.json | 179 +++++++++++++++++- .../nav/groups_dropdown/_show.html.haml | 4 +- .../nav/projects_dropdown/_show.html.haml | 6 +- .../233994_send_usage_data_events.yml | 5 + ...etty_generate_in_usage_data_rake_tasks.yml | 5 + doc/development/dangerbot.md | 42 ++-- doc/development/documentation/workflow.md | 2 +- doc/development/ee_features.md | 22 +-- doc/development/file_storage.md | 8 +- doc/development/gotchas.md | 8 +- doc/development/licensing.md | 6 +- doc/development/mass_insert.md | 2 +- doc/development/polling.md | 2 +- doc/development/polymorphic_associations.md | 14 +- doc/development/post_deployment_migrations.md | 8 +- doc/development/profiling.md | 8 +- doc/development/reference_processing.md | 6 +- doc/development/scalability.md | 61 +++--- .../shell_scripting_guide/index.md | 4 +- doc/development/uploads.md | 16 +- doc/integration/elasticsearch.md | 21 +- doc/raketasks/README.md | 1 + doc/security/asset_proxy.md | 6 +- doc/security/rack_attack.md | 16 +- doc/update/README.md | 2 +- doc/user/profile/notifications.md | 24 +-- .../project/merge_requests/getting_started.md | 4 +- lib/api/feature_flags_user_lists.rb | 2 +- lib/api/group_labels.rb | 2 +- lib/api/labels.rb | 4 +- lib/api/release/links.rb | 2 +- lib/gitlab/usage_data.rb | 2 +- lib/tasks/gitlab/usage_data.rake | 5 +- locale/gitlab.pot | 3 + .../frequent_items/components/app_spec.js | 3 +- .../frequent_items_list_item_spec.js | 27 ++- .../components/frequent_items_list_spec.js | 2 + .../frequent_items_search_input_spec.js | 42 +++- spec/frontend/frequent_items/mock_data.js | 1 - .../graph/graph_component_legacy_spec.js | 4 +- .../pipelines/graph/graph_component_spec.js | 34 +++- .../pipelines/graph/linked_pipeline_spec.js | 22 +-- .../graph/linked_pipelines_column_spec.js | 122 ++++++++++-- spec/frontend/pipelines/graph/mock_data.js | 168 +++++++++++++++- .../services/submit_content_changes_spec.js | 24 +++ spec/lib/gitlab/usage_data_spec.rb | 4 +- .../after_create_service_spec.rb | 19 +- 70 files changed, 1130 insertions(+), 310 deletions(-) create mode 100644 app/assets/javascripts/pipelines/components/graph_shared/linked_graph_wrapper.vue create mode 100644 app/assets/javascripts/pipelines/graphql/fragments/linked_pipelines.fragment.graphql create mode 100644 changelogs/unreleased/233994_send_usage_data_events.yml create mode 100644 changelogs/unreleased/use-json-pretty_generate_in_usage_data_rake_tasks.yml diff --git a/.gitlab/merge_request_templates/Documentation.md b/.gitlab/merge_request_templates/Documentation.md index b059c1f68ad..fcf26d95035 100644 --- a/.gitlab/merge_request_templates/Documentation.md +++ b/.gitlab/merge_request_templates/Documentation.md @@ -15,9 +15,9 @@ ## Author's checklist (required) -- [ ] Follow the [Documentation Guidelines](https://docs.gitlab.com/ee/development/documentation/) and [Style Guide](https://docs.gitlab.com/ee/development/documentation/styleguide.html). +- [ ] Follow the [Documentation Guidelines](https://docs.gitlab.com/ee/development/documentation/) and [Style Guide](https://docs.gitlab.com/ee/development/documentation/styleguide/). - If you have **Developer** permissions or higher: - - [ ] Ensure that the [product tier badge](https://docs.gitlab.com/ee/development/documentation/styleguide.html#product-badges) is added to doc's `h1`. + - [ ] Ensure that the [product tier badge](https://docs.gitlab.com/ee/development/documentation/styleguide/index.html#product-tier-badges) is added to doc's `h1`. - [ ] Apply the ~documentation label, plus: - The corresponding DevOps stage and group labels, if applicable. - ~"development guidelines" when changing docs under `doc/development/*`, `CONTRIBUTING.md`, or `README.md`. diff --git a/app/assets/javascripts/frequent_items/components/app.vue b/app/assets/javascripts/frequent_items/components/app.vue index 61080fb5487..c4f61b839e4 100644 --- a/app/assets/javascripts/frequent_items/components/app.vue +++ b/app/assets/javascripts/frequent_items/components/app.vue @@ -3,7 +3,6 @@ import { mapState, mapActions, mapGetters } from 'vuex'; import { GlLoadingIcon } from '@gitlab/ui'; import AccessorUtilities from '~/lib/utils/accessor'; import eventHub from '../event_hub'; -import store from '../store'; import { FREQUENT_ITEMS, STORAGE_KEY } from '../constants'; import { isMobile, updateExistingFrequentItem, sanitizeItem } from '../utils'; import FrequentItemsSearchInput from './frequent_items_search_input.vue'; @@ -11,7 +10,6 @@ import FrequentItemsList from './frequent_items_list.vue'; import frequentItemsMixin from './frequent_items_mixin'; export default { - store, components: { FrequentItemsSearchInput, FrequentItemsList, diff --git a/app/assets/javascripts/frequent_items/components/frequent_items_list_item.vue b/app/assets/javascripts/frequent_items/components/frequent_items_list_item.vue index 1203f389931..3260d768fd9 100644 --- a/app/assets/javascripts/frequent_items/components/frequent_items_list_item.vue +++ b/app/assets/javascripts/frequent_items/components/frequent_items_list_item.vue @@ -1,13 +1,18 @@ @@ -36,13 +90,39 @@ export default { class="gl-pipeline-min-h gl-display-flex gl-position-relative gl-overflow-auto gl-bg-gray-10 gl-white-space-nowrap" :class="{ 'gl-py-5': !isLinkedPipeline }" > - + + + + + diff --git a/app/assets/javascripts/pipelines/components/graph/graph_component_wrapper.vue b/app/assets/javascripts/pipelines/components/graph/graph_component_wrapper.vue index 49a2feab0fc..cb2f4d0d623 100644 --- a/app/assets/javascripts/pipelines/components/graph/graph_component_wrapper.vue +++ b/app/assets/javascripts/pipelines/components/graph/graph_component_wrapper.vue @@ -42,7 +42,7 @@ export default { }; }, update(data) { - return unwrapPipelineData(this.pipelineIid, data); + return unwrapPipelineData(this.pipelineProjectPath, data); }, error() { this.reportFailure(LOAD_FAILURE); @@ -77,13 +77,11 @@ export default { }; diff --git a/app/assets/javascripts/pipelines/components/graph/linked_pipeline.vue b/app/assets/javascripts/pipelines/components/graph/linked_pipeline.vue index 97e5a309215..1a179de64cd 100644 --- a/app/assets/javascripts/pipelines/components/graph/linked_pipeline.vue +++ b/app/assets/javascripts/pipelines/components/graph/linked_pipeline.vue @@ -25,23 +25,33 @@ export default { type: String, required: true, }, - pipeline: { - type: Object, + expanded: { + type: Boolean, required: true, }, - projectId: { - type: Number, + pipeline: { + type: Object, required: true, }, type: { type: String, required: true, }, - }, - data() { - return { - expanded: false, - }; + /* + The next two props will be removed or required + once the graph transition is done. + See: https://gitlab.com/gitlab-org/gitlab/-/issues/291043 + */ + isLoading: { + type: Boolean, + required: false, + default: false, + }, + projectId: { + type: Number, + required: false, + default: -1, + }, }, computed: { tooltipText() { @@ -74,6 +84,9 @@ export default { } return __('Multi-project'); }, + pipelineIsLoading() { + return Boolean(this.isLoading || this.pipeline.isLoading); + }, isDownstream() { return this.type === DOWNSTREAM; }, @@ -81,7 +94,9 @@ export default { return this.type === UPSTREAM; }, isSameProject() { - return this.projectId === this.pipeline.project.id; + return this.projectId > -1 + ? this.projectId === this.pipeline.project.id + : !this.pipeline.multiproject; }, sourceJobName() { return accessValue(this.dataMethod, 'sourceJob', this.pipeline); @@ -101,16 +116,15 @@ export default { }, methods: { onClickLinkedPipeline() { - this.$root.$emit('bv::hide::tooltip', this.buttonId); - this.expanded = !this.expanded; + this.hideTooltips(); this.$emit('pipelineClicked', this.$refs.linkedPipeline); - this.$emit('pipelineExpandToggle', this.pipeline.source_job.name, this.expanded); + this.$emit('pipelineExpandToggle', this.sourceJobName, !this.expanded); }, hideTooltips() { this.$root.$emit('bv::hide::tooltip'); }, onDownstreamHovered() { - this.$emit('downstreamHovered', this.pipeline.source_job.name); + this.$emit('downstreamHovered', this.sourceJobName); }, onDownstreamHoverLeave() { this.$emit('downstreamHovered', ''); @@ -120,10 +134,10 @@ export default { diff --git a/app/assets/javascripts/pipelines/components/graph/linked_pipelines_column.vue b/app/assets/javascripts/pipelines/components/graph/linked_pipelines_column.vue index 2ca33e6d33e..58757a88102 100644 --- a/app/assets/javascripts/pipelines/components/graph/linked_pipelines_column.vue +++ b/app/assets/javascripts/pipelines/components/graph/linked_pipelines_column.vue @@ -1,10 +1,14 @@ diff --git a/app/assets/javascripts/pipelines/components/graph/linked_pipelines_column_legacy.vue b/app/assets/javascripts/pipelines/components/graph/linked_pipelines_column_legacy.vue index 2ca33e6d33e..7d371b33220 100644 --- a/app/assets/javascripts/pipelines/components/graph/linked_pipelines_column_legacy.vue +++ b/app/assets/javascripts/pipelines/components/graph/linked_pipelines_column_legacy.vue @@ -35,7 +35,9 @@ export default { graphPosition() { return this.isUpstream ? 'left' : 'right'; }, - // Refactor string match when BE returns Upstream/Downstream indicators + isExpanded() { + return this.pipeline?.isExpanded || false; + }, isUpstream() { return this.type === UPSTREAM; }, @@ -64,21 +66,22 @@ export default {
{{ columnTitle }}
diff --git a/app/assets/javascripts/pipelines/components/graph/utils.js b/app/assets/javascripts/pipelines/components/graph/utils.js index df3615772ce..7bf44b160ef 100644 --- a/app/assets/javascripts/pipelines/components/graph/utils.js +++ b/app/assets/javascripts/pipelines/components/graph/utils.js @@ -1,28 +1,42 @@ +import { getIdFromGraphQLId } from '~/graphql_shared/utils'; import { unwrapStagesWithNeeds } from '../unwrapping_utils'; -const addMulti = (mainId, pipeline) => { - return { ...pipeline, multiproject: mainId !== pipeline.id }; +const addMulti = (mainPipelineProjectPath, linkedPipeline) => { + return { + ...linkedPipeline, + multiproject: mainPipelineProjectPath !== linkedPipeline.project.fullPath, + }; }; -const unwrapPipelineData = (mainPipelineId, data) => { +const transformId = linkedPipeline => { + return { ...linkedPipeline, id: getIdFromGraphQLId(linkedPipeline.id) }; +}; + +const unwrapPipelineData = (mainPipelineProjectPath, data) => { if (!data?.project?.pipeline) { return null; } + const { pipeline } = data.project; + const { - id, upstream, downstream, stages: { nodes: stages }, - } = data.project.pipeline; + } = pipeline; const nodes = unwrapStagesWithNeeds(stages); return { - id, + ...pipeline, + id: getIdFromGraphQLId(pipeline.id), stages: nodes, - upstream: upstream ? [upstream].map(addMulti.bind(null, mainPipelineId)) : [], - downstream: downstream ? downstream.map(addMulti.bind(null, mainPipelineId)) : [], + upstream: upstream + ? [upstream].map(addMulti.bind(null, mainPipelineProjectPath)).map(transformId) + : [], + downstream: downstream + ? downstream.nodes.map(addMulti.bind(null, mainPipelineProjectPath)).map(transformId) + : [], }; }; diff --git a/app/assets/javascripts/pipelines/components/graph_shared/linked_graph_wrapper.vue b/app/assets/javascripts/pipelines/components/graph_shared/linked_graph_wrapper.vue new file mode 100644 index 00000000000..fb2280d971a --- /dev/null +++ b/app/assets/javascripts/pipelines/components/graph_shared/linked_graph_wrapper.vue @@ -0,0 +1,7 @@ + diff --git a/app/assets/javascripts/pipelines/components/graph_shared/main_graph_wrapper.vue b/app/assets/javascripts/pipelines/components/graph_shared/main_graph_wrapper.vue index 205ee0fb414..1c9e3236d56 100644 --- a/app/assets/javascripts/pipelines/components/graph_shared/main_graph_wrapper.vue +++ b/app/assets/javascripts/pipelines/components/graph_shared/main_graph_wrapper.vue @@ -17,7 +17,7 @@ export default {