Add latest changes from gitlab-org/gitlab@master

This commit is contained in:
GitLab Bot 2020-03-11 21:09:19 +00:00
parent 76e9fc7b29
commit fca89bb73f
191 changed files with 749 additions and 294 deletions

View File

@ -84,7 +84,6 @@ export default () => {
rootPath: $boardApp.dataset.rootPath,
bulkUpdatePath: $boardApp.dataset.bulkUpdatePath,
detailIssue: boardsStore.detail,
defaultAvatar: $boardApp.dataset.defaultAvatar,
},
computed: {
detailIssueVisible() {
@ -130,13 +129,10 @@ export default () => {
position = -1;
}
boardsStore.addList(
{
...listObj,
position,
},
this.defaultAvatar,
);
boardsStore.addList({
...listObj,
position,
});
});
boardsStore.addBlankState();

View File

@ -1,9 +1,9 @@
export default class ListAssignee {
constructor(obj, defaultAvatar) {
constructor(obj) {
this.id = obj.id;
this.name = obj.name;
this.username = obj.username;
this.avatar = obj.avatar_url || obj.avatar || defaultAvatar;
this.avatar = obj.avatar_url || obj.avatar || gon.default_avatar_url;
this.path = obj.path;
this.state = obj.state;
this.webUrl = obj.web_url || obj.webUrl;

View File

@ -10,7 +10,7 @@ import IssueProject from './project';
import boardsStore from '../stores/boards_store';
class ListIssue {
constructor(obj, defaultAvatar) {
constructor(obj) {
this.subscribed = obj.subscribed;
this.labels = [];
this.assignees = [];
@ -22,11 +22,11 @@ class ListIssue {
this.closed = obj.closed;
this.isLoading = {};
this.refreshData(obj, defaultAvatar);
this.refreshData(obj);
}
refreshData(obj, defaultAvatar) {
boardsStore.refreshIssueData(this, obj, defaultAvatar);
refreshData(obj) {
boardsStore.refreshIssueData(this, obj);
}
addLabel(label) {

View File

@ -36,7 +36,7 @@ const TYPES = {
};
class List {
constructor(obj, defaultAvatar) {
constructor(obj) {
this.id = obj.id;
this._uid = this.guid();
this.position = obj.position;
@ -55,7 +55,6 @@ class List {
this.maxIssueCount = Object.hasOwnProperty.call(obj, 'max_issue_count')
? obj.max_issue_count
: 0;
this.defaultAvatar = defaultAvatar;
if (obj.label) {
this.label = new ListLabel(obj.label);
@ -156,7 +155,7 @@ class List {
createIssues(data) {
data.forEach(issueObj => {
this.addIssue(new ListIssue(issueObj, this.defaultAvatar));
this.addIssue(new ListIssue(issueObj));
});
}

View File

@ -74,8 +74,8 @@ const boardsStore = {
showPage(page) {
this.state.currentPage = page;
},
addList(listObj, defaultAvatar) {
const list = new List(listObj, defaultAvatar);
addList(listObj) {
const list = new List(listObj);
this.state.lists = _.sortBy([...this.state.lists, list], 'position');
return list;
@ -602,7 +602,7 @@ const boardsStore = {
clearMultiSelect() {
this.multiSelect.list = [];
},
refreshIssueData(issue, obj, defaultAvatar) {
refreshIssueData(issue, obj) {
issue.id = obj.id;
issue.iid = obj.iid;
issue.title = obj.title;
@ -631,7 +631,7 @@ const boardsStore = {
}
if (obj.assignees) {
issue.assignees = obj.assignees.map(a => new ListAssignee(a, defaultAvatar));
issue.assignees = obj.assignees.map(a => new ListAssignee(a));
}
},
};

View File

@ -1,5 +1,6 @@
<script>
import ItemButton from './button.vue';
import { isTextFile } from '~/ide/utils';
export default {
components: {
@ -23,29 +24,11 @@ export default {
},
},
methods: {
isText(content, fileType) {
const knownBinaryFileTypes = ['image/'];
const knownTextFileTypes = ['text/'];
const isKnownBinaryFileType = knownBinaryFileTypes.find(type => fileType.includes(type));
const isKnownTextFileType = knownTextFileTypes.find(type => fileType.includes(type));
const asciiRegex = /^[ -~\t\n\r]+$/; // tests whether a string contains ascii characters only (ranges from space to tilde, tabs and new lines)
if (isKnownBinaryFileType) {
return false;
}
if (isKnownTextFileType) {
return true;
}
// if it's not a known file type, determine the type by evaluating the file contents
return asciiRegex.test(content);
},
createFile(target, file) {
const { name } = file;
const encodedContent = target.result.split('base64,')[1];
const rawContent = encodedContent ? atob(encodedContent) : '';
const isText = this.isText(rawContent, file.type);
const isText = isTextFile(rawContent, file.type, name);
const emitCreateEvent = content =>
this.$emit('create', {

View File

@ -1,4 +1,57 @@
import { commitItemIconMap } from './constants';
import { languages } from 'monaco-editor';
import { flatten } from 'lodash';
const toLowerCase = x => x.toLowerCase();
const monacoLanguages = languages.getLanguages();
const monacoExtensions = new Set(
flatten(monacoLanguages.map(lang => lang.extensions?.map(toLowerCase) || [])),
);
const monacoMimetypes = new Set(
flatten(monacoLanguages.map(lang => lang.mimetypes?.map(toLowerCase) || [])),
);
const monacoFilenames = new Set(
flatten(monacoLanguages.map(lang => lang.filenames?.map(toLowerCase) || [])),
);
const KNOWN_TYPES = [
{
isText: false,
isMatch(mimeType) {
return mimeType.toLowerCase().includes('image/');
},
},
{
isText: true,
isMatch(mimeType) {
return mimeType.toLowerCase().includes('text/');
},
},
{
isText: true,
isMatch(mimeType, fileName) {
const fileExtension = fileName.includes('.') ? `.${fileName.split('.').pop()}` : '';
return (
monacoExtensions.has(fileExtension.toLowerCase()) ||
monacoMimetypes.has(mimeType.toLowerCase()) ||
monacoFilenames.has(fileName.toLowerCase())
);
},
},
];
export function isTextFile(content, mimeType, fileName) {
const knownType = KNOWN_TYPES.find(type => type.isMatch(mimeType, fileName));
if (knownType) return knownType.isText;
// does the string contain ascii characters only (ranges from space to tilde, tabs and new lines)
const asciiRegex = /^[ -~\t\n\r]+$/;
// for unknown types, determine the type by evaluating the file contents
return asciiRegex.test(content);
}
export const getCommitIconMap = file => {
if (file.deleted) {

View File

@ -11,7 +11,7 @@ import {
GlTooltip,
GlTooltipDirective,
} from '@gitlab/ui';
import { __ } from '~/locale';
import { __, n__ } from '~/locale';
import Icon from '~/vue_shared/components/icon.vue';
import MonitorTimeSeriesChart from './charts/time_series.vue';
import MonitorAnomalyChart from './charts/anomaly.vue';
@ -120,6 +120,12 @@ export default {
!this.isPanelType('stacked-column')
);
},
editCustomMetricLink() {
return this.graphData?.metrics[0].edit_path;
},
editCustomMetricLinkText() {
return n__('Metrics|Edit metric', 'Metrics|Edit metrics', this.graphData.metrics.length);
},
},
mounted() {
this.refreshTitleTooltip();
@ -195,7 +201,13 @@ export default {
<template slot="button-content">
<icon name="ellipsis_v" class="text-secondary" />
</template>
<gl-dropdown-item
v-if="editCustomMetricLink"
ref="editMetricLink"
:href="editCustomMetricLink"
>
{{ editCustomMetricLinkText }}
</gl-dropdown-item>
<gl-dropdown-item
v-if="logsPathWithTimeRange"
ref="viewLogsLink"

View File

@ -15,7 +15,6 @@ module BoardsHelper
root_path: root_path,
full_path: full_path,
bulk_update_path: @bulk_issues_path,
default_avatar: image_path(default_avatar),
time_tracking_limit_to_hours: Gitlab::CurrentSettings.time_tracking_limit_to_hours.to_s,
recent_boards_endpoint: recent_boards_path
}

View File

@ -95,6 +95,7 @@ class GroupPolicy < BasePolicy
enable :admin_cluster
enable :destroy_deploy_token
enable :read_deploy_token
enable :create_deploy_token
end
rule { owner }.policy do

View File

@ -7,8 +7,13 @@ module Projects
class LfsDownloadLinkListService < BaseService
DOWNLOAD_ACTION = 'download'
# This could be different per server, but it seems like a reasonable value to start with.
# https://github.com/git-lfs/git-lfs/issues/419
REQUEST_BATCH_SIZE = 100
DownloadLinksError = Class.new(StandardError)
DownloadLinkNotFound = Class.new(StandardError)
DownloadLinksRequestEntityTooLargeError = Class.new(StandardError)
attr_reader :remote_uri
@ -25,16 +30,39 @@ module Projects
def execute(oids)
return [] unless project&.lfs_enabled? && remote_uri && oids.present?
get_download_links(oids)
get_download_links_in_batches(oids)
end
private
def get_download_links_in_batches(oids, batch_size = REQUEST_BATCH_SIZE)
download_links = []
oids.each_slice(batch_size) do |batch|
download_links += get_download_links(batch)
end
download_links
rescue DownloadLinksRequestEntityTooLargeError => e
# Log this exceptions to see how open it happens
Gitlab::ErrorTracking
.track_exception(e, project_id: project&.id, batch_size: batch_size, oids_count: oids.count)
# Try again with a smaller batch
batch_size /= 2
retry if batch_size > REQUEST_BATCH_SIZE / 3
raise DownloadLinksError, 'Unable to download due to RequestEntityTooLarge errors'
end
def get_download_links(oids)
response = Gitlab::HTTP.post(remote_uri,
body: request_body(oids),
headers: headers)
raise DownloadLinksRequestEntityTooLargeError if response.request_entity_too_large?
raise DownloadLinksError, response.message unless response.success?
# Since the LFS Batch API may return a Content-Ttpe of

View File

@ -0,0 +1,5 @@
---
title: Optimize services usage counters using batch counters
merge_request: 26973
author:
type: performance

View File

@ -0,0 +1,5 @@
---
title: Fix embeds so that a chart appears only once
merge_request: 26997
author:
type: fixed

View File

@ -0,0 +1,5 @@
---
title: Add api endpoint for creating group deploy tokens
merge_request: 25629
author:
type: added

View File

@ -0,0 +1,6 @@
---
title: Fix issues with non-ASCII plain text files being incorrectly uploaded as binary
in the Web IDE
merge_request: 26360
author:
type: fixed

View File

@ -0,0 +1,5 @@
---
title: Batch processing LFS objects downloads
merge_request: 26434
author:
type: changed

View File

@ -0,0 +1,5 @@
---
title: Add edit custom metric link to metrics dashboard
merge_request: 26511
author:
type: changed

View File

@ -0,0 +1,5 @@
---
title: Add airgap support to Dependency Scanning template
merge_request: 26145
author:
type: changed

View File

@ -68,7 +68,7 @@ constraints(::Constraints::ProjectUrlConstrainer.new) do
end
namespace :settings do
get :members, to: redirect("%{namespace_id}/%{project_id}/project_members")
get :members, to: redirect("%{namespace_id}/%{project_id}/-/project_members")
resource :ci_cd, only: [:show, :update], controller: 'ci_cd' do
post :reset_cache

View File

@ -156,6 +156,45 @@ Example response:
]
```
### Create a group deploy token
> [Introduced](https://gitlab.com/gitlab-org/gitlab/issues/21811) in GitLab 12.9.
Creates a new deploy token for a group.
```
POST /groups/:id/deploy_tokens
```
| Attribute | Type | Required | Description |
| --------- | ---- | -------- | ----------- |
| `id` | integer/string | yes | The ID or [URL-encoded path of the group](README.md#namespaced-path-encoding) owned by the authenticated user |
| `name` | string | yes | New deploy token's name |
| `expires_at` | datetime | no | Expiration date for the deploy token. Does not expire if no value is provided. |
| `username` | string | no | Username for deploy token. Default is `gitlab+deploy-token-{n}` |
| `scopes` | array of strings | yes | Indicates the deploy token scopes. Must be at least one of `read_repository` or `read_registry`. |
Example request:
```shell
curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" --header "Content-Type: application/json" --data '{"name": "My deploy token", "expires_at": "2021-01-01", "username": "custom-user", "scopes": ["read_repository"]}' "https://gitlab.example.com/api/v4/groups/5/deploy_tokens/"
```
Example response:
```json
{
"id": 1,
"name": "My deploy token",
"username": "custom-user",
"expires_at": "2021-01-01T00:00:00.000Z",
"token": "jMRvtPNxrn3crTAGukpZ",
"scopes": [
"read_registry"
]
}
```
### Delete a group deploy token
> [Introduced](https://gitlab.com/gitlab-org/gitlab/issues/21811) in GitLab 12.9.

View File

@ -18,7 +18,7 @@ a database schema.
Adding a `:migration` tag to a test signature enables some custom RSpec
`before` and `after` hooks in our
[`spec_helper.rb`](https://gitlab.com/gitlab-org/gitlab/blob/3b29908a64ff729c0cf6d93452fe00ab23079c75/spec%2Fspec_helper.rb#L259)
[`spec/support/migration.rb`](https://gitlab.com/gitlab-org/gitlab/-/blob/f81fa6ab1dd788b70ef44b85aaba1f31ffafae7d/spec/support/migration.rb)
to run.
A `before` hook will revert all migrations to the point that a migration
@ -112,7 +112,7 @@ migration. You can find the complete spec in
require 'spec_helper'
require Rails.root.join('db', 'post_migrate', '20170526185842_migrate_pipeline_stages.rb')
describe MigratePipelineStages, :migration do
describe MigratePipelineStages do
# Create test data - pipeline and CI/CD jobs.
let(:jobs) { table(:ci_builds) }
let(:stages) { table(:ci_stages) }
@ -163,7 +163,7 @@ schema tag to a context that you want to switch the database schema within.
Example:
```ruby
describe SomeClass, :migration, schema: 20170608152748 do
describe SomeClass, schema: 20170608152748 do
# ...
end
```
@ -178,7 +178,7 @@ background migration. You can find the complete spec on
```ruby
require 'spec_helper'
describe Gitlab::BackgroundMigration::ArchiveLegacyTraces, :migration, schema: 20180529152628 do
describe Gitlab::BackgroundMigration::ArchiveLegacyTraces, schema: 20180529152628 do
include TraceHelpers
let(:namespaces) { table(:namespaces) }

View File

@ -183,7 +183,7 @@ NOTE: **Note:** GitLab is unable to provide support for IdPs that are not listed
| JumpCloud | [Single Sign On (SSO) with GitLab](https://support.jumpcloud.com/support/s/article/single-sign-on-sso-with-gitlab-2019-08-21-10-36-47) |
| Okta | [Setting up a SAML application in Okta](https://developer.okta.com/docs/guides/saml-application-setup/overview/) |
| OneLogin | [Use the OneLogin SAML Test Connector](https://onelogin.service-now.com/support?id=kb_article&sys_id=93f95543db109700d5505eea4b96198f) |
| Ping Identity | [Add and configure a new SAML application](https://support.pingidentity.com/s/document-item?bundleId=pingone&topicId=xsh1564020480660-1.html) |
| Ping One for Enterprise | [Add and configure a new SAML application](https://support.pingidentity.com/s/document-item?bundleId=pingone&topicId=xsh1564020480660-1.html) |
When [configuring your identify provider](#configuring-your-identity-provider), please consider the notes below for specific providers to help avoid common issues and as a guide for terminology used.

View File

@ -31,7 +31,7 @@ module API
end
params do
requires :id, type: Integer, desc: 'The ID of a project'
requires :id, type: String, desc: 'The ID of a project'
end
resource :projects, requirements: API::NAMESPACE_OR_PROJECT_REQUIREMENTS do
before do
@ -74,7 +74,7 @@ module API
end
params do
requires :id, type: Integer, desc: 'The ID of a group'
requires :id, type: String, desc: 'The ID of a group'
end
resource :groups, requirements: API::NAMESPACE_OR_PROJECT_REQUIREMENTS do
before do
@ -94,6 +94,27 @@ module API
present paginate(user_group.deploy_tokens), with: Entities::DeployToken
end
params do
requires :name, type: String, desc: 'The name of the deploy token'
requires :expires_at, type: DateTime, desc: 'Expiration date for the deploy token. Does not expire if no value is provided.'
requires :username, type: String, desc: 'Username for deploy token. Default is `gitlab+deploy-token-{n}`'
requires :scopes, type: Array[String], values: ::DeployToken::AVAILABLE_SCOPES.map(&:to_s),
desc: 'Indicates the deploy token scopes. Must be at least one of "read_repository" or "read_registry".'
end
desc 'Create a group deploy token' do
detail 'This feature was introduced in GitLab 12.9'
success Entities::DeployTokenWithToken
end
post ':id/deploy_tokens' do
authorize!(:create_deploy_token, user_group)
deploy_token = ::Groups::DeployTokens::CreateService.new(
user_group, current_user, scope_params.merge(declared(params, include_missing: false, include_parent_namespaces: false))
).execute
present deploy_token, with: Entities::DeployTokenWithToken
end
desc 'Delete a group deploy token' do
detail 'This feature was introduced in GitLab 12.9'
end

View File

@ -6,7 +6,6 @@ module Banzai
# a given link format. To transform references to DB
# resources in place, prefer to inherit from AbstractReferenceFilter.
class InlineEmbedsFilter < HTML::Pipeline::Filter
include Gitlab::Utils::StrongMemoize
# Find every relevant link, create a new node based on
# the link, and insert this node after any html content
# surrounding the link.
@ -74,9 +73,7 @@ module Banzai
# Ex) 'https://<root>/<project>/<environment>/metrics?title=Title&group=Group'
# --> { title: 'Title', group: 'Group' }
def query_params(url)
strong_memoize(:query_params) do
Gitlab::Metrics::Dashboard::Url.parse_query(url)
end
Gitlab::Metrics::Dashboard::Url.parse_query(url)
end
# Implement in child class.

View File

@ -5,7 +5,8 @@
# How to set: https://docs.gitlab.com/ee/ci/yaml/#variables
variables:
DS_ANALYZER_IMAGE_PREFIX: "registry.gitlab.com/gitlab-org/security-products/analyzers"
SECURITY_SCANNER_IMAGE_PREFIX: "registry.gitlab.com/gitlab-org/security-products"
DS_ANALYZER_IMAGE_PREFIX: "$SECURITY_SCANNER_IMAGE_PREFIX/analyzers"
DS_DEFAULT_ANALYZERS: "bundler-audit, retire.js, gemnasium, gemnasium-maven, gemnasium-python"
DS_MAJOR_VERSION: 2
DS_DISABLE_DIND: "false"
@ -64,7 +65,7 @@ dependency_scanning:
) \
--volume "$PWD:/code" \
--volume /var/run/docker.sock:/var/run/docker.sock \
"registry.gitlab.com/gitlab-org/security-products/dependency-scanning:$DS_VERSION" /code
"$SECURITY_SCANNER_IMAGE_PREFIX/dependency-scanning:$DS_VERSION" /code
artifacts:
reports:
dependency_scanning: gl-dependency-scanning-report.json

View File

@ -183,10 +183,8 @@ module Gitlab
# rubocop: disable CodeReuse/ActiveRecord
def services_usage
service_counts = count(Service.active.where(template: false).where.not(type: 'JiraService').group(:type), fallback: Hash.new(-1), batch: false)
results = Service.available_services_names.each_with_object({}) do |service_name, response|
response["projects_#{service_name}_active".to_sym] = service_counts["#{service_name}_service".camelize] || 0
results = Service.available_services_names.without('jira').each_with_object({}) do |service_name, response|
response["projects_#{service_name}_active".to_sym] = count(Service.active.where(template: false, type: "#{service_name}_service".camelize))
end
# Keep old Slack keys for backward compatibility, https://gitlab.com/gitlab-data/analytics/issues/3241

View File

@ -12507,7 +12507,9 @@ msgid "Metrics|Duplicating..."
msgstr ""
msgid "Metrics|Edit metric"
msgstr ""
msgid_plural "Metrics|Edit metrics"
msgstr[0] ""
msgstr[1] ""
msgid "Metrics|Environment"
msgstr ""

View File

@ -62,6 +62,29 @@ describe 'Metrics rendering', :js, :use_clean_rails_memory_store_caching, :sidek
expect(page).to have_text(chart_params[:title])
expect(page).to have_text(chart_params[:y_label])
end
context 'when two dashboard urls are included' do
let(:chart_params_2) do
{
group: 'System metrics (Kubernetes)',
title: 'Core Usage (Total)',
y_label: 'Total Cores'
}
end
let(:metrics_url_2) { urls.metrics_project_environment_url(project, environment, **chart_params_2) }
let(:description) { "See [metrics dashboard](#{metrics_url}) for info. \n See [metrics dashboard](#{metrics_url_2}) for info." }
let(:issue) { create(:issue, project: project, description: description) }
it 'shows embedded metrics for both urls' do
visit project_issue_path(project, issue)
expect(page).to have_css('div.prometheus-graph')
expect(page).to have_text(chart_params[:title])
expect(page).to have_text(chart_params[:y_label])
expect(page).to have_text(chart_params_2[:title])
expect(page).to have_text(chart_params_2[:y_label])
end
end
end
end

View File

@ -155,18 +155,17 @@ describe('Issue card component', () => {
describe('assignee default avatar', () => {
beforeEach(done => {
global.gon.default_avatar_url = 'default_avatar';
wrapper.setProps({
issue: {
...wrapper.props('issue'),
assignees: [
new ListAssignee(
{
id: 1,
name: 'testing 123',
username: 'test',
},
'default_avatar',
),
new ListAssignee({
id: 1,
name: 'testing 123',
username: 'test',
}),
],
},
});
@ -174,6 +173,10 @@ describe('Issue card component', () => {
wrapper.vm.$nextTick(done);
});
afterEach(() => {
global.gon.default_avatar_url = null;
});
it('displays defaults avatar if users avatar is null', () => {
expect(wrapper.find('.board-card-assignee img').exists()).toBe(true);
expect(wrapper.find('.board-card-assignee img').attributes('src')).toBe(

View File

@ -1,8 +1,66 @@
import { commitItemIconMap } from '~/ide/constants';
import { getCommitIconMap } from '~/ide/utils';
import { getCommitIconMap, isTextFile } from '~/ide/utils';
import { decorateData } from '~/ide/stores/utils';
describe('WebIDE utils', () => {
describe('isTextFile', () => {
it('returns false for known binary types', () => {
expect(isTextFile('file content', 'image/png', 'my.png')).toBeFalsy();
// mime types are case insensitive
expect(isTextFile('file content', 'IMAGE/PNG', 'my.png')).toBeFalsy();
});
it('returns true for known text types', () => {
expect(isTextFile('file content', 'text/plain', 'my.txt')).toBeTruthy();
// mime types are case insensitive
expect(isTextFile('file content', 'TEXT/PLAIN', 'my.txt')).toBeTruthy();
});
it('returns true for file extensions that Monaco supports syntax highlighting for', () => {
// test based on both MIME and extension
expect(isTextFile('{"éêė":"value"}', 'application/json', 'my.json')).toBeTruthy();
expect(isTextFile('{"éêė":"value"}', 'application/json', '.tsconfig')).toBeTruthy();
expect(isTextFile('SELECT "éêė" from tablename', 'application/sql', 'my.sql')).toBeTruthy();
});
it('returns true even irrespective of whether the mimes, extensions or file names are lowercase or upper case', () => {
expect(isTextFile('{"éêė":"value"}', 'application/json', 'MY.JSON')).toBeTruthy();
expect(isTextFile('SELECT "éêė" from tablename', 'application/sql', 'MY.SQL')).toBeTruthy();
expect(
isTextFile('var code = "something"', 'application/javascript', 'Gruntfile'),
).toBeTruthy();
expect(
isTextFile(
'MAINTAINER Александр "alexander11354322283@me.com"',
'application/octet-stream',
'dockerfile',
),
).toBeTruthy();
});
it('returns false if filename is same as the expected extension', () => {
expect(isTextFile('SELECT "éêė" from tablename', 'application/sql', 'sql')).toBeFalsy();
});
it('returns true for ASCII only content for unknown types', () => {
expect(isTextFile('plain text', 'application/x-new-type', 'hello.mytype')).toBeTruthy();
});
it('returns true for relevant filenames', () => {
expect(
isTextFile(
'MAINTAINER Александр "alexander11354322283@me.com"',
'application/octet-stream',
'Dockerfile',
),
).toBeTruthy();
});
it('returns false for non-ASCII content for unknown types', () => {
expect(isTextFile('{"éêė":"value"}', 'application/octet-stream', 'my.random')).toBeFalsy();
});
});
const createFile = (name = 'name', id = name, type = '', parent = null) =>
decorateData({
id,

View File

@ -148,6 +148,82 @@ describe('Panel Type component', () => {
});
});
describe('Edit custom metric dropdown item', () => {
const findEditCustomMetricLink = () => wrapper.find({ ref: 'editMetricLink' });
beforeEach(() => {
createWrapper({
graphData: {
...graphDataPrometheusQueryRange,
},
});
return wrapper.vm.$nextTick();
});
it('is not present if the panel is not a custom metric', () => {
expect(findEditCustomMetricLink().exists()).toBe(false);
});
it('is present when the panel contains an edit_path property', () => {
wrapper.setProps({
graphData: {
...graphDataPrometheusQueryRange,
metrics: [
{
...graphDataPrometheusQueryRange.metrics[0],
edit_path: '/root/kubernetes-gke-project/prometheus/metrics/23/edit',
},
],
},
});
return wrapper.vm.$nextTick(() => {
expect(findEditCustomMetricLink().exists()).toBe(true);
});
});
it('shows an "Edit metric" link for a panel with a single metric', () => {
wrapper.setProps({
graphData: {
...graphDataPrometheusQueryRange,
metrics: [
{
...graphDataPrometheusQueryRange.metrics[0],
edit_path: '/root/kubernetes-gke-project/prometheus/metrics/23/edit',
},
],
},
});
return wrapper.vm.$nextTick(() => {
expect(findEditCustomMetricLink().text()).toBe('Edit metric');
});
});
it('shows an "Edit metrics" link for a panel with multiple metrics', () => {
wrapper.setProps({
graphData: {
...graphDataPrometheusQueryRange,
metrics: [
{
...graphDataPrometheusQueryRange.metrics[0],
edit_path: '/root/kubernetes-gke-project/prometheus/metrics/23/edit',
},
{
...graphDataPrometheusQueryRange.metrics[0],
edit_path: '/root/kubernetes-gke-project/prometheus/metrics/23/edit',
},
],
},
});
return wrapper.vm.$nextTick(() => {
expect(findEditCustomMetricLink().text()).toBe('Edit metrics');
});
});
});
describe('View Logs dropdown item', () => {
const mockLogsPath = '/path/to/logs';
const mockTimeRange = { duration: { seconds: 120 } };

View File

@ -1,5 +1,5 @@
/* eslint-disable no-new */
import _ from 'underscore';
import { clone } from 'lodash';
import MockAdapter from 'axios-mock-adapter';
import axios from '~/lib/utils/axios_utils';
import Sidebar from '~/right_sidebar';
@ -24,13 +24,13 @@ describe('Issuable right sidebar collapsed todo toggle', () => {
mock = new MockAdapter(axios);
mock.onPost(`${gl.TEST_HOST}/frontend-fixtures/issues-project/todos`).reply(() => {
const response = _.clone(todoData);
const response = clone(todoData);
return [200, response];
});
mock.onDelete(/(.*)\/dashboard\/todos\/\d+$/).reply(() => {
const response = _.clone(todoData);
const response = clone(todoData);
delete response.delete_path;
return [200, response];

View File

@ -1,4 +1,4 @@
import _ from 'underscore';
import { range as rge } from 'lodash';
import DirtySubmitForm from '~/dirty_submit/dirty_submit_form';
import { getInputValue, setInputValue, createForm } from './helper';
@ -82,7 +82,7 @@ describe('DirtySubmitForm', () => {
const { form, input } = createForm();
const updateDirtyInputSpy = spyOn(new DirtySubmitForm(form), 'updateDirtyInput');
_.range(10).forEach(i => {
rge(10).forEach(i => {
setInputValue(input, `change ${i}`, false);
});
@ -93,7 +93,7 @@ describe('DirtySubmitForm', () => {
it('does not throttle updates when rapid changes are made to different form elements', () => {
const form = document.createElement('form');
const range = _.range(10);
const range = rge(10);
range.forEach(i => {
form.innerHTML += `<input type="text" name="input-${i}" class="js-input-${i}"/>`;
});

View File

@ -2,7 +2,7 @@
import $ from 'jquery';
import MockAdapter from 'axios-mock-adapter';
import _ from 'underscore';
import { shuffle } from 'lodash';
import axios from '~/lib/utils/axios_utils';
import IssuableContext from '~/issuable_context';
import LabelsSelect from '~/labels_select';
@ -27,7 +27,7 @@ function testLabelClicks(labelOrder, done) {
expect(labelsInDropdown.length).toBe(10);
const arrayOfLabels = labelsInDropdown.get();
const randomArrayOfLabels = _.shuffle(arrayOfLabels);
const randomArrayOfLabels = shuffle(arrayOfLabels);
randomArrayOfLabels.forEach((label, i) => {
if (i < saveLabelCount) {
$(label).click();

View File

@ -1,4 +1,4 @@
import _ from 'underscore';
import { range as rge } from 'lodash';
import Vue from 'vue';
import { mountComponentWithStore } from 'spec/helpers/vue_mount_component_helper';
import app from '~/releases/components/app_index.vue';
@ -28,7 +28,7 @@ describe('Releases App ', () => {
beforeEach(() => {
store = createStore({ modules: { list: listModule } });
releasesPagination = _.range(21).map(index => ({
releasesPagination = rge(21).map(index => ({
...convertObjectPropsToCamelCase(release, { deep: true }),
tagName: `${index}.00`,
}));

View File

@ -1,5 +1,5 @@
import $ from 'jquery';
import _ from 'underscore';
import { assignIn } from 'lodash';
import waitForPromises from 'spec/helpers/wait_for_promises';
import SmartInterval from '~/smart_interval';
@ -21,7 +21,7 @@ describe('SmartInterval', function() {
};
if (config) {
_.extend(defaultParams, config);
assignIn(defaultParams, config);
}
return new SmartInterval(defaultParams);

View File

@ -2,7 +2,7 @@
require 'spec_helper'
describe Gitlab::BackgroundMigration::AddMergeRequestDiffCommitsCount, :migration, schema: 20180105212544 do
describe Gitlab::BackgroundMigration::AddMergeRequestDiffCommitsCount, schema: 20180105212544 do
let(:projects_table) { table(:projects) }
let(:merge_requests_table) { table(:merge_requests) }
let(:merge_request_diffs_table) { table(:merge_request_diffs) }

View File

@ -2,7 +2,7 @@
require 'spec_helper'
describe Gitlab::BackgroundMigration::ArchiveLegacyTraces, :migration, schema: 20180529152628 do
describe Gitlab::BackgroundMigration::ArchiveLegacyTraces, schema: 20180529152628 do
include TraceHelpers
let(:namespaces) { table(:namespaces) }

View File

@ -2,6 +2,6 @@
require 'spec_helper'
describe Gitlab::BackgroundMigration::BackfillHashedProjectRepositories, :migration, schema: 20181130102132 do
describe Gitlab::BackgroundMigration::BackfillHashedProjectRepositories, schema: 20181130102132 do
it_behaves_like 'backfill migration for project repositories', :hashed
end

View File

@ -2,6 +2,6 @@
require 'spec_helper'
describe Gitlab::BackgroundMigration::BackfillLegacyProjectRepositories, :migration, schema: 20181212171634 do
describe Gitlab::BackgroundMigration::BackfillLegacyProjectRepositories, schema: 20181212171634 do
it_behaves_like 'backfill migration for project repositories', :legacy
end

View File

@ -2,7 +2,7 @@
require 'spec_helper'
describe Gitlab::BackgroundMigration::BackfillProjectFullpathInRepoConfig, :migration, schema: 20181010133639 do
describe Gitlab::BackgroundMigration::BackfillProjectFullpathInRepoConfig, schema: 20181010133639 do
let(:namespaces) { table(:namespaces) }
let(:projects) { table(:projects) }
let(:group) { namespaces.create!(name: 'foo', path: 'foo') }

View File

@ -3,7 +3,7 @@
require 'spec_helper'
# rubocop:disable RSpec/FactoriesInMigrationSpecs
describe Gitlab::BackgroundMigration::BackfillProjectRepositories do
describe Gitlab::BackgroundMigration::BackfillProjectRepositories, schema: :latest do
let(:group) { create(:group, name: 'foo', path: 'foo') }
describe described_class::ShardFinder do

View File

@ -2,7 +2,7 @@
require 'spec_helper'
describe Gitlab::BackgroundMigration::BackfillProjectSettings, :migration, schema: 20200114113341 do
describe Gitlab::BackgroundMigration::BackfillProjectSettings, schema: 20200114113341 do
let(:projects) { table(:projects) }
let(:project_settings) { table(:project_settings) }
let(:namespace) { table(:namespaces).create(name: 'user', path: 'user') }

View File

@ -2,7 +2,7 @@
require 'spec_helper'
describe Gitlab::BackgroundMigration::DigestColumn, :migration, schema: 20180913142237 do
describe Gitlab::BackgroundMigration::DigestColumn, schema: 20180913142237 do
let(:personal_access_tokens) { table(:personal_access_tokens) }
let(:users) { table(:users) }

View File

@ -2,7 +2,7 @@
require 'spec_helper'
describe Gitlab::BackgroundMigration::EncryptColumns, :migration, schema: 20180910115836 do
describe Gitlab::BackgroundMigration::EncryptColumns, schema: 20180910115836 do
let(:model) { Gitlab::BackgroundMigration::Models::EncryptColumns::WebHook }
let(:web_hooks) { table(:web_hooks) }

View File

@ -2,7 +2,7 @@
require 'spec_helper'
describe Gitlab::BackgroundMigration::EncryptRunnersTokens, :migration, schema: 20181121111200 do
describe Gitlab::BackgroundMigration::EncryptRunnersTokens, schema: 20181121111200 do
let(:settings) { table(:application_settings) }
let(:namespaces) { table(:namespaces) }
let(:projects) { table(:projects) }

View File

@ -2,7 +2,7 @@
require 'spec_helper'
describe Gitlab::BackgroundMigration::FixCrossProjectLabelLinks, :migration, schema: 20180702120647 do
describe Gitlab::BackgroundMigration::FixCrossProjectLabelLinks, schema: 20180702120647 do
let(:namespaces_table) { table(:namespaces) }
let(:projects_table) { table(:projects) }
let(:issues_table) { table(:issues) }

View File

@ -2,7 +2,7 @@
require 'spec_helper'
describe Gitlab::BackgroundMigration::FixProjectsWithoutProjectFeature, :migration, schema: 2020_01_27_111840 do
describe Gitlab::BackgroundMigration::FixProjectsWithoutProjectFeature, schema: 2020_01_27_111840 do
let(:namespaces) { table(:namespaces) }
let(:projects) { table(:projects) }
let(:project_features) { table(:project_features) }

View File

@ -2,7 +2,7 @@
require 'spec_helper'
describe Gitlab::BackgroundMigration::FixPromotedEpicsDiscussionIds, :migration, schema: 20190715193142 do
describe Gitlab::BackgroundMigration::FixPromotedEpicsDiscussionIds, schema: 20190715193142 do
let(:namespaces) { table(:namespaces) }
let(:users) { table(:users) }
let(:epics) { table(:epics) }

View File

@ -2,7 +2,7 @@
require 'spec_helper'
describe Gitlab::BackgroundMigration::FixUserNamespaceNames, :migration, schema: 20190620112608 do
describe Gitlab::BackgroundMigration::FixUserNamespaceNames, schema: 20190620112608 do
let(:namespaces) { table(:namespaces) }
let(:users) { table(:users) }
let(:user) { users.create(name: "The user's full name", projects_limit: 10, username: 'not-null', email: '1') }

View File

@ -2,7 +2,7 @@
require 'spec_helper'
describe Gitlab::BackgroundMigration::FixUserProjectRouteNames, :migration, schema: 20190620112608 do
describe Gitlab::BackgroundMigration::FixUserProjectRouteNames, schema: 20190620112608 do
let(:namespaces) { table(:namespaces) }
let(:users) { table(:users) }
let(:routes) { table(:routes) }

View File

@ -2,7 +2,7 @@
require 'spec_helper'
# rubocop: disable RSpec/FactoriesInMigrationSpecs
describe Gitlab::BackgroundMigration::LegacyUploadMover do
describe Gitlab::BackgroundMigration::LegacyUploadMover, schema: :latest do
let(:test_dir) { FileUploader.options['storage_path'] }
let(:filename) { 'image.png' }

View File

@ -2,7 +2,7 @@
require 'spec_helper'
# rubocop: disable RSpec/FactoriesInMigrationSpecs
describe Gitlab::BackgroundMigration::LegacyUploadsMigrator do
describe Gitlab::BackgroundMigration::LegacyUploadsMigrator, schema: :latest do
let(:test_dir) { FileUploader.options['storage_path'] }
let!(:hashed_project) { create(:project) }

View File

@ -2,7 +2,7 @@
require 'spec_helper'
describe Gitlab::BackgroundMigration::MergeRequestAssigneesMigrationProgressCheck do
describe Gitlab::BackgroundMigration::MergeRequestAssigneesMigrationProgressCheck, schema: :latest do
context 'rescheduling' do
context 'when there are ongoing and no dead jobs' do
it 'reschedules check' do

View File

@ -2,7 +2,7 @@
require 'spec_helper'
describe Gitlab::BackgroundMigration::MigrateBuildStage, :migration, schema: 20180212101928 do
describe Gitlab::BackgroundMigration::MigrateBuildStage, schema: 20180212101928 do
let(:projects) { table(:projects) }
let(:pipelines) { table(:ci_pipelines) }
let(:stages) { table(:ci_stages) }

View File

@ -2,7 +2,7 @@
require 'spec_helper'
describe Gitlab::BackgroundMigration::MigrateFingerprintSha256WithinKeys, :migration, schema: 20200106071113 do
describe Gitlab::BackgroundMigration::MigrateFingerprintSha256WithinKeys, schema: 20200106071113 do
subject(:fingerprint_migrator) { described_class.new }
let(:key_table) { table(:keys) }

View File

@ -1,7 +1,7 @@
# frozen_string_literal: true
require 'spec_helper'
describe Gitlab::BackgroundMigration::MigrateIssueTrackersSensitiveData, :migration, schema: 20200130145430 do
describe Gitlab::BackgroundMigration::MigrateIssueTrackersSensitiveData, schema: 20200130145430 do
let(:services) { table(:services) }
# we need to define the classes due to encryption

View File

@ -2,7 +2,7 @@
require 'spec_helper'
describe Gitlab::BackgroundMigration::MigrateLegacyArtifacts, :migration, schema: 20180816161409 do
describe Gitlab::BackgroundMigration::MigrateLegacyArtifacts, schema: 20180816161409 do
let(:namespaces) { table(:namespaces) }
let(:projects) { table(:projects) }
let(:pipelines) { table(:ci_pipelines) }

View File

@ -2,7 +2,7 @@
require 'spec_helper'
describe Gitlab::BackgroundMigration::MigrateNullPrivateProfileToFalse, :migration, schema: 20190620105427 do
describe Gitlab::BackgroundMigration::MigrateNullPrivateProfileToFalse, schema: 20190620105427 do
let(:users) { table(:users) }
it 'correctly migrates nil private_profile to false' do

View File

@ -2,7 +2,7 @@
require 'spec_helper'
describe Gitlab::BackgroundMigration::MigratePagesMetadata, :migration, schema: 20190919040324 do
describe Gitlab::BackgroundMigration::MigratePagesMetadata, schema: 20190919040324 do
let(:projects) { table(:projects) }
subject(:migrate_pages_metadata) { described_class.new }

View File

@ -2,7 +2,7 @@
require 'spec_helper'
describe Gitlab::BackgroundMigration::MigrateStageIndex, :migration, schema: 20180420080616 do
describe Gitlab::BackgroundMigration::MigrateStageIndex, schema: 20180420080616 do
let(:namespaces) { table(:namespaces) }
let(:projects) { table(:projects) }
let(:pipelines) { table(:ci_pipelines) }

View File

@ -2,7 +2,7 @@
require 'spec_helper'
describe Gitlab::BackgroundMigration::PopulateClusterKubernetesNamespaceTable, :migration, schema: 20181022173835 do
describe Gitlab::BackgroundMigration::PopulateClusterKubernetesNamespaceTable, schema: 20181022173835 do
include MigrationHelpers::ClusterHelpers
let(:migration) { described_class.new }

View File

@ -2,7 +2,7 @@
require 'spec_helper'
describe Gitlab::BackgroundMigration::PopulateMergeRequestAssigneesTable, :migration, schema: 20190315191339 do
describe Gitlab::BackgroundMigration::PopulateMergeRequestAssigneesTable, schema: 20190315191339 do
let(:namespaces) { table(:namespaces) }
let(:projects) { table(:projects) }
let(:users) { table(:users) }

View File

@ -3,7 +3,7 @@
require 'spec_helper'
# Rollback DB to 10.5 (later than this was originally written for) because it still needs to work.
describe Gitlab::BackgroundMigration::PopulateUntrackedUploadsDependencies::UntrackedFile, :migration, schema: 20180208183958 do
describe Gitlab::BackgroundMigration::PopulateUntrackedUploadsDependencies::UntrackedFile, schema: 20180208183958 do
include MigrationsHelpers::TrackUntrackedUploadsHelpers
let!(:appearances) { table(:appearances) }

View File

@ -3,7 +3,7 @@
require 'spec_helper'
# Rollback DB to 10.5 (later than this was originally written for) because it still needs to work.
describe Gitlab::BackgroundMigration::PopulateUntrackedUploads, :migration, schema: 20180208183958 do
describe Gitlab::BackgroundMigration::PopulateUntrackedUploads, schema: 20180208183958 do
include MigrationsHelpers::TrackUntrackedUploadsHelpers
subject { described_class.new }

View File

@ -3,7 +3,7 @@
require 'spec_helper'
# Rollback DB to 10.5 (later than this was originally written for) because it still needs to work.
describe Gitlab::BackgroundMigration::PrepareUntrackedUploads, :migration, schema: 20180208183958 do
describe Gitlab::BackgroundMigration::PrepareUntrackedUploads, schema: 20180208183958 do
include MigrationsHelpers::TrackUntrackedUploadsHelpers
let!(:untracked_files_for_uploads) { table(:untracked_files_for_uploads) }

View File

@ -2,7 +2,7 @@
require 'spec_helper'
describe Gitlab::BackgroundMigration::RecalculateProjectAuthorizations, :migration, schema: 20200204113223 do
describe Gitlab::BackgroundMigration::RecalculateProjectAuthorizations, schema: 20200204113223 do
let(:users_table) { table(:users) }
let(:namespaces_table) { table(:namespaces) }
let(:projects_table) { table(:projects) }

View File

@ -2,7 +2,7 @@
require 'spec_helper'
describe Gitlab::BackgroundMigration::RecalculateProjectAuthorizationsWithMinMaxUserId, :migration, schema: 20200204113224 do
describe Gitlab::BackgroundMigration::RecalculateProjectAuthorizationsWithMinMaxUserId, schema: 20200204113224 do
let(:users_table) { table(:users) }
let(:min) { 1 }
let(:max) { 5 }

View File

@ -2,7 +2,7 @@
require 'spec_helper'
describe Gitlab::BackgroundMigration::RemoveRestrictedTodos, :migration, schema: 20180704204006 do
describe Gitlab::BackgroundMigration::RemoveRestrictedTodos, schema: 20180704204006 do
let(:projects) { table(:projects) }
let(:users) { table(:users) }
let(:todos) { table(:todos) }

View File

@ -2,7 +2,7 @@
require 'spec_helper'
describe Gitlab::BackgroundMigration::ResetMergeStatus, :migration, schema: 20190528180441 do
describe Gitlab::BackgroundMigration::ResetMergeStatus, schema: 20190528180441 do
let(:namespaces) { table(:namespaces) }
let(:projects) { table(:projects) }
let(:namespace) { namespaces.create(name: 'gitlab', path: 'gitlab-org') }

View File

@ -3,7 +3,7 @@
require 'spec_helper'
require Rails.root.join('db', 'post_migrate', '20190527194900_schedule_calculate_wiki_sizes.rb')
describe ScheduleCalculateWikiSizes, :migration do
describe ScheduleCalculateWikiSizes do
let(:migration_class) { Gitlab::BackgroundMigration::CalculateWikiSizes }
let(:migration_name) { migration_class.to_s.demodulize }

View File

@ -2,7 +2,7 @@
require 'spec_helper'
describe Gitlab::BackgroundMigration::SetConfidentialNoteEventsOnServices, :migration, schema: 20180122154930 do
describe Gitlab::BackgroundMigration::SetConfidentialNoteEventsOnServices, schema: 20180122154930 do
let(:services) { table(:services) }
describe '#perform' do

View File

@ -2,7 +2,7 @@
require 'spec_helper'
describe Gitlab::BackgroundMigration::SetConfidentialNoteEventsOnWebhooks, :migration, schema: 20180104131052 do
describe Gitlab::BackgroundMigration::SetConfidentialNoteEventsOnWebhooks, schema: 20180104131052 do
let(:web_hooks) { table(:web_hooks) }
describe '#perform' do

View File

@ -2,7 +2,7 @@
require 'spec_helper'
describe Gitlab::BackgroundMigration::UpdateExistingSubgroupToMatchVisibilityLevelOfParent, :migration, schema: 2020_01_10_121314 do
describe Gitlab::BackgroundMigration::UpdateExistingSubgroupToMatchVisibilityLevelOfParent, schema: 2020_01_10_121314 do
include MigrationHelpers::NamespacesHelpers
context 'private visibility level' do

View File

@ -2,7 +2,7 @@
require 'spec_helper'
describe Gitlab::BackgroundMigration do
describe Gitlab::BackgroundMigration, schema: :latest do
describe '.queue' do
it 'returns background migration worker queue' do
expect(described_class.queue)

View File

@ -3,7 +3,7 @@
require 'spec_helper'
require Rails.root.join('db', 'post_migrate', '20190924152703_migrate_issue_trackers_data.rb')
describe MigrateIssueTrackersData, :migration do
describe MigrateIssueTrackersData do
let(:services) { table(:services) }
let(:migration_class) { Gitlab::BackgroundMigration::MigrateIssueTrackersSensitiveData }
let(:migration_name) { migration_class.to_s.demodulize }

View File

@ -3,7 +3,7 @@
require 'spec_helper'
require Rails.root.join('db', 'post_migrate', '20191015154408_drop_merge_requests_require_code_owner_approval_from_projects.rb')
describe DropMergeRequestsRequireCodeOwnerApprovalFromProjects, :migration do
describe DropMergeRequestsRequireCodeOwnerApprovalFromProjects do
let(:projects_table) { table(:projects) }
subject(:migration) { described_class.new }

View File

@ -3,7 +3,7 @@
require 'spec_helper'
require Rails.root.join('db', 'migrate', '20191125114345_add_admin_mode_protected_path.rb')
describe AddAdminModeProtectedPath, :migration do
describe AddAdminModeProtectedPath do
ADMIN_MODE_ENDPOINT = '/admin/session'
subject(:migration) { described_class.new }

View File

@ -3,7 +3,7 @@
require 'spec_helper'
require Rails.root.join('db', 'post_migrate', '20191204114127_delete_legacy_triggers.rb')
describe DeleteLegacyTriggers, :migration, schema: 2019_11_25_140458 do
describe DeleteLegacyTriggers, schema: 2019_11_25_140458 do
let(:ci_trigger_table) { table(:ci_triggers) }
let(:user) { table(:users).create!(name: 'test', email: 'test@example.com', projects_limit: 1) }

View File

@ -3,7 +3,7 @@
require 'spec_helper'
require Rails.root.join('db', 'migrate', '20200107172020_add_timestamp_softwarelicensespolicy.rb')
describe AddTimestampSoftwarelicensespolicy, :migration do
describe AddTimestampSoftwarelicensespolicy do
let(:software_licenses_policy) { table(:software_license_policies) }
let(:projects) { table(:projects) }
let(:licenses) { table(:software_licenses) }

View File

@ -3,7 +3,7 @@
require 'spec_helper'
require Rails.root.join('db', 'post_migrate', '20200122123016_backfill_project_settings.rb')
describe BackfillProjectSettings, :migration, :sidekiq, schema: 20200114113341 do
describe BackfillProjectSettings, :sidekiq, schema: 20200114113341 do
let(:projects) { table(:projects) }
let(:namespace) { table(:namespaces).create(name: 'user', path: 'user') }
let(:project) { projects.create(namespace_id: namespace.id) }

View File

@ -3,7 +3,7 @@
require 'spec_helper'
require Rails.root.join('db', 'post_migrate', '20200123155929_remove_invalid_jira_data.rb')
describe RemoveInvalidJiraData, :migration do
describe RemoveInvalidJiraData do
let(:jira_tracker_data) { table(:jira_tracker_data) }
let(:services) { table(:services) }

View File

@ -3,7 +3,7 @@
require 'spec_helper'
require Rails.root.join('db', 'post_migrate', '20200127090233_remove_invalid_issue_tracker_data.rb')
describe RemoveInvalidIssueTrackerData, :migration do
describe RemoveInvalidIssueTrackerData do
let(:issue_tracker_data) { table(:issue_tracker_data) }
let(:services) { table(:services) }

View File

@ -3,7 +3,7 @@
require 'spec_helper'
require Rails.root.join('db', 'post_migrate', '20200130145430_reschedule_migrate_issue_trackers_data.rb')
describe RescheduleMigrateIssueTrackersData, :migration do
describe RescheduleMigrateIssueTrackersData do
let(:services) { table(:services) }
let(:migration_class) { Gitlab::BackgroundMigration::MigrateIssueTrackersSensitiveData }
let(:migration_name) { migration_class.to_s.demodulize }

View File

@ -3,7 +3,7 @@
require 'spec_helper'
require Rails.root.join('db', 'post_migrate', '20180122154930_schedule_set_confidential_note_events_on_services.rb')
describe ScheduleSetConfidentialNoteEventsOnServices, :migration do
describe ScheduleSetConfidentialNoteEventsOnServices do
let(:services_table) { table(:services) }
let(:migration_class) { Gitlab::BackgroundMigration::SetConfidentialNoteEventsOnServices }
let(:migration_name) { migration_class.to_s.demodulize }

View File

@ -5,7 +5,7 @@ require 'spec_helper'
# Check consistency of db/schema.rb version, migrations' timestamps, and the latest migration timestamp
# stored in the database's schema_migrations table.
describe ActiveRecord::Schema do
describe ActiveRecord::Schema, schema: :latest do
let(:latest_migration_timestamp) do
migrations_paths = %w[db/migrate db/post_migrate]
.map { |path| Rails.root.join(*path, '*') }

View File

@ -3,7 +3,7 @@
require 'spec_helper'
require Rails.root.join('db', 'migrate', '20191023152913_add_default_and_free_plans.rb')
describe AddDefaultAndFreePlans, :migration do
describe AddDefaultAndFreePlans do
describe 'migrate' do
let(:plans) { table(:plans) }

View File

@ -3,7 +3,7 @@
require 'spec_helper'
require Rails.root.join('db', 'migrate', '20200122161638_add_deploy_token_type_to_deploy_tokens.rb')
describe AddDeployTokenTypeToDeployTokens, :migration do
describe AddDeployTokenTypeToDeployTokens do
let(:deploy_tokens) { table(:deploy_tokens) }
let(:deploy_token) do
deploy_tokens.create(name: 'token_test',

View File

@ -3,7 +3,7 @@
require 'spec_helper'
require Rails.root.join('db', 'migrate', '20180710162338_add_foreign_key_from_notification_settings_to_users.rb')
describe AddForeignKeyFromNotificationSettingsToUsers, :migration do
describe AddForeignKeyFromNotificationSettingsToUsers do
let(:notification_settings) { table(:notification_settings) }
let(:users) { table(:users) }
let(:projects) { table(:projects) }

View File

@ -3,7 +3,7 @@
require 'spec_helper'
require Rails.root.join('db', 'migrate', '20180201110056_add_foreign_keys_to_todos.rb')
describe AddForeignKeysToTodos, :migration do
describe AddForeignKeysToTodos do
let(:todos) { table(:todos) }
let(:users) { table(:users) }
let(:projects) { table(:projects) }

View File

@ -3,7 +3,7 @@
require 'spec_helper'
require Rails.root.join('db', 'migrate', '20180508100222_add_not_null_constraint_to_project_mirror_data_foreign_key.rb')
describe AddNotNullConstraintToProjectMirrorDataForeignKey, :migration do
describe AddNotNullConstraintToProjectMirrorDataForeignKey do
let(:namespaces) { table(:namespaces) }
let(:projects) { table(:projects) }
let(:import_state) { table(:project_mirror_data) }

View File

@ -3,7 +3,7 @@
require 'spec_helper'
require Rails.root.join('db', 'migrate', '20180423204600_add_pages_access_level_to_project_feature.rb')
describe AddPagesAccessLevelToProjectFeature, :migration do
describe AddPagesAccessLevelToProjectFeature do
let(:namespaces) { table(:namespaces) }
let(:projects) { table(:projects) }
let(:features) { table(:project_features) }

View File

@ -3,7 +3,7 @@
require 'spec_helper'
require Rails.root.join('db', 'migrate', '20180420010016_add_pipeline_build_foreign_key.rb')
describe AddPipelineBuildForeignKey, :migration do
describe AddPipelineBuildForeignKey do
let(:namespaces) { table(:namespaces) }
let(:projects) { table(:projects) }
let(:pipelines) { table(:ci_pipelines) }

View File

@ -3,7 +3,7 @@
require 'spec_helper'
require Rails.root.join('db', 'post_migrate', '20200114112932_add_temporary_partial_index_on_project_id_to_services.rb')
describe AddTemporaryPartialIndexOnProjectIdToServices, :migration do
describe AddTemporaryPartialIndexOnProjectIdToServices do
let(:migration) { described_class.new }
describe '#up' do

View File

@ -3,7 +3,7 @@
require 'spec_helper'
require Rails.root.join('db', 'post_migrate', '20190404143330_add_unique_constraint_to_approvals_user_id_and_merge_request_id.rb')
describe AddUniqueConstraintToApprovalsUserIdAndMergeRequestId, :migration do
describe AddUniqueConstraintToApprovalsUserIdAndMergeRequestId do
let(:migration) { described_class.new }
let(:namespaces) { table(:namespaces) }
let(:projects) { table(:projects) }

View File

@ -3,7 +3,7 @@
require 'spec_helper'
require Rails.root.join('db', 'post_migrate', '20180511174224_add_unique_constraint_to_project_features_project_id.rb')
describe AddUniqueConstraintToProjectFeaturesProjectId, :migration do
describe AddUniqueConstraintToProjectFeaturesProjectId do
let(:namespaces) { table(:namespaces) }
let(:projects) { table(:projects) }
let(:features) { table(:project_features) }

View File

@ -3,7 +3,7 @@
require 'spec_helper'
require Rails.root.join('db', 'migrate', '20180425131009_assure_commits_count_for_merge_request_diff.rb')
describe AssureCommitsCountForMergeRequestDiff, :migration, :redis do
describe AssureCommitsCountForMergeRequestDiff, :redis do
let(:migration) { spy('migration') }
before do

View File

@ -3,7 +3,7 @@
require 'spec_helper'
require Rails.root.join('db', 'migrate', '20190628185004_backfill_and_add_not_null_constraint_to_released_at_column_on_releases_table.rb')
describe BackfillAndAddNotNullConstraintToReleasedAtColumnOnReleasesTable, :migration do
describe BackfillAndAddNotNullConstraintToReleasedAtColumnOnReleasesTable do
let(:releases) { table(:releases) }
let(:namespaces) { table(:namespaces) }
let(:projects) { table(:projects) }

View File

@ -3,7 +3,7 @@
require 'spec_helper'
require Rails.root.join('db', 'migrate', '20191213184609_backfill_operations_feature_flags_active.rb')
describe BackfillOperationsFeatureFlagsActive, :migration do
describe BackfillOperationsFeatureFlagsActive do
let(:namespaces) { table(:namespaces) }
let(:projects) { table(:projects) }
let(:flags) { table(:operations_feature_flags) }

View File

@ -3,7 +3,7 @@
require 'spec_helper'
require Rails.root.join('db', 'post_migrate', '20200117194850_backfill_operations_feature_flags_iid.rb')
describe BackfillOperationsFeatureFlagsIid, :migration do
describe BackfillOperationsFeatureFlagsIid do
let(:namespaces) { table(:namespaces) }
let(:projects) { table(:projects) }
let(:flags) { table(:operations_feature_flags) }

Some files were not shown because too many files have changed in this diff Show More