summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-06-30 15:08:27 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2021-06-30 15:08:27 +0000
commit9376fdc13edb5fb822431df943fa088b6a273316 (patch)
treef12ac6debd2c3efc59f1629062628f40996e752f
parent7c28a677895df5195ed6342921934734646c90c9 (diff)
downloadgitlab-ce-9376fdc13edb5fb822431df943fa088b6a273316.tar.gz
Add latest changes from gitlab-org/gitlab@master
-rw-r--r--GITALY_SERVER_VERSION2
-rw-r--r--app/assets/javascripts/analytics/usage_trends/components/usage_counts.vue32
-rw-r--r--app/assets/javascripts/boards/components/board_content.vue17
-rw-r--r--app/assets/javascripts/boards/components/board_sidebar.js2
-rw-r--r--app/assets/javascripts/boards/stores/actions.js6
-rw-r--r--app/assets/javascripts/diffs/components/diff_file.vue61
-rw-r--r--app/assets/javascripts/diffs/components/diff_file_header.vue9
-rw-r--r--app/assets/javascripts/diffs/components/diff_view.vue27
-rw-r--r--app/assets/javascripts/sidebar/components/assignees/sidebar_assignees_widget.vue22
-rw-r--r--app/models/namespace.rb9
-rw-r--r--app/services/git/wiki_push_service/change.rb3
-rw-r--r--app/workers/gitlab/import/stuck_import_job.rb2
-rw-r--r--config/feature_flags/development/recursive_approach_for_all_projects.yml8
-rw-r--r--config/metrics/counts_28d/20210201124930_deployments.yml2
-rw-r--r--config/metrics/counts_28d/20210216175016_analytics_total_unique_counts_monthly.yml2
-rw-r--r--config/metrics/counts_28d/20210216175434_project_clusters_enabled.yml2
-rw-r--r--config/metrics/counts_28d/20210216175616_user_dast_jobs.yml2
-rw-r--r--config/metrics/counts_28d/20210216175618_dast_pipeline.yml2
-rw-r--r--config/metrics/counts_28d/20210216180355_user_api_fuzzing_jobs.yml2
-rw-r--r--config/metrics/counts_28d/20210216180357_user_api_fuzzing_dnd_jobs.yml2
-rw-r--r--config/metrics/counts_28d/20210216180622_incident_management_total_unique_counts_monthly.yml2
-rw-r--r--config/metrics/counts_28d/20210216181148_service_desk_issues.yml2
-rw-r--r--config/metrics/counts_28d/20210216181150_projects_jira_active.yml2
-rw-r--r--config/metrics/counts_28d/20210216181152_projects_jira_dvcs_cloud_active.yml2
-rw-r--r--config/metrics/counts_28d/20210216181154_projects_jira_dvcs_server_active.yml2
-rw-r--r--config/metrics/counts_28d/20210216181323_g_project_management_issue_created_monthly.yml2
-rw-r--r--config/metrics/counts_28d/20210216181326_g_project_management_issue_closed_monthly.yml2
-rw-r--r--config/metrics/counts_28d/20210216181504_issues_edit_total_unique_counts_monthly.yml2
-rw-r--r--config/metrics/counts_28d/20210216181956_user_unique_users_all_secure_scanners.yml2
-rw-r--r--config/metrics/counts_28d/20210216182125_user_sast_jobs.yml3
-rw-r--r--config/metrics/counts_28d/20210216182127_user_secret_detection_jobs.yml3
-rw-r--r--config/metrics/counts_28d/20210216182129_sast_pipeline.yml3
-rw-r--r--config/metrics/counts_28d/20210216182131_secret_detection_pipeline.yml3
-rw-r--r--config/metrics/counts_28d/20210216183817_user_coverage_fuzzing_jobs.yml2
-rw-r--r--config/metrics/counts_28d/20210216183826_sast_scans.yml2
-rw-r--r--config/metrics/counts_28d/20210216183830_container_scanning_scans.yml2
-rw-r--r--config/metrics/counts_28d/20210216183832_dast_scans.yml2
-rw-r--r--config/metrics/counts_28d/20210216183834_secret_detection_scans.yml2
-rw-r--r--config/metrics/counts_28d/20210216183836_coverage_fuzzing_scans.yml2
-rw-r--r--config/metrics/counts_28d/20210216183838_api_fuzzing_scans.yml2
-rw-r--r--config/metrics/counts_28d/20210216184259_p_terraform_state_api_unique_users_monthly.yml2
-rw-r--r--config/metrics/counts_28d/20210216184937_user_packages_total_unique_counts_monthly.yml2
-rw-r--r--config/metrics/counts_all/20210204124930_servers.yml2
-rw-r--r--config/metrics/counts_all/20210204124932_clusters.yml2
-rw-r--r--config/metrics/counts_all/20210216175026_service_desk_issues.yml2
-rw-r--r--config/metrics/counts_all/20210216175039_merge_requests.yml2
-rw-r--r--config/metrics/counts_all/20210216175312_clusters_applications_cilium.yml2
-rw-r--r--config/metrics/counts_all/20210216175320_projects_with_terraform_reports.yml2
-rw-r--r--config/metrics/counts_all/20210216175322_projects_with_terraform_states.yml2
-rw-r--r--config/metrics/counts_all/20210216175442_ingress_modsecurity_packets_processed.yml2
-rw-r--r--config/metrics/counts_all/20210216175444_ingress_modsecurity_packets_anomalous.yml2
-rw-r--r--config/metrics/counts_all/20210216175446_network_policy_forwards.yml2
-rw-r--r--config/metrics/counts_all/20210216175448_network_policy_drops.yml2
-rw-r--r--config/metrics/counts_all/20210216175450_ingress_modsecurity_logging.yml2
-rw-r--r--config/metrics/counts_all/20210216175452_ingress_modsecurity_blocking.yml2
-rw-r--r--config/metrics/counts_all/20210216175454_ingress_modsecurity_disabled.yml2
-rw-r--r--config/metrics/counts_all/20210216175456_ingress_modsecurity_not_installed.yml2
-rw-r--r--config/metrics/counts_all/20210216175510_ci_builds.yml2
-rw-r--r--config/metrics/counts_all/20210216175512_ci_internal_pipelines.yml2
-rw-r--r--config/metrics/counts_all/20210216175514_ci_external_pipelines.yml2
-rw-r--r--config/metrics/counts_all/20210216175612_dast_jobs.yml2
-rw-r--r--config/metrics/counts_all/20210216175614_user_dast_jobs.yml2
-rw-r--r--config/metrics/counts_all/20210216175645_projects_bamboo_active.yml2
-rw-r--r--config/metrics/counts_all/20210216175804_projects_drone_ci_active.yml2
-rw-r--r--config/metrics/counts_all/20210216175932_projects_jenkins_active.yml2
-rw-r--r--config/metrics/counts_all/20210216175943_projects_jira_active.yml2
-rw-r--r--config/metrics/counts_all/20210216180228_projects_jira_server_active.yml2
-rw-r--r--config/metrics/counts_all/20210216180230_projects_jira_cloud_active.yml2
-rw-r--r--config/metrics/counts_all/20210216180232_projects_jira_dvcs_cloud_active.yml2
-rw-r--r--config/metrics/counts_all/20210216180234_projects_jira_dvcs_server_active.yml2
-rw-r--r--config/metrics/counts_all/20210216180348_user_api_fuzzing_jobs.yml2
-rw-r--r--config/metrics/counts_all/20210216180350_user_api_fuzzing_dnd_jobs.yml2
-rw-r--r--config/metrics/counts_all/20210216180628_projects_imported_from_github.yml2
-rw-r--r--config/metrics/counts_all/20210216180654_jira.yml2
-rw-r--r--config/metrics/counts_all/20210216181102_issues.yml2
-rw-r--r--config/metrics/counts_all/20210216181115_issues.yml2
-rw-r--r--config/metrics/counts_all/20210216181134_epics.yml2
-rw-r--r--config/metrics/counts_all/20210216181254_projects.yml2
-rw-r--r--config/metrics/counts_all/20210216181256_todos.yml2
-rw-r--r--config/metrics/counts_all/20210216181954_user_unique_users_all_secure_scanners.yml2
-rw-r--r--config/metrics/counts_all/20210216182002_remote_mirrors.yml2
-rw-r--r--config/metrics/counts_all/20210216182112_sast_jobs.yml3
-rw-r--r--config/metrics/counts_all/20210216182114_secret_detection_jobs.yml3
-rw-r--r--config/metrics/counts_all/20210216182116_user_sast_jobs.yml3
-rw-r--r--config/metrics/counts_all/20210216182118_user_secret_detection_jobs.yml3
-rw-r--r--config/metrics/counts_all/20210216183514_user_coverage_fuzzing_jobs.yml2
-rw-r--r--config/metrics/license/20210204124928_version.yml2
-rw-r--r--config/metrics/license/20210216183237_version.yml2
-rw-r--r--config/metrics/settings/20210216175459_ingress_modsecurity_enabled.yml2
-rw-r--r--doc/api/job_artifacts.md4
-rw-r--r--doc/api/jobs.md2
-rw-r--r--doc/api/pipelines.md2
-rw-r--r--doc/ci/environments/deployment_safety.md2
-rw-r--r--doc/ci/jobs/job_control.md4
-rw-r--r--doc/ci/multi_project_pipelines.md314
-rw-r--r--doc/ci/parent_child_pipelines.md192
-rw-r--r--doc/ci/pipelines/img/multi_pipeline_mini_graph.gif (renamed from doc/ci/img/multi_pipeline_mini_graph.gif)bin11466 -> 11466 bytes
-rw-r--r--doc/ci/pipelines/img/multi_project_pipeline_graph.png (renamed from doc/ci/img/multi_project_pipeline_graph.png)bin10671 -> 10671 bytes
-rw-r--r--doc/ci/pipelines/img/parent_pipeline_graph_expanded_v12_6.png (renamed from doc/ci/img/parent_pipeline_graph_expanded_v12_6.png)bin96087 -> 96087 bytes
-rw-r--r--doc/ci/pipelines/index.md6
-rw-r--r--doc/ci/pipelines/job_artifacts.md2
-rw-r--r--doc/ci/pipelines/multi_project_pipelines.md314
-rw-r--r--doc/ci/pipelines/parent_child_pipelines.md192
-rw-r--r--doc/ci/pipelines/pipeline_architectures.md2
-rw-r--r--doc/ci/pipelines/pipeline_efficiency.md2
-rw-r--r--doc/ci/runners/index.md2
-rw-r--r--doc/ci/triggers/index.md2
-rw-r--r--doc/ci/troubleshooting.md6
-rw-r--r--doc/ci/variables/index.md4
-rw-r--r--doc/ci/yaml/index.md20
-rw-r--r--doc/development/cicd/index.md2
-rw-r--r--doc/development/documentation/index.md2
-rw-r--r--doc/development/redis.md1
-rw-r--r--doc/integration/jira/issues.md13
-rw-r--r--doc/user/admin_area/diff_limits.md11
-rw-r--r--doc/user/application_security/coverage_fuzzing/index.md2
-rw-r--r--doc/user/group/epics/epic_boards.md36
-rw-r--r--doc/user/group/iterations/index.md101
-rw-r--r--doc/user/index.md2
-rw-r--r--doc/user/project/merge_requests/testing_and_reports_in_merge_requests.md2
-rw-r--r--lib/api/entities/basic_project_details.rb2
-rw-r--r--lib/bulk_imports/groups/graphql/get_members_query.rb1
-rw-r--r--lib/bulk_imports/groups/pipelines/members_pipeline.rb3
-rw-r--r--lib/bulk_imports/groups/transformers/member_attributes_transformer.rb16
-rw-r--r--lib/bulk_imports/ndjson_pipeline.rb6
-rw-r--r--lib/bulk_imports/users_mapper.rb51
-rw-r--r--lib/gitlab/cache/import/caching.rb28
-rw-r--r--locale/gitlab.pot9
-rw-r--r--spec/fast_spec_helper.rb2
-rw-r--r--spec/features/projects/settings/monitor_settings_spec.rb2
-rw-r--r--spec/features/projects/terraform_spec.rb2
-rw-r--r--spec/frontend/analytics/usage_trends/components/usage_counts_spec.js (renamed from spec/frontend/analytics/usage_trends/components/instance_counts_spec.js)22
-rw-r--r--spec/frontend/boards/stores/actions_spec.js7
-rw-r--r--spec/frontend/diffs/components/diff_view_spec.js8
-rw-r--r--spec/frontend/sidebar/components/assignees/sidebar_assignees_widget_spec.js44
-rw-r--r--spec/lib/api/entities/basic_project_details_spec.rb27
-rw-r--r--spec/lib/bulk_imports/groups/pipelines/members_pipeline_spec.rb8
-rw-r--r--spec/lib/bulk_imports/groups/transformers/member_attributes_transformer_spec.rb28
-rw-r--r--spec/lib/bulk_imports/ndjson_pipeline_spec.rb7
-rw-r--r--spec/lib/bulk_imports/users_mapper_spec.rb68
-rw-r--r--spec/lib/gitlab/cache/import/caching_spec.rb24
-rw-r--r--spec/models/namespace_spec.rb8
-rw-r--r--spec/services/git/wiki_push_service_spec.rb25
-rw-r--r--spec/spec_helper.rb3
-rw-r--r--workhorse/internal/api/api.go46
-rw-r--r--workhorse/internal/api/api_test.go74
-rw-r--r--workhorse/internal/upstream/routes.go7
-rw-r--r--workhorse/internal/upstream/upstream.go33
148 files changed, 1370 insertions, 795 deletions
diff --git a/GITALY_SERVER_VERSION b/GITALY_SERVER_VERSION
index 17a43ba2c3c..7b249908114 100644
--- a/GITALY_SERVER_VERSION
+++ b/GITALY_SERVER_VERSION
@@ -1 +1 @@
-d5777441938369d512a7825c57ccf6115d7afdfa
+21e7c85471a8d7401fad69be300eaff1c0384577
diff --git a/app/assets/javascripts/analytics/usage_trends/components/usage_counts.vue b/app/assets/javascripts/analytics/usage_trends/components/usage_counts.vue
index 0b4fa879b03..1eb4832a2a3 100644
--- a/app/assets/javascripts/analytics/usage_trends/components/usage_counts.vue
+++ b/app/assets/javascripts/analytics/usage_trends/components/usage_counts.vue
@@ -1,5 +1,6 @@
<script>
-import MetricCard from '~/analytics/shared/components/metric_card.vue';
+import { GlDeprecatedSkeletonLoading as GlSkeletonLoading } from '@gitlab/ui';
+import { GlSingleStat } from '@gitlab/ui/dist/charts';
import createFlash from '~/flash';
import { number } from '~/lib/utils/unit_format';
import { s__ } from '~/locale';
@@ -10,7 +11,8 @@ const defaultPrecision = 0;
export default {
name: 'UsageCounts',
components: {
- MetricCard,
+ GlSkeletonLoading,
+ GlSingleStat,
},
data() {
return {
@@ -56,10 +58,24 @@ export default {
</script>
<template>
- <metric-card
- :title="__('Usage Trends')"
- :metrics="counts"
- :is-loading="$apollo.queries.counts.loading"
- class="gl-mt-4"
- />
+ <div>
+ <h2>
+ {{ __('Usage Trends') }}
+ </h2>
+ <div
+ class="gl-display-flex gl-flex-direction-column gl-md-flex-direction-row gl-my-6 gl-align-items-flex-start"
+ >
+ <gl-skeleton-loading v-if="$apollo.queries.counts.loading" />
+ <template v-else>
+ <gl-single-stat
+ v-for="count in counts"
+ :key="count.key"
+ class="gl-pr-9 gl-my-4 gl-md-mt-0 gl-md-mb-0"
+ :value="`${count.value}`"
+ :title="count.label"
+ :should-animate="true"
+ />
+ </template>
+ </div>
+ </div>
</template>
diff --git a/app/assets/javascripts/boards/components/board_content.vue b/app/assets/javascripts/boards/components/board_content.vue
index 9c0d2dee313..53b071aaed1 100644
--- a/app/assets/javascripts/boards/components/board_content.vue
+++ b/app/assets/javascripts/boards/components/board_content.vue
@@ -12,10 +12,8 @@ import BoardColumnDeprecated from './board_column_deprecated.vue';
export default {
components: {
BoardAddNewColumn,
- BoardColumn:
- gon.features?.graphqlBoardLists || gon.features?.epicBoards
- ? BoardColumn
- : BoardColumnDeprecated,
+ BoardColumn,
+ BoardColumnDeprecated,
BoardContentSidebar: () => import('~/boards/components/board_content_sidebar.vue'),
EpicBoardContentSidebar: () =>
import('ee_component/boards/components/epic_board_content_sidebar.vue'),
@@ -38,11 +36,14 @@ export default {
computed: {
...mapState(['boardLists', 'error', 'addColumnForm']),
...mapGetters(['isSwimlanesOn', 'isEpicBoard']),
+ useNewBoardColumnComponent() {
+ return this.glFeatures.graphqlBoardLists || this.isSwimlanesOn || this.isEpicBoard;
+ },
addColumnFormVisible() {
return this.addColumnForm?.visible;
},
boardListsToUse() {
- return this.glFeatures.graphqlBoardLists || this.isSwimlanesOn || this.isEpicBoard
+ return this.useNewBoardColumnComponent
? sortBy([...Object.values(this.boardLists)], 'position')
: this.lists;
},
@@ -65,6 +66,9 @@ export default {
return this.canDragColumns ? options : {};
},
+ boardColumnComponent() {
+ return this.useNewBoardColumnComponent ? BoardColumn : BoardColumnDeprecated;
+ },
},
methods: {
...mapActions(['moveList', 'unsetError']),
@@ -102,7 +106,8 @@ export default {
class="boards-list gl-w-full gl-py-5 gl-px-3 gl-white-space-nowrap"
@end="handleDragOnEnd"
>
- <board-column
+ <component
+ :is="boardColumnComponent"
v-for="(list, index) in boardListsToUse"
:key="index"
ref="board"
diff --git a/app/assets/javascripts/boards/components/board_sidebar.js b/app/assets/javascripts/boards/components/board_sidebar.js
index 55bc91cbcff..21a34182369 100644
--- a/app/assets/javascripts/boards/components/board_sidebar.js
+++ b/app/assets/javascripts/boards/components/board_sidebar.js
@@ -105,7 +105,7 @@ export default Vue.extend({
closeSidebar() {
this.detail.issue = {};
},
- setAssignees(assignees) {
+ setAssignees({ assignees }) {
boardsStore.detail.issue.setAssignees(assignees);
},
showScopedLabels(label) {
diff --git a/app/assets/javascripts/boards/stores/actions.js b/app/assets/javascripts/boards/stores/actions.js
index 65adb56f6d4..f9503cb592c 100644
--- a/app/assets/javascripts/boards/stores/actions.js
+++ b/app/assets/javascripts/boards/stores/actions.js
@@ -472,11 +472,11 @@ export default {
}
},
- setAssignees: ({ commit, getters }, assigneeUsernames) => {
+ setAssignees: ({ commit }, { id, assignees }) => {
commit('UPDATE_BOARD_ITEM_BY_ID', {
- itemId: getters.activeBoardItem.id,
+ itemId: id,
prop: 'assignees',
- value: assigneeUsernames,
+ value: assignees,
});
},
diff --git a/app/assets/javascripts/diffs/components/diff_file.vue b/app/assets/javascripts/diffs/components/diff_file.vue
index d38a703688a..5cf547c1423 100644
--- a/app/assets/javascripts/diffs/components/diff_file.vue
+++ b/app/assets/javascripts/diffs/components/diff_file.vue
@@ -2,6 +2,7 @@
import { GlButton, GlLoadingIcon, GlSafeHtmlDirective as SafeHtml, GlSprintf } from '@gitlab/ui';
import { escape } from 'lodash';
import { mapActions, mapGetters, mapState } from 'vuex';
+import { IdState } from 'vendor/vue-virtual-scroller';
import createFlash from '~/flash';
import { hasDiff } from '~/helpers/diffs_helper';
import { diffViewerErrors } from '~/ide/constants';
@@ -34,7 +35,7 @@ export default {
directives: {
SafeHtml,
},
- mixins: [glFeatureFlagsMixin()],
+ mixins: [glFeatureFlagsMixin(), IdState({ idProp: (vm) => vm.file.file_hash })],
props: {
file: {
type: Object,
@@ -79,7 +80,7 @@ export default {
default: false,
},
},
- data() {
+ idState() {
return {
isLoadingCollapsedDiff: false,
forkMessageVisible: false,
@@ -101,7 +102,9 @@ export default {
return getShortShaFromFile(this.file);
},
showLoadingIcon() {
- return this.isLoadingCollapsedDiff || (!this.file.renderIt && !this.isCollapsed);
+ return (
+ this.idState.isLoadingCollapsedDiff || (!this.file.renderIt && !this.idState.isCollapsed)
+ );
},
hasDiff() {
return hasDiff(this.file);
@@ -145,13 +148,13 @@ export default {
return collapsedType(this.file) === DIFF_FILE_MANUAL_COLLAPSE;
},
showBody() {
- return !this.isCollapsed || this.automaticallyCollapsed;
+ return !this.idState.isCollapsed || this.automaticallyCollapsed;
},
showWarning() {
- return this.isCollapsed && this.automaticallyCollapsed && !this.viewDiffsFileByFile;
+ return this.idState.isCollapsed && this.automaticallyCollapsed && !this.viewDiffsFileByFile;
},
showContent() {
- return !this.isCollapsed && !this.isFileTooLarge;
+ return !this.idState.isCollapsed && !this.isFileTooLarge;
},
showLocalFileReviews() {
const loggedIn = Boolean(gon.current_user_id);
@@ -179,23 +182,16 @@ export default {
this.requestDiff();
}
},
- immediate: true,
},
'file.viewer.automaticallyCollapsed': {
handler: function autoChangeWatch(automaticValue) {
- if (collapsedType(this.file) !== DIFF_FILE_MANUAL_COLLAPSE) {
- this.isCollapsed = this.viewDiffsFileByFile ? false : automaticValue;
- }
+ this.handleAutomaticallyCollapsed(automaticValue);
},
- immediate: true,
},
'file.viewer.manuallyCollapsed': {
handler: function manualChangeWatch(manualValue) {
- if (manualValue !== null) {
- this.isCollapsed = manualValue;
- }
+ this.handleManualChangeWatch(manualValue);
},
- immediate: true,
},
},
created() {
@@ -212,6 +208,8 @@ export default {
}
this.manageViewedEffects();
+ this.handleAutomaticallyCollapsed(this.file.viewer.automaticallyCollapsed);
+ this.handleManualChangeWatch(this.file.viewer.manuallyCollapsed);
},
beforeDestroy() {
if (this.preRender) return;
@@ -226,12 +224,12 @@ export default {
'setFileCollapsedByUser',
]),
manageViewedEffects() {
- if (this.reviewed && !this.isCollapsed && this.showLocalFileReviews) {
+ if (this.reviewed && !this.idState.isCollapsed && this.showLocalFileReviews) {
this.handleToggle();
}
},
expandAllListener() {
- if (this.isCollapsed) {
+ if (this.idState.isCollapsed) {
this.handleToggle();
}
},
@@ -253,7 +251,7 @@ export default {
});
},
handleToggle({ viaUserInteraction = false } = {}) {
- const collapsingNow = !this.isCollapsed;
+ const collapsingNow = !this.idState.isCollapsed;
const contentElement = this.$el.querySelector(`#diff-content-${this.file.file_hash}`);
this.setFileCollapsedByUser({
@@ -270,11 +268,11 @@ export default {
}
},
requestDiff() {
- this.isLoadingCollapsedDiff = true;
+ this.idState.isLoadingCollapsedDiff = true;
this.loadCollapsedDiff(this.file)
.then(() => {
- this.isLoadingCollapsedDiff = false;
+ this.idState.isLoadingCollapsedDiff = false;
this.setRenderIt(this.file);
})
.then(() => {
@@ -287,17 +285,27 @@ export default {
);
})
.catch(() => {
- this.isLoadingCollapsedDiff = false;
+ this.idState.isLoadingCollapsedDiff = false;
createFlash({
message: this.$options.i18n.genericError,
});
});
},
showForkMessage() {
- this.forkMessageVisible = true;
+ this.idState.forkMessageVisible = true;
},
hideForkMessage() {
- this.forkMessageVisible = false;
+ this.idState.forkMessageVisible = false;
+ },
+ handleAutomaticallyCollapsed(automaticValue) {
+ if (collapsedType(this.file) !== DIFF_FILE_MANUAL_COLLAPSE) {
+ this.idState.isCollapsed = this.viewDiffsFileByFile ? false : automaticValue;
+ }
+ },
+ handleManualChangeWatch(manualValue) {
+ if (manualValue !== null) {
+ this.idState.isCollapsed = manualValue;
+ }
},
},
};
@@ -320,7 +328,7 @@ export default {
:diff-file="file"
:collapsible="true"
:reviewed="reviewed"
- :expanded="!isCollapsed"
+ :expanded="!idState.isCollapsed"
:add-merge-request-buttons="true"
:view-diffs-file-by-file="viewDiffsFileByFile"
:show-local-file-reviews="showLocalFileReviews"
@@ -331,7 +339,10 @@ export default {
@showForkMessage="showForkMessage"
/>
- <div v-if="forkMessageVisible" class="js-file-fork-suggestion-section file-fork-suggestion">
+ <div
+ v-if="idState.forkMessageVisible"
+ class="js-file-fork-suggestion-section file-fork-suggestion"
+ >
<span v-safe-html="forkMessage" class="file-fork-suggestion-note"></span>
<a
:href="file.fork_path"
diff --git a/app/assets/javascripts/diffs/components/diff_file_header.vue b/app/assets/javascripts/diffs/components/diff_file_header.vue
index 45c7fe35f03..c83abb95198 100644
--- a/app/assets/javascripts/diffs/components/diff_file_header.vue
+++ b/app/assets/javascripts/diffs/components/diff_file_header.vue
@@ -13,6 +13,7 @@ import {
} from '@gitlab/ui';
import { escape } from 'lodash';
import { mapActions, mapGetters, mapState } from 'vuex';
+import { IdState } from 'vendor/vue-virtual-scroller';
import { diffViewerModes } from '~/ide/constants';
import { scrollToElement } from '~/lib/utils/common_utils';
import { truncateSha } from '~/lib/utils/text_utility';
@@ -47,7 +48,7 @@ export default {
GlTooltip: GlTooltipDirective,
SafeHtml: GlSafeHtmlDirective,
},
- mixins: [glFeatureFlagsMixin()],
+ mixins: [glFeatureFlagsMixin(), IdState({ idProp: (vm) => vm.diffFile.file_hash })],
i18n: {
...DIFF_FILE_HEADER,
compareButtonLabel: s__('Compare submodule commit revisions'),
@@ -102,7 +103,7 @@ export default {
default: () => [],
},
},
- data() {
+ idState() {
return {
moreActionsShown: false,
};
@@ -239,7 +240,7 @@ export default {
}
},
setMoreActionsShown(val) {
- this.moreActionsShown = val;
+ this.idState.moreActionsShown = val;
},
toggleReview(newReviewedStatus) {
const autoCollapsed =
@@ -268,7 +269,7 @@ export default {
<template>
<div
ref="header"
- :class="{ 'gl-z-dropdown-menu!': moreActionsShown }"
+ :class="{ 'gl-z-dropdown-menu!': idState.moreActionsShown }"
class="js-file-title file-title file-title-flex-parent"
data-qa-selector="file_title_container"
:data-qa-file-name="filePath"
diff --git a/app/assets/javascripts/diffs/components/diff_view.vue b/app/assets/javascripts/diffs/components/diff_view.vue
index aa3e415b264..485cddd50c0 100644
--- a/app/assets/javascripts/diffs/components/diff_view.vue
+++ b/app/assets/javascripts/diffs/components/diff_view.vue
@@ -1,5 +1,6 @@
<script>
import { mapGetters, mapState, mapActions } from 'vuex';
+import { IdState } from 'vendor/vue-virtual-scroller';
import DraftNote from '~/batch_comments/components/draft_note.vue';
import draftCommentsMixin from '~/diffs/mixins/draft_comments';
import { getCommentedLines } from '~/notes/components/multiline_comment_utils';
@@ -17,7 +18,11 @@ export default {
DiffCommentCell,
DraftNote,
},
- mixins: [draftCommentsMixin, glFeatureFlagsMixin()],
+ mixins: [
+ draftCommentsMixin,
+ glFeatureFlagsMixin(),
+ IdState({ idProp: (vm) => vm.diffFile.file_hash }),
+ ],
props: {
diffFile: {
type: Object,
@@ -38,7 +43,7 @@ export default {
default: false,
},
},
- data() {
+ idState() {
return {
dragStart: null,
updatedLineRange: null,
@@ -80,29 +85,29 @@ export default {
if (event.target?.parentNode) {
hide(event.target.parentNode);
}
- this.dragStart = line;
+ this.idState.dragStart = line;
},
onDragOver(line) {
- if (line.chunk !== this.dragStart.chunk) return;
+ if (line.chunk !== this.idState.dragStart.chunk) return;
- let start = this.dragStart;
+ let start = this.idState.dragStart;
let end = line;
- if (this.dragStart.index >= line.index) {
+ if (this.idState.dragStart.index >= line.index) {
start = line;
- end = this.dragStart;
+ end = this.idState.dragStart;
}
- this.updatedLineRange = { start, end };
+ this.idState.updatedLineRange = { start, end };
- this.setSelectedCommentPosition(this.updatedLineRange);
+ this.setSelectedCommentPosition(this.idState.updatedLineRange);
},
onStopDragging() {
this.showCommentForm({
- lineCode: this.updatedLineRange?.end?.line_code,
+ lineCode: this.idState.updatedLineRange?.end?.line_code,
fileHash: this.diffFile.file_hash,
});
- this.dragStart = null;
+ this.idState.dragStart = null;
},
isHighlighted(line) {
return isHighlighted(
diff --git a/app/assets/javascripts/sidebar/components/assignees/sidebar_assignees_widget.vue b/app/assets/javascripts/sidebar/components/assignees/sidebar_assignees_widget.vue
index d9a974202a3..1dd05d3886e 100644
--- a/app/assets/javascripts/sidebar/components/assignees/sidebar_assignees_widget.vue
+++ b/app/assets/javascripts/sidebar/components/assignees/sidebar_assignees_widget.vue
@@ -3,6 +3,7 @@ import { GlDropdownItem } from '@gitlab/ui';
import { cloneDeep } from 'lodash';
import Vue from 'vue';
import createFlash from '~/flash';
+import { getIdFromGraphQLId } from '~/graphql_shared/utils';
import { IssuableType } from '~/issue_show/constants';
import { __, n__ } from '~/locale';
import SidebarAssigneesRealtime from '~/sidebar/components/assignees/assignees_realtime.vue';
@@ -80,6 +81,8 @@ export default {
selected: [],
isSettingAssignees: false,
isDirty: false,
+ oldIid: null,
+ oldSelected: null,
};
},
apollo: {
@@ -142,6 +145,14 @@ export default {
return this.currentUser.username !== undefined;
},
},
+ watch: {
+ iid(_, oldIid) {
+ if (this.isDirty) {
+ this.oldIid = oldIid;
+ this.oldSelected = this.selected;
+ }
+ },
+ },
created() {
assigneesWidget.updateAssignees = this.updateAssignees;
},
@@ -157,10 +168,14 @@ export default {
variables: {
...this.queryVariables,
assigneeUsernames,
+ iid: this.oldIid || this.iid,
},
})
.then(({ data }) => {
- this.$emit('assignees-updated', data.issuableSetAssignees.issuable.assignees.nodes);
+ this.$emit('assignees-updated', {
+ id: getIdFromGraphQLId(data.issuableSetAssignees.issuable.id),
+ assignees: data.issuableSetAssignees.issuable.assignees.nodes,
+ });
return data;
})
.catch(() => {
@@ -176,7 +191,10 @@ export default {
saveAssignees() {
if (this.isDirty) {
this.isDirty = false;
- this.updateAssignees(this.selected.map(({ username }) => username));
+ const usernames = this.oldSelected || this.selected;
+ this.updateAssignees(usernames.map(({ username }) => username));
+ this.oldIid = null;
+ this.oldSelected = null;
}
this.$el.dispatchEvent(hideDropdownEvent);
},
diff --git a/app/models/namespace.rb b/app/models/namespace.rb
index fd835d0cf06..2d63c1e6ae0 100644
--- a/app/models/namespace.rb
+++ b/app/models/namespace.rb
@@ -279,9 +279,12 @@ class Namespace < ApplicationRecord
# Includes projects from this namespace and projects from all subgroups
# that belongs to this namespace
def all_projects
- namespace = user? ? self : self_and_descendant_ids
-
- Project.where(namespace: namespace)
+ if Feature.enabled?(:recursive_approach_for_all_projects, default_enabled: :yaml)
+ namespace = user? ? self : self_and_descendants
+ Project.where(namespace: namespace)
+ else
+ Project.inside_path(full_path)
+ end
end
def has_parent?
diff --git a/app/services/git/wiki_push_service/change.rb b/app/services/git/wiki_push_service/change.rb
index 9109a7f9d58..8fc821b59fc 100644
--- a/app/services/git/wiki_push_service/change.rb
+++ b/app/services/git/wiki_push_service/change.rb
@@ -66,7 +66,8 @@ module Git
def strip_extension(filename)
return unless filename
- File.basename(filename, File.extname(filename))
+ encoded_filename = Gitlab::EncodingHelper.encode_utf8(filename.dup)
+ File.basename(encoded_filename, File.extname(encoded_filename))
end
end
end
diff --git a/app/workers/gitlab/import/stuck_import_job.rb b/app/workers/gitlab/import/stuck_import_job.rb
index ac789ce1188..57fb3baf2b5 100644
--- a/app/workers/gitlab/import/stuck_import_job.rb
+++ b/app/workers/gitlab/import/stuck_import_job.rb
@@ -5,7 +5,7 @@ module Gitlab
module StuckImportJob
extend ActiveSupport::Concern
- IMPORT_JOBS_EXPIRATION = 15.hours.seconds.to_i
+ IMPORT_JOBS_EXPIRATION = 24.hours.seconds.to_i
included do
include ApplicationWorker
diff --git a/config/feature_flags/development/recursive_approach_for_all_projects.yml b/config/feature_flags/development/recursive_approach_for_all_projects.yml
new file mode 100644
index 00000000000..e2d656b7de2
--- /dev/null
+++ b/config/feature_flags/development/recursive_approach_for_all_projects.yml
@@ -0,0 +1,8 @@
+---
+name: recursive_approach_for_all_projects
+introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/64632
+rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/334817
+milestone: '14.1'
+type: development
+group: group::fulfillment
+default_enabled: true
diff --git a/config/metrics/counts_28d/20210201124930_deployments.yml b/config/metrics/counts_28d/20210201124930_deployments.yml
index 8fdc28d7ebb..ff6456731fe 100644
--- a/config/metrics/counts_28d/20210201124930_deployments.yml
+++ b/config/metrics/counts_28d/20210201124930_deployments.yml
@@ -1,5 +1,5 @@
---
-data_category: Optional
+data_category: Operational
key_path: counts_monthly.deployments
description: Total deployments count for recent 28 days
product_section: ops
diff --git a/config/metrics/counts_28d/20210216175016_analytics_total_unique_counts_monthly.yml b/config/metrics/counts_28d/20210216175016_analytics_total_unique_counts_monthly.yml
index 042d0ab84fe..195b5c2fed5 100644
--- a/config/metrics/counts_28d/20210216175016_analytics_total_unique_counts_monthly.yml
+++ b/config/metrics/counts_28d/20210216175016_analytics_total_unique_counts_monthly.yml
@@ -1,5 +1,5 @@
---
-data_category: Optional
+data_category: Operational
key_path: redis_hll_counters.analytics.analytics_total_unique_counts_monthly
description: The number of unique users who visited any analytics feature by month
product_section: dev
diff --git a/config/metrics/counts_28d/20210216175434_project_clusters_enabled.yml b/config/metrics/counts_28d/20210216175434_project_clusters_enabled.yml
index abb56390622..bac36e62664 100644
--- a/config/metrics/counts_28d/20210216175434_project_clusters_enabled.yml
+++ b/config/metrics/counts_28d/20210216175434_project_clusters_enabled.yml
@@ -1,5 +1,5 @@
---
-data_category: Optional
+data_category: Operational
key_path: usage_activity_by_stage_monthly.configure.project_clusters_enabled
description: Total GitLab Managed enabled clusters attached to projects
product_section: ops
diff --git a/config/metrics/counts_28d/20210216175616_user_dast_jobs.yml b/config/metrics/counts_28d/20210216175616_user_dast_jobs.yml
index 44c9ce38d1d..6b6503e8c34 100644
--- a/config/metrics/counts_28d/20210216175616_user_dast_jobs.yml
+++ b/config/metrics/counts_28d/20210216175616_user_dast_jobs.yml
@@ -1,5 +1,5 @@
---
-data_category: Optional
+data_category: Operational
key_path: usage_activity_by_stage_monthly.secure.user_dast_jobs
description: Users who run a DAST job
product_section: sec
diff --git a/config/metrics/counts_28d/20210216175618_dast_pipeline.yml b/config/metrics/counts_28d/20210216175618_dast_pipeline.yml
index 7ff8fa6589f..a6c78293691 100644
--- a/config/metrics/counts_28d/20210216175618_dast_pipeline.yml
+++ b/config/metrics/counts_28d/20210216175618_dast_pipeline.yml
@@ -1,5 +1,5 @@
---
-data_category: Optional
+data_category: Operational
key_path: usage_activity_by_stage_monthly.secure.dast_pipeline
description: Count of pipelines that have at least 1 DAST job
product_section: sec
diff --git a/config/metrics/counts_28d/20210216180355_user_api_fuzzing_jobs.yml b/config/metrics/counts_28d/20210216180355_user_api_fuzzing_jobs.yml
index 0f274f01654..aa02ce01a0d 100644
--- a/config/metrics/counts_28d/20210216180355_user_api_fuzzing_jobs.yml
+++ b/config/metrics/counts_28d/20210216180355_user_api_fuzzing_jobs.yml
@@ -1,5 +1,5 @@
---
-data_category: Optional
+data_category: Operational
key_path: usage_activity_by_stage_monthly.secure.user_api_fuzzing_jobs
description: Count of API Fuzzing jobs by job name
product_section: sec
diff --git a/config/metrics/counts_28d/20210216180357_user_api_fuzzing_dnd_jobs.yml b/config/metrics/counts_28d/20210216180357_user_api_fuzzing_dnd_jobs.yml
index b3635acbbd4..14d7fa1f83d 100644
--- a/config/metrics/counts_28d/20210216180357_user_api_fuzzing_dnd_jobs.yml
+++ b/config/metrics/counts_28d/20210216180357_user_api_fuzzing_dnd_jobs.yml
@@ -1,5 +1,5 @@
---
-data_category: Optional
+data_category: Operational
key_path: usage_activity_by_stage_monthly.secure.user_api_fuzzing_dnd_jobs
description: Count of API Fuzzing `docker-in-docker` jobs by job names
product_section: sec
diff --git a/config/metrics/counts_28d/20210216180622_incident_management_total_unique_counts_monthly.yml b/config/metrics/counts_28d/20210216180622_incident_management_total_unique_counts_monthly.yml
index 9a1e9d4236f..fe952b30f50 100644
--- a/config/metrics/counts_28d/20210216180622_incident_management_total_unique_counts_monthly.yml
+++ b/config/metrics/counts_28d/20210216180622_incident_management_total_unique_counts_monthly.yml
@@ -1,5 +1,5 @@
---
-data_category: Optional
+data_category: Operational
key_path: redis_hll_counters.incident_management.incident_management_total_unique_counts_monthly
description: Count of unique users performing events related with incidents per month
product_section: ops
diff --git a/config/metrics/counts_28d/20210216181148_service_desk_issues.yml b/config/metrics/counts_28d/20210216181148_service_desk_issues.yml
index 6af51468a06..0a8bc14a581 100644
--- a/config/metrics/counts_28d/20210216181148_service_desk_issues.yml
+++ b/config/metrics/counts_28d/20210216181148_service_desk_issues.yml
@@ -1,5 +1,5 @@
---
-data_category: Optional
+data_category: Operational
key_path: usage_activity_by_stage_monthly.plan.service_desk_issues
description:
product_section: dev
diff --git a/config/metrics/counts_28d/20210216181150_projects_jira_active.yml b/config/metrics/counts_28d/20210216181150_projects_jira_active.yml
index 0507f1eba21..60be7632ceb 100644
--- a/config/metrics/counts_28d/20210216181150_projects_jira_active.yml
+++ b/config/metrics/counts_28d/20210216181150_projects_jira_active.yml
@@ -1,5 +1,5 @@
---
-data_category: Optional
+data_category: Operational
key_path: usage_activity_by_stage_monthly.plan.projects_jira_active
description:
product_section: dev
diff --git a/config/metrics/counts_28d/20210216181152_projects_jira_dvcs_cloud_active.yml b/config/metrics/counts_28d/20210216181152_projects_jira_dvcs_cloud_active.yml
index 6b34e817467..bab2db5ad43 100644
--- a/config/metrics/counts_28d/20210216181152_projects_jira_dvcs_cloud_active.yml
+++ b/config/metrics/counts_28d/20210216181152_projects_jira_dvcs_cloud_active.yml
@@ -1,5 +1,5 @@
---
-data_category: Optional
+data_category: Operational
key_path: usage_activity_by_stage_monthly.plan.projects_jira_dvcs_cloud_active
description:
product_section: dev
diff --git a/config/metrics/counts_28d/20210216181154_projects_jira_dvcs_server_active.yml b/config/metrics/counts_28d/20210216181154_projects_jira_dvcs_server_active.yml
index 45de2088c47..0d9a42d3512 100644
--- a/config/metrics/counts_28d/20210216181154_projects_jira_dvcs_server_active.yml
+++ b/config/metrics/counts_28d/20210216181154_projects_jira_dvcs_server_active.yml
@@ -1,5 +1,5 @@
---
-data_category: Optional
+data_category: Operational
key_path: usage_activity_by_stage_monthly.plan.projects_jira_dvcs_server_active
description:
product_section: dev
diff --git a/config/metrics/counts_28d/20210216181323_g_project_management_issue_created_monthly.yml b/config/metrics/counts_28d/20210216181323_g_project_management_issue_created_monthly.yml
index 66a973f9bfd..1e1a93572a2 100644
--- a/config/metrics/counts_28d/20210216181323_g_project_management_issue_created_monthly.yml
+++ b/config/metrics/counts_28d/20210216181323_g_project_management_issue_created_monthly.yml
@@ -1,5 +1,5 @@
---
-data_category: Optional
+data_category: Operational
key_path: redis_hll_counters.issues_edit.g_project_management_issue_created_monthly
description: Count of MAU creating new issues
product_section: dev
diff --git a/config/metrics/counts_28d/20210216181326_g_project_management_issue_closed_monthly.yml b/config/metrics/counts_28d/20210216181326_g_project_management_issue_closed_monthly.yml
index a66b1bf8ded..c5f26b01f76 100644
--- a/config/metrics/counts_28d/20210216181326_g_project_management_issue_closed_monthly.yml
+++ b/config/metrics/counts_28d/20210216181326_g_project_management_issue_closed_monthly.yml
@@ -1,5 +1,5 @@
---
-data_category: Optional
+data_category: Operational
key_path: redis_hll_counters.issues_edit.g_project_management_issue_closed_monthly
description: Count of MAU closing an issue
product_section: dev
diff --git a/config/metrics/counts_28d/20210216181504_issues_edit_total_unique_counts_monthly.yml b/config/metrics/counts_28d/20210216181504_issues_edit_total_unique_counts_monthly.yml
index 5ea5120b063..f0234ca62a6 100644
--- a/config/metrics/counts_28d/20210216181504_issues_edit_total_unique_counts_monthly.yml
+++ b/config/metrics/counts_28d/20210216181504_issues_edit_total_unique_counts_monthly.yml
@@ -1,5 +1,5 @@
---
-data_category: Optional
+data_category: Operational
key_path: redis_hll_counters.issues_edit.issues_edit_total_unique_counts_monthly
description: Aggregate count of MAU taking an action related to an issue
product_section: dev
diff --git a/config/metrics/counts_28d/20210216181956_user_unique_users_all_secure_scanners.yml b/config/metrics/counts_28d/20210216181956_user_unique_users_all_secure_scanners.yml
index abececa5498..a1d2b955480 100644
--- a/config/metrics/counts_28d/20210216181956_user_unique_users_all_secure_scanners.yml
+++ b/config/metrics/counts_28d/20210216181956_user_unique_users_all_secure_scanners.yml
@@ -1,5 +1,5 @@
---
-data_category: Optional
+data_category: Operational
key_path: usage_activity_by_stage_monthly.secure.user_unique_users_all_secure_scanners
description:
product_section: sec
diff --git a/config/metrics/counts_28d/20210216182125_user_sast_jobs.yml b/config/metrics/counts_28d/20210216182125_user_sast_jobs.yml
index b5c0b9cdca0..1cac9649385 100644
--- a/config/metrics/counts_28d/20210216182125_user_sast_jobs.yml
+++ b/config/metrics/counts_28d/20210216182125_user_sast_jobs.yml
@@ -1,5 +1,5 @@
---
-data_category: Optional
+data_category: Operational
key_path: usage_activity_by_stage_monthly.secure.user_sast_jobs
description: Users who run a SAST job
product_section: sec
@@ -10,7 +10,6 @@ value_type: number
status: data_available
time_frame: 28d
data_source: database
-data_category: Optional
distribution:
- ce
- ee
diff --git a/config/metrics/counts_28d/20210216182127_user_secret_detection_jobs.yml b/config/metrics/counts_28d/20210216182127_user_secret_detection_jobs.yml
index f75099d7f9f..c1da3f76981 100644
--- a/config/metrics/counts_28d/20210216182127_user_secret_detection_jobs.yml
+++ b/config/metrics/counts_28d/20210216182127_user_secret_detection_jobs.yml
@@ -1,5 +1,5 @@
---
-data_category: Optional
+data_category: Operational
key_path: usage_activity_by_stage_monthly.secure.user_secret_detection_jobs
description: Users who run a Secret Detection job
product_section: sec
@@ -10,7 +10,6 @@ value_type: number
status: data_available
time_frame: 28d
data_source: database
-data_category: Optional
distribution:
- ce
- ee
diff --git a/config/metrics/counts_28d/20210216182129_sast_pipeline.yml b/config/metrics/counts_28d/20210216182129_sast_pipeline.yml
index 1e48c55771e..a340dc960d3 100644
--- a/config/metrics/counts_28d/20210216182129_sast_pipeline.yml
+++ b/config/metrics/counts_28d/20210216182129_sast_pipeline.yml
@@ -1,5 +1,5 @@
---
-data_category: Optional
+data_category: Operational
key_path: usage_activity_by_stage_monthly.secure.sast_pipeline
description: Counts of Pipelines that have at least 1 SAST job
product_section: sec
@@ -10,7 +10,6 @@ value_type: number
status: data_available
time_frame: 28d
data_source: database
-data_category: Optional
distribution:
- ce
- ee
diff --git a/config/metrics/counts_28d/20210216182131_secret_detection_pipeline.yml b/config/metrics/counts_28d/20210216182131_secret_detection_pipeline.yml
index 926597c3a7f..171a9696d12 100644
--- a/config/metrics/counts_28d/20210216182131_secret_detection_pipeline.yml
+++ b/config/metrics/counts_28d/20210216182131_secret_detection_pipeline.yml
@@ -1,5 +1,5 @@
---
-data_category: Optional
+data_category: Operational
key_path: usage_activity_by_stage_monthly.secure.secret_detection_pipeline
description: Counts of Pipelines that have at least 1 Secret Detection job
product_section: sec
@@ -10,7 +10,6 @@ value_type: number
status: data_available
time_frame: 28d
data_source: database
-data_category: Optional
distribution:
- ce
- ee
diff --git a/config/metrics/counts_28d/20210216183817_user_coverage_fuzzing_jobs.yml b/config/metrics/counts_28d/20210216183817_user_coverage_fuzzing_jobs.yml
index aed275aea85..a348b5a9717 100644
--- a/config/metrics/counts_28d/20210216183817_user_coverage_fuzzing_jobs.yml
+++ b/config/metrics/counts_28d/20210216183817_user_coverage_fuzzing_jobs.yml
@@ -1,5 +1,5 @@
---
-data_category: Optional
+data_category: Operational
key_path: usage_activity_by_stage_monthly.secure.user_coverage_fuzzing_jobs
description: ''
product_section: ''
diff --git a/config/metrics/counts_28d/20210216183826_sast_scans.yml b/config/metrics/counts_28d/20210216183826_sast_scans.yml
index ce7c330b9e6..9299f45041c 100644
--- a/config/metrics/counts_28d/20210216183826_sast_scans.yml
+++ b/config/metrics/counts_28d/20210216183826_sast_scans.yml
@@ -1,5 +1,5 @@
---
-data_category: Optional
+data_category: Operational
key_path: usage_activity_by_stage_monthly.secure.sast_scans
description: ''
product_section: ''
diff --git a/config/metrics/counts_28d/20210216183830_container_scanning_scans.yml b/config/metrics/counts_28d/20210216183830_container_scanning_scans.yml
index 50b63f70cb8..ca3d9284456 100644
--- a/config/metrics/counts_28d/20210216183830_container_scanning_scans.yml
+++ b/config/metrics/counts_28d/20210216183830_container_scanning_scans.yml
@@ -1,5 +1,5 @@
---
-data_category: Optional
+data_category: Operational
key_path: usage_activity_by_stage_monthly.secure.container_scanning_scans
description: ''
product_section: ''
diff --git a/config/metrics/counts_28d/20210216183832_dast_scans.yml b/config/metrics/counts_28d/20210216183832_dast_scans.yml
index e19a593148b..b83d5da0f9d 100644
--- a/config/metrics/counts_28d/20210216183832_dast_scans.yml
+++ b/config/metrics/counts_28d/20210216183832_dast_scans.yml
@@ -1,5 +1,5 @@
---
-data_category: Optional
+data_category: Operational
key_path: usage_activity_by_stage_monthly.secure.dast_scans
description: ''
product_section: ''
diff --git a/config/metrics/counts_28d/20210216183834_secret_detection_scans.yml b/config/metrics/counts_28d/20210216183834_secret_detection_scans.yml
index ce5b9f69eec..55e55c6b4a1 100644
--- a/config/metrics/counts_28d/20210216183834_secret_detection_scans.yml
+++ b/config/metrics/counts_28d/20210216183834_secret_detection_scans.yml
@@ -1,5 +1,5 @@
---
-data_category: Optional
+data_category: Operational
key_path: usage_activity_by_stage_monthly.secure.secret_detection_scans
description: ''
product_section: ''
diff --git a/config/metrics/counts_28d/20210216183836_coverage_fuzzing_scans.yml b/config/metrics/counts_28d/20210216183836_coverage_fuzzing_scans.yml
index 6da04ceb693..aac4dca0667 100644
--- a/config/metrics/counts_28d/20210216183836_coverage_fuzzing_scans.yml
+++ b/config/metrics/counts_28d/20210216183836_coverage_fuzzing_scans.yml
@@ -1,5 +1,5 @@
---
-data_category: Optional
+data_category: Operational
key_path: usage_activity_by_stage_monthly.secure.coverage_fuzzing_scans
description: ''
product_section: ''
diff --git a/config/metrics/counts_28d/20210216183838_api_fuzzing_scans.yml b/config/metrics/counts_28d/20210216183838_api_fuzzing_scans.yml
index 6e0a0781e17..8986ea82ac8 100644
--- a/config/metrics/counts_28d/20210216183838_api_fuzzing_scans.yml
+++ b/config/metrics/counts_28d/20210216183838_api_fuzzing_scans.yml
@@ -1,5 +1,5 @@
---
-data_category: Optional
+data_category: Operational
key_path: usage_activity_by_stage_monthly.secure.api_fuzzing_scans
description: ''
product_section: ''
diff --git a/config/metrics/counts_28d/20210216184259_p_terraform_state_api_unique_users_monthly.yml b/config/metrics/counts_28d/20210216184259_p_terraform_state_api_unique_users_monthly.yml
index 376a4801372..19c8fe52d3b 100644
--- a/config/metrics/counts_28d/20210216184259_p_terraform_state_api_unique_users_monthly.yml
+++ b/config/metrics/counts_28d/20210216184259_p_terraform_state_api_unique_users_monthly.yml
@@ -1,5 +1,5 @@
---
-data_category: Optional
+data_category: Operational
key_path: redis_hll_counters.terraform.p_terraform_state_api_unique_users_monthly
description: Monthly active users of GitLab Managed Terraform states
product_section: ops
diff --git a/config/metrics/counts_28d/20210216184937_user_packages_total_unique_counts_monthly.yml b/config/metrics/counts_28d/20210216184937_user_packages_total_unique_counts_monthly.yml
index f076ca149b2..826c7e660e6 100644
--- a/config/metrics/counts_28d/20210216184937_user_packages_total_unique_counts_monthly.yml
+++ b/config/metrics/counts_28d/20210216184937_user_packages_total_unique_counts_monthly.yml
@@ -1,5 +1,5 @@
---
-data_category: Optional
+data_category: Operational
key_path: redis_hll_counters.user_packages.user_packages_total_unique_counts_monthly
description: A monthly count of users that have published a package to the registry
product_section: ops
diff --git a/config/metrics/counts_all/20210204124930_servers.yml b/config/metrics/counts_all/20210204124930_servers.yml
index 59ca951c281..f17144ac78b 100644
--- a/config/metrics/counts_all/20210204124930_servers.yml
+++ b/config/metrics/counts_all/20210204124930_servers.yml
@@ -1,5 +1,5 @@
---
-data_category: Optional
+data_category: Operational
key_path: gitaly.servers
description: Total Gitalty Servers
product_section: growth
diff --git a/config/metrics/counts_all/20210204124932_clusters.yml b/config/metrics/counts_all/20210204124932_clusters.yml
index 02a9e3db564..2c59827cda0 100644
--- a/config/metrics/counts_all/20210204124932_clusters.yml
+++ b/config/metrics/counts_all/20210204124932_clusters.yml
@@ -1,5 +1,5 @@
---
-data_category: Optional
+data_category: Operational
key_path: gitaly.clusters
description: Total GitLab Managed clusters both enabled and disabled
product_section: growth
diff --git a/config/metrics/counts_all/20210216175026_service_desk_issues.yml b/config/metrics/counts_all/20210216175026_service_desk_issues.yml
index 9c435cf5fdb..769d817c5df 100644
--- a/config/metrics/counts_all/20210216175026_service_desk_issues.yml
+++ b/config/metrics/counts_all/20210216175026_service_desk_issues.yml
@@ -1,5 +1,5 @@
---
-data_category: Optional
+data_category: Operational
key_path: counts.service_desk_issues
description: Count of service desk issues
product_section: dev
diff --git a/config/metrics/counts_all/20210216175039_merge_requests.yml b/config/metrics/counts_all/20210216175039_merge_requests.yml
index 58eea5961f5..3f4d9c4a09e 100644
--- a/config/metrics/counts_all/20210216175039_merge_requests.yml
+++ b/config/metrics/counts_all/20210216175039_merge_requests.yml
@@ -1,5 +1,5 @@
---
-data_category: Optional
+data_category: Operational
key_path: counts.merge_requests
description: Count of the number of merge requests
product_section: dev
diff --git a/config/metrics/counts_all/20210216175312_clusters_applications_cilium.yml b/config/metrics/counts_all/20210216175312_clusters_applications_cilium.yml
index 6f2571e3710..5cdc7474bf5 100644
--- a/config/metrics/counts_all/20210216175312_clusters_applications_cilium.yml
+++ b/config/metrics/counts_all/20210216175312_clusters_applications_cilium.yml
@@ -1,5 +1,5 @@
---
-data_category: Optional
+data_category: Operational
key_path: counts.clusters_applications_cilium
description: Total GitLab Managed clusters with GitLab Managed App:Cilium installed
product_section: ops
diff --git a/config/metrics/counts_all/20210216175320_projects_with_terraform_reports.yml b/config/metrics/counts_all/20210216175320_projects_with_terraform_reports.yml
index 2d9ceed4c56..07322a58d15 100644
--- a/config/metrics/counts_all/20210216175320_projects_with_terraform_reports.yml
+++ b/config/metrics/counts_all/20210216175320_projects_with_terraform_reports.yml
@@ -1,5 +1,5 @@
---
-data_category: Optional
+data_category: Operational
key_path: counts.projects_with_terraform_reports
description: Count of projects with Terraform MR reports
product_section: ops
diff --git a/config/metrics/counts_all/20210216175322_projects_with_terraform_states.yml b/config/metrics/counts_all/20210216175322_projects_with_terraform_states.yml
index 140dbaad911..be0275883a8 100644
--- a/config/metrics/counts_all/20210216175322_projects_with_terraform_states.yml
+++ b/config/metrics/counts_all/20210216175322_projects_with_terraform_states.yml
@@ -1,5 +1,5 @@
---
-data_category: Optional
+data_category: Operational
key_path: counts.projects_with_terraform_states
description: Count of projects with GitLab Managed Terraform State
product_section: ops
diff --git a/config/metrics/counts_all/20210216175442_ingress_modsecurity_packets_processed.yml b/config/metrics/counts_all/20210216175442_ingress_modsecurity_packets_processed.yml
index 3f3d67c8468..c66cd726b7a 100644
--- a/config/metrics/counts_all/20210216175442_ingress_modsecurity_packets_processed.yml
+++ b/config/metrics/counts_all/20210216175442_ingress_modsecurity_packets_processed.yml
@@ -1,5 +1,5 @@
---
-data_category: Optional
+data_category: Operational
key_path: counts.ingress_modsecurity_packets_processed
description: Cumulative count of packets processed by ModSecurity since Usage Ping
was last reported
diff --git a/config/metrics/counts_all/20210216175444_ingress_modsecurity_packets_anomalous.yml b/config/metrics/counts_all/20210216175444_ingress_modsecurity_packets_anomalous.yml
index 68d10085870..1440f02342c 100644
--- a/config/metrics/counts_all/20210216175444_ingress_modsecurity_packets_anomalous.yml
+++ b/config/metrics/counts_all/20210216175444_ingress_modsecurity_packets_anomalous.yml
@@ -1,5 +1,5 @@
---
-data_category: Optional
+data_category: Operational
key_path: counts.ingress_modsecurity_packets_anomalous
description: Cumulative count of packets identified as anomalous by ModSecurity since
Usage Ping was last reported
diff --git a/config/metrics/counts_all/20210216175446_network_policy_forwards.yml b/config/metrics/counts_all/20210216175446_network_policy_forwards.yml
index 68e0646146d..c6a96626c70 100644
--- a/config/metrics/counts_all/20210216175446_network_policy_forwards.yml
+++ b/config/metrics/counts_all/20210216175446_network_policy_forwards.yml
@@ -1,5 +1,5 @@
---
-data_category: Optional
+data_category: Operational
key_path: counts.network_policy_forwards
description: Cumulative count of packets forwarded by Cilium (Container Network Security)
since Usage Ping was last reported
diff --git a/config/metrics/counts_all/20210216175448_network_policy_drops.yml b/config/metrics/counts_all/20210216175448_network_policy_drops.yml
index 175cd176b09..d7a53aca969 100644
--- a/config/metrics/counts_all/20210216175448_network_policy_drops.yml
+++ b/config/metrics/counts_all/20210216175448_network_policy_drops.yml
@@ -1,5 +1,5 @@
---
-data_category: Optional
+data_category: Operational
key_path: counts.network_policy_drops
description: Cumulative count of packets dropped by Cilium (Container Network Security)
since Usage Ping was last reported
diff --git a/config/metrics/counts_all/20210216175450_ingress_modsecurity_logging.yml b/config/metrics/counts_all/20210216175450_ingress_modsecurity_logging.yml
index 2f0c1ef7ed8..c4dc9186523 100644
--- a/config/metrics/counts_all/20210216175450_ingress_modsecurity_logging.yml
+++ b/config/metrics/counts_all/20210216175450_ingress_modsecurity_logging.yml
@@ -1,5 +1,5 @@
---
-data_category: Optional
+data_category: Operational
key_path: counts.ingress_modsecurity_logging
description: Whether or not ModSecurity is set to logging mode
product_section: sec
diff --git a/config/metrics/counts_all/20210216175452_ingress_modsecurity_blocking.yml b/config/metrics/counts_all/20210216175452_ingress_modsecurity_blocking.yml
index ded87a1272e..c2fc55031de 100644
--- a/config/metrics/counts_all/20210216175452_ingress_modsecurity_blocking.yml
+++ b/config/metrics/counts_all/20210216175452_ingress_modsecurity_blocking.yml
@@ -1,5 +1,5 @@
---
-data_category: Optional
+data_category: Operational
key_path: counts.ingress_modsecurity_blocking
description: Whether or not ModSecurity is set to blocking mode
product_section: sec
diff --git a/config/metrics/counts_all/20210216175454_ingress_modsecurity_disabled.yml b/config/metrics/counts_all/20210216175454_ingress_modsecurity_disabled.yml
index 136607eab26..2f1cb1aa55f 100644
--- a/config/metrics/counts_all/20210216175454_ingress_modsecurity_disabled.yml
+++ b/config/metrics/counts_all/20210216175454_ingress_modsecurity_disabled.yml
@@ -1,5 +1,5 @@
---
-data_category: Optional
+data_category: Operational
key_path: counts.ingress_modsecurity_disabled
description: Whether or not ModSecurity is disabled within Ingress
product_section: sec
diff --git a/config/metrics/counts_all/20210216175456_ingress_modsecurity_not_installed.yml b/config/metrics/counts_all/20210216175456_ingress_modsecurity_not_installed.yml
index 9530a993763..3331525f4b9 100644
--- a/config/metrics/counts_all/20210216175456_ingress_modsecurity_not_installed.yml
+++ b/config/metrics/counts_all/20210216175456_ingress_modsecurity_not_installed.yml
@@ -1,5 +1,5 @@
---
-data_category: Optional
+data_category: Operational
key_path: counts.ingress_modsecurity_not_installed
description: Whether or not ModSecurity has not been installed into the cluster
product_section: sec
diff --git a/config/metrics/counts_all/20210216175510_ci_builds.yml b/config/metrics/counts_all/20210216175510_ci_builds.yml
index aca8b1d1290..692b7aaead6 100644
--- a/config/metrics/counts_all/20210216175510_ci_builds.yml
+++ b/config/metrics/counts_all/20210216175510_ci_builds.yml
@@ -1,5 +1,5 @@
---
-data_category: Optional
+data_category: Operational
key_path: counts.ci_builds
description: Unique builds in project
product_section: ops
diff --git a/config/metrics/counts_all/20210216175512_ci_internal_pipelines.yml b/config/metrics/counts_all/20210216175512_ci_internal_pipelines.yml
index 87933eb686c..333cdb695f3 100644
--- a/config/metrics/counts_all/20210216175512_ci_internal_pipelines.yml
+++ b/config/metrics/counts_all/20210216175512_ci_internal_pipelines.yml
@@ -1,5 +1,5 @@
---
-data_category: Optional
+data_category: Operational
key_path: counts.ci_internal_pipelines
description: Total pipelines in GitLab repositories
product_section: ops
diff --git a/config/metrics/counts_all/20210216175514_ci_external_pipelines.yml b/config/metrics/counts_all/20210216175514_ci_external_pipelines.yml
index 5736f89369f..25421f724d6 100644
--- a/config/metrics/counts_all/20210216175514_ci_external_pipelines.yml
+++ b/config/metrics/counts_all/20210216175514_ci_external_pipelines.yml
@@ -1,5 +1,5 @@
---
-data_category: Optional
+data_category: Operational
key_path: counts.ci_external_pipelines
description: Total pipelines in external repositories
product_section: ops
diff --git a/config/metrics/counts_all/20210216175612_dast_jobs.yml b/config/metrics/counts_all/20210216175612_dast_jobs.yml
index 449350ae6f1..d0156f1f3c8 100644
--- a/config/metrics/counts_all/20210216175612_dast_jobs.yml
+++ b/config/metrics/counts_all/20210216175612_dast_jobs.yml
@@ -1,5 +1,5 @@
---
-data_category: Optional
+data_category: Operational
key_path: counts.dast_jobs
description: Count of DAST jobs run
product_section: sec
diff --git a/config/metrics/counts_all/20210216175614_user_dast_jobs.yml b/config/metrics/counts_all/20210216175614_user_dast_jobs.yml
index 02bb0a95125..2670cb4b8fe 100644
--- a/config/metrics/counts_all/20210216175614_user_dast_jobs.yml
+++ b/config/metrics/counts_all/20210216175614_user_dast_jobs.yml
@@ -1,5 +1,5 @@
---
-data_category: Optional
+data_category: Operational
key_path: usage_activity_by_stage.secure.user_dast_jobs
description: Count of DAST jobs
product_section: sec
diff --git a/config/metrics/counts_all/20210216175645_projects_bamboo_active.yml b/config/metrics/counts_all/20210216175645_projects_bamboo_active.yml
index ce1cf9ddace..cc9f74c7415 100644
--- a/config/metrics/counts_all/20210216175645_projects_bamboo_active.yml
+++ b/config/metrics/counts_all/20210216175645_projects_bamboo_active.yml
@@ -1,5 +1,5 @@
---
-data_category: Optional
+data_category: Operational
key_path: counts.projects_bamboo_active
description: Count of projects with active integrations for Bamboo CI
product_section: dev
diff --git a/config/metrics/counts_all/20210216175804_projects_drone_ci_active.yml b/config/metrics/counts_all/20210216175804_projects_drone_ci_active.yml
index 0d9f2a8a1c2..73c20fe6c7f 100644
--- a/config/metrics/counts_all/20210216175804_projects_drone_ci_active.yml
+++ b/config/metrics/counts_all/20210216175804_projects_drone_ci_active.yml
@@ -1,5 +1,5 @@
---
-data_category: Optional
+data_category: Operational
key_path: counts.projects_drone_ci_active
description: Count of projects with active integrations for Drone CI
product_section: dev
diff --git a/config/metrics/counts_all/20210216175932_projects_jenkins_active.yml b/config/metrics/counts_all/20210216175932_projects_jenkins_active.yml
index 0d75ad60268..b294ccfec1b 100644
--- a/config/metrics/counts_all/20210216175932_projects_jenkins_active.yml
+++ b/config/metrics/counts_all/20210216175932_projects_jenkins_active.yml
@@ -1,5 +1,5 @@
---
-data_category: Optional
+data_category: Operational
key_path: counts.projects_jenkins_active
description: Count of projects with active integrations for Jenkins
product_section: dev
diff --git a/config/metrics/counts_all/20210216175943_projects_jira_active.yml b/config/metrics/counts_all/20210216175943_projects_jira_active.yml
index f97ee2b04f1..77437903f5b 100644
--- a/config/metrics/counts_all/20210216175943_projects_jira_active.yml
+++ b/config/metrics/counts_all/20210216175943_projects_jira_active.yml
@@ -1,5 +1,5 @@
---
-data_category: Optional
+data_category: Operational
key_path: counts.projects_jira_active
description: Count of projects with active integrations for Jira
product_section: dev
diff --git a/config/metrics/counts_all/20210216180228_projects_jira_server_active.yml b/config/metrics/counts_all/20210216180228_projects_jira_server_active.yml
index fb87a3398ca..5cee8c3bf73 100644
--- a/config/metrics/counts_all/20210216180228_projects_jira_server_active.yml
+++ b/config/metrics/counts_all/20210216180228_projects_jira_server_active.yml
@@ -1,5 +1,5 @@
---
-data_category: Optional
+data_category: Operational
key_path: counts.projects_jira_server_active
description: Count of active integrations with Jira Software (server)
product_section: dev
diff --git a/config/metrics/counts_all/20210216180230_projects_jira_cloud_active.yml b/config/metrics/counts_all/20210216180230_projects_jira_cloud_active.yml
index 8a2f4699779..b0c17d0593a 100644
--- a/config/metrics/counts_all/20210216180230_projects_jira_cloud_active.yml
+++ b/config/metrics/counts_all/20210216180230_projects_jira_cloud_active.yml
@@ -1,5 +1,5 @@
---
-data_category: Optional
+data_category: Operational
key_path: counts.projects_jira_cloud_active
description: Count of active integrations with Jira Cloud (Saas)
product_section: dev
diff --git a/config/metrics/counts_all/20210216180232_projects_jira_dvcs_cloud_active.yml b/config/metrics/counts_all/20210216180232_projects_jira_dvcs_cloud_active.yml
index b4f9c70b4e7..0e25660ce50 100644
--- a/config/metrics/counts_all/20210216180232_projects_jira_dvcs_cloud_active.yml
+++ b/config/metrics/counts_all/20210216180232_projects_jira_dvcs_cloud_active.yml
@@ -1,5 +1,5 @@
---
-data_category: Optional
+data_category: Operational
key_path: counts.projects_jira_dvcs_cloud_active
description: Count of active integrations with Jira Cloud (DVCS Connector)
product_section: dev
diff --git a/config/metrics/counts_all/20210216180234_projects_jira_dvcs_server_active.yml b/config/metrics/counts_all/20210216180234_projects_jira_dvcs_server_active.yml
index d9c5c6134fd..41c2de3e50d 100644
--- a/config/metrics/counts_all/20210216180234_projects_jira_dvcs_server_active.yml
+++ b/config/metrics/counts_all/20210216180234_projects_jira_dvcs_server_active.yml
@@ -1,5 +1,5 @@
---
-data_category: Optional
+data_category: Operational
key_path: counts.projects_jira_dvcs_server_active
description: Count of active integrations with Jira Software (DVCS connector)
product_section: dev
diff --git a/config/metrics/counts_all/20210216180348_user_api_fuzzing_jobs.yml b/config/metrics/counts_all/20210216180348_user_api_fuzzing_jobs.yml
index 6b65fdb17e6..58fba247d3f 100644
--- a/config/metrics/counts_all/20210216180348_user_api_fuzzing_jobs.yml
+++ b/config/metrics/counts_all/20210216180348_user_api_fuzzing_jobs.yml
@@ -1,5 +1,5 @@
---
-data_category: Optional
+data_category: Operational
key_path: usage_activity_by_stage.secure.user_api_fuzzing_jobs
description: Count of API Fuzzing jobs by job name
product_section: sec
diff --git a/config/metrics/counts_all/20210216180350_user_api_fuzzing_dnd_jobs.yml b/config/metrics/counts_all/20210216180350_user_api_fuzzing_dnd_jobs.yml
index 2c67a918e7d..417ea83e182 100644
--- a/config/metrics/counts_all/20210216180350_user_api_fuzzing_dnd_jobs.yml
+++ b/config/metrics/counts_all/20210216180350_user_api_fuzzing_dnd_jobs.yml
@@ -1,5 +1,5 @@
---
-data_category: Optional
+data_category: Operational
key_path: usage_activity_by_stage.secure.user_api_fuzzing_dnd_jobs
description: Count of API Fuzzing `docker-in-docker` jobs by job name
product_section: sec
diff --git a/config/metrics/counts_all/20210216180628_projects_imported_from_github.yml b/config/metrics/counts_all/20210216180628_projects_imported_from_github.yml
index f9ae15e7c89..d3e4c6a4ee0 100644
--- a/config/metrics/counts_all/20210216180628_projects_imported_from_github.yml
+++ b/config/metrics/counts_all/20210216180628_projects_imported_from_github.yml
@@ -1,5 +1,5 @@
---
-data_category: Optional
+data_category: Operational
key_path: counts.projects_imported_from_github
description:
product_section: dev
diff --git a/config/metrics/counts_all/20210216180654_jira.yml b/config/metrics/counts_all/20210216180654_jira.yml
index 2fe43e1b471..fe94597bbea 100644
--- a/config/metrics/counts_all/20210216180654_jira.yml
+++ b/config/metrics/counts_all/20210216180654_jira.yml
@@ -1,5 +1,5 @@
---
-data_category: Optional
+data_category: Operational
key_path: usage_activity_by_stage.manage.issue_imports.jira
description: Count of projects imported from Jira
product_section: dev
diff --git a/config/metrics/counts_all/20210216181102_issues.yml b/config/metrics/counts_all/20210216181102_issues.yml
index 5ba83036fae..b35585c5573 100644
--- a/config/metrics/counts_all/20210216181102_issues.yml
+++ b/config/metrics/counts_all/20210216181102_issues.yml
@@ -1,5 +1,5 @@
---
-data_category: Optional
+data_category: Operational
key_path: counts.issues
description: Count of Issues created
product_section: dev
diff --git a/config/metrics/counts_all/20210216181115_issues.yml b/config/metrics/counts_all/20210216181115_issues.yml
index 31fb798b4fc..da840704e26 100644
--- a/config/metrics/counts_all/20210216181115_issues.yml
+++ b/config/metrics/counts_all/20210216181115_issues.yml
@@ -1,5 +1,5 @@
---
-data_category: Optional
+data_category: Operational
key_path: usage_activity_by_stage.plan.issues
description: Count of users creating Issues
product_section: dev
diff --git a/config/metrics/counts_all/20210216181134_epics.yml b/config/metrics/counts_all/20210216181134_epics.yml
index 3643a5f14c3..8b87f64a4e1 100644
--- a/config/metrics/counts_all/20210216181134_epics.yml
+++ b/config/metrics/counts_all/20210216181134_epics.yml
@@ -1,5 +1,5 @@
---
-data_category: Optional
+data_category: Operational
key_path: usage_activity_by_stage.plan.epics
description:
product_section: dev
diff --git a/config/metrics/counts_all/20210216181254_projects.yml b/config/metrics/counts_all/20210216181254_projects.yml
index b8b678c4138..4892e8ae9a5 100644
--- a/config/metrics/counts_all/20210216181254_projects.yml
+++ b/config/metrics/counts_all/20210216181254_projects.yml
@@ -1,5 +1,5 @@
---
-data_category: Optional
+data_category: Operational
key_path: counts.projects
description: Count of Projects created
product_section: dev
diff --git a/config/metrics/counts_all/20210216181256_todos.yml b/config/metrics/counts_all/20210216181256_todos.yml
index 647a014070e..25cf4edcf60 100644
--- a/config/metrics/counts_all/20210216181256_todos.yml
+++ b/config/metrics/counts_all/20210216181256_todos.yml
@@ -1,5 +1,5 @@
---
-data_category: Optional
+data_category: Operational
key_path: counts.todos
description: Count of todos created
product_section: dev
diff --git a/config/metrics/counts_all/20210216181954_user_unique_users_all_secure_scanners.yml b/config/metrics/counts_all/20210216181954_user_unique_users_all_secure_scanners.yml
index b5c5ed10672..39fc30c9153 100644
--- a/config/metrics/counts_all/20210216181954_user_unique_users_all_secure_scanners.yml
+++ b/config/metrics/counts_all/20210216181954_user_unique_users_all_secure_scanners.yml
@@ -1,5 +1,5 @@
---
-data_category: Optional
+data_category: Operational
key_path: usage_activity_by_stage.secure.user_unique_users_all_secure_scanners
description:
product_section: sec
diff --git a/config/metrics/counts_all/20210216182002_remote_mirrors.yml b/config/metrics/counts_all/20210216182002_remote_mirrors.yml
index 1a644d04d92..608e1648872 100644
--- a/config/metrics/counts_all/20210216182002_remote_mirrors.yml
+++ b/config/metrics/counts_all/20210216182002_remote_mirrors.yml
@@ -1,5 +1,5 @@
---
-data_category: Optional
+data_category: Operational
key_path: counts.remote_mirrors
description: Count of total remote mirrors. Includes both push and pull mirrors
product_section: dev
diff --git a/config/metrics/counts_all/20210216182112_sast_jobs.yml b/config/metrics/counts_all/20210216182112_sast_jobs.yml
index e2a4af8d1b5..9813ac4051a 100644
--- a/config/metrics/counts_all/20210216182112_sast_jobs.yml
+++ b/config/metrics/counts_all/20210216182112_sast_jobs.yml
@@ -1,5 +1,5 @@
---
-data_category: Optional
+data_category: Operational
key_path: counts.sast_jobs
description: Count of SAST CI jobs for the month. Job names ending in '-sast'
product_section: sec
@@ -10,7 +10,6 @@ value_type: number
status: data_available
time_frame: all
data_source: database
-data_category: Optional
distribution:
- ce
- ee
diff --git a/config/metrics/counts_all/20210216182114_secret_detection_jobs.yml b/config/metrics/counts_all/20210216182114_secret_detection_jobs.yml
index 993945b0d1c..2203501bdb0 100644
--- a/config/metrics/counts_all/20210216182114_secret_detection_jobs.yml
+++ b/config/metrics/counts_all/20210216182114_secret_detection_jobs.yml
@@ -1,5 +1,5 @@
---
-data_category: Optional
+data_category: Operational
key_path: counts.secret_detection_jobs
description: Count of all 'secret-detection' CI jobs.
product_section: sec
@@ -10,7 +10,6 @@ value_type: number
status: data_available
time_frame: all
data_source: database
-data_category: Optional
distribution:
- ce
- ee
diff --git a/config/metrics/counts_all/20210216182116_user_sast_jobs.yml b/config/metrics/counts_all/20210216182116_user_sast_jobs.yml
index 48caa2e0e97..d10010cff4f 100644
--- a/config/metrics/counts_all/20210216182116_user_sast_jobs.yml
+++ b/config/metrics/counts_all/20210216182116_user_sast_jobs.yml
@@ -1,5 +1,5 @@
---
-data_category: Optional
+data_category: Operational
key_path: usage_activity_by_stage.secure.user_sast_jobs
description: Count of SAST jobs per user
product_section: sec
@@ -10,7 +10,6 @@ value_type: number
status: data_available
time_frame: all
data_source: database
-data_category: Optional
distribution:
- ce
- ee
diff --git a/config/metrics/counts_all/20210216182118_user_secret_detection_jobs.yml b/config/metrics/counts_all/20210216182118_user_secret_detection_jobs.yml
index 68f463042cc..3711f1591c9 100644
--- a/config/metrics/counts_all/20210216182118_user_secret_detection_jobs.yml
+++ b/config/metrics/counts_all/20210216182118_user_secret_detection_jobs.yml
@@ -1,5 +1,5 @@
---
-data_category: Optional
+data_category: Operational
key_path: usage_activity_by_stage.secure.user_secret_detection_jobs
description: Count of Secret Detection Jobs per user
product_section: sec
@@ -10,7 +10,6 @@ value_type: number
status: data_available
time_frame: all
data_source: database
-data_category: Optional
distribution:
- ce
- ee
diff --git a/config/metrics/counts_all/20210216183514_user_coverage_fuzzing_jobs.yml b/config/metrics/counts_all/20210216183514_user_coverage_fuzzing_jobs.yml
index 4a41246c947..014e6f16623 100644
--- a/config/metrics/counts_all/20210216183514_user_coverage_fuzzing_jobs.yml
+++ b/config/metrics/counts_all/20210216183514_user_coverage_fuzzing_jobs.yml
@@ -1,5 +1,5 @@
---
-data_category: Optional
+data_category: Operational
key_path: usage_activity_by_stage.secure.user_coverage_fuzzing_jobs
description: ''
product_section: ''
diff --git a/config/metrics/license/20210204124928_version.yml b/config/metrics/license/20210204124928_version.yml
index 5c34c0ae146..8323f5ea760 100644
--- a/config/metrics/license/20210204124928_version.yml
+++ b/config/metrics/license/20210204124928_version.yml
@@ -1,5 +1,5 @@
---
-data_category: Optional
+data_category: Operational
key_path: gitaly.version
description: Version of Gitaly
product_section: growth
diff --git a/config/metrics/license/20210216183237_version.yml b/config/metrics/license/20210216183237_version.yml
index d25ec6ac08a..33dc3c38a9c 100644
--- a/config/metrics/license/20210216183237_version.yml
+++ b/config/metrics/license/20210216183237_version.yml
@@ -1,5 +1,5 @@
---
-data_category: Optional
+data_category: Operational
key_path: git.version
description: Information about Git version
product_section: enablement
diff --git a/config/metrics/settings/20210216175459_ingress_modsecurity_enabled.yml b/config/metrics/settings/20210216175459_ingress_modsecurity_enabled.yml
index 6cde08e1983..603064a301d 100644
--- a/config/metrics/settings/20210216175459_ingress_modsecurity_enabled.yml
+++ b/config/metrics/settings/20210216175459_ingress_modsecurity_enabled.yml
@@ -1,5 +1,5 @@
---
-data_category: Optional
+data_category: Operational
key_path: ingress_modsecurity_enabled
description: Whether or not ModSecurity is enabled within Ingress
product_section: sec
diff --git a/doc/api/job_artifacts.md b/doc/api/job_artifacts.md
index 156fda9acae..5e2312891ef 100644
--- a/doc/api/job_artifacts.md
+++ b/doc/api/job_artifacts.md
@@ -70,7 +70,7 @@ is the same as [getting the job's artifacts](#get-job-artifacts), but by
defining the job's name instead of its ID.
NOTE:
-If a pipeline is [parent of other child pipelines](../ci/parent_child_pipelines.md), artifacts
+If a pipeline is [parent of other child pipelines](../ci/pipelines/parent_child_pipelines.md), artifacts
are searched in hierarchical order from parent to child. For example, if both parent and
child pipelines have a job with the same name, the artifact from the parent pipeline is returned.
@@ -172,7 +172,7 @@ pipeline for the given reference name from inside the job's artifacts archive.
The file is extracted from the archive and streamed to the client.
In [GitLab 13.5](https://gitlab.com/gitlab-org/gitlab/-/issues/201784) and later, artifacts
-for [parent and child pipelines](../ci/parent_child_pipelines.md) are searched in hierarchical
+for [parent and child pipelines](../ci/pipelines/parent_child_pipelines.md) are searched in hierarchical
order from parent to child. For example, if both parent and child pipelines have a
job with the same name, the artifact from the parent pipeline is returned.
diff --git a/doc/api/jobs.md b/doc/api/jobs.md
index 890ca03a473..42774b80b27 100644
--- a/doc/api/jobs.md
+++ b/doc/api/jobs.md
@@ -295,7 +295,7 @@ Example of response
```
In GitLab 13.3 and later, this endpoint [returns data for any pipeline](pipelines.md#single-pipeline-requests)
-including [child pipelines](../ci/parent_child_pipelines.md).
+including [child pipelines](../ci/pipelines/parent_child_pipelines.md).
In GitLab 13.5 and later, this endpoint does not return retried jobs in the response
by default. Additionally, jobs are sorted by ID in descending order (newest first).
diff --git a/doc/api/pipelines.md b/doc/api/pipelines.md
index 9e5889a7554..7d433923865 100644
--- a/doc/api/pipelines.md
+++ b/doc/api/pipelines.md
@@ -11,7 +11,7 @@ info: To determine the technical writer assigned to the Stage/Group associated w
> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/36494) in GitLab 13.3.
Endpoints that request information about a single pipeline return data for any pipeline.
-Before 13.3, requests for [child pipelines](../ci/parent_child_pipelines.md) returned
+Before 13.3, requests for [child pipelines](../ci/pipelines/parent_child_pipelines.md) returned
a 404 error.
## Pipelines pagination
diff --git a/doc/ci/environments/deployment_safety.md b/doc/ci/environments/deployment_safety.md
index f8aa179b881..beb820a1da9 100644
--- a/doc/ci/environments/deployment_safety.md
+++ b/doc/ci/environments/deployment_safety.md
@@ -129,7 +129,7 @@ All project maintainers have access to production secrets. If you need to limit
that can deploy to a production environment, you can create a separate project and configure a new
permission model that isolates the CD permissions from the original project and prevents the
original project's maintainers from accessing the production secret and CD configuration. You can
-connect the CD project to your development projects by using [multi-project pipelines](../multi_project_pipelines.md).
+connect the CD project to your development projects by using [multi-project pipelines](../pipelines/multi_project_pipelines.md).
## Protect `gitlab-ci.yml` from change
diff --git a/doc/ci/jobs/job_control.md b/doc/ci/jobs/job_control.md
index 03aad57b57d..634214aedc3 100644
--- a/doc/ci/jobs/job_control.md
+++ b/doc/ci/jobs/job_control.md
@@ -221,8 +221,8 @@ check the value of the `$CI_PIPELINE_SOURCE` variable:
| `external` | When you use CI services other than GitLab. |
| `external_pull_request_event` | When an external pull request on GitHub is created or updated. See [Pipelines for external pull requests](../ci_cd_for_external_repos/index.md#pipelines-for-external-pull-requests). |
| `merge_request_event` | For pipelines created when a merge request is created or updated. Required to enable [merge request pipelines](../pipelines/merge_request_pipelines.md), [merged results pipelines](../pipelines/pipelines_for_merged_results.md), and [merge trains](../pipelines/merge_trains.md). |
-| `parent_pipeline` | For pipelines triggered by a [parent/child pipeline](../parent_child_pipelines.md) with `rules`. Use this pipeline source in the child pipeline configuration so that it can be triggered by the parent pipeline. |
-| `pipeline` | For [multi-project pipelines](../multi_project_pipelines.md) created by [using the API with `CI_JOB_TOKEN`](../multi_project_pipelines.md#create-multi-project-pipelines-by-using-the-api), or the [`trigger`](../yaml/index.md#trigger) keyword. |
+| `parent_pipeline` | For pipelines triggered by a [parent/child pipeline](../pipelines/parent_child_pipelines.md) with `rules`. Use this pipeline source in the child pipeline configuration so that it can be triggered by the parent pipeline. |
+| `pipeline` | For [multi-project pipelines](../pipelines/multi_project_pipelines.md) created by [using the API with `CI_JOB_TOKEN`](../pipelines/multi_project_pipelines.md#create-multi-project-pipelines-by-using-the-api), or the [`trigger`](../yaml/index.md#trigger) keyword. |
| `push` | For pipelines triggered by a `git push` event, including for branches and tags. |
| `schedule` | For [scheduled pipelines](../pipelines/schedules.md). |
| `trigger` | For pipelines created by using a [trigger token](../triggers/index.md#trigger-token). |
diff --git a/doc/ci/multi_project_pipelines.md b/doc/ci/multi_project_pipelines.md
index ba3bb4d870c..06cbf63e512 100644
--- a/doc/ci/multi_project_pipelines.md
+++ b/doc/ci/multi_project_pipelines.md
@@ -1,314 +1,8 @@
---
-stage: Verify
-group: Pipeline Authoring
-info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#assignments
-type: reference
+redirect_to: 'pipelines/multi_project_pipelines.md'
---
-# Multi-project pipelines **(FREE)**
+This document was moved to [another location](pipelines/multi_project_pipelines.md).
-> [Moved](https://gitlab.com/gitlab-org/gitlab/-/issues/199224) to GitLab Free in 12.8.
-
-You can set up [GitLab CI/CD](index.md) across multiple projects, so that a pipeline
-in one project can trigger a pipeline in another project. You can visualize the entire pipeline
-in one place, including all cross-project interdependencies.
-
-For example, you might deploy your web application from three different projects in GitLab.
-Each project has its own build, test, and deploy process. With multi-project pipelines you can
-visualize the entire pipeline, including all build and test stages for all three projects.
-
-<i class="fa fa-youtube-play youtube" aria-hidden="true"></i>
-For an overview, see the [Multi-project pipelines demo](https://www.youtube.com/watch?v=g_PIwBM1J84).
-
-Multi-project pipelines are also useful for larger products that require cross-project interdependencies, like those
-with a [microservices architecture](https://about.gitlab.com/blog/2016/08/16/trends-in-version-control-land-microservices/).
-Learn more in the [Cross-project Pipeline Triggering and Visualization demo](https://about.gitlab.com/learn/)
-at GitLab@learn, in the Continuous Integration section.
-
-If you trigger a pipeline in a downstream private project, on the upstream project's pipelines page,
-you can view:
-
-- The name of the project.
-- The status of the pipeline.
-
-If you have a public project that can trigger downstream pipelines in a private project,
-make sure there are no confidentiality problems.
-
-## Create multi-project pipelines
-
-To create multi-project pipelines, you can:
-
-- [Define them in your `.gitlab-ci.yml` file](#define-multi-project-pipelines-in-your-gitlab-ciyml-file).
-- [Use the API](#create-multi-project-pipelines-by-using-the-api).
-
-### Define multi-project pipelines in your `.gitlab-ci.yml` file
-
-> [Moved](https://gitlab.com/gitlab-org/gitlab/-/issues/199224) to GitLab Free in 12.8.
-
-When you create a multi-project pipeline in your `.gitlab-ci.yml` file,
-you create what is called a *trigger job*. For example:
-
-```yaml
-rspec:
- stage: test
- script: bundle exec rspec
-
-staging:
- variables:
- ENVIRONMENT: staging
- stage: deploy
- trigger: my/deployment
-```
-
-In this example, after the `rspec` job succeeds in the `test` stage,
-the `staging` trigger job starts. The initial status of this
-job is `pending`.
-
-GitLab then creates a downstream pipeline in the
-`my/deployment` project and, as soon as the pipeline is created, the
-`staging` job succeeds. The full path to the project is `my/deployment`.
-
-You can view the status for the pipeline, or you can display
-[the downstream pipeline's status instead](#mirror-status-of-a-triggered-pipeline-in-the-trigger-job).
-
-The user that creates the upstream pipeline must be able to create pipelines in the
-downstream project (`my/deployment`) too. If the downstream project is not found,
-or the user does not have [permission](../user/permissions.md) to create a pipeline there,
-the `staging` job is marked as _failed_.
-
-#### Trigger job configuration keywords
-
-Trigger jobs can use only a limited set of the GitLab CI/CD [configuration keywords](yaml/index.md).
-The keywords available for use in trigger jobs are:
-
-- [`trigger`](yaml/index.md#trigger)
-- [`stage`](yaml/index.md#stage)
-- [`allow_failure`](yaml/index.md#allow_failure)
-- [`rules`](yaml/index.md#rules)
-- [`only` and `except`](yaml/index.md#only--except)
-- [`when`](yaml/index.md#when) (only with a value of `on_success`, `on_failure`, or `always`)
-- [`extends`](yaml/index.md#extends)
-- [`needs`](yaml/index.md#needs)
-
-#### Specify a downstream pipeline branch
-
-You can specify a branch name for the downstream pipeline to use.
-GitLab uses the commit on the head of the branch to
-create the downstream pipeline.
-
-```yaml
-rspec:
- stage: test
- script: bundle exec rspec
-
-staging:
- stage: deploy
- trigger:
- project: my/deployment
- branch: stable-11-2
-```
-
-Use:
-
-- The `project` keyword to specify the full path to a downstream project.
-- The `branch` keyword to specify the name of a branch in the project specified by `project`.
- [In GitLab 12.4](https://gitlab.com/gitlab-org/gitlab/-/issues/10126) and later, variable expansion is
- supported.
-
-Pipelines triggered on a protected branch in a downstream project use the [role](../user/permissions.md)
-of the user that ran the trigger job in the upstream project. If the user does not
-have permission to run CI/CD pipelines against the protected branch, the pipeline fails. See
-[pipeline security for protected branches](pipelines/index.md#pipeline-security-on-protected-branches).
-
-#### Pass CI/CD variables to a downstream pipeline by using the `variables` keyword
-
-Sometimes you might want to pass CI/CD variables to a downstream pipeline.
-You can do that by using the `variables` keyword, just like you would for any other job.
-
-```yaml
-rspec:
- stage: test
- script: bundle exec rspec
-
-staging:
- variables:
- ENVIRONMENT: staging
- stage: deploy
- trigger: my/deployment
-```
-
-The `ENVIRONMENT` variable is passed to every job defined in a downstream
-pipeline. It is available as a variable when GitLab Runner picks a job.
-
-In the following configuration, the `MY_VARIABLE` variable is passed to the downstream pipeline
-that is created when the `trigger-downstream` job is queued. This is because `trigger-downstream`
-job inherits variables declared in global variables blocks, and then we pass these variables to a downstream pipeline.
-
-```yaml
-variables:
- MY_VARIABLE: my-value
-
-trigger-downstream:
- variables:
- ENVIRONMENT: something
- trigger: my/project
-```
-
-You might want to pass some information about the upstream pipeline using, for
-example, predefined variables. In order to do that, you can use interpolation
-to pass any variable. For example:
-
-```yaml
-downstream-job:
- variables:
- UPSTREAM_BRANCH: $CI_COMMIT_REF_NAME
- trigger: my/project
-```
-
-In this scenario, the `UPSTREAM_BRANCH` variable with a value related to the
-upstream pipeline is passed to the `downstream-job` job. It is available
-in the context of all downstream builds.
-
-Upstream pipelines take precedence over downstream ones. If there are two
-variables with the same name defined in both upstream and downstream projects,
-the ones defined in the upstream project take precedence.
-
-#### Pass CI/CD variables to a downstream pipeline by using variable inheritance
-
-You can pass variables to a downstream pipeline with [`dotenv` variable inheritance](variables/index.md#pass-an-environment-variable-to-another-job) and [cross project artifact downloads](yaml/index.md#cross-project-artifact-downloads-with-needs).
-
-In the upstream pipeline:
-
-1. Save the variables in a `.env` file.
-1. Save the `.env` file as a `dotenv` report.
-1. Trigger the downstream pipeline.
-
- ```yaml
- build_vars:
- stage: build
- script:
- - echo "BUILD_VERSION=hello" >> build.env
- artifacts:
- reports:
- dotenv: build.env
-
- deploy:
- stage: deploy
- trigger: my/downstream_project
- ```
-
-1. Set the `test` job in the downstream pipeline to inherit the variables from the `build_vars`
- job in the upstream project with `needs:`. The `test` job inherits the variables in the
- `dotenv` report and it can access `BUILD_VERSION` in the script:
-
- ```yaml
- test:
- stage: test
- script:
- - echo $BUILD_VERSION
- needs:
- - project: my/upstream_project
- job: build_vars
- ref: master
- artifacts: true
- ```
-
-#### Use `rules` or `only`/`except` with multi-project pipelines
-
-You can use CI/CD variables or the [`rules`](yaml/index.md#rulesif) keyword to
-[control job behavior](jobs/job_control.md) for multi-project pipelines. When a
-downstream pipeline is triggered with the [`trigger`](yaml/index.md#trigger) keyword,
-the value of the [`$CI_PIPELINE_SOURCE` predefined variable](variables/predefined_variables.md)
-is `pipeline` for all its jobs.
-
-If you use [`only/except`](yaml/index.md#only--except) to control job behavior, use the
-[`pipelines`](yaml/index.md#onlyrefs--exceptrefs) keyword.
-
-#### Mirror status of a triggered pipeline in the trigger job
-
-> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/11238) in GitLab Premium 12.3.
-> - [Moved](https://gitlab.com/gitlab-org/gitlab/-/issues/199224) to GitLab Free in 12.8.
-
-You can mirror the pipeline status from the triggered pipeline to the source
-trigger job by using `strategy: depend`. For example:
-
-```yaml
-trigger_job:
- trigger:
- project: my/project
- strategy: depend
-```
-
-#### Mirror status from upstream pipeline
-
-You can mirror the pipeline status from an upstream pipeline to a bridge job by
-using the `needs:pipeline` keyword. The latest pipeline status from the default branch is
-replicated to the bridge job.
-
-For example:
-
-```yaml
-upstream_bridge:
- stage: test
- needs:
- pipeline: other/project
-```
-
-### Create multi-project pipelines by using the API
-
-> [Moved](https://gitlab.com/gitlab-org/gitlab/-/issues/31573) to GitLab Free in 12.4.
-
-When you use the [`CI_JOB_TOKEN` to trigger pipelines](triggers/index.md#ci-job-token),
-GitLab recognizes the source of the job token. The pipelines become related,
-so you can visualize their relationships on pipeline graphs.
-
-These relationships are displayed in the pipeline graph by showing inbound and
-outbound connections for upstream and downstream pipeline dependencies.
-
-When using:
-
-- CI/CD variables or [`rules`](yaml/index.md#rulesif) to control job behavior, the value of
- the [`$CI_PIPELINE_SOURCE` predefined variable](variables/predefined_variables.md) is
- `pipeline` for multi-project pipeline triggered through the API with `CI_JOB_TOKEN`.
-- [`only/except`](yaml/index.md#only--except) to control job behavior, use the
- `pipelines` keyword.
-
-## Trigger a pipeline when an upstream project is rebuilt **(PREMIUM)**
-
-> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/9045) in GitLab Premium 12.8.
-
-You can trigger a pipeline in your project whenever a pipeline finishes for a new
-tag in a different project.
-
-Prerequisites:
-
-- The upstream project must be [public](../public_access/public_access.md).
-- The user must have the [Developer role](../user/permissions.md#project-members-permissions)
- in the upstream project.
-
-To trigger the pipeline when the upstream project is rebuilt:
-
-1. On the top bar, select **Menu > Projects** and find your project.
-1. On the left sidebar, select **Settings > CI/CD** page.
-1. Expand the **Pipeline subscriptions** section.
-1. Enter the project you want to subscribe to, in the format `<namespace>/<project>`.
- For example, if the project is `https://gitlab.com/gitlab-org/gitlab`, use `gitlab-org/gitlab`.
-1. Select **Subscribe**.
-
-Any pipelines that complete successfully for new tags in the subscribed project
-now trigger a pipeline on the current project's default branch. The maximum
-number of upstream pipeline subscriptions is 2 by default, for both the upstream and
-downstream projects. On self-managed instances, an administrator can change this
-[limit](../administration/instance_limits.md#number-of-cicd-subscriptions-to-a-project).
-
-## Multi-project pipeline visualization **(PREMIUM)**
-
-When you configure GitLab CI/CD for your project, you can visualize the stages of your
-[jobs](pipelines/index.md#configure-a-pipeline) on a [pipeline graph](pipelines/index.md#visualize-pipelines).
-
-![Multi-project pipeline graph](img/multi_project_pipeline_graph.png)
-
-In the merge request, on the **Pipelines** tab, multi-project pipeline mini-graphs are displayed.
-They expand and are shown adjacent to each other when hovering (or tapping on touchscreen devices).
-
-![Multi-project mini graph](img/multi_pipeline_mini_graph.gif)
+<!-- This redirect file can be deleted after 2021-09-29. -->
+<!-- Before deletion, see: https://docs.gitlab.com/ee/development/documentation/#move-or-rename-a-page -->
diff --git a/doc/ci/parent_child_pipelines.md b/doc/ci/parent_child_pipelines.md
index ee4e7e65b0e..0b8df2e9f4c 100644
--- a/doc/ci/parent_child_pipelines.md
+++ b/doc/ci/parent_child_pipelines.md
@@ -1,192 +1,8 @@
---
-stage: Verify
-group: Pipeline Execution
-info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#assignments
-type: reference
+redirect_to: 'pipelines/parent_child_pipelines.md'
---
-# Parent-child pipelines **(FREE)**
+This document was moved to [another location](pipelines/parent_child_pipelines.md).
-> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/16094) in GitLab 12.7.
-
-As pipelines grow more complex, a few related problems start to emerge:
-
-- The staged structure, where all steps in a stage must be completed before the first
- job in next stage begins, causes arbitrary waits, slowing things down.
-- Configuration for the single global pipeline becomes very long and complicated,
- making it hard to manage.
-- Imports with [`include`](yaml/index.md#include) increase the complexity of the configuration, and create the potential
- for namespace collisions where jobs are unintentionally duplicated.
-- Pipeline UX can become unwieldy with so many jobs and stages to work with.
-
-Additionally, sometimes the behavior of a pipeline needs to be more dynamic. The ability
-to choose to start sub-pipelines (or not) is a powerful ability, especially if the
-YAML is dynamically generated.
-
-![Parent pipeline graph expanded](img/parent_pipeline_graph_expanded_v12_6.png)
-
-Similarly to [multi-project pipelines](multi_project_pipelines.md), a pipeline can trigger a
-set of concurrently running child pipelines, but within the same project:
-
-- Child pipelines still execute each of their jobs according to a stage sequence, but
- would be free to continue forward through their stages without waiting for unrelated
- jobs in the parent pipeline to finish.
-- The configuration is split up into smaller child pipeline configurations, which are
- easier to understand. This reduces the cognitive load to understand the overall configuration.
-- Imports are done at the child pipeline level, reducing the likelihood of collisions.
-- Each pipeline has only relevant steps, making it easier to understand what's going on.
-
-Child pipelines work well with other GitLab CI/CD features:
-
-- Use [`rules: changes`](yaml/index.md#ruleschanges) to trigger pipelines only when
- certain files change. This is useful for monorepos, for example.
-- Since the parent pipeline in `.gitlab-ci.yml` and the child pipeline run as normal
- pipelines, they can have their own behaviors and sequencing in relation to triggers.
-
-See the [`trigger:`](yaml/index.md#trigger) keyword documentation for full details on how to
-include the child pipeline configuration.
-
-<i class="fa fa-youtube-play youtube" aria-hidden="true"></i>
-For an overview, see [Parent-Child Pipelines feature demo](https://youtu.be/n8KpBSqZNbk).
-
-## Examples
-
-The simplest case is [triggering a child pipeline](yaml/index.md#trigger) using a
-local YAML file to define the pipeline configuration. In this case, the parent pipeline
-triggers the child pipeline, and continues without waiting:
-
-```yaml
-microservice_a:
- trigger:
- include: path/to/microservice_a.yml
-```
-
-You can include multiple files when composing a child pipeline:
-
-```yaml
-microservice_a:
- trigger:
- include:
- - local: path/to/microservice_a.yml
- - template: Security/SAST.gitlab-ci.yml
-```
-
-In [GitLab 13.5](https://gitlab.com/gitlab-org/gitlab/-/issues/205157) and later,
-you can use [`include:file`](yaml/index.md#includefile) to trigger child pipelines
-with a configuration file in a different project:
-
-```yaml
-microservice_a:
- trigger:
- include:
- - project: 'my-group/my-pipeline-library'
- file: 'path/to/ci-config.yml'
-```
-
-The maximum number of entries that are accepted for `trigger:include:` is three.
-
-Similar to [multi-project pipelines](multi_project_pipelines.md#mirror-status-of-a-triggered-pipeline-in-the-trigger-job),
-we can set the parent pipeline to depend on the status of the child pipeline upon completion:
-
-```yaml
-microservice_a:
- trigger:
- include:
- - local: path/to/microservice_a.yml
- - template: Security/SAST.gitlab-ci.yml
- strategy: depend
-```
-
-## Merge Request child pipelines
-
-To trigger a child pipeline as a [Merge Request Pipeline](pipelines/merge_request_pipelines.md) we need to:
-
-- Set the trigger job to run on merge requests:
-
-```yaml
-# parent .gitlab-ci.yml
-microservice_a:
- trigger:
- include: path/to/microservice_a.yml
- rules:
- - if: $CI_MERGE_REQUEST_ID
-```
-
-- Configure the child pipeline by either:
-
- - Setting all jobs in the child pipeline to evaluate in the context of a merge request:
-
- ```yaml
- # child path/to/microservice_a.yml
- workflow:
- rules:
- - if: $CI_MERGE_REQUEST_ID
-
- job1:
- script: ...
-
- job2:
- script: ...
- ```
-
- - Alternatively, setting the rule per job. For example, to create only `job1` in
- the context of merge request pipelines:
-
- ```yaml
- # child path/to/microservice_a.yml
- job1:
- script: ...
- rules:
- - if: $CI_MERGE_REQUEST_ID
-
- job2:
- script: ...
- ```
-
-## Dynamic child pipelines
-
-> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/35632) in GitLab 12.9.
-
-Instead of running a child pipeline from a static YAML file, you can define a job that runs
-your own script to generate a YAML file, which is then [used to trigger a child pipeline](yaml/index.md#trigger-child-pipeline-with-generated-configuration-file).
-
-This technique can be very powerful in generating pipelines targeting content that changed or to
-build a matrix of targets and architectures.
-
-<i class="fa fa-youtube-play youtube" aria-hidden="true"></i>
-For an overview, see [Create child pipelines using dynamically generated configurations](https://youtu.be/nMdfus2JWHM).
-
-<!-- vale gitlab.Spelling = NO -->
-We also have an example project using
-[Dynamic Child Pipelines with Jsonnet](https://gitlab.com/gitlab-org/project-templates/jsonnet)
-which shows how to use a data templating language to generate your `.gitlab-ci.yml` at runtime. You could use a similar process for other templating languages like [Dhall](https://dhall-lang.org/) or [`ytt`](https://get-ytt.io/).
-<!-- vale gitlab.Spelling = NO -->
-
-The artifact path is parsed by GitLab, not the runner, so the path must match the
-syntax for the OS running GitLab. If GitLab is running on Linux but using a Windows
-runner for testing, the path separator for the trigger job would be `/`. Other CI/CD
-configuration for jobs, like scripts, that use the Windows runner would use `\`.
-
-In GitLab 12.9, the child pipeline could fail to be created in certain cases, causing the parent pipeline to fail.
-This is [resolved in GitLab 12.10](https://gitlab.com/gitlab-org/gitlab/-/issues/209070).
-
-## Nested child pipelines
-
-> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/29651) in GitLab 13.4.
-> - [Feature flag removed](https://gitlab.com/gitlab-org/gitlab/-/issues/243747) in GitLab 13.5.
-
-Parent and child pipelines were introduced with a maximum depth of one level of child
-pipelines, which was later increased to two. A parent pipeline can trigger many child
-pipelines, and these child pipelines can trigger their own child pipelines. It's not
-possible to trigger another level of child pipelines.
-
-<i class="fa fa-youtube-play youtube" aria-hidden="true"></i>
-For an overview, see [Nested Dynamic Pipelines](https://youtu.be/C5j3ju9je2M).
-
-## Pass CI/CD variables to a child pipeline
-
-You can pass CI/CD variables to a downstream pipeline using the same methods as
-multi-project pipelines:
-
-- [By using the `variable` keyword](multi_project_pipelines.md#pass-cicd-variables-to-a-downstream-pipeline-by-using-the-variables-keyword).
-- [By using variable inheritance](multi_project_pipelines.md#pass-cicd-variables-to-a-downstream-pipeline-by-using-variable-inheritance).
+<!-- This redirect file can be deleted after 2021-09-29. -->
+<!-- Before deletion, see: https://docs.gitlab.com/ee/development/documentation/#move-or-rename-a-page -->
diff --git a/doc/ci/img/multi_pipeline_mini_graph.gif b/doc/ci/pipelines/img/multi_pipeline_mini_graph.gif
index de49ba5aa12..de49ba5aa12 100644
--- a/doc/ci/img/multi_pipeline_mini_graph.gif
+++ b/doc/ci/pipelines/img/multi_pipeline_mini_graph.gif
Binary files differ
diff --git a/doc/ci/img/multi_project_pipeline_graph.png b/doc/ci/pipelines/img/multi_project_pipeline_graph.png
index 723a455cb4a..723a455cb4a 100644
--- a/doc/ci/img/multi_project_pipeline_graph.png
+++ b/doc/ci/pipelines/img/multi_project_pipeline_graph.png
Binary files differ
diff --git a/doc/ci/img/parent_pipeline_graph_expanded_v12_6.png b/doc/ci/pipelines/img/parent_pipeline_graph_expanded_v12_6.png
index db18cc201fc..db18cc201fc 100644
--- a/doc/ci/img/parent_pipeline_graph_expanded_v12_6.png
+++ b/doc/ci/pipelines/img/parent_pipeline_graph_expanded_v12_6.png
Binary files differ
diff --git a/doc/ci/pipelines/index.md b/doc/ci/pipelines/index.md
index 621ad4a60d9..feba310bf8f 100644
--- a/doc/ci/pipelines/index.md
+++ b/doc/ci/pipelines/index.md
@@ -50,8 +50,8 @@ Pipelines can be configured in many different ways:
followed by the next stage.
- [Directed Acyclic Graph Pipeline (DAG) pipelines](../directed_acyclic_graph/index.md) are based on relationships
between jobs and can run more quickly than basic pipelines.
-- [Multi-project pipelines](../multi_project_pipelines.md) combine pipelines for different projects together.
-- [Parent-Child pipelines](../parent_child_pipelines.md) break down complex pipelines
+- [Multi-project pipelines](multi_project_pipelines.md) combine pipelines for different projects together.
+- [Parent-Child pipelines](parent_child_pipelines.md) break down complex pipelines
into one parent pipeline that can trigger multiple child sub-pipelines, which all
run in the same project and with the same SHA.
- [Pipelines for Merge Requests](../pipelines/merge_request_pipelines.md) run for merge
@@ -349,7 +349,7 @@ You can group the jobs by:
- [Job dependencies](#view-job-dependencies-in-the-pipeline-graph), which arranges
jobs based on their [`needs`](../yaml/index.md#needs) dependencies.
-[Multi-project pipeline graphs](../multi_project_pipelines.md#multi-project-pipeline-visualization) help
+[Multi-project pipeline graphs](multi_project_pipelines.md#multi-project-pipeline-visualization) help
you visualize the entire pipeline, including all cross-project inter-dependencies. **(PREMIUM)**
### View job dependencies in the pipeline graph
diff --git a/doc/ci/pipelines/job_artifacts.md b/doc/ci/pipelines/job_artifacts.md
index eed30648b75..b9a42c76293 100644
--- a/doc/ci/pipelines/job_artifacts.md
+++ b/doc/ci/pipelines/job_artifacts.md
@@ -112,7 +112,7 @@ the artifact.
## How searching for job artifacts works
In [GitLab 13.5](https://gitlab.com/gitlab-org/gitlab/-/issues/201784) and later, artifacts
-for [parent and child pipelines](../parent_child_pipelines.md) are searched in hierarchical
+for [parent and child pipelines](parent_child_pipelines.md) are searched in hierarchical
order from parent to child. For example, if both parent and child pipelines have a
job with the same name, the job artifact from the parent pipeline is returned.
diff --git a/doc/ci/pipelines/multi_project_pipelines.md b/doc/ci/pipelines/multi_project_pipelines.md
new file mode 100644
index 00000000000..52939e75d4c
--- /dev/null
+++ b/doc/ci/pipelines/multi_project_pipelines.md
@@ -0,0 +1,314 @@
+---
+stage: Verify
+group: Pipeline Authoring
+info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#assignments
+type: reference
+---
+
+# Multi-project pipelines **(FREE)**
+
+> [Moved](https://gitlab.com/gitlab-org/gitlab/-/issues/199224) to GitLab Free in 12.8.
+
+You can set up [GitLab CI/CD](../index.md) across multiple projects, so that a pipeline
+in one project can trigger a pipeline in another project. You can visualize the entire pipeline
+in one place, including all cross-project interdependencies.
+
+For example, you might deploy your web application from three different projects in GitLab.
+Each project has its own build, test, and deploy process. With multi-project pipelines you can
+visualize the entire pipeline, including all build and test stages for all three projects.
+
+<i class="fa fa-youtube-play youtube" aria-hidden="true"></i>
+For an overview, see the [Multi-project pipelines demo](https://www.youtube.com/watch?v=g_PIwBM1J84).
+
+Multi-project pipelines are also useful for larger products that require cross-project interdependencies, like those
+with a [microservices architecture](https://about.gitlab.com/blog/2016/08/16/trends-in-version-control-land-microservices/).
+Learn more in the [Cross-project Pipeline Triggering and Visualization demo](https://about.gitlab.com/learn/)
+at GitLab@learn, in the Continuous Integration section.
+
+If you trigger a pipeline in a downstream private project, on the upstream project's pipelines page,
+you can view:
+
+- The name of the project.
+- The status of the pipeline.
+
+If you have a public project that can trigger downstream pipelines in a private project,
+make sure there are no confidentiality problems.
+
+## Create multi-project pipelines
+
+To create multi-project pipelines, you can:
+
+- [Define them in your `.gitlab-ci.yml` file](#define-multi-project-pipelines-in-your-gitlab-ciyml-file).
+- [Use the API](#create-multi-project-pipelines-by-using-the-api).
+
+### Define multi-project pipelines in your `.gitlab-ci.yml` file
+
+> [Moved](https://gitlab.com/gitlab-org/gitlab/-/issues/199224) to GitLab Free in 12.8.
+
+When you create a multi-project pipeline in your `.gitlab-ci.yml` file,
+you create what is called a *trigger job*. For example:
+
+```yaml
+rspec:
+ stage: test
+ script: bundle exec rspec
+
+staging:
+ variables:
+ ENVIRONMENT: staging
+ stage: deploy
+ trigger: my/deployment
+```
+
+In this example, after the `rspec` job succeeds in the `test` stage,
+the `staging` trigger job starts. The initial status of this
+job is `pending`.
+
+GitLab then creates a downstream pipeline in the
+`my/deployment` project and, as soon as the pipeline is created, the
+`staging` job succeeds. The full path to the project is `my/deployment`.
+
+You can view the status for the pipeline, or you can display
+[the downstream pipeline's status instead](#mirror-status-of-a-triggered-pipeline-in-the-trigger-job).
+
+The user that creates the upstream pipeline must be able to create pipelines in the
+downstream project (`my/deployment`) too. If the downstream project is not found,
+or the user does not have [permission](../../user/permissions.md) to create a pipeline there,
+the `staging` job is marked as _failed_.
+
+#### Trigger job configuration keywords
+
+Trigger jobs can use only a limited set of the GitLab CI/CD [configuration keywords](../yaml/index.md).
+The keywords available for use in trigger jobs are:
+
+- [`trigger`](../yaml/index.md#trigger)
+- [`stage`](../yaml/index.md#stage)
+- [`allow_failure`](../yaml/index.md#allow_failure)
+- [`rules`](../yaml/index.md#rules)
+- [`only` and `except`](../yaml/index.md#only--except)
+- [`when`](../yaml/index.md#when) (only with a value of `on_success`, `on_failure`, or `always`)
+- [`extends`](../yaml/index.md#extends)
+- [`needs`](../yaml/index.md#needs)
+
+#### Specify a downstream pipeline branch
+
+You can specify a branch name for the downstream pipeline to use.
+GitLab uses the commit on the head of the branch to
+create the downstream pipeline.
+
+```yaml
+rspec:
+ stage: test
+ script: bundle exec rspec
+
+staging:
+ stage: deploy
+ trigger:
+ project: my/deployment
+ branch: stable-11-2
+```
+
+Use:
+
+- The `project` keyword to specify the full path to a downstream project.
+- The `branch` keyword to specify the name of a branch in the project specified by `project`.
+ [In GitLab 12.4](https://gitlab.com/gitlab-org/gitlab/-/issues/10126) and later, variable expansion is
+ supported.
+
+Pipelines triggered on a protected branch in a downstream project use the [role](../../user/permissions.md)
+of the user that ran the trigger job in the upstream project. If the user does not
+have permission to run CI/CD pipelines against the protected branch, the pipeline fails. See
+[pipeline security for protected branches](index.md#pipeline-security-on-protected-branches).
+
+#### Pass CI/CD variables to a downstream pipeline by using the `variables` keyword
+
+Sometimes you might want to pass CI/CD variables to a downstream pipeline.
+You can do that by using the `variables` keyword, just like you would for any other job.
+
+```yaml
+rspec:
+ stage: test
+ script: bundle exec rspec
+
+staging:
+ variables:
+ ENVIRONMENT: staging
+ stage: deploy
+ trigger: my/deployment
+```
+
+The `ENVIRONMENT` variable is passed to every job defined in a downstream
+pipeline. It is available as a variable when GitLab Runner picks a job.
+
+In the following configuration, the `MY_VARIABLE` variable is passed to the downstream pipeline
+that is created when the `trigger-downstream` job is queued. This is because `trigger-downstream`
+job inherits variables declared in global variables blocks, and then we pass these variables to a downstream pipeline.
+
+```yaml
+variables:
+ MY_VARIABLE: my-value
+
+trigger-downstream:
+ variables:
+ ENVIRONMENT: something
+ trigger: my/project
+```
+
+You might want to pass some information about the upstream pipeline using, for
+example, predefined variables. In order to do that, you can use interpolation
+to pass any variable. For example:
+
+```yaml
+downstream-job:
+ variables:
+ UPSTREAM_BRANCH: $CI_COMMIT_REF_NAME
+ trigger: my/project
+```
+
+In this scenario, the `UPSTREAM_BRANCH` variable with a value related to the
+upstream pipeline is passed to the `downstream-job` job. It is available
+in the context of all downstream builds.
+
+Upstream pipelines take precedence over downstream ones. If there are two
+variables with the same name defined in both upstream and downstream projects,
+the ones defined in the upstream project take precedence.
+
+#### Pass CI/CD variables to a downstream pipeline by using variable inheritance
+
+You can pass variables to a downstream pipeline with [`dotenv` variable inheritance](../variables/index.md#pass-an-environment-variable-to-another-job) and [cross project artifact downloads](../yaml/index.md#cross-project-artifact-downloads-with-needs).
+
+In the upstream pipeline:
+
+1. Save the variables in a `.env` file.
+1. Save the `.env` file as a `dotenv` report.
+1. Trigger the downstream pipeline.
+
+ ```yaml
+ build_vars:
+ stage: build
+ script:
+ - echo "BUILD_VERSION=hello" >> build.env
+ artifacts:
+ reports:
+ dotenv: build.env
+
+ deploy:
+ stage: deploy
+ trigger: my/downstream_project
+ ```
+
+1. Set the `test` job in the downstream pipeline to inherit the variables from the `build_vars`
+ job in the upstream project with `needs:`. The `test` job inherits the variables in the
+ `dotenv` report and it can access `BUILD_VERSION` in the script:
+
+ ```yaml
+ test:
+ stage: test
+ script:
+ - echo $BUILD_VERSION
+ needs:
+ - project: my/upstream_project
+ job: build_vars
+ ref: master
+ artifacts: true
+ ```
+
+#### Use `rules` or `only`/`except` with multi-project pipelines
+
+You can use CI/CD variables or the [`rules`](../yaml/index.md#rulesif) keyword to
+[control job behavior](../jobs/job_control.md) for multi-project pipelines. When a
+downstream pipeline is triggered with the [`trigger`](../yaml/index.md#trigger) keyword,
+the value of the [`$CI_PIPELINE_SOURCE` predefined variable](../variables/predefined_variables.md)
+is `pipeline` for all its jobs.
+
+If you use [`only/except`](../yaml/index.md#only--except) to control job behavior, use the
+[`pipelines`](../yaml/index.md#onlyrefs--exceptrefs) keyword.
+
+#### Mirror status of a triggered pipeline in the trigger job
+
+> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/11238) in GitLab Premium 12.3.
+> - [Moved](https://gitlab.com/gitlab-org/gitlab/-/issues/199224) to GitLab Free in 12.8.
+
+You can mirror the pipeline status from the triggered pipeline to the source
+trigger job by using `strategy: depend`. For example:
+
+```yaml
+trigger_job:
+ trigger:
+ project: my/project
+ strategy: depend
+```
+
+#### Mirror status from upstream pipeline
+
+You can mirror the pipeline status from an upstream pipeline to a bridge job by
+using the `needs:pipeline` keyword. The latest pipeline status from the default branch is
+replicated to the bridge job.
+
+For example:
+
+```yaml
+upstream_bridge:
+ stage: test
+ needs:
+ pipeline: other/project
+```
+
+### Create multi-project pipelines by using the API
+
+> [Moved](https://gitlab.com/gitlab-org/gitlab/-/issues/31573) to GitLab Free in 12.4.
+
+When you use the [`CI_JOB_TOKEN` to trigger pipelines](../triggers/index.md#ci-job-token),
+GitLab recognizes the source of the job token. The pipelines become related,
+so you can visualize their relationships on pipeline graphs.
+
+These relationships are displayed in the pipeline graph by showing inbound and
+outbound connections for upstream and downstream pipeline dependencies.
+
+When using:
+
+- CI/CD variables or [`rules`](../yaml/index.md#rulesif) to control job behavior, the value of
+ the [`$CI_PIPELINE_SOURCE` predefined variable](../variables/predefined_variables.md) is
+ `pipeline` for multi-project pipeline triggered through the API with `CI_JOB_TOKEN`.
+- [`only/except`](../yaml/index.md#only--except) to control job behavior, use the
+ `pipelines` keyword.
+
+## Trigger a pipeline when an upstream project is rebuilt **(PREMIUM)**
+
+> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/9045) in GitLab Premium 12.8.
+
+You can trigger a pipeline in your project whenever a pipeline finishes for a new
+tag in a different project.
+
+Prerequisites:
+
+- The upstream project must be [public](../../public_access/public_access.md).
+- The user must have the [Developer role](../../user/permissions.md#project-members-permissions)
+ in the upstream project.
+
+To trigger the pipeline when the upstream project is rebuilt:
+
+1. On the top bar, select **Menu > Projects** and find your project.
+1. On the left sidebar, select **Settings > CI/CD** page.
+1. Expand the **Pipeline subscriptions** section.
+1. Enter the project you want to subscribe to, in the format `<namespace>/<project>`.
+ For example, if the project is `https://gitlab.com/gitlab-org/gitlab`, use `gitlab-org/gitlab`.
+1. Select **Subscribe**.
+
+Any pipelines that complete successfully for new tags in the subscribed project
+now trigger a pipeline on the current project's default branch. The maximum
+number of upstream pipeline subscriptions is 2 by default, for both the upstream and
+downstream projects. On self-managed instances, an administrator can change this
+[limit](../../administration/instance_limits.md#number-of-cicd-subscriptions-to-a-project).
+
+## Multi-project pipeline visualization **(PREMIUM)**
+
+When you configure GitLab CI/CD for your project, you can visualize the stages of your
+[jobs](index.md#configure-a-pipeline) on a [pipeline graph](index.md#visualize-pipelines).
+
+![Multi-project pipeline graph](img/multi_project_pipeline_graph.png)
+
+In the merge request, on the **Pipelines** tab, multi-project pipeline mini-graphs are displayed.
+They expand and are shown adjacent to each other when hovering (or tapping on touchscreen devices).
+
+![Multi-project mini graph](img/multi_pipeline_mini_graph.gif)
diff --git a/doc/ci/pipelines/parent_child_pipelines.md b/doc/ci/pipelines/parent_child_pipelines.md
new file mode 100644
index 00000000000..2e29f4fe812
--- /dev/null
+++ b/doc/ci/pipelines/parent_child_pipelines.md
@@ -0,0 +1,192 @@
+---
+stage: Verify
+group: Pipeline Authoring
+info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#assignments
+type: reference
+---
+
+# Parent-child pipelines **(FREE)**
+
+> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/16094) in GitLab 12.7.
+
+As pipelines grow more complex, a few related problems start to emerge:
+
+- The staged structure, where all steps in a stage must be completed before the first
+ job in next stage begins, causes arbitrary waits, slowing things down.
+- Configuration for the single global pipeline becomes very long and complicated,
+ making it hard to manage.
+- Imports with [`include`](../yaml/index.md#include) increase the complexity of the configuration, and create the potential
+ for namespace collisions where jobs are unintentionally duplicated.
+- Pipeline UX can become unwieldy with so many jobs and stages to work with.
+
+Additionally, sometimes the behavior of a pipeline needs to be more dynamic. The ability
+to choose to start sub-pipelines (or not) is a powerful ability, especially if the
+YAML is dynamically generated.
+
+![Parent pipeline graph expanded](img/parent_pipeline_graph_expanded_v12_6.png)
+
+Similarly to [multi-project pipelines](multi_project_pipelines.md), a pipeline can trigger a
+set of concurrently running child pipelines, but within the same project:
+
+- Child pipelines still execute each of their jobs according to a stage sequence, but
+ would be free to continue forward through their stages without waiting for unrelated
+ jobs in the parent pipeline to finish.
+- The configuration is split up into smaller child pipeline configurations, which are
+ easier to understand. This reduces the cognitive load to understand the overall configuration.
+- Imports are done at the child pipeline level, reducing the likelihood of collisions.
+- Each pipeline has only relevant steps, making it easier to understand what's going on.
+
+Child pipelines work well with other GitLab CI/CD features:
+
+- Use [`rules: changes`](../yaml/index.md#ruleschanges) to trigger pipelines only when
+ certain files change. This is useful for monorepos, for example.
+- Since the parent pipeline in `.gitlab-ci.yml` and the child pipeline run as normal
+ pipelines, they can have their own behaviors and sequencing in relation to triggers.
+
+See the [`trigger:`](../yaml/index.md#trigger) keyword documentation for full details on how to
+include the child pipeline configuration.
+
+<i class="fa fa-youtube-play youtube" aria-hidden="true"></i>
+For an overview, see [Parent-Child Pipelines feature demo](https://youtu.be/n8KpBSqZNbk).
+
+## Examples
+
+The simplest case is [triggering a child pipeline](../yaml/index.md#trigger) using a
+local YAML file to define the pipeline configuration. In this case, the parent pipeline
+triggers the child pipeline, and continues without waiting:
+
+```yaml
+microservice_a:
+ trigger:
+ include: path/to/microservice_a.yml
+```
+
+You can include multiple files when composing a child pipeline:
+
+```yaml
+microservice_a:
+ trigger:
+ include:
+ - local: path/to/microservice_a.yml
+ - template: Security/SAST.gitlab-ci.yml
+```
+
+In [GitLab 13.5](https://gitlab.com/gitlab-org/gitlab/-/issues/205157) and later,
+you can use [`include:file`](../yaml/index.md#includefile) to trigger child pipelines
+with a configuration file in a different project:
+
+```yaml
+microservice_a:
+ trigger:
+ include:
+ - project: 'my-group/my-pipeline-library'
+ file: 'path/to/ci-config.yml'
+```
+
+The maximum number of entries that are accepted for `trigger:include:` is three.
+
+Similar to [multi-project pipelines](multi_project_pipelines.md#mirror-status-of-a-triggered-pipeline-in-the-trigger-job),
+we can set the parent pipeline to depend on the status of the child pipeline upon completion:
+
+```yaml
+microservice_a:
+ trigger:
+ include:
+ - local: path/to/microservice_a.yml
+ - template: Security/SAST.gitlab-ci.yml
+ strategy: depend
+```
+
+## Merge Request child pipelines
+
+To trigger a child pipeline as a [Merge Request Pipeline](merge_request_pipelines.md) we need to:
+
+- Set the trigger job to run on merge requests:
+
+```yaml
+# parent .gitlab-ci.yml
+microservice_a:
+ trigger:
+ include: path/to/microservice_a.yml
+ rules:
+ - if: $CI_MERGE_REQUEST_ID
+```
+
+- Configure the child pipeline by either:
+
+ - Setting all jobs in the child pipeline to evaluate in the context of a merge request:
+
+ ```yaml
+ # child path/to/microservice_a.yml
+ workflow:
+ rules:
+ - if: $CI_MERGE_REQUEST_ID
+
+ job1:
+ script: ...
+
+ job2:
+ script: ...
+ ```
+
+ - Alternatively, setting the rule per job. For example, to create only `job1` in
+ the context of merge request pipelines:
+
+ ```yaml
+ # child path/to/microservice_a.yml
+ job1:
+ script: ...
+ rules:
+ - if: $CI_MERGE_REQUEST_ID
+
+ job2:
+ script: ...
+ ```
+
+## Dynamic child pipelines
+
+> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/35632) in GitLab 12.9.
+
+Instead of running a child pipeline from a static YAML file, you can define a job that runs
+your own script to generate a YAML file, which is then [used to trigger a child pipeline](../yaml/index.md#trigger-child-pipeline-with-generated-configuration-file).
+
+This technique can be very powerful in generating pipelines targeting content that changed or to
+build a matrix of targets and architectures.
+
+<i class="fa fa-youtube-play youtube" aria-hidden="true"></i>
+For an overview, see [Create child pipelines using dynamically generated configurations](https://youtu.be/nMdfus2JWHM).
+
+<!-- vale gitlab.Spelling = NO -->
+We also have an example project using
+[Dynamic Child Pipelines with Jsonnet](https://gitlab.com/gitlab-org/project-templates/jsonnet)
+which shows how to use a data templating language to generate your `.gitlab-ci.yml` at runtime. You could use a similar process for other templating languages like [Dhall](https://dhall-lang.org/) or [`ytt`](https://get-ytt.io/).
+<!-- vale gitlab.Spelling = NO -->
+
+The artifact path is parsed by GitLab, not the runner, so the path must match the
+syntax for the OS running GitLab. If GitLab is running on Linux but using a Windows
+runner for testing, the path separator for the trigger job would be `/`. Other CI/CD
+configuration for jobs, like scripts, that use the Windows runner would use `\`.
+
+In GitLab 12.9, the child pipeline could fail to be created in certain cases, causing the parent pipeline to fail.
+This is [resolved in GitLab 12.10](https://gitlab.com/gitlab-org/gitlab/-/issues/209070).
+
+## Nested child pipelines
+
+> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/29651) in GitLab 13.4.
+> - [Feature flag removed](https://gitlab.com/gitlab-org/gitlab/-/issues/243747) in GitLab 13.5.
+
+Parent and child pipelines were introduced with a maximum depth of one level of child
+pipelines, which was later increased to two. A parent pipeline can trigger many child
+pipelines, and these child pipelines can trigger their own child pipelines. It's not
+possible to trigger another level of child pipelines.
+
+<i class="fa fa-youtube-play youtube" aria-hidden="true"></i>
+For an overview, see [Nested Dynamic Pipelines](https://youtu.be/C5j3ju9je2M).
+
+## Pass CI/CD variables to a child pipeline
+
+You can pass CI/CD variables to a downstream pipeline using the same methods as
+multi-project pipelines:
+
+- [By using the `variable` keyword](multi_project_pipelines.md#pass-cicd-variables-to-a-downstream-pipeline-by-using-the-variables-keyword).
+- [By using variable inheritance](multi_project_pipelines.md#pass-cicd-variables-to-a-downstream-pipeline-by-using-variable-inheritance).
diff --git a/doc/ci/pipelines/pipeline_architectures.md b/doc/ci/pipelines/pipeline_architectures.md
index 184bc5a956a..1b23727b142 100644
--- a/doc/ci/pipelines/pipeline_architectures.md
+++ b/doc/ci/pipelines/pipeline_architectures.md
@@ -162,7 +162,7 @@ deploy_b:
## Child / Parent Pipelines
In the examples above, it's clear we've got two types of things that could be built independently.
-This is an ideal case for using [Child / Parent Pipelines](../parent_child_pipelines.md)) via
+This is an ideal case for using [Child / Parent Pipelines](parent_child_pipelines.md)) via
the [`trigger` keyword](../yaml/index.md#trigger). It separates out the configuration
into multiple files, keeping things very simple. You can also combine this with:
diff --git a/doc/ci/pipelines/pipeline_efficiency.md b/doc/ci/pipelines/pipeline_efficiency.md
index 5d8d4fa8ff1..91560a0420f 100644
--- a/doc/ci/pipelines/pipeline_efficiency.md
+++ b/doc/ci/pipelines/pipeline_efficiency.md
@@ -186,7 +186,7 @@ shouldn't run, saving pipeline resources.
In a basic configuration, jobs always wait for all other jobs in earlier stages to complete
before running. This is the simplest configuration, but it's also the slowest in most
cases. [Directed Acyclic Graphs](../directed_acyclic_graph/index.md) and
-[parent/child pipelines](../parent_child_pipelines.md) are more flexible and can
+[parent/child pipelines](parent_child_pipelines.md) are more flexible and can
be more efficient, but can also make pipelines harder to understand and analyze.
### Caching
diff --git a/doc/ci/runners/index.md b/doc/ci/runners/index.md
index 67550f27316..acb01012c5f 100644
--- a/doc/ci/runners/index.md
+++ b/doc/ci/runners/index.md
@@ -40,7 +40,7 @@ Below are the shared runners settings.
| Setting | GitLab.com | Default |
| ----------- | ----------------- | ---------- |
-| [GitLab Runner](https://gitlab.com/gitlab-org/gitlab-runner) | [Runner versions dashboard](https://dashboards.gitlab.com/d/000000159/ci?from=now-1h&to=now&refresh=5m&orgId=1&panelId=12&fullscreen&theme=light) | - |
+| [GitLab Runner](https://gitlab.com/gitlab-org/gitlab-runner) | [Runner versions dashboard](https://dashboards.gitlab.net/d/ci-runners-deployment/ci-runners-deployment-overview?orgId=1&refresh=1m) | - |
| Executor | `docker+machine` | - |
| Default Docker image | `ruby:2.5` | - |
| `privileged` (run [Docker in Docker](https://hub.docker.com/_/docker/)) | `true` | `false` |
diff --git a/doc/ci/triggers/index.md b/doc/ci/triggers/index.md
index c2f398d1eb5..15a2a8a3c3f 100644
--- a/doc/ci/triggers/index.md
+++ b/doc/ci/triggers/index.md
@@ -50,7 +50,7 @@ with the [GitLab Container Registry](../../user/packages/container_registry/inde
This way of triggering can only be used when invoked inside `.gitlab-ci.yml`,
and it creates a dependent pipeline relation visible on the
-[pipeline graph](../multi_project_pipelines.md). For example:
+[pipeline graph](../pipelines/multi_project_pipelines.md). For example:
```yaml
trigger_pipeline:
diff --git a/doc/ci/troubleshooting.md b/doc/ci/troubleshooting.md
index fc4a222f87a..df9b20d1708 100644
--- a/doc/ci/troubleshooting.md
+++ b/doc/ci/troubleshooting.md
@@ -60,11 +60,11 @@ and [templates](examples/index.md#cicd-templates).
Some pipeline types have their own detailed usage guides that you should read
if you are using that type:
-- [Multi-project pipelines](multi_project_pipelines.md): Have your pipeline trigger
+- [Multi-project pipelines](pipelines/multi_project_pipelines.md): Have your pipeline trigger
a pipeline in a different project.
-- [Parent/child pipelines](parent_child_pipelines.md): Have your main pipeline trigger
+- [Parent/child pipelines](pipelines/parent_child_pipelines.md): Have your main pipeline trigger
and run separate pipelines in the same project. You can also
- [dynamically generate the child pipeline's configuration](parent_child_pipelines.md#dynamic-child-pipelines)
+ [dynamically generate the child pipeline's configuration](pipelines/parent_child_pipelines.md#dynamic-child-pipelines)
at runtime.
- [Pipelines for Merge Requests](pipelines/merge_request_pipelines.md): Run a pipeline
in the context of a merge request.
diff --git a/doc/ci/variables/index.md b/doc/ci/variables/index.md
index a7f971bc4b5..eff726843b1 100644
--- a/doc/ci/variables/index.md
+++ b/doc/ci/variables/index.md
@@ -581,8 +581,8 @@ You can override the value of a variable when you:
1. Run a job manually in the UI.
1. Use [push options](../../user/project/push_options.md#push-options-for-gitlab-cicd).
1. Trigger a pipeline by using [the API](../triggers/index.md#making-use-of-trigger-variables).
-1. Pass variables to a downstream pipeline [by using the `variable` keyword](../multi_project_pipelines.md#pass-cicd-variables-to-a-downstream-pipeline-by-using-the-variables-keyword)
- or [by using variable inheritance](../multi_project_pipelines.md#pass-cicd-variables-to-a-downstream-pipeline-by-using-variable-inheritance).
+1. Pass variables to a downstream pipeline [by using the `variable` keyword](../pipelines/multi_project_pipelines.md#pass-cicd-variables-to-a-downstream-pipeline-by-using-the-variables-keyword)
+ or [by using variable inheritance](../pipelines/multi_project_pipelines.md#pass-cicd-variables-to-a-downstream-pipeline-by-using-variable-inheritance).
The pipeline variables declared in these events take [priority over other variables](#cicd-variable-precedence).
diff --git a/doc/ci/yaml/index.md b/doc/ci/yaml/index.md
index e2322d640e4..f5f7d427cd9 100644
--- a/doc/ci/yaml/index.md
+++ b/doc/ci/yaml/index.md
@@ -1336,7 +1336,7 @@ pipeline based on branch names or pipeline types.
| `external` | When you use CI services other than GitLab. |
| `external_pull_requests` | When an external pull request on GitHub is created or updated (See [Pipelines for external pull requests](../ci_cd_for_external_repos/index.md#pipelines-for-external-pull-requests)). |
| `merge_requests` | For pipelines created when a merge request is created or updated. Enables [merge request pipelines](../pipelines/merge_request_pipelines.md), [merged results pipelines](../pipelines/pipelines_for_merged_results.md), and [merge trains](../pipelines/merge_trains.md). |
- | `pipelines` | For [multi-project pipelines](../multi_project_pipelines.md) created by [using the API with `CI_JOB_TOKEN`](../multi_project_pipelines.md#create-multi-project-pipelines-by-using-the-api), or the [`trigger`](#trigger) keyword. |
+ | `pipelines` | For [multi-project pipelines](../pipelines/multi_project_pipelines.md) created by [using the API with `CI_JOB_TOKEN`](../pipelines/multi_project_pipelines.md#create-multi-project-pipelines-by-using-the-api), or the [`trigger`](#trigger) keyword. |
| `pushes` | For pipelines triggered by a `git push` event, including for branches and tags. |
| `schedules` | For [scheduled pipelines](../pipelines/schedules.md). |
| `tags` | When the Git reference for a pipeline is a tag. |
@@ -1710,7 +1710,7 @@ build_job:
You can't download artifacts from jobs that run in [`parallel:`](#parallel).
-To download artifacts between [parent-child pipelines](../parent_child_pipelines.md),
+To download artifacts between [parent-child pipelines](../pipelines/parent_child_pipelines.md),
use [`needs:pipeline`](#artifact-downloads-to-child-pipelines).
You should not download artifacts from the same ref as a running pipeline. Concurrent
@@ -1720,7 +1720,7 @@ pipelines running on the same ref could override the artifacts.
> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/255983) in GitLab v13.7.
-A [child pipeline](../parent_child_pipelines.md) can download artifacts from a job in
+A [child pipeline](../pipelines/parent_child_pipelines.md) can download artifacts from a job in
its parent pipeline or another child pipeline in the same parent-child pipeline hierarchy.
For example, with the following parent pipeline that has a job that creates some artifacts:
@@ -3305,7 +3305,7 @@ If there is more than one matched line in the job output, the last line is used.
For the matched line, the first occurrence of `\d+(\.\d+)?` is the code coverage.
Leading zeros are removed.
-Coverage output from [child pipelines](../parent_child_pipelines.md) is not recorded
+Coverage output from [child pipelines](../pipelines/parent_child_pipelines.md) is not recorded
or displayed. Check [the related issue](https://gitlab.com/gitlab-org/gitlab/-/issues/280818)
for more details.
@@ -3561,14 +3561,14 @@ deploystacks: [vultr, data]
Use `trigger` to define a downstream pipeline trigger. When GitLab starts a `trigger` job,
a downstream pipeline is created.
-Jobs with `trigger` can only use a [limited set of keywords](../multi_project_pipelines.md#define-multi-project-pipelines-in-your-gitlab-ciyml-file).
+Jobs with `trigger` can only use a [limited set of keywords](../pipelines/multi_project_pipelines.md#define-multi-project-pipelines-in-your-gitlab-ciyml-file).
For example, you can't run commands with [`script`](#script), [`before_script`](#before_script),
or [`after_script`](#after_script).
You can use this keyword to create two different types of downstream pipelines:
-- [Multi-project pipelines](../multi_project_pipelines.md#define-multi-project-pipelines-in-your-gitlab-ciyml-file)
-- [Child pipelines](../parent_child_pipelines.md)
+- [Multi-project pipelines](../pipelines/multi_project_pipelines.md#define-multi-project-pipelines-in-your-gitlab-ciyml-file)
+- [Child pipelines](../pipelines/parent_child_pipelines.md)
[In GitLab 13.2](https://gitlab.com/gitlab-org/gitlab/-/issues/197140/) and later, you can
view which job triggered a downstream pipeline. In the [pipeline graph](../pipelines/index.md#visualize-pipelines),
@@ -3633,7 +3633,7 @@ upstream_bridge:
> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/16094) in GitLab 12.7.
-To create a [child pipeline](../parent_child_pipelines.md), specify the path to the
+To create a [child pipeline](../pipelines/parent_child_pipelines.md), specify the path to the
YAML file that contains the configuration of the child pipeline:
```yaml
@@ -3642,7 +3642,7 @@ trigger_job:
include: path/to/child-pipeline.yml
```
-Similar to [multi-project pipelines](../multi_project_pipelines.md#mirror-status-of-a-triggered-pipeline-in-the-trigger-job),
+Similar to [multi-project pipelines](../pipelines/multi_project_pipelines.md#mirror-status-of-a-triggered-pipeline-in-the-trigger-job),
it's possible to mirror the status from a triggered pipeline:
```yaml
@@ -3657,7 +3657,7 @@ trigger_job:
> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/35632) in GitLab 12.9.
-You can also trigger a child pipeline from a [dynamically generated configuration file](../parent_child_pipelines.md#dynamic-child-pipelines):
+You can also trigger a child pipeline from a [dynamically generated configuration file](../pipelines/parent_child_pipelines.md#dynamic-child-pipelines):
```yaml
generate-config:
diff --git a/doc/development/cicd/index.md b/doc/development/cicd/index.md
index e4cac9c62c7..6d4e19d8196 100644
--- a/doc/development/cicd/index.md
+++ b/doc/development/cicd/index.md
@@ -30,7 +30,7 @@ On the left side we have the events that can trigger a pipeline based on various
- When a [merge request is created or updated](../../ci/pipelines/merge_request_pipelines.md#pipelines-for-merge-requests).
- When an MR is added to a [Merge Train](../../ci/pipelines/merge_trains.md#merge-trains).
- A [scheduled pipeline](../../ci/pipelines/schedules.md#pipeline-schedules).
-- When project is [subscribed to an upstream project](../../ci/multi_project_pipelines.md#trigger-a-pipeline-when-an-upstream-project-is-rebuilt).
+- When project is [subscribed to an upstream project](../../ci/pipelines/multi_project_pipelines.md#trigger-a-pipeline-when-an-upstream-project-is-rebuilt).
- When [Auto DevOps](../../topics/autodevops/index.md) is enabled.
- When GitHub integration is used with [external pull requests](../../ci/ci_cd_for_external_repos/index.md#pipelines-for-external-pull-requests).
- When an upstream pipeline contains a [bridge job](../../ci/yaml/index.md#trigger) which triggers a downstream pipeline.
diff --git a/doc/development/documentation/index.md b/doc/development/documentation/index.md
index 43bcc2843af..91215ca21b4 100644
--- a/doc/development/documentation/index.md
+++ b/doc/development/documentation/index.md
@@ -476,7 +476,7 @@ If you want to know the in-depth details, here's what's really happening:
The following GitLab features are used among others:
- [Manual actions](../../ci/yaml/index.md#whenmanual)
-- [Multi project pipelines](../../ci/multi_project_pipelines.md)
+- [Multi project pipelines](../../ci/pipelines/multi_project_pipelines.md)
- [Review Apps](../../ci/review_apps/index.md)
- [Artifacts](../../ci/yaml/index.md#artifacts)
- [Specific runner](../../ci/runners/runners_scope.md#prevent-a-specific-runner-from-being-enabled-for-other-projects)
diff --git a/doc/development/redis.md b/doc/development/redis.md
index 893fe1dcbcd..e631a6ec80c 100644
--- a/doc/development/redis.md
+++ b/doc/development/redis.md
@@ -20,7 +20,6 @@ On GitLab.com, we use [separate Redis
instances](../administration/redis/replication_and_failover.md#running-multiple-redis-clusters).
See the [Redis SRE guide](https://gitlab.com/gitlab-com/runbooks/-/blob/master/docs/redis/redis-survival-guide-for-sres.md)
for more details on our setup.
-We do not currently use [ActionCable on GitLab.com](https://gitlab.com/groups/gitlab-com/gl-infra/-/epics/228).
Every application process is configured to use the same Redis servers, so they
can be used for inter-process communication in cases where [PostgreSQL](sql.md)
diff --git a/doc/integration/jira/issues.md b/doc/integration/jira/issues.md
index 91311f85310..b773e0c5247 100644
--- a/doc/integration/jira/issues.md
+++ b/doc/integration/jira/issues.md
@@ -49,9 +49,10 @@ You can [disable comments](#disable-comments-on-jira-issues) on issues.
> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/280766) in [GitLab Ultimate](https://about.gitlab.com/pricing/) 13.12 behind a feature flag, disabled by default.
> - [Deployed behind a feature flag](../../user/feature_flags.md), disabled by default.
-> - Disabled on GitLab.com.
-> - Not recommended for production use.
-> - To use in GitLab self-managed instances, ask a GitLab administrator to [enable it](#enable-or-disable-the-ability-to-require-an-associated-jira-issue-on-merge-requests). **(ULTIMATE SELF)**
+> - [Enabled by default](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/61722) in GitLab 14.1.
+> - Enabled on GitLab.com.
+> - Recommended for production use.
+> - For GitLab self-managed instances, GitLab administrators can opt to [disable it](#enable-or-disable-the-ability-to-require-an-associated-jira-issue-on-merge-requests). **(ULTIMATE SELF)**
This in-development feature might not be available for your use. There can be
[risks when enabling features still in development](../../user/application_security/index.md#security-approvals-in-merge-requests).
@@ -188,9 +189,9 @@ adding a comment to the Jira issue:
## Enable or disable the ability to require an associated Jira issue on merge requests
The ability to require an associated Jira issue on merge requests is under development
-and not ready for production use. It is deployed behind a feature flag that is
-**disabled by default**.
-[GitLab administrators with access to the GitLab Rails console](../../administration/feature_flags.md) can enable it.
+but ready for production use. It is deployed behind a feature flag that is
+**enabled by default**.
+[GitLab administrators with access to the GitLab Rails console](../../administration/feature_flags.md) can opt to disable it.
To enable it:
diff --git a/doc/user/admin_area/diff_limits.md b/doc/user/admin_area/diff_limits.md
index 37fdb3ae195..4be1ace10aa 100644
--- a/doc/user/admin_area/diff_limits.md
+++ b/doc/user/admin_area/diff_limits.md
@@ -21,10 +21,11 @@ consumption of your instance. Keep this in mind when adjusting the maximum.
To speed the loading time of merge request views and branch comparison views
on your instance, you can configure three instance-level maximum values for diffs:
-- **Maximum diff patch size**: The total size, in bytes, of the entire diff.
-- **Maximum diff files**: The total number of files changed in a diff.
-- **Maximum diff files**: The total number of files changed in a diff. The default value is 1000.
-- **Maximum diff lines**: The total number of lines changed in a diff. The default value is 50,000.
+| Value | Definition | Default value | Maximum value |
+| ----- | ---------- | :-----------: | :-----------: |
+| **Maximum diff patch size** | The total size, in bytes, of the entire diff. | 200 KB | 500 KB |
+| **Maximum diff files** | The total number of files changed in a diff. | 1000 | 3000 |
+| **Maximum diff lines** | The total number of lines changed in a diff. | 50,000 | 100,000 |
When a diff reaches 10% of any of these values, the files are shown in a
collapsed view, with a link to expand the diff. Diffs that exceed any of the
@@ -35,7 +36,7 @@ To configure these values:
1. On the top bar, select **Menu >** **{admin}** **Admin**.
1. In the left sidebar, select **Settings > General**.
1. Expand **Diff limits**.
-1. Enter a value for **Maximum diff patch size**, measured in bytes.
+1. Enter a value for the diff limit.
1. Select **Save changes**.
<!-- ## Troubleshooting
diff --git a/doc/user/application_security/coverage_fuzzing/index.md b/doc/user/application_security/coverage_fuzzing/index.md
index 9555348dc66..679d20a6394 100644
--- a/doc/user/application_security/coverage_fuzzing/index.md
+++ b/doc/user/application_security/coverage_fuzzing/index.md
@@ -192,7 +192,7 @@ To use coverage fuzzing in an offline environment, follow these steps:
### Continuous fuzzing (long-running asynchronous fuzzing jobs)
It's also possible to run the fuzzing jobs longer and without blocking your main pipeline. This
-configuration uses the GitLab [parent-child pipelines](../../../ci/parent_child_pipelines.md).
+configuration uses the GitLab [parent-child pipelines](../../../ci/pipelines/parent_child_pipelines.md).
The full example is available in the [repository](https://gitlab.com/gitlab-org/security-products/demos/coverage-fuzzing/go-fuzzing-example/-/tree/continuous_fuzzing#running-go-fuzz-from-ci).
This example uses Go, but is applicable for any other supported languages.
diff --git a/doc/user/group/epics/epic_boards.md b/doc/user/group/epics/epic_boards.md
index ef0365b7efa..b0490c1a589 100644
--- a/doc/user/group/epics/epic_boards.md
+++ b/doc/user/group/epics/epic_boards.md
@@ -7,17 +7,16 @@ info: To determine the technical writer assigned to the Stage/Group associated w
# Epic Boards **(PREMIUM)**
> - [Introduced](https://gitlab.com/groups/gitlab-org/-/epics/5067) in GitLab 13.10.
-> - [Deployed behind a feature flag](../../feature_flags.md), disabled by default.
-> - [Enabled by default](https://gitlab.com/gitlab-org/gitlab/-/issues/290039) in GitLab 14.0.
-> - Enabled on GitLab.com.
-> - Recommended for production use.
-> - For GitLab self-managed instances, GitLab administrators can opt to [disable it](../../../administration/feature_flags.md).
+> - [Feature flag removed](https://gitlab.com/gitlab-org/gitlab/-/issues/290039) in GitLab 14.1.
Epic boards build on the existing [epic tracking functionality](index.md) and
[labels](../../project/labels.md). Your epics appear as cards in vertical lists, organized by their assigned
labels.
-To view an epic board, in a group, select **Epics > Boards**.
+To view an epic board:
+
+1. On the top bar, select **Menu > Groups** and find your group.
+1. On the left sidebar, select **Epics > Boards**.
![GitLab epic board - Premium](img/epic_board_v14_0.png)
@@ -29,7 +28,8 @@ Prerequisites:
To create a new epic board:
-1. Go to your group and select **Epics > Boards**.
+1. On the top bar, select **Menu > Groups** and find your group.
+1. On the left sidebar, select **Epics > Boards**.
1. In the upper left corner, select the dropdown with the current board name.
1. Select **Create new board**.
1. Enter the new board's title.
@@ -77,7 +77,8 @@ Prerequisites:
To create a new list:
-1. Go to your group and select **Epics > Boards**.
+1. On the top bar, select **Menu > Groups** and find your group.
+1. On the left sidebar, select **Epics > Boards**.
1. In the upper-right corner, select **Create list**.
1. In the **New list** column expand the **Select a label** dropdown and select the label to use as
list scope.
@@ -161,22 +162,3 @@ To edit the scope of an epic board:
- Show or hide the Open and Closed columns.
- Select other labels as the board's scope.
1. Select **Save changes**.
-
-## Enable or disable epic boards
-
-Epic boards are under development but ready for production use.
-It is deployed behind a feature flag that is **enabled by default**.
-[GitLab administrators with access to the GitLab Rails console](../../../administration/feature_flags.md)
-can disable it.
-
-To disable it:
-
-```ruby
-Feature.disable(:epic_boards)
-```
-
-To enable it:
-
-```ruby
-Feature.enable(:epic_boards)
-```
diff --git a/doc/user/group/iterations/index.md b/doc/user/group/iterations/index.md
index 38d209f04ca..182551c554e 100644
--- a/doc/user/group/iterations/index.md
+++ b/doc/user/group/iterations/index.md
@@ -11,9 +11,9 @@ info: To determine the technical writer assigned to the Stage/Group associated w
> - Deployed behind a feature flag, disabled by default.
> - [Enabled by default](https://gitlab.com/gitlab-org/gitlab/-/issues/221047) in GitLab 13.2.
> - Enabled on GitLab.com.
-> - Able to be enabled or disabled per-group.
+> - Can be enabled or disabled per-group.
> - Recommended for production use.
-> - For GitLab self-managed instances, GitLab administrators can opt to [disable it](#disable-iterations). **(PREMIUM ONLY)**
+> - For GitLab self-managed instances, GitLab administrators can opt to [disable it](#enable-or-disable-iterations). **(PREMIUM ONLY)**
> - Moved to GitLab Premium in 13.9.
Iterations are a way to track issues over a period of time. This allows teams
@@ -32,31 +32,81 @@ In GitLab, iterations are similar to milestones, with a few differences:
- Iterations require both a start and an end date.
- Iteration date ranges cannot overlap.
+## Iteration cadences
+
+> - [Introduced](https://gitlab.com/groups/gitlab-org/-/epics/5077) in GitLab 14.1.
+> - Deployed behind a [feature flag](../../feature_flags.md), disabled by default.
+> - Disabled on GitLab.com.
+> - Not recommended for production use.
+> - To use in GitLab self-managed instances, ask a GitLab administrator to [enable it](#enable-or-disable-iteration-cadences). **(PREMIUM SELF)**
+
+This in-development feature might not be available for your use. There can be
+[risks when enabling features still in development](../../feature_flags.md#risks-when-enabling-features-still-in-development).
+Refer to this feature's version history for more details.
+
+Iteration cadences automate some common iteration tasks. They can be used to
+automatically create iterations every 1, 2, 3, 4, or 6 weeks. They can also
+be configured to automatically roll over incomplete issues to the next iteration.
+
+### Create an iteration cadence
+
+Prerequisites:
+
+- You must have at least the [Developer role](../../permissions.md) for a group.
+
+To create an iteration cadence:
+
+1. On the top bar, select **Menu > Groups** and find your group.
+1. On the left sidebar, select **Issues > Iterations**.
+1. Select **New iteration cadence**.
+1. Fill out required fields, and select **Create iteration cadence**. The cadence list page opens.
+
+## Delete an iteration cadence
+
+Prerequisites:
+
+- You must have at least the [Developer role](../../permissions.md) for a group.
+
+Deleting an iteration cadence also deletes all iterations within that cadence.
+
+To delete an iteration cadence:
+
+1. On the top bar, select **Menu > Groups** and find your group.
+1. On the left sidebar, select **Issues > Iterations**.
+1. Select the three-dot menu (**{ellipsis_v}**) > **Delete cadence** for the cadence you want to delete.
+1. Select **Delete cadence** in the confirmation modal.
+
## View the iterations list
-To view the iterations list, in a group, go to **{issues}** **Issues > Iterations**.
-From there you can create a new iteration or click an iteration to get a more detailed view.
+To view the iterations list, go to **{issues}** **Issues > Iterations**.
+To view all the iterations in a cadence, ordered by descending date, select that iteration cadence.
+From there you can create a new iteration or select an iteration to get a more detailed view.
## Create an iteration
-NOTE:
-You need Developer [permissions](../../permissions.md) or higher to create an iteration.
+Prerequisites:
+
+- You must have at least the [Developer role](../../permissions.md) for a group.
+
+For manually scheduled iteration cadences, you create and add iterations yourself.
To create an iteration:
-1. In a group, go to **{issues}** **Issues > Iterations**.
-1. Click **New iteration**.
+1. On the top bar, select **Menu > Groups** and find your group.
+1. On the left sidebar, select **Issues > Iterations**.
+1. Select the three-dot menu (**{ellipsis_v}**) > **Add iteration** for the cadence you want to add to.
1. Enter the title, a description (optional), a start date, and a due date.
-1. Click **Create iteration**. The iteration details page opens.
+1. Select **Create iteration**. The iteration details page opens.
## Edit an iteration
> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/218277) in GitLab 13.2.
-NOTE:
-You need Developer [permissions](../../permissions.md) or higher to edit an iteration.
+Prerequisites:
+
+- You must have at least the [Developer role](../../permissions.md) for a group.
-To edit an iteration, click the three-dot menu (**{ellipsis_v}**) > **Edit iteration**.
+To edit an iteration, select the three-dot menu (**{ellipsis_v}**) > **Edit iteration**.
## Add an issue to an iteration
@@ -76,7 +126,7 @@ The report also shows a breakdown of total issues in an iteration.
Open iteration reports show a summary of completed, unstarted, and in-progress issues.
Closed iteration reports show the total number of issues completed by the due date.
-To view an iteration report, go to the iterations list page and click an iteration's title.
+To view an iteration report, go to the iterations list page and select an iteration's title.
### Iteration burndown and burnup charts
@@ -99,13 +149,15 @@ and get a more accurate understanding of scope attributable to each label.
To group issues by label:
+1. On the top bar, select **Menu > Groups** and find your group.
+1. On the left sidebar, select **Issues > Iterations**.
1. In the **Group by** dropdown, select **Label**.
1. Select the **Filter by label** dropdown.
1. Select the labels you want to group by in the labels dropdown.
You can also search for labels by typing in the search input.
-1. Click or tap outside of the label dropdown. The page is now grouped by the selected labels.
+1. Select or tap outside of the label dropdown. The page is now grouped by the selected labels.
-## Disable iterations **(PREMIUM SELF)**
+## Enable or disable iterations **(PREMIUM SELF)**
GitLab Iterations feature is deployed with a feature flag that is **enabled by default**.
[GitLab administrators with access to the GitLab Rails console](../../../administration/feature_flags.md)
@@ -129,6 +181,25 @@ Feature.disable(:group_iterations)
Feature.disable(:group_iterations, Group.find(<group ID>))
```
+### Enable or disable iteration cadences **(PREMIUM SELF)**
+
+Iteration Cadences feature is under development and not ready for production use. It is
+deployed behind a feature flag that is **disabled by default**.
+[GitLab administrators with access to the GitLab Rails console](../../../administration/feature_flags.md)
+can enable it.
+
+To enable it:
+
+```ruby
+Feature.enable(:iterations_cadences)
+```
+
+To disable it:
+
+```ruby
+Feature.disable(:iterations_cadences)
+```
+
<!-- ## Troubleshooting
Include any troubleshooting steps that you can foresee. If you know beforehand what issues
diff --git a/doc/user/index.md b/doc/user/index.md
index 12bd926b89b..f93d88e106b 100644
--- a/doc/user/index.md
+++ b/doc/user/index.md
@@ -64,7 +64,7 @@ With GitLab Enterprise Edition, you can also:
- Leverage [Elasticsearch](../integration/elasticsearch.md) with [Advanced Search](search/advanced_search.md) for faster, more advanced code search across your entire GitLab instance.
- [Authenticate users with Kerberos](../integration/kerberos.md).
- [Mirror a repository](project/repository/repository_mirroring.md) from elsewhere on your local server.
-- View your entire CI/CD pipeline involving more than one project with [Multiple-Project Pipelines](../ci/multi_project_pipelines.md).
+- View your entire CI/CD pipeline involving more than one project with [Multiple-Project Pipelines](../ci/pipelines/multi_project_pipelines.md).
- [Lock files](project/file_lock.md) to prevent conflicts.
- View the current health and status of each CI environment running on Kubernetes with [Deploy Boards](project/deploy_boards.md).
- Leverage continuous delivery method with [Canary Deployments](project/canary_deployments.md).
diff --git a/doc/user/project/merge_requests/testing_and_reports_in_merge_requests.md b/doc/user/project/merge_requests/testing_and_reports_in_merge_requests.md
index 9b4cb063f79..0a9a2a37bfe 100644
--- a/doc/user/project/merge_requests/testing_and_reports_in_merge_requests.md
+++ b/doc/user/project/merge_requests/testing_and_reports_in_merge_requests.md
@@ -22,7 +22,7 @@ or link to useful information directly from merge requests:
| [Unit test reports](../../../ci/unit_test_reports.md) | Configure your CI jobs to use Unit test reports, and let GitLab display a report on the merge request so that it's easier and faster to identify the failure without having to check the entire job log. |
| [License Compliance](../../compliance/license_compliance/index.md) **(ULTIMATE)** | Manage the licenses of your dependencies. |
| [Metrics Reports](../../../ci/metrics_reports.md) **(PREMIUM)** | Display the Metrics Report on the merge request so that it's fast and easy to identify changes to important metrics. |
-| [Multi-Project pipelines](../../../ci/multi_project_pipelines.md) **(PREMIUM)** | When you set up GitLab CI/CD across multiple projects, you can visualize the entire pipeline, including all cross-project interdependencies. |
+| [Multi-Project pipelines](../../../ci/pipelines/multi_project_pipelines.md) **(PREMIUM)** | When you set up GitLab CI/CD across multiple projects, you can visualize the entire pipeline, including all cross-project interdependencies. |
| [Pipelines for merge requests](../../../ci/pipelines/merge_request_pipelines.md) | Customize a specific pipeline structure for merge requests in order to speed the cycle up by running only important jobs. |
| [Pipeline Graphs](../../../ci/pipelines/index.md#visualize-pipelines) | View the status of pipelines within the merge request, including the deployment process. |
| [Test Coverage visualization](test_coverage_visualization.md) | See test coverage results for merge requests, within the file diff. |
diff --git a/lib/api/entities/basic_project_details.rb b/lib/api/entities/basic_project_details.rb
index c75b74b4368..0b231906ccd 100644
--- a/lib/api/entities/basic_project_details.rb
+++ b/lib/api/entities/basic_project_details.rb
@@ -6,7 +6,7 @@ module API
include ::API::ProjectsRelationBuilder
include Gitlab::Utils::StrongMemoize
- expose :default_branch, if: -> (project, options) { Ability.allowed?(options[:current_user], :download_code, project) }
+ expose :default_branch_or_main, as: :default_branch, if: -> (project, options) { Ability.allowed?(options[:current_user], :download_code, project) }
# Avoids an N+1 query: https://github.com/mbleigh/acts-as-taggable-on/issues/91#issuecomment-168273770
expose :topic_names, as: :tag_list
diff --git a/lib/bulk_imports/groups/graphql/get_members_query.rb b/lib/bulk_imports/groups/graphql/get_members_query.rb
index e44d3c5aa9b..e76c87cc521 100644
--- a/lib/bulk_imports/groups/graphql/get_members_query.rb
+++ b/lib/bulk_imports/groups/graphql/get_members_query.rb
@@ -22,6 +22,7 @@ module BulkImports
integer_value: integerValue
}
user {
+ user_gid: id
public_email: publicEmail
}
}
diff --git a/lib/bulk_imports/groups/pipelines/members_pipeline.rb b/lib/bulk_imports/groups/pipelines/members_pipeline.rb
index 5e4293d2c06..265abd5e3a7 100644
--- a/lib/bulk_imports/groups/pipelines/members_pipeline.rb
+++ b/lib/bulk_imports/groups/pipelines/members_pipeline.rb
@@ -15,6 +15,9 @@ module BulkImports
def load(context, data)
return unless data
+ # Current user is already a member
+ return if data['user_id'].to_i == context.current_user.id
+
context.group.members.create!(data)
end
end
diff --git a/lib/bulk_imports/groups/transformers/member_attributes_transformer.rb b/lib/bulk_imports/groups/transformers/member_attributes_transformer.rb
index e92c898171a..b9de375d0e9 100644
--- a/lib/bulk_imports/groups/transformers/member_attributes_transformer.rb
+++ b/lib/bulk_imports/groups/transformers/member_attributes_transformer.rb
@@ -6,18 +6,20 @@ module BulkImports
class MemberAttributesTransformer
def transform(context, data)
data
- .then { |data| add_user(data) }
+ .then { |data| add_user(data, context) }
.then { |data| add_access_level(data) }
.then { |data| add_author(data, context) }
end
private
- def add_user(data)
+ def add_user(data, context)
user = find_user(data&.dig('user', 'public_email'))
return unless user
+ cache_source_user_id(data, user, context)
+
data
.except('user')
.merge('user_id' => user.id)
@@ -48,6 +50,16 @@ module BulkImports
data.merge('created_by_id' => context.current_user.id)
end
+
+ def cache_source_user_id(data, user, context)
+ gid = data&.dig('user', 'user_gid')
+
+ return unless gid
+
+ source_user_id = GlobalID.parse(gid).model_id
+
+ ::BulkImports::UsersMapper.new(context: context).cache_source_user_id(source_user_id, user.id)
+ end
end
end
end
diff --git a/lib/bulk_imports/ndjson_pipeline.rb b/lib/bulk_imports/ndjson_pipeline.rb
index 2de06bbcb88..93fd6986173 100644
--- a/lib/bulk_imports/ndjson_pipeline.rb
+++ b/lib/bulk_imports/ndjson_pipeline.rb
@@ -88,11 +88,7 @@ module BulkImports
end
def members_mapper
- @members_mapper ||= Gitlab::ImportExport::MembersMapper.new(
- exported_members: [],
- user: current_user,
- importable: portable
- )
+ @members_mapper ||= BulkImports::UsersMapper.new(context: context)
end
end
end
diff --git a/lib/bulk_imports/users_mapper.rb b/lib/bulk_imports/users_mapper.rb
new file mode 100644
index 00000000000..74412bc3831
--- /dev/null
+++ b/lib/bulk_imports/users_mapper.rb
@@ -0,0 +1,51 @@
+# frozen_string_literal: true
+
+module BulkImports
+ class UsersMapper
+ include Gitlab::Utils::StrongMemoize
+
+ SOURCE_USER_IDS_CACHE_KEY = 'bulk_imports/%{bulk_import}/%{entity}/source_user_ids'
+
+ def initialize(context:)
+ @context = context
+ @cache_key = SOURCE_USER_IDS_CACHE_KEY % {
+ bulk_import: @context.bulk_import.id,
+ entity: @context.entity.id
+ }
+ end
+
+ def map
+ strong_memoize(:map) do
+ map = hash_with_default
+
+ cached_source_user_ids.each_pair do |source_id, destination_id|
+ map[source_id.to_i] = destination_id.to_i
+ end
+
+ map
+ end
+ end
+
+ def include?(source_user_id)
+ map.has_key?(source_user_id)
+ end
+
+ def default_user_id
+ @context.current_user.id
+ end
+
+ def cache_source_user_id(source_id, destination_id)
+ ::Gitlab::Cache::Import::Caching.hash_add(@cache_key, source_id, destination_id)
+ end
+
+ private
+
+ def hash_with_default
+ Hash.new { default_user_id }
+ end
+
+ def cached_source_user_ids
+ ::Gitlab::Cache::Import::Caching.values_from_hash(@cache_key)
+ end
+ end
+end
diff --git a/lib/gitlab/cache/import/caching.rb b/lib/gitlab/cache/import/caching.rb
index 86441973941..4cbc0231bce 100644
--- a/lib/gitlab/cache/import/caching.rb
+++ b/lib/gitlab/cache/import/caching.rb
@@ -173,6 +173,34 @@ module Gitlab
val ? true : false
end
+ # Adds a value to a hash.
+ #
+ # raw_key - The key of the hash to add to.
+ # field - The field to add to the hash.
+ # value - The field value to add to the hash.
+ # timeout - The new timeout of the key.
+ def self.hash_add(raw_key, field, value, timeout: TIMEOUT)
+ key = cache_key_for(raw_key)
+
+ Redis::Cache.with do |redis|
+ redis.multi do |m|
+ m.hset(key, field, value)
+ m.expire(key, timeout)
+ end
+ end
+ end
+
+ # Returns the values of the given hash.
+ #
+ # raw_key - The key of the set to check.
+ def self.values_from_hash(raw_key)
+ key = cache_key_for(raw_key)
+
+ Redis::Cache.with do |redis|
+ redis.hgetall(key)
+ end
+ end
+
def self.cache_key_for(raw_key)
"#{Redis::Cache::CACHE_NAMESPACE}:#{raw_key}"
end
diff --git a/locale/gitlab.pot b/locale/gitlab.pot
index 16a8afb7b94..c41ed976001 100644
--- a/locale/gitlab.pot
+++ b/locale/gitlab.pot
@@ -21608,9 +21608,6 @@ msgstr ""
msgid "NetworkPolicies|Something went wrong, unable to fetch policies"
msgstr ""
-msgid "NetworkPolicies|Status"
-msgstr ""
-
msgid "NetworkPolicies|Traffic that does not match any rule will be blocked."
msgstr ""
@@ -31425,6 +31422,12 @@ msgstr ""
msgid "SuperSonics|Cloud license"
msgstr ""
+msgid "SuperSonics|Cloud licensing"
+msgstr ""
+
+msgid "SuperSonics|Cloud licensing is now available. It's an easier way to activate instances and manage subscriptions. Read more about it in our %{blogPostLinkStart}blog post%{blogPostLinkEnd}. Activation codes are available in the %{portalLinkStart}Customers Portal%{portalLinkEnd}."
+msgstr ""
+
msgid "SuperSonics|Expires on"
msgstr ""
diff --git a/spec/fast_spec_helper.rb b/spec/fast_spec_helper.rb
index 0672a47c73c..597f2aa4362 100644
--- a/spec/fast_spec_helper.rb
+++ b/spec/fast_spec_helper.rb
@@ -25,6 +25,8 @@ ActiveSupport::XmlMini.backend = 'Nokogiri'
RSpec.configure do |config|
unless ENV['CI']
+ # Allow running `:focus` examples locally,
+ # falling back to all tests when there is no `:focus` example.
config.filter_run focus: true
config.run_all_when_everything_filtered = true
end
diff --git a/spec/features/projects/settings/monitor_settings_spec.rb b/spec/features/projects/settings/monitor_settings_spec.rb
index b43b7b742f4..2d8c418b7d0 100644
--- a/spec/features/projects/settings/monitor_settings_spec.rb
+++ b/spec/features/projects/settings/monitor_settings_spec.rb
@@ -42,7 +42,7 @@ RSpec.describe 'Projects > Settings > For a forked project', :js do
expect(find_field(send_email)).to be_checked
end
- it 'updates form values' do
+ it 'updates form values', quarantine: 'https://gitlab.com/gitlab-org/gitlab/-/issues/333665' do
check(create_issue)
uncheck(send_email)
click_on('No template selected')
diff --git a/spec/features/projects/terraform_spec.rb b/spec/features/projects/terraform_spec.rb
index 55b906c2bc5..d080d101285 100644
--- a/spec/features/projects/terraform_spec.rb
+++ b/spec/features/projects/terraform_spec.rb
@@ -58,7 +58,7 @@ RSpec.describe 'Terraform', :js do
context 'when clicking on the delete button' do
let(:additional_state) { create(:terraform_state, project: project) }
- it 'removes the state', :aggregate_failures do
+ it 'removes the state', :aggregate_failures, quarantine: 'https://gitlab.com/gitlab-org/gitlab/-/issues/333640' do
visit project_terraform_index_path(project)
expect(page).to have_content(additional_state.name)
diff --git a/spec/frontend/analytics/usage_trends/components/instance_counts_spec.js b/spec/frontend/analytics/usage_trends/components/usage_counts_spec.js
index 707d2cc310f..703767dab47 100644
--- a/spec/frontend/analytics/usage_trends/components/instance_counts_spec.js
+++ b/spec/frontend/analytics/usage_trends/components/usage_counts_spec.js
@@ -1,5 +1,6 @@
+import { GlDeprecatedSkeletonLoading as GlSkeletonLoading } from '@gitlab/ui';
+import { GlSingleStat } from '@gitlab/ui/dist/charts';
import { shallowMount } from '@vue/test-utils';
-import MetricCard from '~/analytics/shared/components/metric_card.vue';
import UsageCounts from '~/analytics/usage_trends/components/usage_counts.vue';
import { mockUsageCounts } from '../mock_data';
@@ -27,18 +28,18 @@ describe('UsageCounts', () => {
afterEach(() => {
wrapper.destroy();
- wrapper = null;
});
- const findMetricCard = () => wrapper.find(MetricCard);
+ const findSkeletonLoader = () => wrapper.findComponent(GlSkeletonLoading);
+ const findAllSingleStats = () => wrapper.findAllComponents(GlSingleStat);
describe('while loading', () => {
beforeEach(() => {
createComponent({ loading: true });
});
- it('displays the metric card with isLoading=true', () => {
- expect(findMetricCard().props('isLoading')).toBe(true);
+ it('displays a loading indicator', () => {
+ expect(findSkeletonLoader().exists()).toBe(true);
});
});
@@ -47,8 +48,15 @@ describe('UsageCounts', () => {
createComponent({ data: { counts: mockUsageCounts } });
});
- it('passes the counts data to the metric card', () => {
- expect(findMetricCard().props('metrics')).toEqual(mockUsageCounts);
+ it.each`
+ index | value | title
+ ${0} | ${mockUsageCounts[0].value} | ${mockUsageCounts[0].label}
+ ${1} | ${mockUsageCounts[1].value} | ${mockUsageCounts[1].label}
+ `('renders a GlSingleStat for "$title"', ({ index, value, title }) => {
+ const singleStat = findAllSingleStats().at(index);
+
+ expect(singleStat.props('value')).toBe(`${value}`);
+ expect(singleStat.props('title')).toBe(title);
});
});
});
diff --git a/spec/frontend/boards/stores/actions_spec.js b/spec/frontend/boards/stores/actions_spec.js
index b28412f2127..5f8af7cdc60 100644
--- a/spec/frontend/boards/stores/actions_spec.js
+++ b/spec/frontend/boards/stores/actions_spec.js
@@ -1111,16 +1111,13 @@ describe('updateIssueOrder', () => {
describe('setAssignees', () => {
const node = { username: 'name' };
- const projectPath = 'h/h';
- const refPath = `${projectPath}#3`;
- const iid = '1';
describe('when succeeds', () => {
it('calls the correct mutation with the correct values', (done) => {
testAction(
actions.setAssignees,
- [node],
- { activeBoardItem: { iid, referencePath: refPath }, commit: () => {} },
+ { assignees: [node], iid: '1' },
+ { commit: () => {} },
[
{
type: 'UPDATE_BOARD_ITEM_BY_ID',
diff --git a/spec/frontend/diffs/components/diff_view_spec.js b/spec/frontend/diffs/components/diff_view_spec.js
index 2d68fd2bf43..3af66526050 100644
--- a/spec/frontend/diffs/components/diff_view_spec.js
+++ b/spec/frontend/diffs/components/diff_view_spec.js
@@ -41,7 +41,7 @@ describe('DiffView', () => {
});
const propsData = {
- diffFile: {},
+ diffFile: { file_hash: '123' },
diffLines: [],
...props,
};
@@ -85,7 +85,7 @@ describe('DiffView', () => {
const wrapper = createWrapper({ diffLines: [{}] });
wrapper.findComponent(DiffRow).vm.$emit('startdragging', { line: { test: true } });
- expect(wrapper.vm.dragStart).toEqual({ test: true });
+ expect(wrapper.vm.idState.dragStart).toEqual({ test: true });
});
it('does not call `setSelectedCommentPosition` on different chunks onDragOver', () => {
@@ -123,10 +123,10 @@ describe('DiffView', () => {
const diffRow = getDiffRow(wrapper);
diffRow.$emit('startdragging', { line: { test: true } });
- expect(wrapper.vm.dragStart).toEqual({ test: true });
+ expect(wrapper.vm.idState.dragStart).toEqual({ test: true });
diffRow.$emit('stopdragging');
- expect(wrapper.vm.dragStart).toBeNull();
+ expect(wrapper.vm.idState.dragStart).toBeNull();
expect(showCommentForm).toHaveBeenCalled();
});
});
diff --git a/spec/frontend/sidebar/components/assignees/sidebar_assignees_widget_spec.js b/spec/frontend/sidebar/components/assignees/sidebar_assignees_widget_spec.js
index 0e052abffeb..8504684d23a 100644
--- a/spec/frontend/sidebar/components/assignees/sidebar_assignees_widget_spec.js
+++ b/spec/frontend/sidebar/components/assignees/sidebar_assignees_widget_spec.js
@@ -176,7 +176,7 @@ describe('Sidebar assignees widget', () => {
).toBe(true);
});
- it('emits an event with assignees list on successful mutation', async () => {
+ it('emits an event with assignees list and issuable id on successful mutation', async () => {
createComponent();
await waitForPromises();
@@ -193,18 +193,21 @@ describe('Sidebar assignees widget', () => {
expect(wrapper.emitted('assignees-updated')).toEqual([
[
- [
- {
- __typename: 'User',
- avatarUrl:
- 'https://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon',
- id: 'gid://gitlab/User/1',
- name: 'Administrator',
- username: 'root',
- webUrl: '/root',
- status: null,
- },
- ],
+ {
+ assignees: [
+ {
+ __typename: 'User',
+ avatarUrl:
+ 'https://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon',
+ id: 'gid://gitlab/User/1',
+ name: 'Administrator',
+ username: 'root',
+ webUrl: '/root',
+ status: null,
+ },
+ ],
+ id: 1,
+ },
],
]);
});
@@ -285,6 +288,21 @@ describe('Sidebar assignees widget', () => {
expect(updateIssueAssigneesMutationSuccess).not.toHaveBeenCalled();
expect(findUserSelect().isVisible()).toBe(true);
});
+
+ it('calls the mutation old issuable id if `iid` prop was changed', async () => {
+ findUserSelect().vm.$emit('input', [{ username: 'francina.skiles' }]);
+ wrapper.setProps({
+ iid: '2',
+ });
+ await nextTick();
+ findEditableItem().vm.$emit('close');
+
+ expect(updateIssueAssigneesMutationSuccess).toHaveBeenCalledWith({
+ assigneeUsernames: ['francina.skiles'],
+ fullPath: '/mygroup/myProject',
+ iid: '1',
+ });
+ });
});
it('shows an error if update assignees mutation is rejected', async () => {
diff --git a/spec/lib/api/entities/basic_project_details_spec.rb b/spec/lib/api/entities/basic_project_details_spec.rb
new file mode 100644
index 00000000000..dc7c4fdce4e
--- /dev/null
+++ b/spec/lib/api/entities/basic_project_details_spec.rb
@@ -0,0 +1,27 @@
+# frozen_string_literal: true
+
+require 'spec_helper'
+
+RSpec.describe API::Entities::BasicProjectDetails do
+ let_it_be(:project) { create(:project) }
+
+ let(:current_user) { project.owner }
+
+ subject(:output) { described_class.new(project, current_user: current_user).as_json }
+
+ describe '#default_branch' do
+ it 'delegates to Project#default_branch_or_main' do
+ expect(project).to receive(:default_branch_or_main).twice.and_call_original
+
+ expect(output).to include(default_branch: project.default_branch_or_main)
+ end
+
+ context 'anonymous user' do
+ let(:current_user) { nil }
+
+ it 'is not included' do
+ expect(output.keys).not_to include(:default_branch)
+ end
+ end
+ end
+end
diff --git a/spec/lib/bulk_imports/groups/pipelines/members_pipeline_spec.rb b/spec/lib/bulk_imports/groups/pipelines/members_pipeline_spec.rb
index d8a667ec92a..0126acb320b 100644
--- a/spec/lib/bulk_imports/groups/pipelines/members_pipeline_spec.rb
+++ b/spec/lib/bulk_imports/groups/pipelines/members_pipeline_spec.rb
@@ -63,6 +63,14 @@ RSpec.describe BulkImports::Groups::Pipelines::MembersPipeline do
expect(member.updated_at).to eq('2020-01-01T00:00:00Z')
expect(member.expires_at).to eq(nil)
end
+
+ context 'when user_id is current user id' do
+ it 'does not create new member' do
+ data = { 'user_id' => user.id }
+
+ expect { subject.load(context, data) }.not_to change(GroupMember, :count)
+ end
+ end
end
describe 'pipeline parts' do
diff --git a/spec/lib/bulk_imports/groups/transformers/member_attributes_transformer_spec.rb b/spec/lib/bulk_imports/groups/transformers/member_attributes_transformer_spec.rb
index f3905a4b6e4..af99428e0c1 100644
--- a/spec/lib/bulk_imports/groups/transformers/member_attributes_transformer_spec.rb
+++ b/spec/lib/bulk_imports/groups/transformers/member_attributes_transformer_spec.rb
@@ -84,9 +84,34 @@ RSpec.describe BulkImports::Groups::Transformers::MemberAttributesTransformer do
expect(subject.transform(context, data)).to be_nil
end
end
+
+ context 'source user id caching' do
+ context 'when user gid is present' do
+ it 'caches source user id' do
+ gid = 'gid://gitlab/User/7'
+ data = member_data(email: user.email, gid: gid)
+
+ expect_next_instance_of(BulkImports::UsersMapper) do |mapper|
+ expect(mapper).to receive(:cache_source_user_id).with('7', user.id)
+ end
+
+ subject.transform(context, data)
+ end
+ end
+
+ context 'when user gid is missing' do
+ it 'does not use caching' do
+ data = member_data(email: user.email)
+
+ expect(BulkImports::UsersMapper).not_to receive(:new)
+
+ subject.transform(context, data)
+ end
+ end
+ end
end
- def member_data(email: '', access_level: 30)
+ def member_data(email: '', gid: nil, access_level: 30)
{
'created_at' => '2020-01-01T00:00:00Z',
'updated_at' => '2020-01-01T00:00:00Z',
@@ -95,6 +120,7 @@ RSpec.describe BulkImports::Groups::Transformers::MemberAttributesTransformer do
'integer_value' => access_level
},
'user' => {
+ 'user_gid' => gid,
'public_email' => email
}
}
diff --git a/spec/lib/bulk_imports/ndjson_pipeline_spec.rb b/spec/lib/bulk_imports/ndjson_pipeline_spec.rb
index a5d1a5f7fbb..57a258b0d9f 100644
--- a/spec/lib/bulk_imports/ndjson_pipeline_spec.rb
+++ b/spec/lib/bulk_imports/ndjson_pipeline_spec.rb
@@ -106,8 +106,11 @@ RSpec.describe BulkImports::NdjsonPipeline do
data = [hash, 1]
user = double
config = double(relation_excluded_keys: nil, top_relation_tree: [])
- context = double(portable: group, current_user: user, import_export_config: config)
+ import_double = instance_double(BulkImport, id: 1)
+ entity_double = instance_double(BulkImports::Entity, id: 2)
+ context = double(portable: group, current_user: user, import_export_config: config, bulk_import: import_double, entity: entity_double)
allow(subject).to receive(:import_export_config).and_return(config)
+ allow(subject).to receive(:context).and_return(context)
expect(Gitlab::ImportExport::Group::RelationFactory)
.to receive(:create)
@@ -116,7 +119,7 @@ RSpec.describe BulkImports::NdjsonPipeline do
relation_sym: :test,
relation_hash: hash,
importable: group,
- members_mapper: instance_of(Gitlab::ImportExport::MembersMapper),
+ members_mapper: instance_of(BulkImports::UsersMapper),
object_builder: Gitlab::ImportExport::Group::ObjectBuilder,
user: user,
excluded_keys: nil
diff --git a/spec/lib/bulk_imports/users_mapper_spec.rb b/spec/lib/bulk_imports/users_mapper_spec.rb
new file mode 100644
index 00000000000..e6357319d05
--- /dev/null
+++ b/spec/lib/bulk_imports/users_mapper_spec.rb
@@ -0,0 +1,68 @@
+# frozen_string_literal: true
+
+require 'spec_helper'
+
+RSpec.describe BulkImports::UsersMapper do
+ let_it_be(:user) { create(:user) }
+ let_it_be(:import) { create(:bulk_import, user: user) }
+ let_it_be(:entity) { create(:bulk_import_entity, bulk_import: import) }
+
+ let(:context) do
+ instance_double(
+ BulkImports::Pipeline::Context,
+ bulk_import: import,
+ entity: entity,
+ current_user: user
+ )
+ end
+
+ subject { described_class.new(context: context) }
+
+ describe '#map' do
+ context 'when value for specified key exists' do
+ it 'returns a map of source & destination user ids from redis' do
+ allow(Gitlab::Cache::Import::Caching).to receive(:values_from_hash).and_return({ "1" => "2" })
+
+ expect(subject.map).to eq({ 1 => 2 })
+ end
+ end
+
+ context 'when value for specified key does not exist' do
+ it 'returns default value' do
+ expect(subject.map[:non_existent_key]).to eq(user.id)
+ end
+ end
+ end
+
+ describe '#default_user_id' do
+ it 'returns current user id' do
+ expect(subject.default_user_id).to eq(user.id)
+ end
+ end
+
+ describe '#include?' do
+ context 'when source user id is present in the map' do
+ it 'returns true' do
+ allow(subject).to receive(:map).and_return({ 1 => 2 })
+
+ expect(subject.include?(1)).to eq(true)
+ end
+ end
+
+ context 'when source user id is missing in the map' do
+ it 'returns false' do
+ allow(subject).to receive(:map).and_return({})
+
+ expect(subject.include?(1)).to eq(false)
+ end
+ end
+ end
+
+ describe '#cache_source_user_id' do
+ it 'caches provided source & destination user ids in redis' do
+ expect(Gitlab::Cache::Import::Caching).to receive(:hash_add).with("bulk_imports/#{import.id}/#{entity.id}/source_user_ids", 1, 2)
+
+ subject.cache_source_user_id(1, 2)
+ end
+ end
+end
diff --git a/spec/lib/gitlab/cache/import/caching_spec.rb b/spec/lib/gitlab/cache/import/caching_spec.rb
index 8ce12f5d32e..f770960e27a 100644
--- a/spec/lib/gitlab/cache/import/caching_spec.rb
+++ b/spec/lib/gitlab/cache/import/caching_spec.rb
@@ -100,6 +100,30 @@ RSpec.describe Gitlab::Cache::Import::Caching, :clean_gitlab_redis_cache do
end
end
+ describe '.hash_add' do
+ it 'adds a value to a hash' do
+ described_class.hash_add('foo', 1, 1)
+ described_class.hash_add('foo', 2, 2)
+
+ key = described_class.cache_key_for('foo')
+ values = Gitlab::Redis::Cache.with { |r| r.hgetall(key) }
+
+ expect(values).to eq({ '1' => '1', '2' => '2' })
+ end
+ end
+
+ describe '.values_from_hash' do
+ it 'returns empty hash when the hash is empty' do
+ expect(described_class.values_from_hash('foo')).to eq({})
+ end
+
+ it 'returns the set list of values' do
+ described_class.hash_add('foo', 1, 1)
+
+ expect(described_class.values_from_hash('foo')).to eq({ '1' => '1' })
+ end
+ end
+
describe '.write_multiple' do
it 'sets multiple keys when key_prefix not set' do
mapping = { 'foo' => 10, 'bar' => 20 }
diff --git a/spec/models/namespace_spec.rb b/spec/models/namespace_spec.rb
index 09954569ff6..d09d0627053 100644
--- a/spec/models/namespace_spec.rb
+++ b/spec/models/namespace_spec.rb
@@ -1083,6 +1083,14 @@ RSpec.describe Namespace do
end
describe '#all_projects' do
+ context 'when recursive approach is disabled' do
+ before do
+ stub_feature_flags(recursive_approach_for_all_projects: false)
+ end
+
+ include_examples '#all_projects'
+ end
+
context 'with use_traversal_ids feature flag enabled' do
before do
stub_feature_flags(use_traversal_ids: true)
diff --git a/spec/services/git/wiki_push_service_spec.rb b/spec/services/git/wiki_push_service_spec.rb
index ead15e6e022..7e5d7066e89 100644
--- a/spec/services/git/wiki_push_service_spec.rb
+++ b/spec/services/git/wiki_push_service_spec.rb
@@ -65,6 +65,26 @@ RSpec.describe Git::WikiPushService, services: true do
expect(Event.last(count).pluck(:action)).to match_array(Event::WIKI_ACTIONS.map(&:to_s))
end
+
+ context 'when wiki_page slug is not UTF-8 ' do
+ let(:binary_title) { Gitlab::EncodingHelper.encode_binary('编码') }
+
+ def run_service
+ wiki_page = create(:wiki_page, wiki: wiki, title: "#{binary_title} 'foo'")
+
+ process_changes do
+ # Test that new_path is converted to UTF-8
+ create(:wiki_page, wiki: wiki, title: binary_title)
+
+ # Test that old_path is also is converted to UTF-8
+ update_page(wiki_page.title, 'foo')
+ end
+ end
+
+ it 'does not raise an error' do
+ expect { run_service }.not_to raise_error
+ end
+ end
end
context 'two pages have been created' do
@@ -346,9 +366,10 @@ RSpec.describe Git::WikiPushService, services: true do
::Wikis::CreateAttachmentService.new(container: wiki.container, current_user: current_user, params: params).execute
end
- def update_page(title)
+ def update_page(title, new_title = nil)
+ new_title = title unless new_title.present?
page = git_wiki.page(title: title)
- git_wiki.update_page(page.path, title, 'markdown', 'Hey', commit_details)
+ git_wiki.update_page(page.path, new_title, 'markdown', 'Hey', commit_details)
end
def delete_page(page)
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index 6a2975e566a..6d0969e8688 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -110,8 +110,11 @@ RSpec.configure do |config|
end
unless ENV['CI']
+ # Allow running `:focus` examples locally,
+ # falling back to all tests when there is no `:focus` example.
config.filter_run focus: true
config.run_all_when_everything_filtered = true
+
# Re-run failures locally with `--only-failures`
config.example_status_persistence_file_path = './spec/examples.txt'
end
diff --git a/workhorse/internal/api/api.go b/workhorse/internal/api/api.go
index 5dae6eb01bb..db1c4cbbc27 100644
--- a/workhorse/internal/api/api.go
+++ b/workhorse/internal/api/api.go
@@ -3,6 +3,7 @@ package api
import (
"bytes"
"encoding/json"
+ "errors"
"fmt"
"io"
"net/http"
@@ -29,6 +30,8 @@ const (
ResponseContentType = "application/vnd.gitlab-workhorse+json"
failureResponseLimit = 32768
+
+ geoProxyEndpointPath = "/api/v4/geo/proxy"
)
type API struct {
@@ -37,6 +40,8 @@ type API struct {
Version string
}
+var ErrNotGeoSecondary = errors.New("this is not a Geo secondary site")
+
var (
requestsCounter = promauto.NewCounterVec(
prometheus.CounterOpts{
@@ -61,6 +66,10 @@ func NewAPI(myURL *url.URL, version string, roundTripper http.RoundTripper) *API
}
}
+type GeoProxyEndpointResponse struct {
+ GeoProxyURL string `json:"geo_proxy_url"`
+}
+
type HandleFunc func(http.ResponseWriter, *http.Request, *Response)
type MultipartUploadParams struct {
@@ -389,3 +398,40 @@ func bufferResponse(r io.Reader) (*bytes.Buffer, error) {
func validResponseContentType(resp *http.Response) bool {
return helper.IsContentType(ResponseContentType, resp.Header.Get("Content-Type"))
}
+
+// TODO: Cache the result of the API requests https://gitlab.com/gitlab-org/gitlab/-/issues/329671
+func (api *API) GetGeoProxyURL() (*url.URL, error) {
+ geoProxyApiUrl := *api.URL
+ geoProxyApiUrl.Path, geoProxyApiUrl.RawPath = joinURLPath(api.URL, geoProxyEndpointPath)
+ geoProxyApiReq := &http.Request{
+ Method: "GET",
+ URL: &geoProxyApiUrl,
+ Header: make(http.Header),
+ }
+
+ httpResponse, err := api.doRequestWithoutRedirects(geoProxyApiReq)
+ if err != nil {
+ return nil, fmt.Errorf("GetGeoProxyURL: do request: %v", err)
+ }
+ defer httpResponse.Body.Close()
+
+ if httpResponse.StatusCode != http.StatusOK {
+ return nil, fmt.Errorf("GetGeoProxyURL: Received HTTP status code: %v", httpResponse.StatusCode)
+ }
+
+ response := &GeoProxyEndpointResponse{}
+ if err := json.NewDecoder(httpResponse.Body).Decode(response); err != nil {
+ return nil, fmt.Errorf("GetGeoProxyURL: decode response: %v", err)
+ }
+
+ if response.GeoProxyURL == "" {
+ return nil, ErrNotGeoSecondary
+ }
+
+ geoProxyURL, err := url.Parse(response.GeoProxyURL)
+ if err != nil {
+ return nil, fmt.Errorf("GetGeoProxyURL: Could not parse Geo proxy URL: %v, err: %v", response.GeoProxyURL, err)
+ }
+
+ return geoProxyURL, nil
+}
diff --git a/workhorse/internal/api/api_test.go b/workhorse/internal/api/api_test.go
new file mode 100644
index 00000000000..5ab677c4233
--- /dev/null
+++ b/workhorse/internal/api/api_test.go
@@ -0,0 +1,74 @@
+package api
+
+import (
+ "fmt"
+ "net/http"
+ "net/http/httptest"
+ "net/url"
+ "regexp"
+ "testing"
+
+ "github.com/stretchr/testify/require"
+ "gitlab.com/gitlab-org/labkit/log"
+
+ "gitlab.com/gitlab-org/gitlab-workhorse/internal/helper"
+ "gitlab.com/gitlab-org/gitlab-workhorse/internal/secret"
+ "gitlab.com/gitlab-org/gitlab-workhorse/internal/testhelper"
+ "gitlab.com/gitlab-org/gitlab-workhorse/internal/upstream/roundtripper"
+)
+
+func TestGetGeoProxyURLWhenGeoSecondary(t *testing.T) {
+ geoProxyURL, err := getGeoProxyURLGivenResponse(t, `{"geo_proxy_url":"http://primary"}`)
+
+ require.NoError(t, err)
+ require.NotNil(t, geoProxyURL)
+ require.Equal(t, "http://primary", geoProxyURL.String())
+}
+
+func TestGetGeoProxyURLWhenGeoPrimaryOrNonGeo(t *testing.T) {
+ geoProxyURL, err := getGeoProxyURLGivenResponse(t, "{}")
+
+ require.Error(t, err)
+ require.Equal(t, ErrNotGeoSecondary, err)
+ require.Nil(t, geoProxyURL)
+}
+
+func getGeoProxyURLGivenResponse(t *testing.T, givenInternalApiResponse string) (*url.URL, error) {
+ t.Helper()
+ ts := testRailsServer(regexp.MustCompile(`/api/v4/geo/proxy`), 200, givenInternalApiResponse)
+ defer ts.Close()
+ backend := helper.URLMustParse(ts.URL)
+ version := "123"
+ rt := roundtripper.NewTestBackendRoundTripper(backend)
+ testhelper.ConfigureSecret()
+
+ apiClient := NewAPI(backend, version, rt)
+
+ geoProxyURL, err := apiClient.GetGeoProxyURL()
+
+ return geoProxyURL, err
+}
+
+func testRailsServer(url *regexp.Regexp, code int, body string) *httptest.Server {
+ return testhelper.TestServerWithHandler(url, func(w http.ResponseWriter, r *http.Request) {
+ // return a 204 No Content response if we don't receive the JWT header
+ if r.Header.Get(secret.RequestHeader) == "" {
+ w.WriteHeader(204)
+ return
+ }
+
+ w.Header().Set("Content-Type", ResponseContentType)
+
+ logEntry := log.WithFields(log.Fields{
+ "method": r.Method,
+ "url": r.URL,
+ })
+ logEntryWithCode := logEntry.WithField("code", code)
+
+ // Write pure string
+ logEntryWithCode.Info("UPSTREAM")
+
+ w.WriteHeader(code)
+ fmt.Fprint(w, body)
+ })
+}
diff --git a/workhorse/internal/upstream/routes.go b/workhorse/internal/upstream/routes.go
index 230b67ed059..d46397e226e 100644
--- a/workhorse/internal/upstream/routes.go
+++ b/workhorse/internal/upstream/routes.go
@@ -191,12 +191,7 @@ func buildProxy(backend *url.URL, version string, rt http.RoundTripper, cfg conf
// see upstream.ServeHTTP
func configureRoutes(u *upstream) {
- api := apipkg.NewAPI(
- u.Backend,
- u.Version,
- u.RoundTripper,
- )
-
+ api := u.APIClient
static := &staticpages.Static{DocumentRoot: u.DocumentRoot, Exclude: staticExclude}
proxy := buildProxy(u.Backend, u.Version, u.RoundTripper, u.Config)
cableProxy := proxypkg.NewProxy(u.CableBackend, u.Version, u.CableRoundTripper)
diff --git a/workhorse/internal/upstream/upstream.go b/workhorse/internal/upstream/upstream.go
index 80e7d4056b6..c41eb98683b 100644
--- a/workhorse/internal/upstream/upstream.go
+++ b/workhorse/internal/upstream/upstream.go
@@ -8,6 +8,7 @@ package upstream
import (
"fmt"
+ "os"
"net/http"
"strings"
@@ -15,8 +16,10 @@ import (
"github.com/sirupsen/logrus"
"gitlab.com/gitlab-org/labkit/correlation"
+ apipkg "gitlab.com/gitlab-org/gitlab-workhorse/internal/api"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/config"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/helper"
+ "gitlab.com/gitlab-org/gitlab-workhorse/internal/log"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/rejectmethods"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/upload"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/upstream/roundtripper"
@@ -32,11 +35,13 @@ var (
type upstream struct {
config.Config
- URLPrefix urlprefix.Prefix
- Routes []routeEntry
- RoundTripper http.RoundTripper
- CableRoundTripper http.RoundTripper
- accessLogger *logrus.Logger
+ URLPrefix urlprefix.Prefix
+ Routes []routeEntry
+ RoundTripper http.RoundTripper
+ CableRoundTripper http.RoundTripper
+ APIClient *apipkg.API
+ accessLogger *logrus.Logger
+ enableGeoProxyFeature bool
}
func NewUpstream(cfg config.Config, accessLogger *logrus.Logger) http.Handler {
@@ -60,6 +65,13 @@ func newUpstream(cfg config.Config, accessLogger *logrus.Logger, routesCallback
up.RoundTripper = roundtripper.NewBackendRoundTripper(up.Backend, up.Socket, up.ProxyHeadersTimeout, cfg.DevelopmentMode)
up.CableRoundTripper = roundtripper.NewBackendRoundTripper(up.CableBackend, up.CableSocket, up.ProxyHeadersTimeout, cfg.DevelopmentMode)
up.configureURLPrefix()
+ up.APIClient = apipkg.NewAPI(
+ up.Backend,
+ up.Version,
+ up.RoundTripper,
+ )
+ // Kind of a feature flag. See https://gitlab.com/groups/gitlab-org/-/epics/5914#note_564974130
+ up.enableGeoProxyFeature = os.Getenv("GEO_SECONDARY_PROXY") == "1"
routesCallback(&up)
var correlationOpts []correlation.InboundHandlerOption
@@ -108,6 +120,17 @@ func (u *upstream) ServeHTTP(w http.ResponseWriter, r *http.Request) {
// Look for a matching route
var route *routeEntry
+
+ if u.enableGeoProxyFeature {
+ geoProxyURL, err := u.APIClient.GetGeoProxyURL()
+
+ if err == nil {
+ log.WithRequest(r).WithFields(log.Fields{"geoProxyURL": geoProxyURL}).Info("Geo Proxy: Set route according to Geo Proxy logic")
+ } else if err != apipkg.ErrNotGeoSecondary {
+ log.WithRequest(r).WithError(err).Error("Geo Proxy: Unable to determine Geo Proxy URL. Falling back to normal routing")
+ }
+ }
+
for _, ro := range u.Routes {
if ro.isMatch(prefix.Strip(URIPath), r) {
route = &ro