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:
-rw-r--r--.gitlab/ci/reports.gitlab-ci.yml29
-rw-r--r--.gitlab/issue_templates/Experiment Idea.md48
-rw-r--r--.gitpod.yml4
-rw-r--r--app/assets/javascripts/blob/components/blob_content.vue1
-rw-r--r--app/assets/javascripts/blob/viewer/index.js18
-rw-r--r--app/assets/javascripts/performance/constants.js12
-rw-r--r--app/assets/javascripts/registry/explorer/components/details_page/details_header.vue2
-rw-r--r--app/assets/javascripts/registry/explorer/constants/details.js2
-rw-r--r--app/assets/javascripts/repository/index.js5
-rw-r--r--app/assets/javascripts/vue_shared/components/blob_viewers/simple_viewer.vue1
-rw-r--r--app/assets/stylesheets/components/feature_highlight.scss22
-rw-r--r--app/models/application_record.rb6
-rw-r--r--app/models/ci/build.rb3
-rw-r--r--app/models/project.rb11
-rw-r--r--app/services/projects/create_service.rb9
-rw-r--r--changelogs/unreleased/ab-migrate-ci-builds.yml5
-rw-r--r--changelogs/unreleased/gl-card-license-history.yml5
-rw-r--r--changelogs/unreleased/registry-delete-button-copy.yml5
-rw-r--r--danger/changelog/Dangerfile2
-rw-r--r--db/migrate/20210426094524_initialize_conversion_of_ci_builds_to_bigint.rb17
-rw-r--r--db/post_migrate/20210426094549_backfill_ci_builds_for_bigint_conversion.rb28
-rw-r--r--db/schema_migrations/202104260945241
-rw-r--r--db/schema_migrations/202104260945491
-rw-r--r--db/structure.sql14
-rw-r--r--lib/gitlab/import_export/project/import_export.yml2
-rw-r--r--locale/gitlab.pot50
-rw-r--r--spec/frontend/registry/explorer/components/details_page/details_header_spec.js2
-rw-r--r--spec/lib/gitlab/usage/metrics/aggregates/aggregate_spec.rb29
28 files changed, 251 insertions, 83 deletions
diff --git a/.gitlab/ci/reports.gitlab-ci.yml b/.gitlab/ci/reports.gitlab-ci.yml
index 2f02e6c1f97..a05a4798880 100644
--- a/.gitlab/ci/reports.gitlab-ci.yml
+++ b/.gitlab/ci/reports.gitlab-ci.yml
@@ -1,40 +1,17 @@
-# include:
-# - template: Jobs/Code-Quality.gitlab-ci.yml
+include:
+ - template: Jobs/Code-Quality.gitlab-ci.yml
# - template: Security/SAST.gitlab-ci.yml
# - template: Security/Dependency-Scanning.gitlab-ci.yml
# - template: Security/DAST.gitlab-ci.yml
-# We need to duplicate this job's definition because the rules
-# defined in the extended jobs rely on local YAML anchors
-# (`*if-default-refs`)
code_quality:
extends:
- .default-retry
- - .reports:rules:code_quality
- .use-docker-in-docker
- stage: test
- needs: []
- variables:
- CODE_QUALITY_IMAGE: "registry.gitlab.com/gitlab-org/ci-cd/codequality:0.85.23"
- script:
- - |
- if ! docker info &>/dev/null; then
- if [ -z "$DOCKER_HOST" -a "$KUBERNETES_PORT" ]; then
- export DOCKER_HOST='tcp://localhost:2375'
- fi
- fi
- - docker pull --quiet "$CODE_QUALITY_IMAGE"
- - docker run
- --env SOURCE_CODE="$PWD"
- --volume "$PWD":/code
- --volume /var/run/docker.sock:/var/run/docker.sock
- "$CODE_QUALITY_IMAGE" /code
artifacts:
- reports:
- codequality: gl-code-quality-report.json
paths:
- gl-code-quality-report.json # GitLab-specific
- expire_in: 1 week # GitLab-specific
+ rules: !reference [".reports:rules:code_quality", rules]
# We need to duplicate this job's definition because the rules
# defined in the extended jobs rely on local YAML anchors
diff --git a/.gitlab/issue_templates/Experiment Idea.md b/.gitlab/issue_templates/Experiment Idea.md
new file mode 100644
index 00000000000..2693f09e062
--- /dev/null
+++ b/.gitlab/issue_templates/Experiment Idea.md
@@ -0,0 +1,48 @@
+## Experiment summary
+
+We believe that... {describe your hypothesis in one sentence}
+
+To verify that, we will... {describe your test in one sentence}
+
+And we’ll measure the impact on... {metrics}
+
+## Hypothesis
+<!-- The hypothesis represents the high-level thought process in creating the experiment but does not need to be proven in one experiment. For example, you could have a hypothesis that “users would benefit from more easily being able to start a trial” and your first experiment could fail, that doesn’t void your hypothesis only indicates you may need to think of a new iterative experiment that would still align with your hypothesis. -->
+
+## Business problem
+<!-- Where the hypothesis is focused on the user/customer, the business problem represents why/how an experiment in this area could positively impact the business. For example, trials represent a significant way for GitLab to produce valuable leads for the sales team. -->
+
+## Supporting data
+<!-- Why should we run this experiment? What’s the potential impact? Show supporting data that’s both qualitative and quantitative. Quantitative example, we generate 30,000 sign ups a month and 900 trails within 90 days (3%) with a close rate of 10% and an IACV of $400. If we’re able to increase our trial volume by 10% percent (990 trials a month) we will generate an additional $3,600 IACV if our close rates remain constant. Qualitative example, in searching Zendesk I was able to find 10 support tickets in the last 30 days that referenced difficulties with starting a trial due to the user not being an admin. (all numbers are hypothetical and only listed for the purpose of having an example) -->
+
+## Expected outcome
+<!-- What is the expected outcome of this experiment, what metric are we trying to move? Are there any metrics we know we do not want to impact? For example, we want to impact IACV by increasing the rate at which users start trials within 30 days but we also want to ensure we don't increase the churn rate for users who've recently purchased. -->
+
+## Experiment design & implementation
+<!-- What is the experiment we’re going to run? How long do you believe it will need to run to reach significance? For example, our experiment would be to allow non-admins to request a trial through their admin, to detect a 10% change from our baseline conversion rate we’ll need a sample size of 57,000 (source Optimizely), with our current sign up rate of 30,000 a month this experiment will need to run for ~2 months. (all numbers are hypothetical and only listed for the purpose of having an example) -->
+
+## ICE score
+
+<!-- See https://about.gitlab.com/handbook/product/growth/#growth-ideation-and-prioritization -->
+
+| Impact | Confidence | Ease | Score |
+| ------ | ------ | ------ | ------ |
+| value 1 | value 2 | value 3 | Average(1:3) |
+
+## Known assumptions
+<!-- This is an area to call out known assumptions in the experiment, this is especially helpful for any future colleagues that join the team so they understand other potential influences and how they were accounted for. This section is also helpful in framing possible scenarios and to keep the door open for the next steps. For example, we’re hoping our experiment will increase the number of people that start a trial but we’re assuming the conversion rate to paid and IACV will remain the same. This is a known assumption and depending on the results of the experiment could impact the direction we take on any future iterations. -->
+
+## Results, lessons learned, next steps
+<!-- What were the results of the experiment? Was the experiment a success or a failure? Based on the results should we remove the code or advocate that it become a permanent part of the experience for all users? Are there future experiments the team is going to run based off these results (include a link to new issue)? For example, our trial experiment was successful we increased the trial create rate by 10% but we saw a 1% drop in our close rate which means our net impact on IACV was negative $360 (990 * 0.09 * 400 compared tot he control of 900 * 0.1 * 400). Our next experiment (link) will focus on increasing the value once a user starts a trial. (all numbers are hypothetical and only listed for the purpose of having an example) -->
+
+
+## Checklist
+
+* [ ] Fill in the experiment summary and write more about the details of the experiment in the rest of the issue description. Some of these may be filled in through time (the "Result, learnings, next steps" section for example) but at least the experiment summary should be filled in right from the start.
+* [ ] Add the label of the `group::` that will work on this experiment (if known).
+* [ ] Mention the Product Manager, Engineering Manager, and at least one Product Designer from the group that owns the part of the product that the experiment will affect.
+* [ ] Fill in the values in the [ICE score table](#ice-score) ping other team members for the values you aren’t confident about (i.e. engineering should almost always fill out the ease section). Add the ~"ICE Score Needed" label to indicate that the score is incomplete.
+* [ ] Replace the ~"ICE Score Needed" with an ICE low/medium/high score label once all values in the ICE table have been added.
+* [ ] Mention the [at]gitlab-core-team team and ask for their feedback.
+
+/label ~"workflow::validation backlog" ~"experiment idea"
diff --git a/.gitpod.yml b/.gitpod.yml
index 950b06b40e7..f6c1a60b03a 100644
--- a/.gitpod.yml
+++ b/.gitpod.yml
@@ -1,4 +1,4 @@
-image: registry.gitlab.com/gitlab-org/gitlab-development-kit/gitpod-workspace:gitpod-workspace-image
+image: registry.gitlab.com/gitlab-org/gitlab-development-kit/gitpod-workspace:stable
tasks:
@@ -7,8 +7,6 @@ tasks:
- init: |
echo "$(date) – Copying GDK" | tee -a /workspace/startup.log
- rm -r /workspace/.rvm
- mv $HOME/.rvm-workspace /workspace/.rvm
cp -r $HOME/gitlab-development-kit /workspace/
(
set -e
diff --git a/app/assets/javascripts/blob/components/blob_content.vue b/app/assets/javascripts/blob/components/blob_content.vue
index f5f06436bcc..60729c11002 100644
--- a/app/assets/javascripts/blob/components/blob_content.vue
+++ b/app/assets/javascripts/blob/components/blob_content.vue
@@ -6,6 +6,7 @@ import BlobContentError from './blob_content_error.vue';
import { BLOB_RENDER_EVENT_LOAD, BLOB_RENDER_EVENT_SHOW_SOURCE } from './constants';
export default {
+ name: 'BlobContent',
components: {
GlLoadingIcon,
BlobContentError,
diff --git a/app/assets/javascripts/blob/viewer/index.js b/app/assets/javascripts/blob/viewer/index.js
index 4741152afce..22c6b31143f 100644
--- a/app/assets/javascripts/blob/viewer/index.js
+++ b/app/assets/javascripts/blob/viewer/index.js
@@ -1,6 +1,12 @@
import $ from 'jquery';
import '~/behaviors/markdown/render_gfm';
import { __ } from '~/locale';
+import {
+ REPO_BLOB_LOAD_VIEWER_START,
+ REPO_BLOB_LOAD_VIEWER_FINISH,
+ REPO_BLOB_LOAD_VIEWER,
+} from '~/performance/constants';
+import { performanceMarkAndMeasure } from '~/performance/utils';
import { fixTitle } from '~/tooltips';
import { deprecatedCreateFlash as Flash } from '../../flash';
import axios from '../../lib/utils/axios_utils';
@@ -130,6 +136,9 @@ export default class BlobViewer {
}
switchToViewer(name) {
+ performanceMarkAndMeasure({
+ mark: REPO_BLOB_LOAD_VIEWER_START,
+ });
const newViewer = this.$fileHolder[0].querySelector(`.blob-viewer[data-type='${name}']`);
if (this.activeViewer === newViewer) return;
@@ -163,6 +172,15 @@ export default class BlobViewer {
handleLocationHash();
this.toggleCopyButtonState();
+ performanceMarkAndMeasure({
+ mark: REPO_BLOB_LOAD_VIEWER_FINISH,
+ measures: [
+ {
+ name: REPO_BLOB_LOAD_VIEWER,
+ start: REPO_BLOB_LOAD_VIEWER_START,
+ },
+ ],
+ });
})
.catch(() => new Flash(__('Error loading viewer')));
}
diff --git a/app/assets/javascripts/performance/constants.js b/app/assets/javascripts/performance/constants.js
index 98b2e4238c1..1db80057d0c 100644
--- a/app/assets/javascripts/performance/constants.js
+++ b/app/assets/javascripts/performance/constants.js
@@ -43,6 +43,7 @@ export const WEBIDE_MEASURE_FETCH_FILES = 'WebIDE: Fetch Files';
//
// MR Diffs namespace
+//
// Marks
export const MR_DIFFS_MARK_FILE_TREE_START = 'mr-diffs-mark-file-tree-start';
@@ -75,3 +76,14 @@ export const PIPELINES_DETAIL_LINKS_MEASURE_CALCULATION =
export const PIPELINES_DETAIL_LINK_DURATION = 'pipeline_graph_link_calculation_duration_seconds';
export const PIPELINES_DETAIL_LINKS_TOTAL = 'pipeline_graph_links_total';
export const PIPELINES_DETAIL_LINKS_JOB_RATIO = 'pipeline_graph_links_per_job_ratio';
+
+//
+// REPO BROWSER NAMESPACE
+//
+
+// Marks
+export const REPO_BLOB_LOAD_VIEWER_START = 'blobviewer-load-viewer-start';
+export const REPO_BLOB_LOAD_VIEWER_FINISH = 'blobviewer-load-viewer-finish';
+
+// Measures
+export const REPO_BLOB_LOAD_VIEWER = 'Repository File Viewer: loading the content';
diff --git a/app/assets/javascripts/registry/explorer/components/details_page/details_header.vue b/app/assets/javascripts/registry/explorer/components/details_page/details_header.vue
index f46068acd68..0422bfb13c5 100644
--- a/app/assets/javascripts/registry/explorer/components/details_page/details_header.vue
+++ b/app/assets/javascripts/registry/explorer/components/details_page/details_header.vue
@@ -130,7 +130,7 @@ export default {
:disabled="deleteButtonDisabled"
@click="$emit('delete')"
>
- {{ __('Delete') }}
+ {{ __('Delete image repository') }}
</gl-button>
</template>
</title-area>
diff --git a/app/assets/javascripts/registry/explorer/constants/details.js b/app/assets/javascripts/registry/explorer/constants/details.js
index 7220f9646db..5dcc042a9c4 100644
--- a/app/assets/javascripts/registry/explorer/constants/details.js
+++ b/app/assets/javascripts/registry/explorer/constants/details.js
@@ -31,7 +31,7 @@ export const CONFIGURATION_DETAILS_ROW_TEST = s__(
);
export const REMOVE_TAG_BUTTON_TITLE = s__('ContainerRegistry|Remove tag');
-export const REMOVE_TAGS_BUTTON_TITLE = s__('ContainerRegistry|Delete selected');
+export const REMOVE_TAGS_BUTTON_TITLE = s__('ContainerRegistry|Delete selected tags');
export const REMOVE_TAG_CONFIRMATION_TEXT = s__(
`ContainerRegistry|You are about to remove %{item}. Are you sure?`,
diff --git a/app/assets/javascripts/repository/index.js b/app/assets/javascripts/repository/index.js
index 3a9a2adb417..501ae7e9f2f 100644
--- a/app/assets/javascripts/repository/index.js
+++ b/app/assets/javascripts/repository/index.js
@@ -4,6 +4,7 @@ import { parseBoolean } from '~/lib/utils/common_utils';
import { escapeFileUrl } from '~/lib/utils/url_utility';
import { __ } from '~/locale';
import initWebIdeLink from '~/pages/projects/shared/web_ide_link';
+import PerformancePlugin from '~/performance/vue_performance_plugin';
import App from './components/app.vue';
import Breadcrumbs from './components/breadcrumbs.vue';
import DirectoryDownloadLinks from './components/directory_download_links.vue';
@@ -17,6 +18,10 @@ import createRouter from './router';
import { updateFormAction } from './utils/dom';
import { setTitle } from './utils/title';
+Vue.use(PerformancePlugin, {
+ components: ['SimpleViewer', 'BlobContent'],
+});
+
export default function setupVueRepositoryList() {
const el = document.getElementById('js-tree-list');
const { dataset } = el;
diff --git a/app/assets/javascripts/vue_shared/components/blob_viewers/simple_viewer.vue b/app/assets/javascripts/vue_shared/components/blob_viewers/simple_viewer.vue
index f477610ff1d..f6ab3cac536 100644
--- a/app/assets/javascripts/vue_shared/components/blob_viewers/simple_viewer.vue
+++ b/app/assets/javascripts/vue_shared/components/blob_viewers/simple_viewer.vue
@@ -6,6 +6,7 @@ import { HIGHLIGHT_CLASS_NAME } from './constants';
import ViewerMixin from './mixins';
export default {
+ name: 'SimpleViewer',
components: {
GlIcon,
EditorLite: () =>
diff --git a/app/assets/stylesheets/components/feature_highlight.scss b/app/assets/stylesheets/components/feature_highlight.scss
index 08706951967..54123e74675 100644
--- a/app/assets/stylesheets/components/feature_highlight.scss
+++ b/app/assets/stylesheets/components/feature_highlight.scss
@@ -7,3 +7,25 @@
padding: 0.25rem;
}
}
+
+.gl-order-1 {
+ order: 1;
+}
+
+.gl-sm-order-init {
+ @media (min-width: $breakpoint-sm) {
+ order: initial;
+ }
+}
+
+.gl-xs-ml-3 {
+ @media (max-width: $breakpoint-sm) {
+ @include gl-ml-3;
+ }
+}
+
+.gl-sm-mr-3 {
+ @media (min-width: $breakpoint-sm) {
+ @include gl-mr-3;
+ }
+}
diff --git a/app/models/application_record.rb b/app/models/application_record.rb
index 1bbace791ed..cb73822defc 100644
--- a/app/models/application_record.rb
+++ b/app/models/application_record.rb
@@ -66,6 +66,12 @@ class ApplicationRecord < ActiveRecord::Base
end
end
+ def create_or_load_association(association_name)
+ association(association_name).create unless association(association_name).loaded?
+ rescue ActiveRecord::RecordNotUnique, PG::UniqueViolation
+ association(association_name).reader
+ end
+
def self.underscore
Gitlab::SafeRequestStore.fetch("model:#{self}:underscore") { self.to_s.underscore }
end
diff --git a/app/models/ci/build.rb b/app/models/ci/build.rb
index 869f7c1c2ad..4629e8f0325 100644
--- a/app/models/ci/build.rb
+++ b/app/models/ci/build.rb
@@ -62,6 +62,9 @@ module Ci
delegate :gitlab_deploy_token, to: :project
delegate :trigger_short_token, to: :trigger_request, allow_nil: true
+ ignore_columns :id_convert_to_bigint, remove_with: '14.1', remove_after: '2021-07-22'
+ ignore_columns :stage_id_convert_to_bigint, remove_with: '14.1', remove_after: '2021-07-22'
+
##
# Since Gitlab 11.5, deployments records started being created right after
# `ci_builds` creation. We can look up a relevant `environment` through
diff --git a/app/models/project.rb b/app/models/project.rb
index 44c32c53d90..17e53d9e0c2 100644
--- a/app/models/project.rb
+++ b/app/models/project.rb
@@ -104,16 +104,13 @@ class Project < ApplicationRecord
after_save :create_import_state, if: ->(project) { project.import? && project.import_state.nil? }
- after_create :create_project_feature, unless: :project_feature
+ after_create -> { create_or_load_association(:project_feature) }
- after_create :create_ci_cd_settings,
- unless: :ci_cd_settings
+ after_create -> { create_or_load_association(:ci_cd_settings) }
- after_create :create_container_expiration_policy,
- unless: :container_expiration_policy
+ after_create -> { create_or_load_association(:container_expiration_policy) }
- after_create :create_pages_metadatum,
- unless: :pages_metadatum
+ after_create -> { create_or_load_association(:pages_metadatum) }
after_create :set_timestamps_for_create
after_update :update_forks_visibility_level
diff --git a/app/services/projects/create_service.rb b/app/services/projects/create_service.rb
index ceec85c6248..a8481f40604 100644
--- a/app/services/projects/create_service.rb
+++ b/app/services/projects/create_service.rb
@@ -40,7 +40,7 @@ module Projects
if namespace_id
# Find matching namespace and check if it allowed
# for current user if namespace_id passed.
- unless allowed_namespace?(current_user, namespace_id)
+ unless current_user.can?(:create_projects, project_namespace)
@project.namespace_id = nil
deny_namespace
return @project
@@ -83,13 +83,6 @@ module Projects
@project.errors.add(:namespace, "is not valid")
end
- # rubocop: disable CodeReuse/ActiveRecord
- def allowed_namespace?(user, namespace_id)
- namespace = Namespace.find_by(id: namespace_id)
- current_user.can?(:create_projects, namespace)
- end
- # rubocop: enable CodeReuse/ActiveRecord
-
def after_create_actions
log_info("#{@project.owner.name} created a new project \"#{@project.full_name}\"")
diff --git a/changelogs/unreleased/ab-migrate-ci-builds.yml b/changelogs/unreleased/ab-migrate-ci-builds.yml
new file mode 100644
index 00000000000..90c6a7c5770
--- /dev/null
+++ b/changelogs/unreleased/ab-migrate-ci-builds.yml
@@ -0,0 +1,5 @@
+---
+title: Initialize int8 migration for ci_builds
+merge_request: 60265
+author:
+type: other
diff --git a/changelogs/unreleased/gl-card-license-history.yml b/changelogs/unreleased/gl-card-license-history.yml
new file mode 100644
index 00000000000..3ed566f21fc
--- /dev/null
+++ b/changelogs/unreleased/gl-card-license-history.yml
@@ -0,0 +1,5 @@
+---
+title: Move license history to gl-table utility class
+merge_request: 58531
+author: Yogi (@yo)
+type: changed
diff --git a/changelogs/unreleased/registry-delete-button-copy.yml b/changelogs/unreleased/registry-delete-button-copy.yml
new file mode 100644
index 00000000000..63ce8f889b3
--- /dev/null
+++ b/changelogs/unreleased/registry-delete-button-copy.yml
@@ -0,0 +1,5 @@
+---
+title: Clarify image repository delete actions
+merge_request: 60154
+author:
+type: changed
diff --git a/danger/changelog/Dangerfile b/danger/changelog/Dangerfile
index 82ac749b531..1dd58abd9f0 100644
--- a/danger/changelog/Dangerfile
+++ b/danger/changelog/Dangerfile
@@ -20,7 +20,7 @@ CATEGORIES = YAML
.freeze
def check_changelog_trailer(commit)
- trailer = commit.message.match(/^Changelog:\s*(?<category>\w+)/)
+ trailer = commit.message.match(/^Changelog:\s*(?<category>.+)$/)
return :missing if trailer.nil? || trailer[:category].nil?
diff --git a/db/migrate/20210426094524_initialize_conversion_of_ci_builds_to_bigint.rb b/db/migrate/20210426094524_initialize_conversion_of_ci_builds_to_bigint.rb
new file mode 100644
index 00000000000..e2f82557387
--- /dev/null
+++ b/db/migrate/20210426094524_initialize_conversion_of_ci_builds_to_bigint.rb
@@ -0,0 +1,17 @@
+# frozen_string_literal: true
+
+class InitializeConversionOfCiBuildsToBigint < ActiveRecord::Migration[6.0]
+ include Gitlab::Database::MigrationHelpers
+
+ TABLE = :ci_builds
+ COLUMNS = %i(id stage_id)
+ TARGET_COLUMNS = COLUMNS.map { |col| "#{col}_convert_to_bigint" }
+
+ def up
+ initialize_conversion_of_integer_to_bigint(TABLE, COLUMNS)
+ end
+
+ def down
+ revert_initialize_conversion_of_integer_to_bigint(TABLE, COLUMNS)
+ end
+end
diff --git a/db/post_migrate/20210426094549_backfill_ci_builds_for_bigint_conversion.rb b/db/post_migrate/20210426094549_backfill_ci_builds_for_bigint_conversion.rb
new file mode 100644
index 00000000000..972df41f678
--- /dev/null
+++ b/db/post_migrate/20210426094549_backfill_ci_builds_for_bigint_conversion.rb
@@ -0,0 +1,28 @@
+# frozen_string_literal: true
+
+class BackfillCiBuildsForBigintConversion < ActiveRecord::Migration[6.0]
+ include Gitlab::Database::MigrationHelpers
+
+ DOWNTIME = false
+
+ TABLE = :ci_builds
+ COLUMNS = %i(id stage_id).freeze
+
+ def up
+ return unless should_run?
+
+ backfill_conversion_of_integer_to_bigint TABLE, COLUMNS, batch_size: 15000, sub_batch_size: 100
+ end
+
+ def down
+ return unless should_run?
+
+ revert_backfill_conversion_of_integer_to_bigint TABLE, COLUMNS
+ end
+
+ private
+
+ def should_run?
+ Gitlab.dev_or_test_env? || Gitlab.com?
+ end
+end
diff --git a/db/schema_migrations/20210426094524 b/db/schema_migrations/20210426094524
new file mode 100644
index 00000000000..832f2728534
--- /dev/null
+++ b/db/schema_migrations/20210426094524
@@ -0,0 +1 @@
+46de2e905a591c14ce18acf041bac6fb48ec19ad9f40fababcbf27ae02f7fa75 \ No newline at end of file
diff --git a/db/schema_migrations/20210426094549 b/db/schema_migrations/20210426094549
new file mode 100644
index 00000000000..8e3c5347a50
--- /dev/null
+++ b/db/schema_migrations/20210426094549
@@ -0,0 +1 @@
+12ad8f05a4d864d9986d6ca400a687c40b2de1acb461b134a8103f9a882921e7 \ No newline at end of file
diff --git a/db/structure.sql b/db/structure.sql
index 11f13865ebc..1cacea69045 100644
--- a/db/structure.sql
+++ b/db/structure.sql
@@ -115,6 +115,16 @@ BEGIN
END;
$$;
+CREATE FUNCTION trigger_3f6129be01d2() RETURNS trigger
+ LANGUAGE plpgsql
+ AS $$
+BEGIN
+ NEW."id_convert_to_bigint" := NEW."id";
+ NEW."stage_id_convert_to_bigint" := NEW."stage_id";
+ RETURN NEW;
+END;
+$$;
+
CREATE FUNCTION trigger_69523443cc10() RETURNS trigger
LANGUAGE plpgsql
AS $$
@@ -10433,6 +10443,8 @@ CREATE TABLE ci_builds (
waiting_for_resource_at timestamp with time zone,
processed boolean,
scheduling_type smallint,
+ id_convert_to_bigint bigint DEFAULT 0 NOT NULL,
+ stage_id_convert_to_bigint bigint,
CONSTRAINT check_1e2fbd1b39 CHECK ((lock_version IS NOT NULL))
);
@@ -24754,6 +24766,8 @@ CREATE TRIGGER trigger_07c94931164e BEFORE INSERT OR UPDATE ON push_event_payloa
CREATE TRIGGER trigger_21e7a2602957 BEFORE INSERT OR UPDATE ON ci_build_needs FOR EACH ROW EXECUTE PROCEDURE trigger_21e7a2602957();
+CREATE TRIGGER trigger_3f6129be01d2 BEFORE INSERT OR UPDATE ON ci_builds FOR EACH ROW EXECUTE PROCEDURE trigger_3f6129be01d2();
+
CREATE TRIGGER trigger_69523443cc10 BEFORE INSERT OR UPDATE ON events FOR EACH ROW EXECUTE PROCEDURE trigger_69523443cc10();
CREATE TRIGGER trigger_8485e97c00e3 BEFORE INSERT OR UPDATE ON ci_sources_pipelines FOR EACH ROW EXECUTE PROCEDURE trigger_8485e97c00e3();
diff --git a/lib/gitlab/import_export/project/import_export.yml b/lib/gitlab/import_export/project/import_export.yml
index 42d32593cbd..00c5d143b9d 100644
--- a/lib/gitlab/import_export/project/import_export.yml
+++ b/lib/gitlab/import_export/project/import_export.yml
@@ -261,6 +261,8 @@ excluded_attributes:
- :resource_group_id
- :waiting_for_resource_at
- :processed
+ - :id_convert_to_bigint
+ - :stage_id_convert_to_bigint
sentry_issue:
- :issue_id
push_event_payload:
diff --git a/locale/gitlab.pot b/locale/gitlab.pot
index e1b26658e90..cb1f066678b 100644
--- a/locale/gitlab.pot
+++ b/locale/gitlab.pot
@@ -4027,9 +4027,6 @@ msgstr ""
msgid "Applying suggestions..."
msgstr ""
-msgid "Approval Gate"
-msgstr ""
-
msgid "Approval Status"
msgstr ""
@@ -4047,15 +4044,6 @@ msgid_plural "ApprovalRuleRemove|%d members"
msgstr[0] ""
msgstr[1] ""
-msgid "ApprovalRuleRemove|Remove approval gate"
-msgstr ""
-
-msgid "ApprovalRuleRemove|Remove approval gate?"
-msgstr ""
-
-msgid "ApprovalRuleRemove|You are about to remove the %{name} approval gate. Approval from this service is not revoked."
-msgstr ""
-
msgid "ApprovalRuleRemove|You are about to remove the %{name} approver group which has %{strongStart}%{count} member%{strongEnd}. Approvals from this member are not revoked."
msgid_plural "ApprovalRuleRemove|You are about to remove the %{name} approver group which has %{strongStart}%{count} members%{strongEnd}. Approvals from these members are not revoked."
msgstr[0] ""
@@ -4071,24 +4059,15 @@ msgid_plural "ApprovalRuleSummary|%{count} approvals required from %{membersCoun
msgstr[0] ""
msgstr[1] ""
-msgid "ApprovalRule|Add approvel gate"
-msgstr ""
-
msgid "ApprovalRule|Add approvers"
msgstr ""
msgid "ApprovalRule|Approval rules"
msgstr ""
-msgid "ApprovalRule|Approval service API"
-msgstr ""
-
msgid "ApprovalRule|Approvals required"
msgstr ""
-msgid "ApprovalRule|Approvel gate"
-msgstr ""
-
msgid "ApprovalRule|Approver Type"
msgstr ""
@@ -4098,15 +4077,15 @@ msgstr ""
msgid "ApprovalRule|Examples: QA, Security."
msgstr ""
-msgid "ApprovalRule|Invoke an external API as part of the approvals"
-msgstr ""
-
msgid "ApprovalRule|Name"
msgstr ""
msgid "ApprovalRule|Rule name"
msgstr ""
+msgid "ApprovalRule|Status check"
+msgstr ""
+
msgid "ApprovalRule|Target branch"
msgstr ""
@@ -8582,7 +8561,7 @@ msgstr ""
msgid "ContainerRegistry|Delete image repository?"
msgstr ""
-msgid "ContainerRegistry|Delete selected"
+msgid "ContainerRegistry|Delete selected tags"
msgstr ""
msgid "ContainerRegistry|Deleting the image repository will delete all images and tags inside. This action cannot be undone."
@@ -10552,6 +10531,9 @@ msgstr ""
msgid "Delete domain"
msgstr ""
+msgid "Delete image repository"
+msgstr ""
+
msgid "Delete label"
msgstr ""
@@ -30452,6 +30434,24 @@ msgstr ""
msgid "Status: %{title}"
msgstr ""
+msgid "StatusCheck|API to check"
+msgstr ""
+
+msgid "StatusCheck|Invoke an external API as part of the approvals"
+msgstr ""
+
+msgid "StatusCheck|Remove status check"
+msgstr ""
+
+msgid "StatusCheck|Remove status check?"
+msgstr ""
+
+msgid "StatusCheck|Status to check"
+msgstr ""
+
+msgid "StatusCheck|You are about to remove the %{name} status check."
+msgstr ""
+
msgid "StatusPage|AWS %{docsLink}"
msgstr ""
diff --git a/spec/frontend/registry/explorer/components/details_page/details_header_spec.js b/spec/frontend/registry/explorer/components/details_page/details_header_spec.js
index b50ed87a563..4fe44a3307a 100644
--- a/spec/frontend/registry/explorer/components/details_page/details_header_spec.js
+++ b/spec/frontend/registry/explorer/components/details_page/details_header_spec.js
@@ -120,7 +120,7 @@ describe('Details Header', () => {
it('has the correct text', () => {
mountComponent();
- expect(findDeleteButton().text()).toBe('Delete');
+ expect(findDeleteButton().text()).toBe('Delete image repository');
});
it('has the correct props', () => {
diff --git a/spec/lib/gitlab/usage/metrics/aggregates/aggregate_spec.rb b/spec/lib/gitlab/usage/metrics/aggregates/aggregate_spec.rb
index db141358d4f..0fb3a69df05 100644
--- a/spec/lib/gitlab/usage/metrics/aggregates/aggregate_spec.rb
+++ b/spec/lib/gitlab/usage/metrics/aggregates/aggregate_spec.rb
@@ -65,6 +65,15 @@ RSpec.describe Gitlab::Usage::Metrics::Aggregates::Aggregate, :clean_gitlab_redi
end
context 'there are aggregated metrics defined' do
+ let(:aggregated_metrics) do
+ [
+ aggregated_metric(name: "gmau_1", source: datasource, time_frame: time_frame, operator: operator)
+ ]
+ end
+
+ let(:results) { { 'gmau_1' => 5 } }
+ let(:params) { { start_date: start_date, end_date: end_date, recorded_at: recorded_at } }
+
before do
allow_next_instance_of(described_class) do |instance|
allow(instance).to receive(:aggregated_metrics).and_return(aggregated_metrics)
@@ -72,23 +81,23 @@ RSpec.describe Gitlab::Usage::Metrics::Aggregates::Aggregate, :clean_gitlab_redi
end
context 'with OR operator' do
- let(:aggregated_metrics) do
- [
- aggregated_metric(name: "gmau_1", source: datasource, time_frame: time_frame, operator: "OR")
- ]
- end
+ let(:operator) { Gitlab::Usage::Metrics::Aggregates::UNION_OF_AGGREGATED_METRICS }
it 'returns the number of unique events occurred for any metric in aggregate', :aggregate_failures do
- results = {
- 'gmau_1' => 5
- }
- params = { start_date: start_date, end_date: end_date, recorded_at: recorded_at }
-
expect(namespace::SOURCES[datasource]).to receive(:calculate_metrics_union).with(params.merge(metric_names: %w[event1 event2 event3])).and_return(5)
expect(aggregated_metrics_data).to eq(results)
end
end
+ context 'with AND operator' do
+ let(:operator) { Gitlab::Usage::Metrics::Aggregates::INTERSECTION_OF_AGGREGATED_METRICS }
+
+ it 'returns the number of unique events that occurred for all of metrics in the aggregate', :aggregate_failures do
+ expect(namespace::SOURCES[datasource]).to receive(:calculate_metrics_intersections).with(params.merge(metric_names: %w[event1 event2 event3])).and_return(5)
+ expect(aggregated_metrics_data).to eq(results)
+ end
+ end
+
context 'hidden behind feature flag' do
let(:enabled_feature_flag) { 'test_ff_enabled' }
let(:disabled_feature_flag) { 'test_ff_disabled' }