Add latest changes from gitlab-org/gitlab@master

This commit is contained in:
GitLab Bot 2021-05-10 12:10:26 +00:00
parent d5f14b5e2c
commit 0ecdc32a42
28 changed files with 321 additions and 216 deletions

View File

@ -3,7 +3,7 @@
- .default-retry
- .rails-cache
- .default-before_script
- .use-pg11
- .use-pg12
stage: test
needs: ["setup-test-env"]
variables:
@ -29,7 +29,7 @@ run-dev-fixtures-ee:
extends:
- .run-dev-fixtures
- .dev-fixtures:rules:ee-only
- .use-pg11-ee
- .use-pg12-ee
script:
- cp ee/db/fixtures/development/* $FIXTURE_PATH
- *run-dev-fixtures-script

View File

@ -89,7 +89,7 @@ update-yarn-cache:
- .default-retry
- .default-before_script
- .rails-cache
- .use-pg11
- .use-pg12
stage: fixtures
needs: ["setup-test-env", "retrieve-tests-metadata", "compile-test-assets"]
variables:

View File

@ -37,7 +37,7 @@ memory-static:
memory-on-boot:
extends:
- .only-code-memory-job-base
- .use-pg11
- .use-pg12
stage: test
needs: ["setup-test-env", "compile-test-assets"]
variables:

View File

@ -67,11 +67,11 @@
- .rspec-base
- .use-pg12
.rspec-base-pg11-as-if-foss:
.rspec-base-pg12-as-if-foss:
extends:
- .rspec-base
- .as-if-foss
- .use-pg11
- .use-pg12
needs: ["setup-test-env", "retrieve-tests-metadata", "compile-test-assets as-if-foss", "detect-tests"]
.rspec-ee-base-pg11:
@ -104,7 +104,7 @@
extends:
- .rails-job-base
- .rails:rules:ee-and-foss-migration
- .use-pg11
- .use-pg12
stage: test
needs: ["setup-test-env"]
# rspec job base specs
@ -148,7 +148,7 @@ setup-test-env:
- .rails-job-base
- .setup-test-env-cache
- .rails:rules:code-backstage-qa
- .use-pg11
- .use-pg12
stage: prepare
variables:
GITLAB_TEST_EAGER_LOAD: "0"
@ -258,59 +258,59 @@ static-analysis as-if-foss:
- .static-analysis:rules:as-if-foss
- .as-if-foss
rspec migration pg11:
rspec migration pg12:
extends:
- .rspec-base-pg11
- .rspec-base-pg12
- .rspec-base-migration
- .rspec-migration-parallel
rspec migration pg11 minimal:
rspec migration pg12 minimal:
extends:
- rspec migration pg11
- rspec migration pg12
- .minimal-rspec-tests
- .rails:rules:ee-and-foss-migration:minimal
rspec unit pg11:
rspec unit pg12:
extends:
- .rspec-base-pg11
- .rspec-base-pg12
- .rails:rules:ee-and-foss-unit
- .rspec-unit-parallel
rspec unit pg11 minimal:
rspec unit pg12 minimal:
extends:
- rspec unit pg11
- rspec unit pg12
- .minimal-rspec-tests
- .rails:rules:ee-and-foss-unit:minimal
rspec integration pg11:
rspec integration pg12:
extends:
- .rspec-base-pg11
- .rspec-base-pg12
- .rails:rules:ee-and-foss-integration
- .rspec-integration-parallel
rspec integration pg11 minimal:
rspec integration pg12 minimal:
extends:
- rspec integration pg11
- rspec integration pg12
- .minimal-rspec-tests
- .rails:rules:ee-and-foss-integration:minimal
rspec system pg11:
rspec system pg12:
extends:
- .rspec-base-pg11
- .rspec-base-pg12
- .rails:rules:ee-and-foss-system
- .rspec-system-parallel
rspec system pg11 minimal:
rspec system pg12 minimal:
extends:
- rspec system pg11
- rspec system pg12
- .minimal-rspec-tests
- .rails:rules:ee-and-foss-system:minimal
# Dedicated job to test DB library code against PG12.
# Note that these are already tested against PG11 in the `rspec unit pg11` / `rspec-ee unit pg11` jobs.
rspec db-library-code pg12:
# Dedicated job to test DB library code against PG11.
# Note that these are already tested against PG12 in the `rspec unit pg12` / `rspec-ee unit pg12` jobs.
rspec db-library-code pg11:
extends:
- .rspec-base-pg12
- .rspec-base-pg11
- .rails:rules:ee-and-foss-db-library-code
script:
- !reference [.base-script, script]
@ -318,7 +318,7 @@ rspec db-library-code pg12:
rspec fast_spec_helper:
extends:
- .rspec-base-pg11
- .rspec-base-pg12
- .rails:rules:ee-and-foss-fast_spec_helper
script:
- bin/rspec spec/fast_spec_helper.rb
@ -435,17 +435,17 @@ rspec:deprecations:
# We cannot use needs since it would mean needing 84 jobs (since most are parallelized)
# so we use `dependencies` here.
dependencies:
- rspec migration pg11
- rspec unit pg11
- rspec integration pg11
- rspec system pg11
- rspec-ee migration pg11
- rspec-ee unit pg11
- rspec-ee integration pg11
- rspec-ee system pg11
- rspec-ee unit pg11 geo
- rspec-ee integration pg11 geo
- rspec-ee system pg11 geo
- rspec migration pg12
- rspec unit pg12
- rspec integration pg12
- rspec system pg12
- rspec-ee migration pg12
- rspec-ee unit pg12
- rspec-ee integration pg12
- rspec-ee system pg12
- rspec-ee unit pg12 geo
- rspec-ee integration pg12 geo
- rspec-ee system pg12 geo
variables:
SETUP_DB: "false"
script:
@ -467,17 +467,17 @@ rspec:coverage:
# so we use `dependencies` here.
dependencies:
- setup-test-env
- rspec migration pg11
- rspec unit pg11
- rspec integration pg11
- rspec system pg11
- rspec-ee migration pg11
- rspec-ee unit pg11
- rspec-ee integration pg11
- rspec-ee system pg11
- rspec-ee unit pg11 geo
- rspec-ee integration pg11 geo
- rspec-ee system pg11 geo
- rspec migration pg12
- rspec unit pg12
- rspec integration pg12
- rspec system pg12
- rspec-ee migration pg12
- rspec-ee unit pg12
- rspec-ee integration pg12
- rspec-ee system pg12
- rspec-ee unit pg12 geo
- rspec-ee integration pg12 geo
- rspec-ee system pg12 geo
- memory-static
- memory-on-boot
script:
@ -504,17 +504,17 @@ rspec:feature-flags:
# so we use `dependencies` here.
dependencies:
- setup-test-env
- rspec migration pg11
- rspec unit pg11
- rspec integration pg11
- rspec system pg11
- rspec-ee migration pg11
- rspec-ee unit pg11
- rspec-ee integration pg11
- rspec-ee system pg11
- rspec-ee unit pg11 geo
- rspec-ee integration pg11 geo
- rspec-ee system pg11 geo
- rspec migration pg12
- rspec unit pg12
- rspec integration pg12
- rspec system pg12
- rspec-ee migration pg12
- rspec-ee unit pg12
- rspec-ee integration pg12
- rspec-ee system pg12
- rspec-ee unit pg12 geo
- rspec-ee integration pg12 geo
- rspec-ee system pg12 geo
- memory-static
- memory-on-boot
script:
@ -530,138 +530,138 @@ rspec:feature-flags:
##################################################
# EE: default refs (MRs, default branch, schedules) jobs #
rspec migration pg11-as-if-foss:
rspec migration pg12-as-if-foss:
extends:
- .rspec-base-pg11-as-if-foss
- .rspec-base-pg12-as-if-foss
- .rspec-base-migration
- .rails:rules:as-if-foss-migration
- .rspec-migration-parallel
rspec migration pg11-as-if-foss minimal:
rspec migration pg12-as-if-foss minimal:
extends:
- rspec migration pg11-as-if-foss
- rspec migration pg12-as-if-foss
- .minimal-rspec-tests
- .rails:rules:as-if-foss-migration:minimal
rspec unit pg11-as-if-foss:
rspec unit pg12-as-if-foss:
extends:
- .rspec-base-pg11-as-if-foss
- .rspec-base-pg12-as-if-foss
- .rails:rules:as-if-foss-unit
- .rspec-unit-parallel
rspec unit pg11-as-if-foss minimal:
rspec unit pg12-as-if-foss minimal:
extends:
- rspec unit pg11-as-if-foss
- rspec unit pg12-as-if-foss
- .minimal-rspec-tests
- .rails:rules:as-if-foss-unit:minimal
rspec integration pg11-as-if-foss:
rspec integration pg12-as-if-foss:
extends:
- .rspec-base-pg11-as-if-foss
- .rspec-base-pg12-as-if-foss
- .rails:rules:as-if-foss-integration
- .rspec-integration-parallel
rspec integration pg11-as-if-foss minimal:
rspec integration pg12-as-if-foss minimal:
extends:
- rspec integration pg11-as-if-foss
- rspec integration pg12-as-if-foss
- .minimal-rspec-tests
- .rails:rules:as-if-foss-integration:minimal
rspec system pg11-as-if-foss:
rspec system pg12-as-if-foss:
extends:
- .rspec-base-pg11-as-if-foss
- .rspec-base-pg12-as-if-foss
- .rails:rules:as-if-foss-system
- .rspec-system-parallel
rspec system pg11-as-if-foss minimal:
rspec system pg12-as-if-foss minimal:
extends:
- rspec system pg11-as-if-foss
- rspec system pg12-as-if-foss
- .minimal-rspec-tests
- .rails:rules:as-if-foss-system:minimal
rspec-ee migration pg11:
rspec-ee migration pg12:
extends:
- .rspec-ee-base-pg11
- .rspec-ee-base-pg12
- .rspec-base-migration
- .rails:rules:ee-only-migration
- .rspec-ee-migration-parallel
rspec-ee migration pg11 minimal:
rspec-ee migration pg12 minimal:
extends:
- rspec-ee migration pg11
- rspec-ee migration pg12
- .minimal-rspec-tests
- .rails:rules:ee-only-migration:minimal
rspec-ee unit pg11:
rspec-ee unit pg12:
extends:
- .rspec-ee-base-pg11
- .rspec-ee-base-pg12
- .rails:rules:ee-only-unit
- .rspec-ee-unit-parallel
rspec-ee unit pg11 minimal:
rspec-ee unit pg12 minimal:
extends:
- rspec-ee unit pg11
- rspec-ee unit pg12
- .minimal-rspec-tests
- .rails:rules:ee-only-unit:minimal
rspec-ee integration pg11:
rspec-ee integration pg12:
extends:
- .rspec-ee-base-pg11
- .rspec-ee-base-pg12
- .rails:rules:ee-only-integration
- .rspec-ee-integration-parallel
rspec-ee integration pg11 minimal:
rspec-ee integration pg12 minimal:
extends:
- rspec-ee integration pg11
- rspec-ee integration pg12
- .minimal-rspec-tests
- .rails:rules:ee-only-integration:minimal
rspec-ee system pg11:
rspec-ee system pg12:
extends:
- .rspec-ee-base-pg11
- .rspec-ee-base-pg12
- .rails:rules:ee-only-system
- .rspec-ee-system-parallel
rspec-ee system pg11 minimal:
rspec-ee system pg12 minimal:
extends:
- rspec-ee system pg11
- rspec-ee system pg12
- .minimal-rspec-tests
- .rails:rules:ee-only-system:minimal
rspec-ee unit pg11 geo:
rspec-ee unit pg12 geo:
extends:
- .rspec-ee-base-geo-pg11
- .rspec-ee-base-geo-pg12
- .rails:rules:ee-only-unit
- .rspec-ee-unit-geo-parallel
# FIXME: Temporarily disable geo minimal rspec jobs https://gitlab.com/gitlab-org/gitlab/-/issues/294212
#rspec-ee unit pg11 geo minimal:
#rspec-ee unit pg12 geo minimal:
# extends:
# - rspec-ee unit pg11 geo
# - rspec-ee unit pg12 geo
# - .minimal-rspec-tests
# - .rails:rules:ee-only-unit:minimal
rspec-ee integration pg11 geo:
rspec-ee integration pg12 geo:
extends:
- .rspec-ee-base-geo-pg11
- .rspec-ee-base-geo-pg12
- .rails:rules:ee-only-integration
# FIXME: Temporarily disable geo minimal rspec jobs https://gitlab.com/gitlab-org/gitlab/-/issues/294212
#rspec-ee integration pg11 geo minimal:
#rspec-ee integration pg12 geo minimal:
# extends:
# - rspec-ee integration pg11 geo
# - rspec-ee integration pg12 geo
# - .minimal-rspec-tests
# - .rails:rules:ee-only-integration:minimal
rspec-ee system pg11 geo:
rspec-ee system pg12 geo:
extends:
- .rspec-ee-base-geo-pg11
- .rspec-ee-base-geo-pg12
- .rails:rules:ee-only-system
# FIXME: Temporarily disable geo minimal rspec jobs https://gitlab.com/gitlab-org/gitlab/-/issues/294212
#rspec-ee system pg11 geo minimal:
#rspec-ee system pg12 geo minimal:
# extends:
# - rspec-ee system pg11 geo
# - rspec-ee system pg12 geo
# - .minimal-rspec-tests
# - .rails:rules:ee-only-system:minimal
@ -677,75 +677,75 @@ db:rollback geo:
##########################################
# EE/FOSS: default branch nightly scheduled jobs #
rspec migration pg12:
rspec migration pg11:
extends:
- .rspec-base-pg12
- .rspec-base-pg11
- .rspec-base-migration
- .rails:rules:default-branch-schedule-2-hourly-nightly--code-backstage
- .rails:rules:default-branch-schedule-nightly--code-backstage
- .rspec-migration-parallel
rspec unit pg12:
rspec unit pg11:
extends:
- .rspec-base-pg12
- .rails:rules:default-branch-schedule-2-hourly-nightly--code-backstage
- .rspec-base-pg11
- .rails:rules:default-branch-schedule-nightly--code-backstage
- .rspec-unit-parallel
rspec integration pg12:
rspec integration pg11:
extends:
- .rspec-base-pg12
- .rails:rules:default-branch-schedule-2-hourly-nightly--code-backstage
- .rspec-base-pg11
- .rails:rules:default-branch-schedule-nightly--code-backstage
- .rspec-integration-parallel
rspec system pg12:
rspec system pg11:
extends:
- .rspec-base-pg12
- .rails:rules:default-branch-schedule-2-hourly-nightly--code-backstage
- .rspec-base-pg11
- .rails:rules:default-branch-schedule-nightly--code-backstage
- .rspec-system-parallel
# EE/FOSS: default branch nightly scheduled jobs #
##########################################
#####################################
# EE: default branch nightly scheduled jobs #
rspec-ee migration pg12:
rspec-ee migration pg11:
extends:
- .rspec-ee-base-pg12
- .rspec-ee-base-pg11
- .rspec-base-migration
- .rails:rules:default-branch-schedule-2-hourly-nightly--code-backstage-ee-only
- .rails:rules:default-branch-schedule-nightly--code-backstage-ee-only
- .rspec-ee-migration-parallel
rspec-ee unit pg12:
rspec-ee unit pg11:
extends:
- .rspec-ee-base-pg12
- .rails:rules:default-branch-schedule-2-hourly-nightly--code-backstage-ee-only
- .rspec-ee-base-pg11
- .rails:rules:default-branch-schedule-nightly--code-backstage-ee-only
- .rspec-ee-unit-parallel
rspec-ee integration pg12:
rspec-ee integration pg11:
extends:
- .rspec-ee-base-pg12
- .rails:rules:default-branch-schedule-2-hourly-nightly--code-backstage-ee-only
- .rspec-ee-base-pg11
- .rails:rules:default-branch-schedule-nightly--code-backstage-ee-only
- .rspec-ee-integration-parallel
rspec-ee system pg12:
rspec-ee system pg11:
extends:
- .rspec-ee-base-pg12
- .rails:rules:default-branch-schedule-2-hourly-nightly--code-backstage-ee-only
- .rspec-ee-base-pg11
- .rails:rules:default-branch-schedule-nightly--code-backstage-ee-only
- .rspec-ee-system-parallel
rspec-ee unit pg12 geo:
rspec-ee unit pg11 geo:
extends:
- .rspec-ee-base-geo-pg12
- .rails:rules:default-branch-schedule-2-hourly-nightly--code-backstage-ee-only
- .rspec-ee-base-geo-pg11
- .rails:rules:default-branch-schedule-nightly--code-backstage-ee-only
- .rspec-ee-unit-geo-parallel
rspec-ee integration pg12 geo:
rspec-ee integration pg11 geo:
extends:
- .rspec-ee-base-geo-pg12
- .rails:rules:default-branch-schedule-2-hourly-nightly--code-backstage-ee-only
- .rspec-ee-base-geo-pg11
- .rails:rules:default-branch-schedule-nightly--code-backstage-ee-only
rspec-ee system pg12 geo:
rspec-ee system pg11 geo:
extends:
- .rspec-ee-base-geo-pg12
- .rails:rules:default-branch-schedule-2-hourly-nightly--code-backstage-ee-only
- .rspec-ee-base-geo-pg11
- .rails:rules:default-branch-schedule-nightly--code-backstage-ee-only
# EE: default branch nightly scheduled jobs #
#####################################
@ -753,7 +753,7 @@ rspec-ee system pg12 geo:
# EE: Canonical MR pipelines
rspec fail-fast:
extends:
- .rspec-ee-base-pg11 # This job also runs EE spec which needs elasticsearch
- .rspec-ee-base-pg12 # This job also runs EE spec which needs elasticsearch
- .rails:rules:rspec fail-fast
stage: test
needs: ["setup-test-env", "retrieve-tests-metadata", "compile-test-assets", "detect-tests"]
@ -767,7 +767,7 @@ rspec fail-fast:
rspec foss-impact:
extends:
- .rspec-base-pg11-as-if-foss
- .rspec-base-pg12-as-if-foss
- .rails:rules:rspec-foss-impact
needs: ["setup-test-env", "retrieve-tests-metadata", "compile-test-assets as-if-foss", "detect-tests as-if-foss"]
script:

View File

@ -922,18 +922,16 @@
allow_failure: true
- <<: *if-merge-request-title-run-all-rspec
.rails:rules:default-branch-schedule-2-hourly-nightly--code-backstage:
.rails:rules:default-branch-schedule-nightly--code-backstage:
rules:
- <<: *if-default-branch-schedule-2-hourly
- <<: *if-default-branch-schedule-nightly
- <<: *if-merge-request
changes: [".gitlab/ci/rails.gitlab-ci.yml"]
.rails:rules:default-branch-schedule-2-hourly-nightly--code-backstage-ee-only:
.rails:rules:default-branch-schedule-nightly--code-backstage-ee-only:
rules:
- <<: *if-not-ee
when: never
- <<: *if-default-branch-schedule-2-hourly
- <<: *if-default-branch-schedule-nightly
- <<: *if-merge-request
changes: [".gitlab/ci/rails.gitlab-ci.yml"]

View File

@ -27,19 +27,19 @@ update-tests-metadata:
stage: post-test
dependencies:
- setup-test-env
- rspec migration pg11
- rspec migration pg12
- rspec frontend_fixture
- rspec-ee frontend_fixture
- rspec unit pg11
- rspec integration pg11
- rspec system pg11
- rspec-ee migration pg11
- rspec-ee unit pg11
- rspec-ee integration pg11
- rspec-ee system pg11
- rspec-ee unit pg11 geo
- rspec-ee integration pg11 geo
- rspec-ee system pg11 geo
- rspec unit pg12
- rspec integration pg12
- rspec system pg12
- rspec-ee migration pg12
- rspec-ee unit pg12
- rspec-ee integration pg12
- rspec-ee system pg12
- rspec-ee unit pg12 geo
- rspec-ee integration pg12 geo
- rspec-ee system pg12 geo
script:
- run_timed_command "retry gem install fog-aws mime-types activesupport rspec_profiling postgres-copy --no-document"
- source ./scripts/rspec_helpers.sh

View File

@ -1 +1 @@
529ef59e73a21d1abc54833c4edbe92cbcc9fb64
1966c1d9d4f11d05e73519e13ed8d0f56e3f0155

View File

@ -1,7 +1,7 @@
import { ApolloLink, Observable } from 'apollo-link';
import { print } from 'graphql';
import cable from '~/actioncable_consumer';
import { uuids } from '~/diffs/utils/uuids';
import { uuids } from '~/lib/utils/uuids';
export default class ActionCableLink extends ApolloLink {
// eslint-disable-next-line class-methods-use-this

View File

@ -1,4 +1,5 @@
import { truncateSha } from '~/lib/utils/text_utility';
import { uuids } from '~/lib/utils/uuids';
import {
DIFF_FILE_SYMLINK_MODE,
@ -7,7 +8,6 @@ import {
DIFF_FILE_AUTOMATIC_COLLAPSE,
} from '../constants';
import { getDerivedMergeRequestInformation } from './merge_request';
import { uuids } from './uuids';
function fileSymlinkInformation(file, fileList) {
const duplicates = fileList.filter((iteratedFile) => iteratedFile.file_hash === file.file_hash);

View File

@ -1,10 +1,10 @@
import { editor as monacoEditor, languages as monacoLanguages, Uri } from 'monaco-editor';
import { uuids } from '~/diffs/utils/uuids';
import { defaultEditorOptions } from '~/ide/lib/editor_options';
import languages from '~/ide/lib/languages';
import { DEFAULT_THEME, themes } from '~/ide/lib/themes';
import { registerLanguages } from '~/ide/utils';
import { joinPaths } from '~/lib/utils/url_utility';
import { uuids } from '~/lib/utils/uuids';
import {
EDITOR_LITE_INSTANCE_ERROR_NO_EL,
URI_PREFIX,

View File

@ -1,4 +1,4 @@
import { uuids } from '../../diffs/utils/uuids';
import { uuids } from './uuids';
/**
* @module recurrence

View File

@ -5,4 +5,4 @@ rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/323159
milestone: '13.10'
type: development
group: group::optimize
default_enabled: false
default_enabled: true

View File

@ -24961,35 +24961,35 @@ ALTER INDEX product_analytics_events_experimental_pkey ATTACH PARTITION gitlab_p
ALTER INDEX product_analytics_events_experimental_pkey ATTACH PARTITION gitlab_partitions_static.product_analytics_events_experimental_63_pkey;
CREATE TRIGGER table_sync_trigger_b99eb6998c AFTER INSERT OR DELETE OR UPDATE ON web_hook_logs FOR EACH ROW EXECUTE PROCEDURE table_sync_function_29bc99d6db();
CREATE TRIGGER table_sync_trigger_b99eb6998c AFTER INSERT OR DELETE OR UPDATE ON web_hook_logs FOR EACH ROW EXECUTE FUNCTION table_sync_function_29bc99d6db();
CREATE TRIGGER trigger_07c94931164e BEFORE INSERT OR UPDATE ON push_event_payloads FOR EACH ROW EXECUTE PROCEDURE trigger_07c94931164e();
CREATE TRIGGER trigger_07c94931164e BEFORE INSERT OR UPDATE ON push_event_payloads FOR EACH ROW EXECUTE FUNCTION trigger_07c94931164e();
CREATE TRIGGER trigger_21e7a2602957 BEFORE INSERT OR UPDATE ON ci_build_needs FOR EACH ROW EXECUTE PROCEDURE trigger_21e7a2602957();
CREATE TRIGGER trigger_21e7a2602957 BEFORE INSERT OR UPDATE ON ci_build_needs FOR EACH ROW EXECUTE FUNCTION trigger_21e7a2602957();
CREATE TRIGGER trigger_3f6129be01d2 BEFORE INSERT OR UPDATE ON ci_builds FOR EACH ROW EXECUTE PROCEDURE trigger_3f6129be01d2();
CREATE TRIGGER trigger_3f6129be01d2 BEFORE INSERT OR UPDATE ON ci_builds FOR EACH ROW EXECUTE FUNCTION trigger_3f6129be01d2();
CREATE TRIGGER trigger_51ab7cef8934 BEFORE INSERT OR UPDATE ON ci_builds_runner_session FOR EACH ROW EXECUTE PROCEDURE trigger_51ab7cef8934();
CREATE TRIGGER trigger_51ab7cef8934 BEFORE INSERT OR UPDATE ON ci_builds_runner_session FOR EACH ROW EXECUTE FUNCTION trigger_51ab7cef8934();
CREATE TRIGGER trigger_69523443cc10 BEFORE INSERT OR UPDATE ON events FOR EACH ROW EXECUTE PROCEDURE trigger_69523443cc10();
CREATE TRIGGER trigger_69523443cc10 BEFORE INSERT OR UPDATE ON events FOR EACH ROW EXECUTE FUNCTION trigger_69523443cc10();
CREATE TRIGGER trigger_8485e97c00e3 BEFORE INSERT OR UPDATE ON ci_sources_pipelines FOR EACH ROW EXECUTE PROCEDURE trigger_8485e97c00e3();
CREATE TRIGGER trigger_8485e97c00e3 BEFORE INSERT OR UPDATE ON ci_sources_pipelines FOR EACH ROW EXECUTE FUNCTION trigger_8485e97c00e3();
CREATE TRIGGER trigger_be1804f21693 BEFORE INSERT OR UPDATE ON ci_job_artifacts FOR EACH ROW EXECUTE PROCEDURE trigger_be1804f21693();
CREATE TRIGGER trigger_be1804f21693 BEFORE INSERT OR UPDATE ON ci_job_artifacts FOR EACH ROW EXECUTE FUNCTION trigger_be1804f21693();
CREATE TRIGGER trigger_cf2f9e35f002 BEFORE INSERT OR UPDATE ON ci_build_trace_chunks FOR EACH ROW EXECUTE PROCEDURE trigger_cf2f9e35f002();
CREATE TRIGGER trigger_cf2f9e35f002 BEFORE INSERT OR UPDATE ON ci_build_trace_chunks FOR EACH ROW EXECUTE FUNCTION trigger_cf2f9e35f002();
CREATE TRIGGER trigger_has_external_issue_tracker_on_delete AFTER DELETE ON services FOR EACH ROW WHEN ((((old.category)::text = 'issue_tracker'::text) AND (old.active = true) AND (old.project_id IS NOT NULL))) EXECUTE PROCEDURE set_has_external_issue_tracker();
CREATE TRIGGER trigger_has_external_issue_tracker_on_delete AFTER DELETE ON services FOR EACH ROW WHEN ((((old.category)::text = 'issue_tracker'::text) AND (old.active = true) AND (old.project_id IS NOT NULL))) EXECUTE FUNCTION set_has_external_issue_tracker();
CREATE TRIGGER trigger_has_external_issue_tracker_on_insert AFTER INSERT ON services FOR EACH ROW WHEN ((((new.category)::text = 'issue_tracker'::text) AND (new.active = true) AND (new.project_id IS NOT NULL))) EXECUTE PROCEDURE set_has_external_issue_tracker();
CREATE TRIGGER trigger_has_external_issue_tracker_on_insert AFTER INSERT ON services FOR EACH ROW WHEN ((((new.category)::text = 'issue_tracker'::text) AND (new.active = true) AND (new.project_id IS NOT NULL))) EXECUTE FUNCTION set_has_external_issue_tracker();
CREATE TRIGGER trigger_has_external_issue_tracker_on_update AFTER UPDATE ON services FOR EACH ROW WHEN ((((new.category)::text = 'issue_tracker'::text) AND (old.active <> new.active) AND (new.project_id IS NOT NULL))) EXECUTE PROCEDURE set_has_external_issue_tracker();
CREATE TRIGGER trigger_has_external_issue_tracker_on_update AFTER UPDATE ON services FOR EACH ROW WHEN ((((new.category)::text = 'issue_tracker'::text) AND (old.active <> new.active) AND (new.project_id IS NOT NULL))) EXECUTE FUNCTION set_has_external_issue_tracker();
CREATE TRIGGER trigger_has_external_wiki_on_delete AFTER DELETE ON services FOR EACH ROW WHEN ((((old.type)::text = 'ExternalWikiService'::text) AND (old.project_id IS NOT NULL))) EXECUTE PROCEDURE set_has_external_wiki();
CREATE TRIGGER trigger_has_external_wiki_on_delete AFTER DELETE ON services FOR EACH ROW WHEN ((((old.type)::text = 'ExternalWikiService'::text) AND (old.project_id IS NOT NULL))) EXECUTE FUNCTION set_has_external_wiki();
CREATE TRIGGER trigger_has_external_wiki_on_insert AFTER INSERT ON services FOR EACH ROW WHEN (((new.active = true) AND ((new.type)::text = 'ExternalWikiService'::text) AND (new.project_id IS NOT NULL))) EXECUTE PROCEDURE set_has_external_wiki();
CREATE TRIGGER trigger_has_external_wiki_on_insert AFTER INSERT ON services FOR EACH ROW WHEN (((new.active = true) AND ((new.type)::text = 'ExternalWikiService'::text) AND (new.project_id IS NOT NULL))) EXECUTE FUNCTION set_has_external_wiki();
CREATE TRIGGER trigger_has_external_wiki_on_update AFTER UPDATE ON services FOR EACH ROW WHEN ((((new.type)::text = 'ExternalWikiService'::text) AND (old.active <> new.active) AND (new.project_id IS NOT NULL))) EXECUTE PROCEDURE set_has_external_wiki();
CREATE TRIGGER trigger_has_external_wiki_on_update AFTER UPDATE ON services FOR EACH ROW WHEN ((((new.type)::text = 'ExternalWikiService'::text) AND (old.active <> new.active) AND (new.project_id IS NOT NULL))) EXECUTE FUNCTION set_has_external_wiki();
ALTER TABLE ONLY chat_names
ADD CONSTRAINT fk_00797a2bf9 FOREIGN KEY (service_id) REFERENCES services(id) ON DELETE CASCADE;

View File

@ -128,6 +128,7 @@ The following metrics are available:
| `pipeline_graph_links_total` | Histogram | 13.9 | Number of links per graph | |
| `pipeline_graph_links_per_job_ratio` | Histogram | 13.9 | Ratio of links to job per graph | |
| `gitlab_ci_pipeline_security_orchestration_policy_processing_duration_seconds` | Histogram | 13.12 | Time in seconds it takes to process Security Policies in CI/CD pipeline | |
| `gitlab_ci_difference_live_vs_actual_minutes` | Histogram | 13.12 | Difference between CI minute consumption counted while jobs were running (live) vs when jobs are complete (actual). Used to enforce CI minute consumption limits on long running jobs. | `plan` |
## Metrics controlled by a feature flag

View File

@ -479,29 +479,30 @@ because of 2 reasons:
### PostgreSQL versions testing
Even though [Omnibus defaults to PG12 for new installs and upgrades](https://docs.gitlab.com/omnibus/package-information/postgresql_versions.html),
our test suite is currently running against PG11, since GitLab.com still runs on PG11.
Our test suite runs against PG12 as GitLab.com runs on PG12 and
[Omnibus defaults to PG12 for new installs and upgrades](https://docs.gitlab.com/omnibus/package-information/postgresql_versions.html),
Our test suite is currently running against PG11, since GitLab.com still runs on PG11.
We do run our test suite against PG12 on nightly scheduled pipelines as well as upon specific
database library changes in MRs and `master` pipelines (with the `rspec db-library-code pg12` job).
We do run our test suite against PG11 on nightly scheduled pipelines as well as upon specific
database library changes in MRs and `master` pipelines (with the `rspec db-library-code pg11` job).
#### Current versions testing
| Where? | PostgreSQL version |
| ------ | ------------------ |
| MRs | 11, 12 for DB library changes |
| `master` (non-scheduled pipelines) | 11, 12 for DB library changes |
| 2-hourly scheduled pipelines | 11, 12 for DB library changes |
| `nightly` scheduled pipelines | 11, 12 |
| MRs | 12, 11 for DB library changes |
| `master` (non-scheduled pipelines) | 12, 11 for DB library changes |
| 2-hourly scheduled pipelines | 12, 11 for DB library changes |
| `nightly` scheduled pipelines | 12, 11 |
#### Long-term plan
We follow the [PostgreSQL versions shipped with Omnibus GitLab](https://docs.gitlab.com/omnibus/package-information/postgresql_versions.html):
| PostgreSQL version | 13.7 (December 2020) | 13.8 (January 2021) | 13.9 (February 2021) | 13.10 (March 2021) | 13.11 (April 2021) | 14.0 (May 2021?) |
| -------------------| -------------------- | ------------------- | -------------------- | ------------------ | ------------------ | ---------------- |
| PG11 | MRs/`2-hour`/`nightly` | MRs/`2-hour`/`nightly` | MRs/`2-hour`/`nightly` | MRs/`2-hour`/`nightly` | MRs/`2-hour`/`nightly` | MRs/`2-hour`/`nightly` |
| PG12 | `nightly` | `nightly` | `nightly` | `nightly` | `nightly` | `nightly` |
| PostgreSQL version | 13.11 (April 2021) | 13.12 (May 2021) | 14.0 (June 2021?) |
| -------------------| ---------------------- | ---------------------- | ---------------------- |
| PG12 | `nightly` | MRs/`2-hour`/`nightly` | MRs/`2-hour`/`nightly` |
| PG11 | MRs/`2-hour`/`nightly` | `nightly` | `nightly` |
### Test jobs

View File

@ -37,6 +37,7 @@ Each metric is defined in a separate YAML file consisting of a number of fields:
| `status` | yes | `string`; [status](#metric-statuses) of the metric, may be set to `data_available`, `implemented`, `not_used`, `deprecated`, `removed`. |
| `time_frame` | yes | `string`; may be set to a value like `7d`, `28d`, `all`, `none`. |
| `data_source` | yes | `string`; may be set to a value like `database`, `redis`, `redis_hll`, `prometheus`, `ruby`. |
| `instrumentation_class` | no | `string`; [the class that implements the metric](metrics_instrumentation.md). |
| `distribution` | yes | `array`; may be set to one of `ce, ee` or `ee`. The [distribution](https://about.gitlab.com/handbook/marketing/strategic-marketing/tiers/#definitions) where the tracked feature is available. |
| `tier` | yes | `array`; may be set to one of `free, premium, ultimate`, `premium, ultimate` or `ultimate`. The [tier]( https://about.gitlab.com/handbook/marketing/strategic-marketing/tiers/) where the tracked feature is available. |
| `milestone` | no | The milestone when the metric is introduced. |

View File

@ -0,0 +1,90 @@
---
stage: Growth
group: Product Intelligence
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#assignments
---
# Metrics instrumentation guide
This guide describes how to develop Usage Ping metrics using metrics instrumentation.
## Nomenclature
- **Instrumentation class**:
- Inherits one of the metric classes: `DatabaseMetric`, `RedisHLLMetric` or `GenericMetric`.
- Implements the logic that calculates the value for a Usage Ping metric.
- **Metric definition**
The Usage Data metric YAML definition.
- **Hardening**:
Hardening a method is the process that ensures the method fails safe, returning a fallback value like -1.
## How it works
A metric definition has the [`instrumentation_class`](metrics_dictionary.md) field, which can be set to a class.
The defined instrumentation class should have one of the existing metric classes: `DatabaseMetric`, `RedisHLLMetric`, or `GenericMetric`.
Using the instrumentation classes ensures that metrics can fail safe individually, without breaking the entire
process of Usage Ping generation.
We have built a domain-specific language (DSL) to define the metrics instrumentation.
## Database metrics
[Example of a merge request that adds a database metric](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/60022).
```ruby
module Gitlab
module Usage
module Metrics
module Instrumentations
class CountBoardsMetric < DatabaseMetric
operation :count
relation { Board }
end
end
end
end
end
```
## Redis HyperLogLog metrics
[Example of a merge request that adds a `RedisHLL` metric](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/60089/diffs).
```ruby
module Gitlab
module Usage
module Metrics
module Instrumentations
class CountUsersUsingApproveQuickActionMetric < RedisHLLMetric
event_names :i_quickactions_approve
end
end
end
end
end
```
## Generic metrics
[Example of a merge request that adds a generic metric](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/60256).
```ruby
module Gitlab
module Usage
module Metrics
module Instrumentations
class UuidMetric < GenericMetric
value do
Gitlab::CurrentSettings.uuid
end
end
end
end
end
end
```

View File

@ -33,7 +33,7 @@ The following is an example of the Credentials inventory page:
If you see a **Revoke** button, you can revoke that user's PAT. Whether you see a **Revoke** button depends on the token state, and if an expiration date has been set. For more information, see the following table:
| Token state | [Token expiration enforced?](settings/account_and_limit_settings.md#optional-non-enforcement-of-personal-access-token-expiration) | Show Revoke button? | Comments |
| Token state | [Token expiration enforced?](settings/account_and_limit_settings.md#do-not-enforce-personal-access-token-expiration) | Show Revoke button? | Comments |
|-------------|------------------------|--------------------|----------------------------------------------------------------------------|
| Active | Yes | Yes | Allows administrators to revoke the PAT, such as for a compromised account |
| Active | No | Yes | Allows administrators to revoke the PAT, such as for a compromised account |

View File

@ -50,7 +50,7 @@ You can set a global prefix for all generated Personal Access Tokens.
A prefix can help you identify PATs visually, as well as with automation tools.
### Setting a prefix
### Set a prefix
Only a GitLab administrator can set the prefix, which is a global setting applied
to any PAT generated in the system by any user:
@ -148,7 +148,7 @@ To set a limit on how long these sessions are valid:
1. Fill in the **Session duration for Git operations when 2FA is enabled (minutes)** field.
1. Click **Save changes**.
## Limiting lifetime of personal access tokens **(ULTIMATE SELF)**
## Limit the lifetime of personal access tokens **(ULTIMATE SELF)**
> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/3649) in GitLab Ultimate 12.6.
@ -160,7 +160,7 @@ Personal access tokens are the only tokens needed for programmatic access to Git
However, organizations with security requirements may want to enforce more protection by
requiring the regular rotation of these tokens.
### Setting a lifetime
### Set a lifetime
Only a GitLab administrator can set a lifetime. Leaving it empty means
there are no restrictions.
@ -180,12 +180,16 @@ Once a lifetime for personal access tokens is set, GitLab:
allowed lifetime. Three hours is given to allow administrators to change the allowed lifetime,
or remove it, before revocation takes place.
## Optional enforcement of SSH key expiration **(ULTIMATE SELF)**
## Enforce SSH key expiration **(ULTIMATE SELF)**
> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/250480) in GitLab 13.9.
By default, expired SSH keys **can still be used**.
You can prevent the use of expired SSH keys with the following steps:
WARNING:
Allowing use of expired SSH keys by default is deprecated and scheduled to change in GitLab 14.0.
To prevent the use of expired SSH keys:
1. Navigate to **Admin Area > Settings > General**.
1. Expand the **Account and limit** section.
@ -195,7 +199,7 @@ Enforcing SSH key expiration immediately disables all expired SSH keys.
For more information, see the following issue on [SSH key expiration](https://gitlab.com/gitlab-org/gitlab/-/issues/320970).
## Optional non-enforcement of Personal Access Token expiration **(ULTIMATE SELF)**
## Do not enforce Personal Access Token expiration **(ULTIMATE SELF)**
> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/214723) in GitLab Ultimate 13.1.
> - [Feature flag removed](https://gitlab.com/gitlab-org/gitlab/-/issues/296881) in GitLab 13.9.
@ -209,7 +213,7 @@ To do this:
1. Expand the **Account and limit** section.
1. Uncheck the **Enforce personal access token expiration** checkbox.
## Disabling user profile name changes **(PREMIUM SELF)**
## Disable user profile name changes **(PREMIUM SELF)**
> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/24605) in GitLab 12.7.

View File

@ -7,10 +7,8 @@ info: To determine the technical writer assigned to the Stage/Group associated w
# Group DevOps Adoption **(ULTIMATE)**
> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/321083) as a [Beta feature](https://about.gitlab.com/handbook/product/gitlab-the-product/#beta) in GitLab 13.11.
> - [Deployed behind a feature flag](../../../user/feature_flags.md), disabled by default.
> - Disabled on GitLab.com.
> - [Deployed behind a feature flag](../../../user/feature_flags.md), enabled by default.
> - Not recommended for production use.
> - To use in GitLab self-managed instances, ask a GitLab administrator to [enable it](#enable-or-disable-group-devops-adoption).
This in-development feature might not be available for your use. There can be
[risks when enabling features still in development](../../feature_flags.md#risks-when-enabling-features-still-in-development).
@ -46,18 +44,18 @@ With DevOps Adoption you can:
## Enable or disable Group DevOps Adoption **(ULTIMATE)**
Group DevOps Adoption is under development and not ready for production use. It is
deployed behind a feature flag that is **disabled by default**.
deployed behind a feature flag that is **enabled by default**.
[GitLab administrators with access to the GitLab Rails console](../../../administration/feature_flags.md)
can enable it.
To enable it:
```ruby
Feature.enable(:group_devops_adoption)
```
can disable it.
To disable it:
```ruby
Feature.disable(:group_devops_adoption)
```
To reenable it:
```ruby
Feature.enable(:group_devops_adoption)
```

View File

@ -104,9 +104,11 @@ This expiration date is not a requirement, and can be set to any arbitrary date.
Since personal access tokens are the only token needed for programmatic access to GitLab, organizations with security requirements may want to enforce more protection to require regular rotation of these tokens.
### Setting a limit
### Set a limit
Only a GitLab administrator or an owner of a group-managed account can set a limit. When this field is left empty, the [instance-level restriction](../../admin_area/settings/account_and_limit_settings.md#limiting-lifetime-of-personal-access-tokens) on the lifetime of personal access tokens apply.
Only a GitLab administrator or an owner of a group-managed account can set a limit. When this field
is left empty, the [instance-level restriction](../../admin_area/settings/account_and_limit_settings.md#limit-the-lifetime-of-personal-access-tokens)
on the lifetime of personal access tokens apply.
To set a limit on how long personal access tokens are valid for users in a group managed account:

View File

@ -79,8 +79,10 @@ Personal access tokens expire on the date you define, at midnight UTC.
- GitLab runs a check at 01:00 AM UTC every day to identify personal access tokens that expire in the next seven days. The owners of these tokens are notified by email.
- GitLab runs a check at 02:00 AM UTC every day to identify personal access tokens that expire on the current date. The owners of these tokens are notified by email.
- In GitLab Ultimate, administrators can [limit the lifetime of personal access tokens](../admin_area/settings/account_and_limit_settings.md#limiting-lifetime-of-personal-access-tokens).
- In GitLab Ultimate, administrators can choose whether or not to [enforce personal access token expiration](../admin_area/settings/account_and_limit_settings.md#optional-non-enforcement-of-personal-access-token-expiration).
- In GitLab Ultimate, administrators can
[limit the lifetime of personal access tokens](../admin_area/settings/account_and_limit_settings.md#limit-the-lifetime-of-personal-access-tokens).
- In GitLab Ultimate, administrators can choose whether or not to
[enforce personal access token expiration](../admin_area/settings/account_and_limit_settings.md#do-not-enforce-personal-access-token-expiration).
## Create a personal access token programmatically **(FREE SELF)**

View File

@ -70,6 +70,14 @@ module Gitlab
Gitlab::Metrics.counter(name, comment)
end
def self.gitlab_ci_difference_live_vs_actual_minutes
name = :gitlab_ci_difference_live_vs_actual_minutes
comment = 'Comparison between CI minutes consumption from live tracking vs actual consumption'
labels = {}
buckets = [-120.0, -60.0, -30.0, -10.0, -5.0, -3.0, -1.0, 0.0, 1.0, 3.0, 5.0, 10.0, 30.0, 60.0, 120.0]
::Gitlab::Metrics.histogram(name, comment, labels, buckets)
end
end
end
end

View File

@ -95,7 +95,7 @@ function rspec_paralellized_job() {
read -ra job_name <<< "${CI_JOB_NAME}"
local test_tool="${job_name[0]}"
local test_level="${job_name[1]}"
local report_name=$(echo "${CI_JOB_NAME}" | sed -E 's|[/ ]|_|g') # e.g. 'rspec unit pg11 1/24' would become 'rspec_unit_pg11_1_24'
local report_name=$(echo "${CI_JOB_NAME}" | sed -E 's|[/ ]|_|g') # e.g. 'rspec unit pg12 1/24' would become 'rspec_unit_pg12_1_24'
local rspec_opts="${1}"
local spec_folder_prefix=""

View File

@ -4,7 +4,7 @@ import cable from '~/actioncable_consumer';
import ActionCableLink from '~/actioncable_link';
// Mock uuids module for determinism
jest.mock('~/diffs/utils/uuids', () => ({
jest.mock('~/lib/utils/uuids', () => ({
uuids: () => ['testuuid'],
}));

View File

@ -27,7 +27,7 @@ describe('Deploy freeze mutations', () => {
describe('RECEIVE_FREEZE_PERIODS_SUCCESS', () => {
it('should set freeze periods and format timezones from identifiers to names', () => {
const timezoneNames = ['Berlin', 'UTC', 'Eastern Time (US & Canada)'];
const timezoneNames = ['Eastern Time (US & Canada)', 'UTC', 'Berlin'];
mutations[types.RECEIVE_FREEZE_PERIODS_SUCCESS](stateCopy, freezePeriodsFixture);

View File

@ -1,4 +1,4 @@
import { uuids } from '~/diffs/utils/uuids';
import { uuids } from '~/lib/utils/uuids';
const HEX = /[a-f0-9]/i;
const HEX_RE = HEX.source;