Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-03-26 21:09:16 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2021-03-26 21:09:16 +0300
commit006a4f3c1c288c1ea59c3423225527897fa60d6e (patch)
treee4e0d2bb7de0b1ad82bd366088d007b9055d447a
parent2446c39adaea91d1120c9eb0936e93e9314171c1 (diff)
Add latest changes from gitlab-org/gitlab@master
-rw-r--r--app/assets/javascripts/pipeline_editor/components/header/pipeline_editor_header.vue6
-rw-r--r--app/assets/javascripts/pipeline_editor/pipeline_editor_app.vue1
-rw-r--r--app/assets/javascripts/pipeline_editor/pipeline_editor_home.vue9
-rw-r--r--app/assets/javascripts/pipelines/components/graph/graph_component.vue3
-rw-r--r--app/assets/javascripts/pipelines/components/graph/graph_component_legacy.vue2
-rw-r--r--app/assets/javascripts/pipelines/components/graph/graph_component_wrapper.vue2
-rw-r--r--app/assets/javascripts/pipelines/components/graph/job_group_dropdown.vue2
-rw-r--r--app/assets/javascripts/pipelines/components/graph/job_item.vue6
-rw-r--r--app/assets/javascripts/pipelines/components/graph/linked_pipeline.vue2
-rw-r--r--app/assets/javascripts/pipelines/components/graph/linked_pipelines_column.vue2
-rw-r--r--app/assets/javascripts/pipelines/components/graph/linked_pipelines_column_legacy.vue2
-rw-r--r--app/assets/javascripts/pipelines/components/graph/stage_column_component.vue25
-rw-r--r--app/assets/javascripts/pipelines/components/graph/stage_column_component_legacy.vue4
-rw-r--r--app/assets/javascripts/pipelines/components/graph/utils.js9
-rw-r--r--app/assets/javascripts/pipelines/components/graph_shared/api.js2
-rw-r--r--app/assets/javascripts/pipelines/components/graph_shared/links_inner.vue3
-rw-r--r--app/assets/javascripts/pipelines/components/graph_shared/links_layer.vue2
-rw-r--r--app/assets/javascripts/pipelines/components/jobs_shared/action_component.vue (renamed from app/assets/javascripts/pipelines/components/graph/action_component.vue)2
-rw-r--r--app/assets/javascripts/pipelines/components/jobs_shared/job_name_component.vue (renamed from app/assets/javascripts/pipelines/components/graph/job_name_component.vue)0
-rw-r--r--app/assets/javascripts/pipelines/components/pipelines_list/job_item.vue186
-rw-r--r--app/assets/javascripts/pipelines/components/pipelines_list/pipeline_stage.vue2
-rw-r--r--app/assets/javascripts/pipelines/pipeline_details_bundle.js2
-rw-r--r--app/assets/javascripts/pipelines/pipeline_details_graph.js2
-rw-r--r--app/assets/javascripts/pipelines/utils.js8
-rw-r--r--app/assets/javascripts/tracking.js8
-rw-r--r--app/assets/stylesheets/pages/settings.scss4
-rw-r--r--app/controllers/customers_dot/proxy_controller.rb21
-rw-r--r--app/helpers/tracking_helper.rb4
-rw-r--r--app/models/clusters/agent_token.rb2
-rw-r--r--app/models/internal_id.rb35
-rw-r--r--app/views/projects/deploy_keys/edit.html.haml4
-rw-r--r--app/views/projects/services/prometheus/_configuration_banner.html.haml2
-rw-r--r--app/views/projects/services/prometheus/_custom_metrics.html.haml2
-rw-r--r--app/workers/build_hooks_worker.rb1
-rw-r--r--changelogs/unreleased/22691-externalize-app-views-projects-deploy_keys-edit.yml5
-rw-r--r--changelogs/unreleased/290962-rename-event-to-action-in-haml-snowplow-helper.yml5
-rw-r--r--changelogs/unreleased/322745-validate-null-constraint.yml5
-rw-r--r--changelogs/unreleased/323675-cleanup-web-hoo-logs-backfill-migration.yml5
-rw-r--r--changelogs/unreleased/ak-fix-registration-token.yml5
-rw-r--r--changelogs/unreleased/btn-confirm-projects-services.yml5
-rw-r--r--config/feature_flags/development/load_balancing_for_build_hooks_worker.yml8
-rw-r--r--config/routes.rb1
-rw-r--r--config/routes/customers_dot.rb7
-rw-r--r--danger/product_intelligence/Dangerfile3
-rw-r--r--db/post_migrate/20210317155207_validate_not_null_constraint_on_cluster_token_name.rb16
-rw-r--r--db/post_migrate/20210326121537_backfill_cleanup_for_partitioned_web_hook_logs.rb17
-rw-r--r--db/schema_migrations/202103171552071
-rw-r--r--db/schema_migrations/202103261215371
-rw-r--r--db/structure.sql4
-rw-r--r--doc/administration/geo/replication/geo_validation_tests.md2
-rw-r--r--doc/development/documentation/feature_flags.md30
-rw-r--r--doc/development/snowplow.md12
-rw-r--r--doc/development/usage_ping/index.md16
-rw-r--r--doc/raketasks/backup_restore.md6
-rw-r--r--doc/subscriptions/gitlab_com/index.md2
-rw-r--r--doc/topics/autodevops/stages.md19
-rw-r--r--doc/topics/git/lfs/index.md8
-rw-r--r--doc/update/index.md2
-rw-r--r--doc/user/admin_area/credentials_inventory.md8
-rw-r--r--doc/user/clusters/applications.md4
-rw-r--r--doc/user/discussions/index.md16
-rw-r--r--doc/user/group/iterations/index.md10
-rw-r--r--doc/user/packages/composer_repository/index.md4
-rw-r--r--doc/user/packages/container_registry/index.md2
-rw-r--r--doc/user/project/merge_requests/getting_started.md8
-rw-r--r--doc/user/project/merge_requests/squash_and_merge.md13
-rw-r--r--doc/user/project/settings/index.md11
-rw-r--r--lib/gitlab/ci/runner_instructions.rb6
-rw-r--r--qa/qa/page/project/settings/ci_cd.rb2
-rw-r--r--spec/fixtures/lib/generators/gitlab/usage_metric_definition_generator/sample_metric.yml21
-rw-r--r--spec/fixtures/lib/generators/gitlab/usage_metric_definition_generator/sample_metric_with_name_suggestions.yml22
-rw-r--r--spec/frontend/pipeline_editor/components/header/pipeline_editor_header_spec.js16
-rw-r--r--spec/frontend/pipeline_editor/pipeline_editor_home_spec.js1
-rw-r--r--spec/frontend/pipelines/graph/action_component_spec.js2
-rw-r--r--spec/frontend/pipelines/graph/job_name_component_spec.js2
-rw-r--r--spec/frontend/pipelines/graph/stage_column_component_spec.js24
-rw-r--r--spec/frontend/pipelines/graph_shared/links_inner_spec.js2
-rw-r--r--spec/frontend/tracking_spec.js50
-rw-r--r--spec/helpers/tracking_helper_spec.rb2
-rw-r--r--spec/lib/generators/gitlab/usage_metric_definition_generator_spec.rb78
-rw-r--r--spec/lib/gitlab/ci/runner_instructions_spec.rb6
-rw-r--r--spec/models/internal_id_spec.rb61
-rw-r--r--spec/requests/customers_dot/proxy_controller_spec.rb37
-rw-r--r--spec/support/helpers/test_env.rb2
-rw-r--r--spec/support/helpers/usage_data_helpers.rb8
-rw-r--r--spec/support/shared_examples/workers/worker_with_data_consistency_shared_example.rb27
-rw-r--r--spec/workers/build_hooks_worker_spec.rb5
87 files changed, 802 insertions, 200 deletions
diff --git a/app/assets/javascripts/pipeline_editor/components/header/pipeline_editor_header.vue b/app/assets/javascripts/pipeline_editor/components/header/pipeline_editor_header.vue
index 6652c0026ca..fefa784f060 100644
--- a/app/assets/javascripts/pipeline_editor/components/header/pipeline_editor_header.vue
+++ b/app/assets/javascripts/pipeline_editor/components/header/pipeline_editor_header.vue
@@ -35,10 +35,14 @@ export default {
type: Object,
required: true,
},
+ isNewCiConfigFile: {
+ type: Boolean,
+ required: true,
+ },
},
computed: {
showPipelineStatus() {
- return this.glFeatures.pipelineStatusForPipelineEditor;
+ return this.glFeatures.pipelineStatusForPipelineEditor && !this.isNewCiConfigFile;
},
// make sure corners are rounded correctly depending on if
// pipeline status is rendered
diff --git a/app/assets/javascripts/pipeline_editor/pipeline_editor_app.vue b/app/assets/javascripts/pipeline_editor/pipeline_editor_app.vue
index 488cabc85be..bd1853d3bab 100644
--- a/app/assets/javascripts/pipeline_editor/pipeline_editor_app.vue
+++ b/app/assets/javascripts/pipeline_editor/pipeline_editor_app.vue
@@ -278,6 +278,7 @@ export default {
<pipeline-editor-home
:ci-config-data="ciConfigData"
:ci-file-content="currentCiFileContent"
+ :is-new-ci-config-file="isNewCiConfigFile"
@commit="updateOnCommit"
@resetContent="resetContent"
@showError="showErrorAlert"
diff --git a/app/assets/javascripts/pipeline_editor/pipeline_editor_home.vue b/app/assets/javascripts/pipeline_editor/pipeline_editor_home.vue
index 0eba8696f7b..aafd95412c4 100644
--- a/app/assets/javascripts/pipeline_editor/pipeline_editor_home.vue
+++ b/app/assets/javascripts/pipeline_editor/pipeline_editor_home.vue
@@ -19,6 +19,10 @@ export default {
type: String,
required: true,
},
+ isNewCiConfigFile: {
+ type: Boolean,
+ required: true,
+ },
},
data() {
return {
@@ -40,7 +44,10 @@ export default {
<template>
<div>
- <pipeline-editor-header :ci-config-data="ciConfigData" />
+ <pipeline-editor-header
+ :ci-config-data="ciConfigData"
+ :is-new-ci-config-file="isNewCiConfigFile"
+ />
<pipeline-editor-tabs
:ci-config-data="ciConfigData"
:ci-file-content="ciFileContent"
diff --git a/app/assets/javascripts/pipelines/components/graph/graph_component.vue b/app/assets/javascripts/pipelines/components/graph/graph_component.vue
index 363226a0d85..d7a7fc9c375 100644
--- a/app/assets/javascripts/pipelines/components/graph/graph_component.vue
+++ b/app/assets/javascripts/pipelines/components/graph/graph_component.vue
@@ -1,10 +1,11 @@
<script>
+import { reportToSentry } from '../../utils';
import LinkedGraphWrapper from '../graph_shared/linked_graph_wrapper.vue';
import LinksLayer from '../graph_shared/links_layer.vue';
import { DOWNSTREAM, MAIN, UPSTREAM, ONE_COL_WIDTH } from './constants';
import LinkedPipelinesColumn from './linked_pipelines_column.vue';
import StageColumnComponent from './stage_column_component.vue';
-import { reportToSentry, validateConfigPaths } from './utils';
+import { validateConfigPaths } from './utils';
export default {
name: 'PipelineGraph',
diff --git a/app/assets/javascripts/pipelines/components/graph/graph_component_legacy.vue b/app/assets/javascripts/pipelines/components/graph/graph_component_legacy.vue
index abbf8df6eed..39d0fa8a8ca 100644
--- a/app/assets/javascripts/pipelines/components/graph/graph_component_legacy.vue
+++ b/app/assets/javascripts/pipelines/components/graph/graph_component_legacy.vue
@@ -2,10 +2,10 @@
import { GlLoadingIcon } from '@gitlab/ui';
import { escape, capitalize } from 'lodash';
import GraphBundleMixin from '../../mixins/graph_pipeline_bundle_mixin';
+import { reportToSentry } from '../../utils';
import { UPSTREAM, DOWNSTREAM, MAIN } from './constants';
import LinkedPipelinesColumnLegacy from './linked_pipelines_column_legacy.vue';
import StageColumnComponentLegacy from './stage_column_component_legacy.vue';
-import { reportToSentry } from './utils';
export default {
name: 'PipelineGraphLegacy',
diff --git a/app/assets/javascripts/pipelines/components/graph/graph_component_wrapper.vue b/app/assets/javascripts/pipelines/components/graph/graph_component_wrapper.vue
index 5299694ce13..be0f3643784 100644
--- a/app/assets/javascripts/pipelines/components/graph/graph_component_wrapper.vue
+++ b/app/assets/javascripts/pipelines/components/graph/graph_component_wrapper.vue
@@ -4,12 +4,12 @@ import getPipelineDetails from 'shared_queries/pipelines/get_pipeline_details.qu
import { __ } from '~/locale';
import glFeatureFlagMixin from '~/vue_shared/mixins/gl_feature_flags_mixin';
import { DEFAULT, DRAW_FAILURE, LOAD_FAILURE } from '../../constants';
+import { reportToSentry } from '../../utils';
import { IID_FAILURE, STAGE_VIEW } from './constants';
import PipelineGraph from './graph_component.vue';
import GraphViewSelector from './graph_view_selector.vue';
import {
getQueryHeaders,
- reportToSentry,
serializeLoadErrors,
toggleQueryPollingByVisibility,
unwrapPipelineData,
diff --git a/app/assets/javascripts/pipelines/components/graph/job_group_dropdown.vue b/app/assets/javascripts/pipelines/components/graph/job_group_dropdown.vue
index f6aee8c5fcf..8577a49ff7a 100644
--- a/app/assets/javascripts/pipelines/components/graph/job_group_dropdown.vue
+++ b/app/assets/javascripts/pipelines/components/graph/job_group_dropdown.vue
@@ -1,8 +1,8 @@
<script>
import { GlTooltipDirective } from '@gitlab/ui';
import CiIcon from '~/vue_shared/components/ci_icon.vue';
+import { reportToSentry } from '../../utils';
import JobItem from './job_item.vue';
-import { reportToSentry } from './utils';
/**
* Renders the dropdown for the pipeline graph.
diff --git a/app/assets/javascripts/pipelines/components/graph/job_item.vue b/app/assets/javascripts/pipelines/components/graph/job_item.vue
index 46ef0457d40..df83488a226 100644
--- a/app/assets/javascripts/pipelines/components/graph/job_item.vue
+++ b/app/assets/javascripts/pipelines/components/graph/job_item.vue
@@ -3,11 +3,11 @@ import { GlTooltipDirective, GlLink } from '@gitlab/ui';
import delayedJobMixin from '~/jobs/mixins/delayed_job_mixin';
import { BV_HIDE_TOOLTIP } from '~/lib/utils/constants';
import { sprintf } from '~/locale';
+import { reportToSentry } from '../../utils';
+import ActionComponent from '../jobs_shared/action_component.vue';
+import JobNameComponent from '../jobs_shared/job_name_component.vue';
import { accessValue } from './accessors';
-import ActionComponent from './action_component.vue';
import { REST } from './constants';
-import JobNameComponent from './job_name_component.vue';
-import { reportToSentry } from './utils';
/**
* Renders the badge for the pipeline graph and the job's dropdown.
diff --git a/app/assets/javascripts/pipelines/components/graph/linked_pipeline.vue b/app/assets/javascripts/pipelines/components/graph/linked_pipeline.vue
index add7b3445f7..5fc3988ed29 100644
--- a/app/assets/javascripts/pipelines/components/graph/linked_pipeline.vue
+++ b/app/assets/javascripts/pipelines/components/graph/linked_pipeline.vue
@@ -3,9 +3,9 @@ import { GlTooltipDirective, GlButton, GlLink, GlLoadingIcon, GlBadge } from '@g
import { BV_HIDE_TOOLTIP } from '~/lib/utils/constants';
import { __, sprintf } from '~/locale';
import CiStatus from '~/vue_shared/components/ci_icon.vue';
+import { reportToSentry } from '../../utils';
import { accessValue } from './accessors';
import { DOWNSTREAM, REST, UPSTREAM } from './constants';
-import { reportToSentry } from './utils';
export default {
directives: {
diff --git a/app/assets/javascripts/pipelines/components/graph/linked_pipelines_column.vue b/app/assets/javascripts/pipelines/components/graph/linked_pipelines_column.vue
index b55a77a3c4f..a8942c86ba9 100644
--- a/app/assets/javascripts/pipelines/components/graph/linked_pipelines_column.vue
+++ b/app/assets/javascripts/pipelines/components/graph/linked_pipelines_column.vue
@@ -1,11 +1,11 @@
<script>
import getPipelineDetails from 'shared_queries/pipelines/get_pipeline_details.query.graphql';
import { LOAD_FAILURE } from '../../constants';
+import { reportToSentry } from '../../utils';
import { ONE_COL_WIDTH, UPSTREAM } from './constants';
import LinkedPipeline from './linked_pipeline.vue';
import {
getQueryHeaders,
- reportToSentry,
serializeLoadErrors,
toggleQueryPollingByVisibility,
unwrapPipelineData,
diff --git a/app/assets/javascripts/pipelines/components/graph/linked_pipelines_column_legacy.vue b/app/assets/javascripts/pipelines/components/graph/linked_pipelines_column_legacy.vue
index 0d1ff94c275..39baeb6e1c3 100644
--- a/app/assets/javascripts/pipelines/components/graph/linked_pipelines_column_legacy.vue
+++ b/app/assets/javascripts/pipelines/components/graph/linked_pipelines_column_legacy.vue
@@ -1,7 +1,7 @@
<script>
+import { reportToSentry } from '../../utils';
import { UPSTREAM } from './constants';
import LinkedPipeline from './linked_pipeline.vue';
-import { reportToSentry } from './utils';
export default {
components: {
diff --git a/app/assets/javascripts/pipelines/components/graph/stage_column_component.vue b/app/assets/javascripts/pipelines/components/graph/stage_column_component.vue
index 66467dbc994..0e945a553e4 100644
--- a/app/assets/javascripts/pipelines/components/graph/stage_column_component.vue
+++ b/app/assets/javascripts/pipelines/components/graph/stage_column_component.vue
@@ -1,13 +1,13 @@
<script>
import { capitalize, escape, isEmpty } from 'lodash';
import glFeatureFlagMixin from '~/vue_shared/mixins/gl_feature_flags_mixin';
+import { reportToSentry } from '../../utils';
import MainGraphWrapper from '../graph_shared/main_graph_wrapper.vue';
+import ActionComponent from '../jobs_shared/action_component.vue';
import { accessValue } from './accessors';
-import ActionComponent from './action_component.vue';
import { GRAPHQL } from './constants';
import JobGroupDropdown from './job_group_dropdown.vue';
import JobItem from './job_item.vue';
-import { reportToSentry } from './utils';
export default {
components: {
@@ -97,6 +97,23 @@ export default {
isFadedOut(jobName) {
return this.highlightedJobs.length > 1 && !this.highlightedJobs.includes(jobName);
},
+ isParallel(group) {
+ return group.size > 1 && group.jobs.length > 1;
+ },
+ singleJobExists(group) {
+ const firstJobDefined = Boolean(group.jobs?.[0]);
+
+ if (!firstJobDefined) {
+ const currentGroup = this.groups.find((element) => element.name === group.name);
+ const serializedGroup = Object.entries(currentGroup).join(' ');
+ reportToSentry(
+ 'stage_column_component',
+ `undefined_job_hunt, serialized group: ${serializedGroup}`,
+ );
+ }
+
+ return group.size === 1 && firstJobDefined;
+ },
},
};
</script>
@@ -130,7 +147,7 @@ export default {
@mouseleave="$emit('jobHover', '')"
>
<job-item
- v-if="group.size === 1"
+ v-if="singleJobExists(group)"
:job="group.jobs[0]"
:job-hovered="jobHovered"
:pipeline-expanded="pipelineExpanded"
@@ -139,7 +156,7 @@ export default {
:class="{ 'gl-opacity-3': isFadedOut(group.name) }"
@pipelineActionRequestComplete="$emit('refreshPipelineGraph')"
/>
- <div v-else :class="{ 'gl-opacity-3': isFadedOut(group.name) }">
+ <div v-else-if="isParallel(group)" :class="{ 'gl-opacity-3': isFadedOut(group.name) }">
<job-group-dropdown :group="group" :pipeline-id="pipelineId" />
</div>
</div>
diff --git a/app/assets/javascripts/pipelines/components/graph/stage_column_component_legacy.vue b/app/assets/javascripts/pipelines/components/graph/stage_column_component_legacy.vue
index 2cee2fbbd8f..cbaf07c05cf 100644
--- a/app/assets/javascripts/pipelines/components/graph/stage_column_component_legacy.vue
+++ b/app/assets/javascripts/pipelines/components/graph/stage_column_component_legacy.vue
@@ -1,10 +1,10 @@
<script>
import { isEmpty, escape } from 'lodash';
import stageColumnMixin from '../../mixins/stage_column_mixin';
-import ActionComponent from './action_component.vue';
+import { reportToSentry } from '../../utils';
+import ActionComponent from '../jobs_shared/action_component.vue';
import JobGroupDropdown from './job_group_dropdown.vue';
import JobItem from './job_item.vue';
-import { reportToSentry } from './utils';
export default {
components: {
diff --git a/app/assets/javascripts/pipelines/components/graph/utils.js b/app/assets/javascripts/pipelines/components/graph/utils.js
index b9a8e2638bc..d36f18f0903 100644
--- a/app/assets/javascripts/pipelines/components/graph/utils.js
+++ b/app/assets/javascripts/pipelines/components/graph/utils.js
@@ -1,4 +1,3 @@
-import * as Sentry from '@sentry/browser';
import Visibility from 'visibilityjs';
import { getIdFromGraphQLId } from '~/graphql_shared/utils';
import { unwrapStagesWithNeeds } from '../unwrapping_utils';
@@ -24,13 +23,6 @@ const getQueryHeaders = (etagResource) => {
};
};
-const reportToSentry = (component, failureType) => {
- Sentry.withScope((scope) => {
- scope.setTag('component', component);
- Sentry.captureException(failureType);
- });
-};
-
const serializeGqlErr = (gqlError) => {
const { locations = [], message = '', path = [] } = gqlError;
@@ -113,7 +105,6 @@ const validateConfigPaths = (value) => value.graphqlResourceEtag?.length > 0;
export {
getQueryHeaders,
- reportToSentry,
serializeGqlErr,
serializeLoadErrors,
toggleQueryPollingByVisibility,
diff --git a/app/assets/javascripts/pipelines/components/graph_shared/api.js b/app/assets/javascripts/pipelines/components/graph_shared/api.js
index 04ac15ae24c..49cd04d11e9 100644
--- a/app/assets/javascripts/pipelines/components/graph_shared/api.js
+++ b/app/assets/javascripts/pipelines/components/graph_shared/api.js
@@ -1,5 +1,5 @@
import axios from '~/lib/utils/axios_utils';
-import { reportToSentry } from '../graph/utils';
+import { reportToSentry } from '../../utils';
export const reportPerformance = (path, stats) => {
axios.post(path, stats).catch((err) => {
diff --git a/app/assets/javascripts/pipelines/components/graph_shared/links_inner.vue b/app/assets/javascripts/pipelines/components/graph_shared/links_inner.vue
index fad57084992..382127285ba 100644
--- a/app/assets/javascripts/pipelines/components/graph_shared/links_inner.vue
+++ b/app/assets/javascripts/pipelines/components/graph_shared/links_inner.vue
@@ -10,8 +10,7 @@ import {
} from '~/performance/constants';
import { performanceMarkAndMeasure } from '~/performance/utils';
import { DRAW_FAILURE } from '../../constants';
-import { createJobsHash, generateJobNeedsDict } from '../../utils';
-import { reportToSentry } from '../graph/utils';
+import { createJobsHash, generateJobNeedsDict, reportToSentry } from '../../utils';
import { parseData } from '../parsing_utils';
import { reportPerformance } from './api';
import { generateLinksData } from './drawing_utils';
diff --git a/app/assets/javascripts/pipelines/components/graph_shared/links_layer.vue b/app/assets/javascripts/pipelines/components/graph_shared/links_layer.vue
index 42eab13b0bd..8dbab245f44 100644
--- a/app/assets/javascripts/pipelines/components/graph_shared/links_layer.vue
+++ b/app/assets/javascripts/pipelines/components/graph_shared/links_layer.vue
@@ -11,7 +11,7 @@ import {
PIPELINES_DETAIL_LINKS_JOB_RATIO,
} from '~/performance/constants';
import { performanceMarkAndMeasure } from '~/performance/utils';
-import { reportToSentry } from '../graph/utils';
+import { reportToSentry } from '../../utils';
import { parseData } from '../parsing_utils';
import { reportPerformance } from './api';
import LinksInner from './links_inner.vue';
diff --git a/app/assets/javascripts/pipelines/components/graph/action_component.vue b/app/assets/javascripts/pipelines/components/jobs_shared/action_component.vue
index 1df693704d4..3972c126673 100644
--- a/app/assets/javascripts/pipelines/components/graph/action_component.vue
+++ b/app/assets/javascripts/pipelines/components/jobs_shared/action_component.vue
@@ -5,7 +5,7 @@ import axios from '~/lib/utils/axios_utils';
import { BV_HIDE_TOOLTIP } from '~/lib/utils/constants';
import { dasherize } from '~/lib/utils/text_utility';
import { __ } from '~/locale';
-import { reportToSentry } from './utils';
+import { reportToSentry } from '../../utils';
/**
* Renders either a cancel, retry or play icon button and handles the post request
diff --git a/app/assets/javascripts/pipelines/components/graph/job_name_component.vue b/app/assets/javascripts/pipelines/components/jobs_shared/job_name_component.vue
index fffd8e1818a..fffd8e1818a 100644
--- a/app/assets/javascripts/pipelines/components/graph/job_name_component.vue
+++ b/app/assets/javascripts/pipelines/components/jobs_shared/job_name_component.vue
diff --git a/app/assets/javascripts/pipelines/components/pipelines_list/job_item.vue b/app/assets/javascripts/pipelines/components/pipelines_list/job_item.vue
new file mode 100644
index 00000000000..de326e3eeb6
--- /dev/null
+++ b/app/assets/javascripts/pipelines/components/pipelines_list/job_item.vue
@@ -0,0 +1,186 @@
+<script>
+import { GlTooltipDirective, GlLink } from '@gitlab/ui';
+import delayedJobMixin from '~/jobs/mixins/delayed_job_mixin';
+import { BV_HIDE_TOOLTIP } from '~/lib/utils/constants';
+import { sprintf } from '~/locale';
+import { reportToSentry } from '../../utils';
+import ActionComponent from '../jobs_shared/action_component.vue';
+import JobNameComponent from '../jobs_shared/job_name_component.vue';
+
+/**
+ * Renders the badge for the pipeline graph and the job's dropdown.
+ *
+ * The following object should be provided as `job`:
+ *
+ * {
+ * "id": 4256,
+ * "name": "test",
+ * "status": {
+ * "icon": "status_success",
+ * "text": "passed",
+ * "label": "passed",
+ * "group": "success",
+ * "tooltip": "passed",
+ * "details_path": "/root/ci-mock/builds/4256",
+ * "action": {
+ * "icon": "retry",
+ * "title": "Retry",
+ * "path": "/root/ci-mock/builds/4256/retry",
+ * "method": "post"
+ * }
+ * }
+ * }
+ */
+
+export default {
+ hoverClass: 'gl-shadow-x0-y0-b3-s1-blue-500',
+ components: {
+ ActionComponent,
+ JobNameComponent,
+ GlLink,
+ },
+ directives: {
+ GlTooltip: GlTooltipDirective,
+ },
+ mixins: [delayedJobMixin],
+ props: {
+ job: {
+ type: Object,
+ required: true,
+ },
+ cssClassJobName: {
+ type: String,
+ required: false,
+ default: '',
+ },
+ dropdownLength: {
+ type: Number,
+ required: false,
+ default: Infinity,
+ },
+ jobHovered: {
+ type: String,
+ required: false,
+ default: '',
+ },
+ pipelineExpanded: {
+ type: Object,
+ required: false,
+ default: () => ({}),
+ },
+ pipelineId: {
+ type: Number,
+ required: false,
+ default: -1,
+ },
+ },
+ computed: {
+ boundary() {
+ return this.dropdownLength === 1 ? 'viewport' : 'scrollParent';
+ },
+ detailsPath() {
+ return this.status.details_path;
+ },
+ hasDetails() {
+ return this.status.has_details;
+ },
+ status() {
+ return this.job && this.job.status ? this.job.status : {};
+ },
+ tooltipText() {
+ const textBuilder = [];
+ const { name: jobName } = this.job;
+
+ if (jobName) {
+ textBuilder.push(jobName);
+ }
+
+ const { tooltip: statusTooltip } = this.status;
+ if (jobName && statusTooltip) {
+ textBuilder.push('-');
+ }
+
+ if (statusTooltip) {
+ if (this.isDelayedJob) {
+ textBuilder.push(sprintf(statusTooltip, { remainingTime: this.remainingTime }));
+ } else {
+ textBuilder.push(statusTooltip);
+ }
+ }
+
+ return textBuilder.join(' ');
+ },
+ /**
+ * Verifies if the provided job has an action path
+ *
+ * @return {Boolean}
+ */
+ hasAction() {
+ return this.job.status && this.job.status.action && this.job.status.action.path;
+ },
+ relatedDownstreamHovered() {
+ return this.job.name === this.jobHovered;
+ },
+ relatedDownstreamExpanded() {
+ return this.job.name === this.pipelineExpanded.jobName && this.pipelineExpanded.expanded;
+ },
+ jobClasses() {
+ return this.relatedDownstreamHovered || this.relatedDownstreamExpanded
+ ? `${this.$options.hoverClass} ${this.cssClassJobName}`
+ : this.cssClassJobName;
+ },
+ },
+ errorCaptured(err, _vm, info) {
+ reportToSentry('pipelines_job_item', `pipelines_job_item error: ${err}, info: ${info}`);
+ },
+ methods: {
+ hideTooltips() {
+ this.$root.$emit(BV_HIDE_TOOLTIP);
+ },
+ pipelineActionRequestComplete() {
+ this.$emit('pipelineActionRequestComplete');
+ },
+ },
+};
+</script>
+<template>
+ <div
+ class="ci-job-component gl-display-flex gl-align-items-center gl-justify-content-space-between"
+ data-qa-selector="job_item_container"
+ >
+ <gl-link
+ v-if="hasDetails"
+ v-gl-tooltip="{ boundary, placement: 'bottom', customClass: 'gl-pointer-events-none' }"
+ :href="detailsPath"
+ :title="tooltipText"
+ :class="jobClasses"
+ class="js-pipeline-graph-job-link qa-job-link menu-item gl-text-gray-900 gl-active-text-decoration-none gl-focus-text-decoration-none gl-hover-text-decoration-none"
+ data-testid="job-with-link"
+ @click.stop="hideTooltips"
+ @mouseout="hideTooltips"
+ >
+ <job-name-component :name="job.name" :status="job.status" :icon-size="24" />
+ </gl-link>
+
+ <div
+ v-else
+ v-gl-tooltip="{ boundary, placement: 'bottom', customClass: 'gl-pointer-events-none' }"
+ :title="tooltipText"
+ :class="jobClasses"
+ class="js-job-component-tooltip non-details-job-component menu-item"
+ data-testid="job-without-link"
+ @mouseout="hideTooltips"
+ >
+ <job-name-component :name="job.name" :status="job.status" :icon-size="24" />
+ </div>
+
+ <action-component
+ v-if="hasAction"
+ :tooltip-text="status.action.title"
+ :link="status.action.path"
+ :action-icon="status.action.icon"
+ data-qa-selector="action_button"
+ @pipelineActionRequestComplete="pipelineActionRequestComplete"
+ />
+ </div>
+</template>
diff --git a/app/assets/javascripts/pipelines/components/pipelines_list/pipeline_stage.vue b/app/assets/javascripts/pipelines/components/pipelines_list/pipeline_stage.vue
index bdb7dd06620..d15c3e0bb6d 100644
--- a/app/assets/javascripts/pipelines/components/pipelines_list/pipeline_stage.vue
+++ b/app/assets/javascripts/pipelines/components/pipelines_list/pipeline_stage.vue
@@ -17,7 +17,7 @@ import { deprecatedCreateFlash as Flash } from '~/flash';
import axios from '~/lib/utils/axios_utils';
import { __ } from '~/locale';
import eventHub from '../../event_hub';
-import JobItem from '../graph/job_item.vue';
+import JobItem from './job_item.vue';
export default {
components: {
diff --git a/app/assets/javascripts/pipelines/pipeline_details_bundle.js b/app/assets/javascripts/pipelines/pipeline_details_bundle.js
index 6b2312edf75..849f4c27988 100644
--- a/app/assets/javascripts/pipelines/pipeline_details_bundle.js
+++ b/app/assets/javascripts/pipelines/pipeline_details_bundle.js
@@ -3,12 +3,12 @@ import { deprecatedCreateFlash as Flash } from '~/flash';
import { __ } from '~/locale';
import Translate from '~/vue_shared/translate';
import PipelineGraphLegacy from './components/graph/graph_component_legacy.vue';
-import { reportToSentry } from './components/graph/utils';
import TestReports from './components/test_reports/test_reports.vue';
import GraphBundleMixin from './mixins/graph_pipeline_bundle_mixin';
import createDagApp from './pipeline_details_dag';
import { apolloProvider } from './pipeline_shared_client';
import createTestReportsStore from './stores/test_reports';
+import { reportToSentry } from './utils';
Vue.use(Translate);
diff --git a/app/assets/javascripts/pipelines/pipeline_details_graph.js b/app/assets/javascripts/pipelines/pipeline_details_graph.js
index 453b387f2f3..39c3c2ea5c5 100644
--- a/app/assets/javascripts/pipelines/pipeline_details_graph.js
+++ b/app/assets/javascripts/pipelines/pipeline_details_graph.js
@@ -2,7 +2,7 @@ import Vue from 'vue';
import VueApollo from 'vue-apollo';
import { GRAPHQL } from './components/graph/constants';
import PipelineGraphWrapper from './components/graph/graph_component_wrapper.vue';
-import { reportToSentry } from './components/graph/utils';
+import { reportToSentry } from './utils';
Vue.use(VueApollo);
diff --git a/app/assets/javascripts/pipelines/utils.js b/app/assets/javascripts/pipelines/utils.js
index 22820fca43e..0a6c326fa3d 100644
--- a/app/assets/javascripts/pipelines/utils.js
+++ b/app/assets/javascripts/pipelines/utils.js
@@ -1,3 +1,4 @@
+import * as Sentry from '@sentry/browser';
import { pickBy } from 'lodash';
import { createNodeDict } from './components/parsing_utils';
import { SUPPORTED_FILTER_PARAMETERS } from './constants';
@@ -65,3 +66,10 @@ export const generateJobNeedsDict = (jobs = {}) => {
return { ...acc, [value]: uniqueValues };
}, {});
};
+
+export const reportToSentry = (component, failureType) => {
+ Sentry.withScope((scope) => {
+ scope.setTag('component', component);
+ Sentry.captureException(failureType);
+ });
+};
diff --git a/app/assets/javascripts/tracking.js b/app/assets/javascripts/tracking.js
index 01de034417e..eccce0d857e 100644
--- a/app/assets/javascripts/tracking.js
+++ b/app/assets/javascripts/tracking.js
@@ -28,7 +28,7 @@ const DEFAULT_SNOWPLOW_OPTIONS = {
};
const createEventPayload = (el, { suffix = '' } = {}) => {
- const action = el.dataset.trackEvent + (suffix || '');
+ const action = (el.dataset.trackAction || el.dataset.trackEvent) + (suffix || '');
let value = el.dataset.trackValue || el.value || undefined;
if (el.type === 'checkbox' && !el.checked) value = false;
@@ -52,7 +52,7 @@ const createEventPayload = (el, { suffix = '' } = {}) => {
};
const eventHandler = (e, func, opts = {}) => {
- const el = e.target.closest('[data-track-event]');
+ const el = e.target.closest('[data-track-event], [data-track-action]');
if (!el) return;
@@ -130,7 +130,9 @@ export default class Tracking {
static trackLoadEvents(category = document.body.dataset.page, parent = document) {
if (!this.enabled()) return [];
- const loadEvents = parent.querySelectorAll('[data-track-event="render"]');
+ const loadEvents = parent.querySelectorAll(
+ '[data-track-action="render"], [data-track-event="render"]',
+ );
loadEvents.forEach((element) => {
const { action, data } = createEventPayload(element);
diff --git a/app/assets/stylesheets/pages/settings.scss b/app/assets/stylesheets/pages/settings.scss
index f31b6d96f03..aa9ebfe2968 100644
--- a/app/assets/stylesheets/pages/settings.scss
+++ b/app/assets/stylesheets/pages/settings.scss
@@ -278,10 +278,6 @@
.card-header {
display: flex;
align-items: center;
-
- > .btn-success {
- margin-left: auto;
- }
}
.custom-metric {
diff --git a/app/controllers/customers_dot/proxy_controller.rb b/app/controllers/customers_dot/proxy_controller.rb
new file mode 100644
index 00000000000..5abf8a487c6
--- /dev/null
+++ b/app/controllers/customers_dot/proxy_controller.rb
@@ -0,0 +1,21 @@
+# frozen_string_literal: true
+
+module CustomersDot
+ class ProxyController < ApplicationController
+ skip_before_action :authenticate_user!
+ skip_before_action :verify_authenticity_token
+
+ feature_category :purchase
+
+ BASE_URL = Gitlab::SubscriptionPortal::SUBSCRIPTIONS_URL
+
+ def graphql
+ response = Gitlab::HTTP.post("#{BASE_URL}/graphql",
+ body: request.raw_post,
+ headers: { 'Content-Type' => 'application/json' }
+ )
+
+ render json: response.body, status: response.code
+ end
+ end
+end
diff --git a/app/helpers/tracking_helper.rb b/app/helpers/tracking_helper.rb
index 221d9692661..7957038c21e 100644
--- a/app/helpers/tracking_helper.rb
+++ b/app/helpers/tracking_helper.rb
@@ -1,13 +1,13 @@
# frozen_string_literal: true
module TrackingHelper
- def tracking_attrs(label, event, property)
+ def tracking_attrs(label, action, property)
return {} unless tracking_enabled?
{
data: {
track_label: label,
- track_event: event,
+ track_action: action,
track_property: property
}
}
diff --git a/app/models/clusters/agent_token.rb b/app/models/clusters/agent_token.rb
index b53bd30272a..d42279502c5 100644
--- a/app/models/clusters/agent_token.rb
+++ b/app/models/clusters/agent_token.rb
@@ -19,7 +19,7 @@ module Clusters
before_save :ensure_token
validates :description, length: { maximum: 1024 }
- validates :name, presence: true, length: { maximum: 255 }, on: :create
+ validates :name, presence: true, length: { maximum: 255 }
def track_usage
track_values = { last_used_at: Time.current.utc }
diff --git a/app/models/internal_id.rb b/app/models/internal_id.rb
index c735e593da7..b56bac58705 100644
--- a/app/models/internal_id.rb
+++ b/app/models/internal_id.rb
@@ -47,18 +47,10 @@ class InternalId < ApplicationRecord
def update_and_save(&block)
lock!
yield
- update_and_save_counter.increment(usage: usage, changed: last_value_changed?)
save!
last_value
end
- # Instrumentation to track for-update locks
- def update_and_save_counter
- strong_memoize(:update_and_save_counter) do
- Gitlab::Metrics.counter(:gitlab_internal_id_for_update_lock, 'Number of ROW SHARE (FOR UPDATE) locks on individual records from internal_ids')
- end
- end
-
class << self
def track_greatest(subject, scope, usage, new_value, init)
InternalIdGenerator.new(subject, scope, usage, init)
@@ -88,6 +80,8 @@ class InternalId < ApplicationRecord
end
class InternalIdGenerator
+ extend Gitlab::Utils::StrongMemoize
+
# Generate next internal id for a given scope and usage.
#
# For currently supported usages, see #usage enum.
@@ -123,6 +117,8 @@ class InternalId < ApplicationRecord
# init: Block that gets called to initialize InternalId record if not present
# Make sure to not throw exceptions in the absence of records (if this is expected).
def generate
+ self.class.internal_id_transactions_increment(operation: :generate, usage: usage)
+
subject.transaction do
# Create a record in internal_ids if one does not yet exist
# and increment its last value
@@ -138,6 +134,8 @@ class InternalId < ApplicationRecord
def reset(value)
return false unless value
+ self.class.internal_id_transactions_increment(operation: :reset, usage: usage)
+
updated =
InternalId
.where(**scope, usage: usage_value)
@@ -152,6 +150,8 @@ class InternalId < ApplicationRecord
#
# Note this will acquire a ROW SHARE lock on the InternalId record
def track_greatest(new_value)
+ self.class.internal_id_transactions_increment(operation: :track_greatest, usage: usage)
+
subject.transaction do
record.track_greatest_and_save!(new_value)
end
@@ -162,6 +162,8 @@ class InternalId < ApplicationRecord
end
def with_lock(&block)
+ self.class.internal_id_transactions_increment(operation: :with_lock, usage: usage)
+
record.with_lock(&block)
end
@@ -197,5 +199,22 @@ class InternalId < ApplicationRecord
rescue ActiveRecord::RecordNotUnique
lookup
end
+
+ def self.internal_id_transactions_increment(operation:, usage:)
+ self.internal_id_transactions_total.increment(
+ operation: operation,
+ usage: usage.to_s,
+ in_transaction: ActiveRecord::Base.connection.transaction_open?.to_s
+ )
+ end
+
+ def self.internal_id_transactions_total
+ strong_memoize(:internal_id_transactions_total) do
+ name = :gitlab_internal_id_transactions_total
+ comment = 'Counts all the internal ids happening within transaction'
+
+ Gitlab::Metrics.counter(name, comment)
+ end
+ end
end
end
diff --git a/app/views/projects/deploy_keys/edit.html.haml b/app/views/projects/deploy_keys/edit.html.haml
index 1527d06e9dc..f0214ade313 100644
--- a/app/views/projects/deploy_keys/edit.html.haml
+++ b/app/views/projects/deploy_keys/edit.html.haml
@@ -6,5 +6,5 @@
= form_for [@project, @deploy_key], include_id: false, html: { class: 'js-requires-input' } do |f|
= render partial: 'shared/deploy_keys/form', locals: { form: f, deploy_key: @deploy_key }
.form-actions
- = f.submit 'Save changes', class: 'gl-button btn btn-confirm'
- = link_to 'Cancel', project_settings_repository_path(@project), class: 'gl-button btn btn-default btn-cancel'
+ = f.submit _('Save changes'), class: 'gl-button btn btn-confirm'
+ = link_to _('Cancel'), project_settings_repository_path(@project), class: 'gl-button btn btn-default btn-cancel'
diff --git a/app/views/projects/services/prometheus/_configuration_banner.html.haml b/app/views/projects/services/prometheus/_configuration_banner.html.haml
index 9b8da857398..3786b845692 100644
--- a/app/views/projects/services/prometheus/_configuration_banner.html.haml
+++ b/app/views/projects/services/prometheus/_configuration_banner.html.haml
@@ -21,6 +21,6 @@
.col-sm-10
%p.gl-mt-3
= s_('PrometheusService|Automatically deploy and configure Prometheus on your clusters to monitor your project’s environments.')
- = link_to s_('PrometheusService|Install Prometheus on clusters'), project_clusters_path(project), class: 'btn gl-button btn-success'
+ = link_to s_('PrometheusService|Install Prometheus on clusters'), project_clusters_path(project), class: 'btn gl-button btn-confirm'
%hr
diff --git a/app/views/projects/services/prometheus/_custom_metrics.html.haml b/app/views/projects/services/prometheus/_custom_metrics.html.haml
index 70685a8a9eb..a901d5b3575 100644
--- a/app/views/projects/services/prometheus/_custom_metrics.html.haml
+++ b/app/views/projects/services/prometheus/_custom_metrics.html.haml
@@ -13,7 +13,7 @@
-# haml-lint:disable NoPlainNodes
%span.badge.badge-pill.js-custom-monitored-count 0
-# haml-lint:enable NoPlainNodes
- = link_to s_('PrometheusService|New metric'), new_project_prometheus_metric_path(project), class: 'btn gl-button btn-success js-new-metric-button hidden', data: { qa_selector: 'new_metric_button' }
+ = link_to s_('PrometheusService|New metric'), new_project_prometheus_metric_path(project), class: 'btn gl-button btn-confirm gl-ml-auto js-new-metric-button hidden', data: { qa_selector: 'new_metric_button' }
.card-body
.flash-container.hidden
.flash-warning
diff --git a/app/workers/build_hooks_worker.rb b/app/workers/build_hooks_worker.rb
index ce4aa7229aa..5e05063f058 100644
--- a/app/workers/build_hooks_worker.rb
+++ b/app/workers/build_hooks_worker.rb
@@ -7,6 +7,7 @@ class BuildHooksWorker # rubocop:disable Scalability/IdempotentWorker
queue_namespace :pipeline_hooks
feature_category :continuous_integration
urgency :high
+ data_consistency :delayed, feature_flag: :load_balancing_for_build_hooks_worker
# rubocop: disable CodeReuse/ActiveRecord
def perform(build_id)
diff --git a/changelogs/unreleased/22691-externalize-app-views-projects-deploy_keys-edit.yml b/changelogs/unreleased/22691-externalize-app-views-projects-deploy_keys-edit.yml
new file mode 100644
index 00000000000..da20f4299e3
--- /dev/null
+++ b/changelogs/unreleased/22691-externalize-app-views-projects-deploy_keys-edit.yml
@@ -0,0 +1,5 @@
+---
+title: Externalize project deploy keys (edit) strings
+merge_request: 57015
+author: Jonston Chan @JonstonChan
+type: other
diff --git a/changelogs/unreleased/290962-rename-event-to-action-in-haml-snowplow-helper.yml b/changelogs/unreleased/290962-rename-event-to-action-in-haml-snowplow-helper.yml
new file mode 100644
index 00000000000..a917ead8bd6
--- /dev/null
+++ b/changelogs/unreleased/290962-rename-event-to-action-in-haml-snowplow-helper.yml
@@ -0,0 +1,5 @@
+---
+title: Rename event to action in Snowplow helpers and FE event handlers
+merge_request: 55698
+author:
+type: deprecated
diff --git a/changelogs/unreleased/322745-validate-null-constraint.yml b/changelogs/unreleased/322745-validate-null-constraint.yml
new file mode 100644
index 00000000000..432f605b54e
--- /dev/null
+++ b/changelogs/unreleased/322745-validate-null-constraint.yml
@@ -0,0 +1,5 @@
+---
+title: Validate null constraint for cluster token name
+merge_request: 56868
+author:
+type: changed
diff --git a/changelogs/unreleased/323675-cleanup-web-hoo-logs-backfill-migration.yml b/changelogs/unreleased/323675-cleanup-web-hoo-logs-backfill-migration.yml
new file mode 100644
index 00000000000..618e8fd606c
--- /dev/null
+++ b/changelogs/unreleased/323675-cleanup-web-hoo-logs-backfill-migration.yml
@@ -0,0 +1,5 @@
+---
+title: Migration to cleanup after partitioned web_hook_logs backfill
+merge_request: 57580
+author:
+type: other
diff --git a/changelogs/unreleased/ak-fix-registration-token.yml b/changelogs/unreleased/ak-fix-registration-token.yml
new file mode 100644
index 00000000000..5c40f8072b3
--- /dev/null
+++ b/changelogs/unreleased/ak-fix-registration-token.yml
@@ -0,0 +1,5 @@
+---
+title: Remove programmatic access to registration tokens
+merge_request: 57524
+author:
+type: changed
diff --git a/changelogs/unreleased/btn-confirm-projects-services.yml b/changelogs/unreleased/btn-confirm-projects-services.yml
new file mode 100644
index 00000000000..87c6d511d87
--- /dev/null
+++ b/changelogs/unreleased/btn-confirm-projects-services.yml
@@ -0,0 +1,5 @@
+---
+title: Move from btn-success to btn-confirm in projects/services directory
+merge_request: 56937
+author: Yogi (@yo)
+type: changed
diff --git a/config/feature_flags/development/load_balancing_for_build_hooks_worker.yml b/config/feature_flags/development/load_balancing_for_build_hooks_worker.yml
new file mode 100644
index 00000000000..41c066c4de9
--- /dev/null
+++ b/config/feature_flags/development/load_balancing_for_build_hooks_worker.yml
@@ -0,0 +1,8 @@
+---
+name: load_balancing_for_build_hooks_worker
+introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/57575
+rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/326095
+milestone: '13.11'
+type: development
+group: group::memory
+default_enabled: false
diff --git a/config/routes.rb b/config/routes.rb
index 38030a24cb5..c7537671336 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -284,6 +284,7 @@ Rails.application.routes.draw do
draw :git_http
draw :api
+ draw :customers_dot
draw :sidekiq
draw :help
draw :google_api
diff --git a/config/routes/customers_dot.rb b/config/routes/customers_dot.rb
new file mode 100644
index 00000000000..d6afb54cae8
--- /dev/null
+++ b/config/routes/customers_dot.rb
@@ -0,0 +1,7 @@
+# frozen_string_literal: true
+
+scope '-' do
+ namespace :customers_dot do
+ post 'proxy/graphql' => 'proxy#graphql'
+ end
+end
diff --git a/danger/product_intelligence/Dangerfile b/danger/product_intelligence/Dangerfile
index b300188a8f8..0e8a58c3a6a 100644
--- a/danger/product_intelligence/Dangerfile
+++ b/danger/product_intelligence/Dangerfile
@@ -51,7 +51,8 @@ end
js_patterns = Regexp.union(
'Tracking.event',
/\btrack\(/,
- 'data-track-event'
+ 'data-track-event',
+ 'data-track-action'
)
dictionary_pattern = Regexp.union(
diff --git a/db/post_migrate/20210317155207_validate_not_null_constraint_on_cluster_token_name.rb b/db/post_migrate/20210317155207_validate_not_null_constraint_on_cluster_token_name.rb
new file mode 100644
index 00000000000..b77523c3a44
--- /dev/null
+++ b/db/post_migrate/20210317155207_validate_not_null_constraint_on_cluster_token_name.rb
@@ -0,0 +1,16 @@
+# frozen_string_literal: true
+
+class ValidateNotNullConstraintOnClusterTokenName < ActiveRecord::Migration[6.0]
+ include Gitlab::Database::MigrationHelpers
+ DOWNTIME = false
+
+ disable_ddl_transaction!
+
+ def up
+ validate_not_null_constraint :cluster_agent_tokens, :name
+ end
+
+ def down
+ # no-op
+ end
+end
diff --git a/db/post_migrate/20210326121537_backfill_cleanup_for_partitioned_web_hook_logs.rb b/db/post_migrate/20210326121537_backfill_cleanup_for_partitioned_web_hook_logs.rb
new file mode 100644
index 00000000000..5816d02561e
--- /dev/null
+++ b/db/post_migrate/20210326121537_backfill_cleanup_for_partitioned_web_hook_logs.rb
@@ -0,0 +1,17 @@
+# frozen_string_literal: true
+
+class BackfillCleanupForPartitionedWebHookLogs < ActiveRecord::Migration[6.0]
+ include Gitlab::Database::PartitioningMigrationHelpers
+
+ DOWNTIME = false
+
+ disable_ddl_transaction!
+
+ def up
+ finalize_backfilling_partitioned_table :web_hook_logs
+ end
+
+ def down
+ # no op
+ end
+end
diff --git a/db/schema_migrations/20210317155207 b/db/schema_migrations/20210317155207
new file mode 100644
index 00000000000..3038d9cb4ab
--- /dev/null
+++ b/db/schema_migrations/20210317155207
@@ -0,0 +1 @@
+b6c30723c2be7dd0afe535272cded230db4954bfe914d5087542be2c27d0ad79 \ No newline at end of file
diff --git a/db/schema_migrations/20210326121537 b/db/schema_migrations/20210326121537
new file mode 100644
index 00000000000..ece53e34413
--- /dev/null
+++ b/db/schema_migrations/20210326121537
@@ -0,0 +1 @@
+ac8063901a0de1f2e6d4fd5336f54bfca0bafa9d081066124ec9d2acf47c9b47 \ No newline at end of file
diff --git a/db/structure.sql b/db/structure.sql
index 04d82926404..904ce58f0d8 100644
--- a/db/structure.sql
+++ b/db/structure.sql
@@ -11199,6 +11199,7 @@ CREATE TABLE cluster_agent_tokens (
description text,
name text,
last_used_at timestamp with time zone,
+ CONSTRAINT check_0fb634d04d CHECK ((name IS NOT NULL)),
CONSTRAINT check_2b79dbb315 CHECK ((char_length(name) <= 255)),
CONSTRAINT check_4e4ec5070a CHECK ((char_length(description) <= 1024)),
CONSTRAINT check_c60daed227 CHECK ((char_length(token_encrypted) <= 255))
@@ -20233,9 +20234,6 @@ ALTER TABLE ONLY chat_names
ALTER TABLE ONLY chat_teams
ADD CONSTRAINT chat_teams_pkey PRIMARY KEY (id);
-ALTER TABLE cluster_agent_tokens
- ADD CONSTRAINT check_0fb634d04d CHECK ((name IS NOT NULL)) NOT VALID;
-
ALTER TABLE vulnerability_scanners
ADD CONSTRAINT check_37608c9db5 CHECK ((char_length(vendor) <= 255)) NOT VALID;
diff --git a/doc/administration/geo/replication/geo_validation_tests.md b/doc/administration/geo/replication/geo_validation_tests.md
index 0bd20c4c4f8..06fd3cd70be 100644
--- a/doc/administration/geo/replication/geo_validation_tests.md
+++ b/doc/administration/geo/replication/geo_validation_tests.md
@@ -148,7 +148,7 @@ The following are PostgreSQL upgrade validation tests we performed.
[PostgreSQL 11 upgrade procedure for Geo installations](https://gitlab.com/gitlab-org/omnibus-gitlab/-/issues/4975):
- Description: Prior to making PostgreSQL 11 the default version of PostgreSQL in GitLab 12.10, we
- tested upgrading to PostgreSQL 11 in Geo deployments on GitLab 12.9.
+ tested upgrading to PostgreSQL 11 in Geo deployments in GitLab 12.9.
- Outcome: Partially successful. Issues were discovered in multi-node configurations with a separate
tracking database and concerns were raised about allowing automatic upgrades when Geo enabled.
- Follow up issues:
diff --git a/doc/development/documentation/feature_flags.md b/doc/development/documentation/feature_flags.md
index 7f87d841139..ca5c250ce69 100644
--- a/doc/development/documentation/feature_flags.md
+++ b/doc/development/documentation/feature_flags.md
@@ -62,10 +62,10 @@ be enabled for a single project, and is not ready for production use:
# Feature Name
> - [Introduced](link-to-issue) in GitLab 12.0.
-> - It's [deployed behind a feature flag](<replace with path to>/user/feature_flags.md), disabled by default.
-> - It's disabled on GitLab.com.
-> - It's not recommended for production use.
-> - To use it in GitLab self-managed instances, ask a GitLab administrator to [enable it](#anchor-to-section). **(FREE SELF)**
+> - [Deployed behind a feature flag](<replace with path to>/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](#anchor-to-section). **(FREE SELF)**
WARNING:
This feature might not be available to you. Check the **version history** note above for details.
@@ -120,10 +120,10 @@ use:
# Feature Name
> - [Introduced](link-to-issue) in GitLab 12.0.
-> - It was [deployed behind a feature flag](<replace with path to>/user/feature_flags.md), disabled by default.
-> - [Became enabled by default](link-to-issue) on GitLab 12.1.
-> - It's enabled on GitLab.com.
-> - It's recommended for production use.
+> - [Deployed behind a feature flag](<replace with path to>/user/feature_flags.md), disabled by default.
+> - [Enabled by default](link-to-issue) in GitLab 12.1.
+> - Enabled on GitLab.com.
+> - Recommended for production use.
> - For GitLab self-managed instances, GitLab administrators can opt to [disable it](#anchor-to-section). **(FREE SELF)**
WARNING:
@@ -177,9 +177,9 @@ cannot be enabled for a single project, and is ready for production use:
# Feature Name
> - [Introduced](link-to-issue) in GitLab 12.0.
-> - It's [deployed behind a feature flag](<replace with path to>/user/feature_flags.md), enabled by default.
-> - It's enabled on GitLab.com.
-> - It's recommended for production use.
+> - [Deployed behind a feature flag](<replace with path to>/user/feature_flags.md), enabled by default.
+> - Enabled on GitLab.com.
+> - Recommended for production use.
> - For GitLab self-managed instances, GitLab administrators can opt to [disable it](#anchor-to-section). **(FREE SELF)**
WARNING:
@@ -249,10 +249,10 @@ be enabled by project, and is ready for production use:
# Feature Name
> - [Introduced](link-to-issue) in GitLab 12.0.
-> - It's [deployed behind a feature flag](<replace with path to>/user/feature_flags.md), enabled by default.
-> - It's enabled on GitLab.com.
-> - It can be enabled or disabled for a single project.
-> - It's recommended for production use.
+> - [Deployed behind a feature flag](<replace with path to>/user/feature_flags.md), enabled by default.
+> - Enabled on GitLab.com.
+> - Can be enabled or disabled for a single project.
+> - Recommended for production use.
> - For GitLab self-managed instances, GitLab administrators can opt to [disable it](#anchor-to-section). **(FREE SELF)**
WARNING:
diff --git a/doc/development/snowplow.md b/doc/development/snowplow.md
index 63eb3f5cac6..3d566100677 100644
--- a/doc/development/snowplow.md
+++ b/doc/development/snowplow.md
@@ -126,17 +126,17 @@ GitLab provides `Tracking`, an interface that wraps the [Snowplow JavaScript Tra
### Tracking in HAML (or Vue Templates)
-When working within HAML (or Vue templates) we can add `data-track-*` attributes to elements of interest. All elements that have a `data-track-event` attribute automatically have event tracking bound on clicks.
+When working within HAML (or Vue templates) we can add `data-track-*` attributes to elements of interest. All elements that have a `data-track-action` attribute automatically have event tracking bound on clicks.
Below is an example of `data-track-*` attributes assigned to a button:
```haml
-%button.btn{ data: { track: { event: "click_button", label: "template_preview", property: "my-template" } } }
+%button.btn{ data: { track: { action: "click_button", label: "template_preview", property: "my-template" } } }
```
```html
<button class="btn"
- data-track-event="click_button"
+ data-track-action="click_button"
data-track-label="template_preview"
data-track-property="my-template"
/>
@@ -148,7 +148,7 @@ Below is a list of supported `data-track-*` attributes:
| attribute | required | description |
|:----------------------|:---------|:------------|
-| `data-track-event` | true | Action the user is taking. Clicks must be prepended with `click` and activations must be prepended with `activate`. For example, focusing a form field would be `activate_form_input` and clicking a button would be `click_button`. |
+| `data-track-action` | true | Action the user is taking. Clicks must be prepended with `click` and activations must be prepended with `activate`. For example, focusing a form field would be `activate_form_input` and clicking a button would be `click_button`. Replaces `data-track-event`, which was [deprecated](https://gitlab.com/gitlab-org/gitlab/-/issues/290962) in GitLab 13.11. |
| `data-track-label` | false | The `label` as described in our [Structured event taxonomy](#structured-event-taxonomy). |
| `data-track-property` | false | The `property` as described in our [Structured event taxonomy](#structured-event-taxonomy). |
| `data-track-value` | false | The `value` as described in our [Structured event taxonomy](#structured-event-taxonomy). If omitted, this is the element's `value` property or an empty string. For checkboxes, the default value is the element's checked attribute or `false` when unchecked. |
@@ -159,11 +159,11 @@ Below is a list of supported `data-track-*` attributes:
When using the GitLab helper method [`nav_link`](https://gitlab.com/gitlab-org/gitlab/-/blob/898b286de322e5df6a38d257b10c94974d580df8/app/helpers/tab_helper.rb#L69) be sure to wrap `html_options` under the `html_options` keyword argument.
Be careful, as this behavior can be confused with the `ActionView` helper method [`link_to`](https://api.rubyonrails.org/v5.2.3/classes/ActionView/Helpers/UrlHelper.html#method-i-link_to) that does not require additional wrapping of `html_options`
-`nav_link(controller: ['dashboard/groups', 'explore/groups'], html_options: { data: { track_label: "groups_dropdown", track_event: "click_dropdown" } })`
+`nav_link(controller: ['dashboard/groups', 'explore/groups'], html_options: { data: { track_label: "groups_dropdown", track_action: "click_dropdown" } })`
vs
-`link_to assigned_issues_dashboard_path, title: _('Issues'), data: { track_label: 'main_navigation', track_event: 'click_issues_link' }`
+`link_to assigned_issues_dashboard_path, title: _('Issues'), data: { track_label: 'main_navigation', track_action: 'click_issues_link' }`
### Tracking within Vue components
diff --git a/doc/development/usage_ping/index.md b/doc/development/usage_ping/index.md
index c8bc995f40c..38514914fd7 100644
--- a/doc/development/usage_ping/index.md
+++ b/doc/development/usage_ping/index.md
@@ -49,7 +49,9 @@ More links:
You can view the exact JSON payload sent to GitLab Inc. in the administration panel. To view the payload:
-1. Navigate to **Admin Area > Settings > Metrics and profiling**.
+1. Sign in as a user with [Administrator](../../user/permissions.md) permissions.
+1. In the top navigation bar, click **(admin)** **Admin Area**.
+1. In the left sidebar, go to **Settings > Metrics and profiling**.
1. Expand the **Usage statistics** section.
1. Click the **Preview payload** button.
@@ -57,9 +59,17 @@ For an example payload, see [Example Usage Ping payload](#example-usage-ping-pay
## Disable Usage Ping
-To disable Usage Ping in the GitLab UI, go to the **Settings** page of your administration panel and uncheck the **Usage Ping** checkbox.
+To disable Usage Ping in the GitLab UI:
-To disable Usage Ping and prevent it from being configured in the future through the administration panel, Omnibus installs can set the following in [`gitlab.rb`](https://docs.gitlab.com/omnibus/settings/configuration.html#configuration-options):
+1. Sign in as a user with [Administrator](../../user/permissions.md) permissions.
+1. In the top navigation bar, click **(admin)** **Admin Area**.
+1. In the left sidebar, go to **Settings > Metrics and profiling**.
+1. Expand the **Usage statistics** section.
+1. Clear the **Usage Ping** checkbox and click **Save changes**.
+
+To disable Usage Ping and prevent it from being configured in the future through
+the administration panel, Omnibus installs can set the following in
+[`gitlab.rb`](https://docs.gitlab.com/omnibus/settings/configuration.html#configuration-options):
```ruby
gitlab_rails['usage_ping_enabled'] = false
diff --git a/doc/raketasks/backup_restore.md b/doc/raketasks/backup_restore.md
index 48fa847e170..e182ecc48bc 100644
--- a/doc/raketasks/backup_restore.md
+++ b/doc/raketasks/backup_restore.md
@@ -941,7 +941,7 @@ Users of GitLab 12.1 and earlier should use the command `gitlab-rake gitlab:back
WARNING:
`gitlab-rake gitlab:backup:restore` doesn't set the correct file system
permissions on your Registry directory. This is a [known issue](https://gitlab.com/gitlab-org/gitlab-foss/-/issues/62759).
-On GitLab 12.2 or later, you can use `gitlab-backup restore` to avoid this
+In GitLab 12.2 or later, you can use `gitlab-backup restore` to avoid this
issue.
If there's a GitLab version mismatch between your backup tar file and the
@@ -963,7 +963,7 @@ sudo gitlab-ctl restart
sudo gitlab-rake gitlab:check SANITIZE=true
```
-On GitLab 13.1 and later, check [database values can be decrypted](../administration/raketasks/doctor.md)
+In GitLab 13.1 and later, check [database values can be decrypted](../administration/raketasks/doctor.md)
especially if `/etc/gitlab/gitlab-secrets.json` was restored, or if a different server is
the target for the restore.
@@ -1011,7 +1011,7 @@ Users of GitLab 12.1 and earlier should use the command `gitlab-rake gitlab:back
WARNING:
`gitlab-rake gitlab:backup:restore` doesn't set the correct file system
permissions on your Registry directory. This is a [known issue](https://gitlab.com/gitlab-org/gitlab-foss/-/issues/62759).
-On GitLab 12.2 or later, you can use `gitlab-backup restore` to avoid this
+In GitLab 12.2 or later, you can use `gitlab-backup restore` to avoid this
issue.
The GitLab Helm chart uses a different process, documented in
diff --git a/doc/subscriptions/gitlab_com/index.md b/doc/subscriptions/gitlab_com/index.md
index d52fccb169a..aa5a7957774 100644
--- a/doc/subscriptions/gitlab_com/index.md
+++ b/doc/subscriptions/gitlab_com/index.md
@@ -161,7 +161,7 @@ You can adjust the number of users before renewing your GitLab SaaS subscription
- To renew for more users than are currently included in your GitLab SaaS plan, [add users to your subscription](#add-users-to-your-subscription).
- To renew for fewer users than are currently included in your GitLab SaaS plan,
-either [disable](../../user/admin_area/activating_deactivating_users.md#deactivating-a-user) or [block](../../user/admin_area/blocking_unblocking_users.md#blocking-a-user) the user accounts you no longer need.
+[remove](#remove-billable-user) the user accounts you no longer need.
For details on upgrading your subscription tier, see
[Upgrade your GitLab SaaS subscription tier](#upgrade-your-gitlab-saas-subscription-tier).
diff --git a/doc/topics/autodevops/stages.md b/doc/topics/autodevops/stages.md
index 913c221d8ec..64ff60dd756 100644
--- a/doc/topics/autodevops/stages.md
+++ b/doc/topics/autodevops/stages.md
@@ -137,8 +137,7 @@ might want to use a [custom buildpack](customize.md#custom-buildpacks).
## Auto Code Quality
-> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/1984) in [GitLab](https://about.gitlab.com/pricing/) 9.3.
-> - Made [available in all tiers](https://gitlab.com/gitlab-org/gitlab/-/issues/212499) in GitLab 13.2.
+> - [Moved](https://gitlab.com/gitlab-org/gitlab/-/issues/212499) to GitLab Free in 13.2.
Auto Code Quality uses the
[Code Quality image](https://gitlab.com/gitlab-org/ci-cd/codequality) to run
@@ -165,7 +164,7 @@ see the documentation.
## Auto Secret Detection
-> - Introduced in [GitLab Ultimate](https://about.gitlab.com/pricing/) 13.1.
+> - Introduced in GitLab Ultimate 13.1.
> - [Select functionality made available in all tiers](../../user/application_security/secret_detection/#making-secret-detection-available-to-all-gitlab-tiers) in 13.3
Secret Detection uses the
@@ -179,8 +178,6 @@ To learn more, see [Secret Detection](../../user/application_security/secret_det
## Auto Dependency Scanning **(ULTIMATE)**
-> Introduced in [GitLab Ultimate](https://about.gitlab.com/pricing/) 10.7.
-
Dependency Scanning runs analysis on the project's dependencies and checks for potential security issues.
The Auto Dependency Scanning stage is skipped on licenses other than
[Ultimate](https://about.gitlab.com/pricing/) and requires
@@ -195,7 +192,7 @@ see the documentation.
## Auto License Compliance **(ULTIMATE)**
-> Introduced in [GitLab Ultimate](https://about.gitlab.com/pricing/) 11.0.
+> Introduced in GitLab Ultimate 11.0.
License Compliance uses the
[License Compliance Docker image](https://gitlab.com/gitlab-org/security-products/analyzers/license-finder)
@@ -211,8 +208,6 @@ documentation.
## Auto Container Scanning **(ULTIMATE)**
-> Introduced in GitLab 10.4.
-
Vulnerability Static Analysis for containers uses [Clair](https://github.com/quay/clair)
to check for potential security issues on Docker images. The Auto Container Scanning
stage is skipped on licenses other than [Ultimate](https://about.gitlab.com/pricing/).
@@ -263,8 +258,6 @@ in the first place, and thus not realize that it needs to re-apply the old confi
## Auto DAST **(ULTIMATE)**
-> Introduced in [GitLab Ultimate](https://about.gitlab.com/pricing/) 10.4.
-
Dynamic Application Security Testing (DAST) uses the popular open source tool
[OWASP ZAProxy](https://github.com/zaproxy/zaproxy) to analyze the current code
and check for potential security issues. The Auto DAST stage is skipped on
@@ -422,10 +415,10 @@ including support for `Deployment` in the `extensions/v1beta1` version.
To use Auto Deploy on a Kubernetes 1.16+ cluster:
-1. If you are deploying your application for the first time on GitLab 13.0 or
+1. If you are deploying your application for the first time in GitLab 13.0 or
newer, no configuration should be required.
-1. On GitLab 12.10 or older, set the following in the [`.gitlab/auto-deploy-values.yaml` file](customize.md#customize-values-for-helm-chart):
+1. In GitLab 12.10 or older, set the following in the [`.gitlab/auto-deploy-values.yaml` file](customize.md#customize-values-for-helm-chart):
```yaml
deploymentApiVersion: apps/v1
@@ -439,7 +432,7 @@ To use Auto Deploy on a Kubernetes 1.16+ cluster:
GitLab 12.9 or 12.10, set `AUTO_DEVOPS_POSTGRES_CHANNEL` to `2`.
WARNING:
-On GitLab 12.9 and 12.10, opting into
+In GitLab 12.9 and 12.10, opting into
`AUTO_DEVOPS_POSTGRES_CHANNEL` version `2` deletes the version `1` PostgreSQL
database. Follow the [guide to upgrading PostgreSQL](upgrading_postgresql.md)
to back up and restore your database before opting into version `2` (On
diff --git a/doc/topics/git/lfs/index.md b/doc/topics/git/lfs/index.md
index 11c0fcc2373..0851d3f6b50 100644
--- a/doc/topics/git/lfs/index.md
+++ b/doc/topics/git/lfs/index.md
@@ -114,10 +114,10 @@ See the documentation on [File Locking](../../../user/project/file_lock.md).
## LFS objects in project archives
> - Support for including Git LFS blobs inside [project source downloads](../../../user/project/repository/index.md) was [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/15079) in GitLab 13.5.
-> - It was [deployed behind a feature flag](../../../user/feature_flags.md), disabled by default.
-> - [Became enabled by default](https://gitlab.com/gitlab-org/gitlab/-/issues/268409) on GitLab 13.6.
-> - It's enabled on GitLab.com.
-> - It's recommended for production use.
+> - [Deployed behind a feature flag](../../../user/feature_flags.md), disabled by default.
+> - [Enabled by default](https://gitlab.com/gitlab-org/gitlab/-/issues/268409) in GitLab 13.6.
+> - Enabled on GitLab.com.
+> - Recommended for production use.
> - For GitLab self-managed instances, GitLab administrators can opt to [disable it](#enable-or-disable-lfs-objects-in-project-archives).
WARNING:
diff --git a/doc/update/index.md b/doc/update/index.md
index 1ecc3b106af..5fb5572f1be 100644
--- a/doc/update/index.md
+++ b/doc/update/index.md
@@ -405,7 +405,7 @@ fail for [multi-node GitLab installations](https://docs.gitlab.com/omnibus/updat
So, if you are using multiple Rails servers and specifically upgrading from 13.0,
all servers must first be upgraded to 13.1.Z before upgrading to 13.2.0 or later:
-1. Ensure all GitLab web nodes are on GitLab 13.1.Z.
+1. Ensure all GitLab web nodes are running GitLab 13.1.Z.
1. Optionally, enable the `global_csrf_token` feature flag to enable new
method of CSRF token generation:
diff --git a/doc/user/admin_area/credentials_inventory.md b/doc/user/admin_area/credentials_inventory.md
index 8306f37f52e..0ae6e41264c 100644
--- a/doc/user/admin_area/credentials_inventory.md
+++ b/doc/user/admin_area/credentials_inventory.md
@@ -56,10 +56,10 @@ The instance then notifies the user.
## Review existing GPG keys
> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/282429) in GitLab 13.10.
-> - It was [deployed behind a feature flag](../feature_flags.md), disabled by default.
-> - [Became enabled by default](https://gitlab.com/gitlab-org/gitlab/-/issues/292961) on GitLab 13.11.
-> - It's enabled on GitLab.com.
-> - It's recommended for production use.
+> - [Deployed behind a feature flag](../feature_flags.md), disabled by default.
+> - [Enabled by default](https://gitlab.com/gitlab-org/gitlab/-/issues/292961) in GitLab 13.11.
+> - Enabled on GitLab.com.
+> - Recommended for production use.
> - For GitLab self-managed instances, GitLab administrators can opt to [disable it](#enable-or-disable-the-gpg-keys-view).
WARNING:
diff --git a/doc/user/clusters/applications.md b/doc/user/clusters/applications.md
index 1fa3657c357..149f6d0e258 100644
--- a/doc/user/clusters/applications.md
+++ b/doc/user/clusters/applications.md
@@ -91,7 +91,7 @@ apps were fetched from the central Helm stable repository (`https://kubernetes-c
This repository [was deleted](https://github.com/helm/charts#deprecation-timeline)
on November 13, 2020. This causes the installation CI/CD pipeline to
fail. Upgrade to GitLab 13.6, or alternatively, you can
-use the following `.gitlab-ci.yml`, which has been tested on GitLab 13.5:
+use the following `.gitlab-ci.yml`, which has been tested in GitLab 13.5:
```yaml
include:
@@ -1062,7 +1062,7 @@ supported by GitLab before installing any of the applications.
used to install the GitLab-managed apps. GitLab runs each `helm` command
in a pod in the `gitlab-managed-apps` namespace inside the cluster.
-- For clusters created on GitLab 13.6 and newer, GitLab uses Helm 3 to manage
+- For clusters created in GitLab 13.6 and newer, GitLab uses Helm 3 to manage
applications.
- For clusters created on versions of GitLab prior to 13.6, GitLab uses Helm 2
with a local [Tiller](https://v2.helm.sh/docs/glossary/#tiller) server. Prior
diff --git a/doc/user/discussions/index.md b/doc/user/discussions/index.md
index 0ac79a011ca..e53476a6385 100644
--- a/doc/user/discussions/index.md
+++ b/doc/user/discussions/index.md
@@ -269,10 +269,10 @@ Additionally, locked issues and merge requests can't be reopened.
## Confidential Comments
> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/207473) in GitLab 13.9.
-> - It's [deployed behind a feature flag](../feature_flags.md), disabled by default.
-> - It's disabled on GitLab.com.
-> - It's not recommended for production use.
-> - To use it in GitLab self-managed instances, ask a GitLab administrator to enable it. **(FREE SELF)**
+> - [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. **(FREE SELF)**
WARNING:
This feature might not be available to you. Check the **version history** note above for details.
@@ -285,7 +285,7 @@ To create a confidential comment, select the **Make this comment confidential**
## Merge request reviews
-> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/4213) in [GitLab Premium](https://about.gitlab.com/pricing/) 11.4.
+> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/4213) in GitLab Premium 11.4.
> - [Moved](https://gitlab.com/gitlab-org/gitlab/-/issues/28154) to GitLab Free in 13.1.
When looking at a merge request diff, you are able to start a review.
@@ -487,9 +487,9 @@ introduced by [#25381](https://gitlab.com/gitlab-org/gitlab/-/issues/25381).
### Batch Suggestions
> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/25486) in GitLab 13.1 as an [alpha feature](https://about.gitlab.com/handbook/product/gitlab-the-product/#alpha).
-> - It was deployed behind a feature flag, disabled by default.
-> - [Became enabled by default](https://gitlab.com/gitlab-org/gitlab/-/issues/227799) on GitLab 13.2.
-> - It's enabled on GitLab.com.
+> - Deployed behind a feature flag, disabled by default.
+> - [Enabled by default](https://gitlab.com/gitlab-org/gitlab/-/issues/227799) in GitLab 13.2.
+> - Enabled on GitLab.com.
> - For GitLab self-managed instances, GitLab administrators can opt to [disable it](#enable-or-disable-batch-suggestions).
You can apply multiple suggestions at once to reduce the number of commits added
diff --git a/doc/user/group/iterations/index.md b/doc/user/group/iterations/index.md
index 8e125a0cc6e..38d209f04ca 100644
--- a/doc/user/group/iterations/index.md
+++ b/doc/user/group/iterations/index.md
@@ -8,11 +8,11 @@ info: To determine the technical writer assigned to the Stage/Group associated w
# Iterations **(PREMIUM)**
> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/214713) in GitLab 13.1.
-> - It was deployed behind a feature flag, disabled by default.
-> - [Became enabled by default](https://gitlab.com/gitlab-org/gitlab/-/issues/221047) on GitLab 13.2.
-> - It's enabled on GitLab.com.
-> - It's able to be enabled or disabled per-group.
-> - It's recommended for production use.
+> - 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.
+> - Recommended for production use.
> - For GitLab self-managed instances, GitLab administrators can opt to [disable it](#disable-iterations). **(PREMIUM ONLY)**
> - Moved to GitLab Premium in 13.9.
diff --git a/doc/user/packages/composer_repository/index.md b/doc/user/packages/composer_repository/index.md
index 26f41fe23e8..722885dfb7b 100644
--- a/doc/user/packages/composer_repository/index.md
+++ b/doc/user/packages/composer_repository/index.md
@@ -8,13 +8,11 @@ info: To determine the technical writer assigned to the Stage/Group associated w
> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/15886) in GitLab Premium 13.2.
> - [Moved](https://gitlab.com/gitlab-org/gitlab/-/issues/221259) to GitLab Free in 13.3.
+> - Support for Composer 2.0 [added](https://gitlab.com/gitlab-org/gitlab/-/issues/259840) in GitLab Free 13.10.
Publish [Composer](https://getcomposer.org/) packages in your project's Package Registry.
Then, install the packages whenever you need to use them as a dependency.
-Only Composer 1.x is supported. Consider contributing or even adding support for
-[Composer 2.0 in the Package Registry](https://gitlab.com/gitlab-org/gitlab/-/issues/259840).
-
## Create a Composer package
If you do not have a Composer package, create one and check it in to
diff --git a/doc/user/packages/container_registry/index.md b/doc/user/packages/container_registry/index.md
index 18c4edd61c7..30811a46b25 100644
--- a/doc/user/packages/container_registry/index.md
+++ b/doc/user/packages/container_registry/index.md
@@ -499,11 +499,11 @@ The cleanup policy:
1. Collects all tags for a given repository in a list.
1. Excludes the tag named `latest` from the list.
1. Evaluates the `name_regex` (tags to expire), excluding non-matching names from the list.
+1. Excludes from the list any tags matching the `name_regex_keep` value (tags to preserve).
1. Excludes any tags that do not have a manifest (not part of the options in the UI).
1. Orders the remaining tags by `created_date`.
1. Excludes from the list the N tags based on the `keep_n` value (Number of tags to retain).
1. Excludes from the list the tags more recent than the `older_than` value (Expiration interval).
-1. Excludes from the list any tags matching the `name_regex_keep` value (tags to preserve).
1. Finally, the remaining tags in the list are deleted from the Container Registry.
WARNING:
diff --git a/doc/user/project/merge_requests/getting_started.md b/doc/user/project/merge_requests/getting_started.md
index f25228729cf..174dbdf7fb6 100644
--- a/doc/user/project/merge_requests/getting_started.md
+++ b/doc/user/project/merge_requests/getting_started.md
@@ -206,10 +206,10 @@ is set for deletion, the merge request widget displays the
### Branch retargeting on merge **(FREE SELF)**
> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/320902) in GitLab 13.9.
-> - It's [deployed behind a feature flag](../../feature_flags.md), disabled by default.
-> - [Became enabled by default](https://gitlab.com/gitlab-org/gitlab/-/issues/320895) on GitLab 13.10.
-> - It's recommended for production use.
-> - To use it in GitLab self-managed instances, ask a GitLab administrator to [disable it](#enable-or-disable-branch-retargeting-on-merge). **(FREE SELF)**
+> - [Deployed behind a feature flag](../../feature_flags.md), disabled by default.
+> - [Enabled by default](https://gitlab.com/gitlab-org/gitlab/-/issues/320895) in GitLab 13.10.
+> - Recommended for production use.
+> - To use in GitLab self-managed instances, ask a GitLab administrator to [disable it](#enable-or-disable-branch-retargeting-on-merge). **(FREE SELF)**
In specific circumstances, GitLab can retarget the destination branch of
open merge request, if the destination branch merges while the merge request is
diff --git a/doc/user/project/merge_requests/squash_and_merge.md b/doc/user/project/merge_requests/squash_and_merge.md
index f500c18a32e..f3adb5a8ae1 100644
--- a/doc/user/project/merge_requests/squash_and_merge.md
+++ b/doc/user/project/merge_requests/squash_and_merge.md
@@ -7,8 +7,7 @@ type: reference, concepts
# Squash and merge **(FREE)**
-> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/1024) in [GitLab Starter](https://about.gitlab.com/pricing/) 8.17.
-> - [Moved](https://gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/18956) from [GitLab Starter](https://about.gitlab.com/pricing/)to GitLab Free in 11.0.
+> - [Moved](https://gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/18956) to GitLab Free in 11.0.
With squash and merge you can combine all your merge request's commits into one
and retain a clean history.
@@ -105,11 +104,11 @@ squashing can itself be considered equivalent to rebasing.
## Squash Commits Options
> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/17613) in GitLab 13.2.
-> - It was deployed behind a feature flag, disabled by default.
-> - [Became enabled by default](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/39382) on GitLab 13.3.
-> - It's enabled on GitLab.com.
-> - It can be enabled per project.
-> - It's recommended for production use.
+> - Deployed behind a feature flag, disabled by default.
+> - [Enabled by default](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/39382) in GitLab 13.3.
+> - Enabled on GitLab.com.
+> - Can be enabled per project.
+> - Recommended for production use.
With Squash Commits Options you can configure the behavior of Squash and Merge for your project.
To set it up, navigate to your project's **Settings > General** and expand **Merge requests**.
diff --git a/doc/user/project/settings/index.md b/doc/user/project/settings/index.md
index 849829dc937..f3b29757a12 100644
--- a/doc/user/project/settings/index.md
+++ b/doc/user/project/settings/index.md
@@ -9,10 +9,15 @@ type: reference, index, howto
NOTE:
Only project maintainers and administrators have the [permissions](../../permissions.md#project-members-permissions)
-to access a project settings.
+to access project settings.
-You can adjust your [project](../index.md) settings by navigating
-to your project's homepage and clicking **Settings**.
+The **Settings** page in GitLab provides a centralized home for your
+[project](../index.md) configuration options. To access it, go to your project's homepage
+and, in the left navigation menu, clicking **Settings**. To reduce complexity, settings are
+grouped by topic into sections. To display all settings in a section, click **Expand**.
+
+In GitLab versions [13.10 and later](https://gitlab.com/groups/gitlab-org/-/epics/4842),
+GitLab displays a search box to help you find the settings you want to view.
## General settings
diff --git a/lib/gitlab/ci/runner_instructions.rb b/lib/gitlab/ci/runner_instructions.rb
index dd0bfa768a8..cc92dfe7806 100644
--- a/lib/gitlab/ci/runner_instructions.rb
+++ b/lib/gitlab/ci/runner_instructions.rb
@@ -117,20 +117,20 @@ module Gitlab
return unless @project
raise Gitlab::Access::AccessDeniedError unless can?(@current_user, :admin_pipeline, @project)
- @project.runners_token
+ '$REGISTRATION_TOKEN'
end
def group_token
return unless @group
raise Gitlab::Access::AccessDeniedError unless can?(@current_user, :admin_group, @group)
- @group.runners_token
+ '$REGISTRATION_TOKEN'
end
def instance_token
raise Gitlab::Access::AccessDeniedError unless @current_user&.admin?
- Gitlab::CurrentSettings.runners_registration_token
+ '$REGISTRATION_TOKEN'
end
end
end
diff --git a/qa/qa/page/project/settings/ci_cd.rb b/qa/qa/page/project/settings/ci_cd.rb
index 7a910233d12..7224fdae10e 100644
--- a/qa/qa/page/project/settings/ci_cd.rb
+++ b/qa/qa/page/project/settings/ci_cd.rb
@@ -42,3 +42,5 @@ module QA
end
end
end
+
+QA::Page::Project::Settings::CICD.prepend_if_ee("QA::EE::Page::Project::Settings::CICD")
diff --git a/spec/fixtures/lib/generators/gitlab/usage_metric_definition_generator/sample_metric.yml b/spec/fixtures/lib/generators/gitlab/usage_metric_definition_generator/sample_metric.yml
new file mode 100644
index 00000000000..90d395e1eda
--- /dev/null
+++ b/spec/fixtures/lib/generators/gitlab/usage_metric_definition_generator/sample_metric.yml
@@ -0,0 +1,21 @@
+---
+# See Usage Ping metrics dictionary docs https://docs.gitlab.com/ee/development/usage_ping/metrics_dictionary.html
+key_path: counts_weekly.test_metric
+description:
+product_section:
+product_stage:
+product_group:
+product_category:
+value_type: number
+status: implemented
+milestone: "13.9"
+introduced_by_url:
+time_frame: 7d
+data_source:
+distribution:
+- ce
+# Add here corresponding tiers
+# tier:
+# - free
+# - premium
+# - ultimate
diff --git a/spec/fixtures/lib/generators/gitlab/usage_metric_definition_generator/sample_metric_with_name_suggestions.yml b/spec/fixtures/lib/generators/gitlab/usage_metric_definition_generator/sample_metric_with_name_suggestions.yml
new file mode 100644
index 00000000000..47fc1d7e376
--- /dev/null
+++ b/spec/fixtures/lib/generators/gitlab/usage_metric_definition_generator/sample_metric_with_name_suggestions.yml
@@ -0,0 +1,22 @@
+---
+# See Usage Ping metrics dictionary docs https://docs.gitlab.com/ee/development/usage_ping/metrics_dictionary.html
+key_path: counts_weekly.test_metric
+name: test metric name
+description:
+product_section:
+product_stage:
+product_group:
+product_category:
+value_type: number
+status: implemented
+milestone: "13.9"
+introduced_by_url:
+time_frame: 7d
+data_source:
+distribution:
+- ce
+# Add here corresponding tiers
+# tier:
+# - free
+# - premium
+# - ultimate
diff --git a/spec/frontend/pipeline_editor/components/header/pipeline_editor_header_spec.js b/spec/frontend/pipeline_editor/components/header/pipeline_editor_header_spec.js
index ef8ca574e59..27652bb268b 100644
--- a/spec/frontend/pipeline_editor/components/header/pipeline_editor_header_spec.js
+++ b/spec/frontend/pipeline_editor/components/header/pipeline_editor_header_spec.js
@@ -13,7 +13,7 @@ describe('Pipeline editor header', () => {
},
};
- const createComponent = ({ provide = {} } = {}) => {
+ const createComponent = ({ provide = {}, props = {} } = {}) => {
wrapper = shallowMount(PipelineEditorHeader, {
provide: {
...mockProvide,
@@ -23,6 +23,8 @@ describe('Pipeline editor header', () => {
ciConfigData: mockLintResponse,
ciFileContent: mockCiYml,
isCiConfigDataLoading: false,
+ isNewCiConfigFile: false,
+ ...props,
},
});
};
@@ -36,15 +38,21 @@ describe('Pipeline editor header', () => {
});
describe('template', () => {
- beforeEach(() => {
- createComponent();
+ it('hides the pipeline status for new projects without a CI file', () => {
+ createComponent({ props: { isNewCiConfigFile: true } });
+
+ expect(findPipelineStatus().exists()).toBe(false);
});
- it('renders the pipeline status', () => {
+ it('renders the pipeline status when CI file exists', () => {
+ createComponent({ props: { isNewCiConfigFile: false } });
+
expect(findPipelineStatus().exists()).toBe(true);
});
it('renders the validation segment', () => {
+ createComponent();
+
expect(findValidationSegment().exists()).toBe(true);
});
});
diff --git a/spec/frontend/pipeline_editor/pipeline_editor_home_spec.js b/spec/frontend/pipeline_editor/pipeline_editor_home_spec.js
index 9864f3c13f9..43e22db1d44 100644
--- a/spec/frontend/pipeline_editor/pipeline_editor_home_spec.js
+++ b/spec/frontend/pipeline_editor/pipeline_editor_home_spec.js
@@ -18,6 +18,7 @@ describe('Pipeline editor home wrapper', () => {
ciConfigData: mockLintResponse,
ciFileContent: mockCiYml,
isCiConfigDataLoading: false,
+ isNewCiConfigFile: false,
...props,
},
});
diff --git a/spec/frontend/pipelines/graph/action_component_spec.js b/spec/frontend/pipelines/graph/action_component_spec.js
index 6a7018fa1e5..177b026491c 100644
--- a/spec/frontend/pipelines/graph/action_component_spec.js
+++ b/spec/frontend/pipelines/graph/action_component_spec.js
@@ -3,7 +3,7 @@ import { mount } from '@vue/test-utils';
import MockAdapter from 'axios-mock-adapter';
import waitForPromises from 'helpers/wait_for_promises';
import axios from '~/lib/utils/axios_utils';
-import ActionComponent from '~/pipelines/components/graph/action_component.vue';
+import ActionComponent from '~/pipelines/components/jobs_shared/action_component.vue';
describe('pipeline graph action component', () => {
let wrapper;
diff --git a/spec/frontend/pipelines/graph/job_name_component_spec.js b/spec/frontend/pipelines/graph/job_name_component_spec.js
index 658b5be87d4..d3008c046e8 100644
--- a/spec/frontend/pipelines/graph/job_name_component_spec.js
+++ b/spec/frontend/pipelines/graph/job_name_component_spec.js
@@ -1,5 +1,5 @@
import { mount } from '@vue/test-utils';
-import jobNameComponent from '~/pipelines/components/graph/job_name_component.vue';
+import jobNameComponent from '~/pipelines/components/jobs_shared/job_name_component.vue';
import ciIcon from '~/vue_shared/components/ci_icon.vue';
describe('job name component', () => {
diff --git a/spec/frontend/pipelines/graph/stage_column_component_spec.js b/spec/frontend/pipelines/graph/stage_column_component_spec.js
index 16dc70a63a5..0d0a99eede8 100644
--- a/spec/frontend/pipelines/graph/stage_column_component_spec.js
+++ b/spec/frontend/pipelines/graph/stage_column_component_spec.js
@@ -1,7 +1,7 @@
import { mount, shallowMount } from '@vue/test-utils';
-import ActionComponent from '~/pipelines/components/graph/action_component.vue';
import JobItem from '~/pipelines/components/graph/job_item.vue';
import StageColumnComponent from '~/pipelines/components/graph/stage_column_component.vue';
+import ActionComponent from '~/pipelines/components/jobs_shared/action_component.vue';
const mockJob = {
id: 4250,
@@ -24,7 +24,7 @@ const mockJob = {
const mockGroups = Array(4)
.fill(0)
.map((item, idx) => {
- return { ...mockJob, id: idx, name: `fish-${idx}` };
+ return { ...mockJob, jobs: [mockJob], id: idx, name: `fish-${idx}` };
});
const defaultProps = {
@@ -104,13 +104,19 @@ describe('stage column component', () => {
props: {
groups: [
{
- id: 4259,
+ ...mockJob,
name: '<img src=x onerror=alert(document.domain)>',
- status: {
- icon: 'status_success',
- label: 'success',
- tooltip: '<img src=x onerror=alert(document.domain)>',
- },
+ jobs: [
+ {
+ id: 4259,
+ name: '<img src=x onerror=alert(document.domain)>',
+ status: {
+ icon: 'status_success',
+ label: 'success',
+ tooltip: '<img src=x onerror=alert(document.domain)>',
+ },
+ },
+ ],
},
],
title: 'test <img src=x onerror=alert(document.domain)>',
@@ -159,6 +165,7 @@ describe('stage column component', () => {
label: 'success',
tooltip: '<img src=x onerror=alert(document.domain)>',
},
+ jobs: [mockJob],
},
],
title: 'test',
@@ -191,6 +198,7 @@ describe('stage column component', () => {
label: 'success',
tooltip: '<img src=x onerror=alert(document.domain)>',
},
+ jobs: [mockJob],
},
],
title: 'test',
diff --git a/spec/frontend/pipelines/graph_shared/links_inner_spec.js b/spec/frontend/pipelines/graph_shared/links_inner_spec.js
index 6fef1c9b62e..e81f046c1eb 100644
--- a/spec/frontend/pipelines/graph_shared/links_inner_spec.js
+++ b/spec/frontend/pipelines/graph_shared/links_inner_spec.js
@@ -8,9 +8,9 @@ import {
PIPELINES_DETAIL_LINKS_JOB_RATIO,
} from '~/performance/constants';
import * as perfUtils from '~/performance/utils';
-import * as sentryUtils from '~/pipelines/components/graph/utils';
import * as Api from '~/pipelines/components/graph_shared/api';
import LinksInner from '~/pipelines/components/graph_shared/links_inner.vue';
+import * as sentryUtils from '~/pipelines/utils';
import { createJobsHash } from '~/pipelines/utils';
import {
jobRect,
diff --git a/spec/frontend/tracking_spec.js b/spec/frontend/tracking_spec.js
index 6a22de3be5c..f61c4d0e707 100644
--- a/spec/frontend/tracking_spec.js
+++ b/spec/frontend/tracking_spec.js
@@ -176,25 +176,29 @@ describe('Tracking', () => {
});
});
- describe('tracking interface events', () => {
+ describe.each`
+ term
+ ${'event'}
+ ${'action'}
+ `('tracking interface events with data-track-$term', ({ term }) => {
let eventSpy;
beforeEach(() => {
eventSpy = jest.spyOn(Tracking, 'event');
Tracking.bindDocument('_category_'); // only happens once
setHTMLFixture(`
- <input data-track-event="click_input1" data-track-label="_label_" value="_value_"/>
- <input data-track-event="click_input2" data-track-value="_value_override_" value="_value_"/>
- <input type="checkbox" data-track-event="toggle_checkbox" value="_value_" checked/>
- <input class="dropdown" data-track-event="toggle_dropdown"/>
- <div data-track-event="nested_event"><span class="nested"></span></div>
- <input data-track-eventbogus="click_bogusinput" data-track-label="_label_" value="_value_"/>
- <input data-track-event="click_input3" data-track-experiment="example" value="_value_"/>
+ <input data-track-${term}="click_input1" data-track-label="_label_" value="_value_"/>
+ <input data-track-${term}="click_input2" data-track-value="_value_override_" value="_value_"/>
+ <input type="checkbox" data-track-${term}="toggle_checkbox" value="_value_" checked/>
+ <input class="dropdown" data-track-${term}="toggle_dropdown"/>
+ <div data-track-${term}="nested_event"><span class="nested"></span></div>
+ <input data-track-bogus="click_bogusinput" data-track-label="_label_" value="_value_"/>
+ <input data-track-${term}="click_input3" data-track-experiment="example" value="_value_"/>
`);
});
- it('binds to clicks on elements matching [data-track-event]', () => {
- document.querySelector('[data-track-event="click_input1"]').click();
+ it(`binds to clicks on elements matching [data-track-${term}]`, () => {
+ document.querySelector(`[data-track-${term}="click_input1"]`).click();
expect(eventSpy).toHaveBeenCalledWith('_category_', 'click_input1', {
label: '_label_',
@@ -202,14 +206,14 @@ describe('Tracking', () => {
});
});
- it('does not bind to clicks on elements without [data-track-event]', () => {
- document.querySelector('[data-track-eventbogus="click_bogusinput"]').click();
+ it(`does not bind to clicks on elements without [data-track-${term}]`, () => {
+ document.querySelector('[data-track-bogus="click_bogusinput"]').click();
expect(eventSpy).not.toHaveBeenCalled();
});
it('allows value override with the data-track-value attribute', () => {
- document.querySelector('[data-track-event="click_input2"]').click();
+ document.querySelector(`[data-track-${term}="click_input2"]`).click();
expect(eventSpy).toHaveBeenCalledWith('_category_', 'click_input2', {
value: '_value_override_',
@@ -217,7 +221,7 @@ describe('Tracking', () => {
});
it('handles checkbox values correctly', () => {
- const checkbox = document.querySelector('[data-track-event="toggle_checkbox"]');
+ const checkbox = document.querySelector(`[data-track-${term}="toggle_checkbox"]`);
checkbox.click(); // unchecking
@@ -233,7 +237,7 @@ describe('Tracking', () => {
});
it('handles bootstrap dropdowns', () => {
- const dropdown = document.querySelector('[data-track-event="toggle_dropdown"]');
+ const dropdown = document.querySelector(`[data-track-${term}="toggle_dropdown"]`);
dropdown.dispatchEvent(new Event('show.bs.dropdown', { bubbles: true }));
@@ -258,7 +262,7 @@ describe('Tracking', () => {
};
getExperimentData.mockReturnValue(mockExperimentData);
- document.querySelector('[data-track-event="click_input3"]').click();
+ document.querySelector(`[data-track-${term}="click_input3"]`).click();
expect(eventSpy).toHaveBeenCalledWith('_category_', 'click_input3', {
value: '_value_',
@@ -267,22 +271,26 @@ describe('Tracking', () => {
});
});
- describe('tracking page loaded events', () => {
+ describe.each`
+ term
+ ${'event'}
+ ${'action'}
+ `('tracking page loaded events with -$term', ({ term }) => {
let eventSpy;
beforeEach(() => {
eventSpy = jest.spyOn(Tracking, 'event');
setHTMLFixture(`
- <input data-track-event="render" data-track-label="label1" value="_value_" data-track-property="_property_"/>
- <span data-track-event="render" data-track-label="label2" data-track-value="_value_">
+ <input data-track-${term}="render" data-track-label="label1" value="_value_" data-track-property="_property_"/>
+ <span data-track-${term}="render" data-track-label="label2" data-track-value="_value_">
Something
</span>
- <input data-track-event="_render_bogus_" data-track-label="label3" value="_value_" data-track-property="_property_"/>
+ <input data-track-${term}="_render_bogus_" data-track-label="label3" value="_value_" data-track-property="_property_"/>
`);
Tracking.trackLoadEvents('_category_'); // only happens once
});
- it('sends tracking events when [data-track-event="render"] is on an element', () => {
+ it(`sends tracking events when [data-track-${term}="render"] is on an element`, () => {
expect(eventSpy.mock.calls).toEqual([
[
'_category_',
diff --git a/spec/helpers/tracking_helper_spec.rb b/spec/helpers/tracking_helper_spec.rb
index 47b344cfc25..cd2f8f9b7d1 100644
--- a/spec/helpers/tracking_helper_spec.rb
+++ b/spec/helpers/tracking_helper_spec.rb
@@ -10,7 +10,7 @@ RSpec.describe TrackingHelper do
let(:results) do
{
no_data: {},
- with_data: { data: { track_label: 'a', track_event: 'b', track_property: 'c' } }
+ with_data: { data: { track_label: 'a', track_action: 'b', track_property: 'c' } }
}
end
diff --git a/spec/lib/generators/gitlab/usage_metric_definition_generator_spec.rb b/spec/lib/generators/gitlab/usage_metric_definition_generator_spec.rb
index b62eac14e3e..52dc6c96ad1 100644
--- a/spec/lib/generators/gitlab/usage_metric_definition_generator_spec.rb
+++ b/spec/lib/generators/gitlab/usage_metric_definition_generator_spec.rb
@@ -3,10 +3,72 @@
require 'generator_helper'
RSpec.describe Gitlab::UsageMetricDefinitionGenerator do
+ include UsageDataHelpers
+
+ let(:key_path) { 'counts_weekly.test_metric' }
+ let(:dir) { '7d' }
+ let(:temp_dir) { Dir.mktmpdir }
+
+ before do
+ stub_const("#{described_class}::TOP_LEVEL_DIR", temp_dir)
+ # Stub Prometheus requests from Gitlab::Utils::UsageData
+ stub_request(:get, 'https://::1:9090/-/ready')
+ .to_return(
+ status: 200,
+ body: [{}].to_json,
+ headers: { 'Content-Type' => 'application/json' }
+ )
+
+ stub_request(:get, %r{^https://::1:9090/api/v1/query\?query=.*})
+ .to_return(
+ status: 200,
+ body: [{}].to_json,
+ headers: { 'Content-Type' => 'application/json' }
+ )
+ end
+
+ after do
+ FileUtils.rm_rf(temp_dir)
+ end
+
+ describe 'Creating metric definition file' do
+ let(:sample_metric) { load_sample_metric_definition }
+
+ # Stub version so that `milestone` key remains constant between releases to prevent flakiness.
+ before do
+ stub_const('Gitlab::VERSION', '13.9.0')
+ allow(::Gitlab::Usage::Metrics::NamesSuggestions::Generator).to receive(:generate).and_return('test metric name')
+ end
+
+ context 'with product_intelligence_metrics_names_suggestions feature ON' do
+ let(:sample_metric) { load_sample_metric_definition(filename: 'sample_metric_with_name_suggestions.yml') }
+
+ it 'creates a metric definition file using the template' do
+ stub_feature_flags(product_intelligence_metrics_names_suggestions: true)
+
+ described_class.new([key_path], { 'dir' => dir }).invoke_all
+
+ metric_definition_path = Dir.glob(File.join(temp_dir, 'metrics/counts_7d/*_test_metric.yml')).first
+
+ expect(YAML.safe_load(File.read(metric_definition_path))).to eq(sample_metric)
+ end
+ end
+
+ context 'with product_intelligence_metrics_names_suggestions feature OFF' do
+ it 'creates a metric definition file using the template' do
+ stub_feature_flags(product_intelligence_metrics_names_suggestions: false)
+
+ described_class.new([key_path], { 'dir' => dir }).invoke_all
+
+ metric_definition_path = Dir.glob(File.join(temp_dir, 'metrics/counts_7d/*_test_metric.yml')).first
+
+ expect(YAML.safe_load(File.read(metric_definition_path))).to eq(sample_metric)
+ end
+ end
+ end
+
describe 'Validation' do
- let(:key_path) { 'counter.category.event' }
- let(:dir) { '7d' }
- let(:options) { [key_path, '--dir', dir, '--pretend'] }
+ let(:options) { [key_path, '--dir', dir] }
subject { described_class.start(options) }
@@ -42,18 +104,12 @@ RSpec.describe Gitlab::UsageMetricDefinitionGenerator do
end
describe 'Name suggestions' do
- let(:temp_dir) { Dir.mktmpdir }
-
- before do
- stub_const("#{described_class}::TOP_LEVEL_DIR", temp_dir)
- end
-
context 'with product_intelligence_metrics_names_suggestions feature ON' do
it 'adds name key to metric definition' do
stub_feature_flags(product_intelligence_metrics_names_suggestions: true)
expect(::Gitlab::Usage::Metrics::NamesSuggestions::Generator).to receive(:generate).and_return('some name')
- described_class.new(['counts_weekly.test_metric'], { 'dir' => '7d' }).invoke_all
+ described_class.new([key_path], { 'dir' => dir }).invoke_all
metric_definition_path = Dir.glob(File.join(temp_dir, 'metrics/counts_7d/*_test_metric.yml')).first
expect(YAML.safe_load(File.read(metric_definition_path))).to include("name" => "some name")
@@ -65,7 +121,7 @@ RSpec.describe Gitlab::UsageMetricDefinitionGenerator do
stub_feature_flags(product_intelligence_metrics_names_suggestions: false)
expect(::Gitlab::Usage::Metrics::NamesSuggestions::Generator).not_to receive(:generate)
- described_class.new(['counts_weekly.test_metric'], { 'dir' => '7d' }).invoke_all
+ described_class.new([key_path], { 'dir' => dir }).invoke_all
metric_definition_path = Dir.glob(File.join(temp_dir, 'metrics/counts_7d/*_test_metric.yml')).first
expect(YAML.safe_load(File.read(metric_definition_path)).keys).not_to include(:name)
diff --git a/spec/lib/gitlab/ci/runner_instructions_spec.rb b/spec/lib/gitlab/ci/runner_instructions_spec.rb
index d1020026fe6..34fe56bfe68 100644
--- a/spec/lib/gitlab/ci/runner_instructions_spec.rb
+++ b/spec/lib/gitlab/ci/runner_instructions_spec.rb
@@ -123,7 +123,7 @@ RSpec.describe Gitlab::Ci::RunnerInstructions do
result = subject.register_command
expect(result).to include("#{commands[commands.each_key.first]} register")
- expect(result).to include("--registration-token #{group.runners_token}")
+ expect(result).to include("--registration-token $REGISTRATION_TOKEN")
expect(result).to include("--url #{Gitlab::Routing.url_helpers.root_url(only_path: false)}")
end
end
@@ -166,7 +166,7 @@ RSpec.describe Gitlab::Ci::RunnerInstructions do
result = subject.register_command
expect(result).to include("#{commands[commands.each_key.first]} register")
- expect(result).to include("--registration-token #{project.runners_token}")
+ expect(result).to include("--registration-token $REGISTRATION_TOKEN")
expect(result).to include("--url #{Gitlab::Routing.url_helpers.root_url(only_path: false)}")
end
end
@@ -205,7 +205,7 @@ RSpec.describe Gitlab::Ci::RunnerInstructions do
result = subject.register_command
expect(result).to include("#{commands[commands.each_key.first]} register")
- expect(result).to include("--registration-token #{Gitlab::CurrentSettings.runners_registration_token}")
+ expect(result).to include("--registration-token $REGISTRATION_TOKEN")
expect(result).to include("--url #{Gitlab::Routing.url_helpers.root_url(only_path: false)}")
end
end
diff --git a/spec/models/internal_id_spec.rb b/spec/models/internal_id_spec.rb
index 07f62b9de55..981245627af 100644
--- a/spec/models/internal_id_spec.rb
+++ b/spec/models/internal_id_spec.rb
@@ -97,6 +97,25 @@ RSpec.describe InternalId do
expect(subject).to eq(1)
end
end
+
+ context 'when executed outside of transaction' do
+ it 'increments counter with in_transaction: "false"' do
+ expect(ActiveRecord::Base.connection).to receive(:transaction_open?) { false }
+ expect(InternalId::InternalIdGenerator.internal_id_transactions_total).to receive(:increment)
+ .with(operation: :generate, usage: 'issues', in_transaction: 'false').and_call_original
+
+ subject
+ end
+ end
+
+ context 'when executed within transaction' do
+ it 'increments counter with in_transaction: "true"' do
+ expect(InternalId::InternalIdGenerator.internal_id_transactions_total).to receive(:increment)
+ .with(operation: :generate, usage: 'issues', in_transaction: 'true').and_call_original
+
+ InternalId.transaction { subject }
+ end
+ end
end
describe '.reset' do
@@ -134,6 +153,29 @@ RSpec.describe InternalId do
described_class.generate_next(issue, scope, usage, init)
end
end
+
+ context 'when executed outside of transaction' do
+ let(:value) { 2 }
+
+ it 'increments counter with in_transaction: "false"' do
+ expect(ActiveRecord::Base.connection).to receive(:transaction_open?) { false }
+ expect(InternalId::InternalIdGenerator.internal_id_transactions_total).to receive(:increment)
+ .with(operation: :reset, usage: 'issues', in_transaction: 'false').and_call_original
+
+ subject
+ end
+ end
+
+ context 'when executed within transaction' do
+ let(:value) { 2 }
+
+ it 'increments counter with in_transaction: "true"' do
+ expect(InternalId::InternalIdGenerator.internal_id_transactions_total).to receive(:increment)
+ .with(operation: :reset, usage: 'issues', in_transaction: 'true').and_call_original
+
+ InternalId.transaction { subject }
+ end
+ end
end
describe '.track_greatest' do
@@ -183,6 +225,25 @@ RSpec.describe InternalId do
expect(subject).to eq(value)
end
end
+
+ context 'when executed outside of transaction' do
+ it 'increments counter with in_transaction: "false"' do
+ expect(ActiveRecord::Base.connection).to receive(:transaction_open?) { false }
+ expect(InternalId::InternalIdGenerator.internal_id_transactions_total).to receive(:increment)
+ .with(operation: :track_greatest, usage: 'issues', in_transaction: 'false').and_call_original
+
+ subject
+ end
+ end
+
+ context 'when executed within transaction' do
+ it 'increments counter with in_transaction: "true"' do
+ expect(InternalId::InternalIdGenerator.internal_id_transactions_total).to receive(:increment)
+ .with(operation: :track_greatest, usage: 'issues', in_transaction: 'true').and_call_original
+
+ InternalId.transaction { subject }
+ end
+ end
end
describe '#increment_and_save!' do
diff --git a/spec/requests/customers_dot/proxy_controller_spec.rb b/spec/requests/customers_dot/proxy_controller_spec.rb
new file mode 100644
index 00000000000..4938c67e0c3
--- /dev/null
+++ b/spec/requests/customers_dot/proxy_controller_spec.rb
@@ -0,0 +1,37 @@
+# frozen_string_literal: true
+
+require 'spec_helper'
+
+RSpec.describe CustomersDot::ProxyController, type: :request do
+ describe 'POST graphql' do
+ let_it_be(:customers_dot) { "#{Gitlab::SubscriptionPortal::SUBSCRIPTIONS_URL}/graphql" }
+
+ it 'forwards request body to customers dot' do
+ request_params = '{ "foo" => "bar" }'
+
+ stub_request(:post, customers_dot)
+
+ post customers_dot_proxy_graphql_path, params: request_params
+
+ expect(WebMock).to have_requested(:post, customers_dot).with(body: request_params)
+ end
+
+ it 'responds with customers dot status' do
+ stub_request(:post, customers_dot).to_return(status: 500)
+
+ post customers_dot_proxy_graphql_path
+
+ expect(response).to have_gitlab_http_status(:internal_server_error)
+ end
+
+ it 'responds with customers dot response body' do
+ customers_dot_response = 'foo'
+
+ stub_request(:post, customers_dot).to_return(body: customers_dot_response)
+
+ post customers_dot_proxy_graphql_path
+
+ expect(response.body).to eq(customers_dot_response)
+ end
+ end
+end
diff --git a/spec/support/helpers/test_env.rb b/spec/support/helpers/test_env.rb
index 9e283b2dd3e..7ba15a9c00b 100644
--- a/spec/support/helpers/test_env.rb
+++ b/spec/support/helpers/test_env.rb
@@ -175,7 +175,7 @@ module TestEnv
{ 'default' => repos_path },
force: true,
options: {
- prometheus_listen_addr: ':9236'
+ prometheus_listen_addr: 'localhost:9236'
}
)
Gitlab::SetupHelper::Gitaly.create_configuration(
diff --git a/spec/support/helpers/usage_data_helpers.rb b/spec/support/helpers/usage_data_helpers.rb
index df79049123d..fb451d5c8c9 100644
--- a/spec/support/helpers/usage_data_helpers.rb
+++ b/spec/support/helpers/usage_data_helpers.rb
@@ -242,4 +242,12 @@ module UsageDataHelpers
end
end
end
+
+ def load_sample_metric_definition(filename: 'sample_metric.yml')
+ load_metric_yaml(fixture_file("lib/generators/gitlab/usage_metric_definition_generator/#{filename}"))
+ end
+
+ def load_metric_yaml(data)
+ ::Gitlab::Config::Loader::Yaml.new(data).load_raw!
+ end
end
diff --git a/spec/support/shared_examples/workers/worker_with_data_consistency_shared_example.rb b/spec/support/shared_examples/workers/worker_with_data_consistency_shared_example.rb
new file mode 100644
index 00000000000..ec09c0380f9
--- /dev/null
+++ b/spec/support/shared_examples/workers/worker_with_data_consistency_shared_example.rb
@@ -0,0 +1,27 @@
+# frozen_string_literal: true
+
+RSpec.shared_examples 'worker with data consistency' do |worker_class, data_consistency: :always, feature_flag: nil|
+ describe '.get_data_consistency_feature_flag_enabled?' do
+ it 'returns true' do
+ expect(worker_class.get_data_consistency_feature_flag_enabled?).to be(true)
+ end
+
+ if feature_flag
+ context "when feature flag :#{feature_flag} is disabled" do
+ before do
+ stub_feature_flags(feature_flag => false)
+ end
+
+ it 'returns false' do
+ expect(worker_class.get_data_consistency_feature_flag_enabled?).to be(false)
+ end
+ end
+ end
+ end
+
+ describe '.get_data_consistency' do
+ it 'returns correct data consistency' do
+ expect(worker_class.get_data_consistency).to eq(data_consistency)
+ end
+ end
+end
diff --git a/spec/workers/build_hooks_worker_spec.rb b/spec/workers/build_hooks_worker_spec.rb
index aefbd7e590e..7e469958a84 100644
--- a/spec/workers/build_hooks_worker_spec.rb
+++ b/spec/workers/build_hooks_worker_spec.rb
@@ -22,4 +22,9 @@ RSpec.describe BuildHooksWorker do
end
end
end
+
+ it_behaves_like 'worker with data consistency',
+ described_class,
+ feature_flag: :load_balancing_for_build_hooks_worker,
+ data_consistency: :delayed
end