diff --git a/app/assets/javascripts/boards/index.js b/app/assets/javascripts/boards/index.js index f72fc8d54b3e2a9860d1d60140cc796e97405591..781cb0c1cc90a6b2af5c23db8bb1db2265c39361 100644 --- a/app/assets/javascripts/boards/index.js +++ b/app/assets/javascripts/boards/index.js @@ -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(); diff --git a/app/assets/javascripts/boards/models/assignee.js b/app/assets/javascripts/boards/models/assignee.js index 4a29b0d05819fd63cb3ddd05b6a3bf46c65557c1..5f5758583bbef8db6dc53444d697715cc7395f95 100644 --- a/app/assets/javascripts/boards/models/assignee.js +++ b/app/assets/javascripts/boards/models/assignee.js @@ -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; diff --git a/app/assets/javascripts/boards/models/issue.js b/app/assets/javascripts/boards/models/issue.js index 4f5d583e61f9178709a4a0db9e44756873a495f0..d099c4b930cd4e9e01b2c1d9eee693bf29997237 100644 --- a/app/assets/javascripts/boards/models/issue.js +++ b/app/assets/javascripts/boards/models/issue.js @@ -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) { diff --git a/app/assets/javascripts/boards/models/list.js b/app/assets/javascripts/boards/models/list.js index ff50b8ed7d199acc49dd5a897404d8a759d9221e..990b648190a884c3dc7f9cbd7774f10624196db6 100644 --- a/app/assets/javascripts/boards/models/list.js +++ b/app/assets/javascripts/boards/models/list.js @@ -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)); }); } diff --git a/app/assets/javascripts/boards/stores/boards_store.js b/app/assets/javascripts/boards/stores/boards_store.js index 2a2cff3d07df6ebf370a32855b119d6276dde44a..528dc4ed68ea59d5e1945719e43250976a84bf97 100644 --- a/app/assets/javascripts/boards/stores/boards_store.js +++ b/app/assets/javascripts/boards/stores/boards_store.js @@ -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)); } }, }; diff --git a/app/assets/javascripts/ide/components/new_dropdown/upload.vue b/app/assets/javascripts/ide/components/new_dropdown/upload.vue index 0efb00122464613656b68ae152531efaa8a0fcc5..7261e0590c8aba8eeb1978a893a895675a30ce5e 100644 --- a/app/assets/javascripts/ide/components/new_dropdown/upload.vue +++ b/app/assets/javascripts/ide/components/new_dropdown/upload.vue @@ -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', { diff --git a/app/assets/javascripts/ide/utils.js b/app/assets/javascripts/ide/utils.js index ae579fef25f7615dba8e99347f425d25150ed5cf..64ac539a4ff4e97439bbcf646465132e5341c068 100644 --- a/app/assets/javascripts/ide/utils.js +++ b/app/assets/javascripts/ide/utils.js @@ -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) { diff --git a/app/assets/javascripts/monitoring/components/panel_type.vue b/app/assets/javascripts/monitoring/components/panel_type.vue index f2f0fff694efa2344b66cef1decd00511b79419a..4573ec58ab8a72dfc0d4f4a87688f837517737fd 100644 --- a/app/assets/javascripts/monitoring/components/panel_type.vue +++ b/app/assets/javascripts/monitoring/components/panel_type.vue @@ -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" diff --git a/app/helpers/boards_helper.rb b/app/helpers/boards_helper.rb index 8bb079e6447e30e9bbcd0099608de98d6d8df553..c14bc454bb9694449cb1fec963c5a7cdda7c5c74 100644 --- a/app/helpers/boards_helper.rb +++ b/app/helpers/boards_helper.rb @@ -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 } diff --git a/app/policies/group_policy.rb b/app/policies/group_policy.rb index 404734ef30ae343167c72c42d25d05ad7e3dd55e..abd637539084bdc867d961db6c9a1205e41fd2fc 100644 --- a/app/policies/group_policy.rb +++ b/app/policies/group_policy.rb @@ -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 diff --git a/app/services/projects/lfs_pointers/lfs_download_link_list_service.rb b/app/services/projects/lfs_pointers/lfs_download_link_list_service.rb index 5ef7e03ea02941916d3100c1b1c96e530f185f92..48a21bf94ba998ad4d45b7fd3c904290397a2ffe 100644 --- a/app/services/projects/lfs_pointers/lfs_download_link_list_service.rb +++ b/app/services/projects/lfs_pointers/lfs_download_link_list_service.rb @@ -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 diff --git a/changelogs/unreleased/210007-optimize-services_usage-counters.yml b/changelogs/unreleased/210007-optimize-services_usage-counters.yml new file mode 100644 index 0000000000000000000000000000000000000000..8b2dc2764ace0b8441a39ae94e85a9fd0943b656 --- /dev/null +++ b/changelogs/unreleased/210007-optimize-services_usage-counters.yml @@ -0,0 +1,5 @@ +--- +title: Optimize services usage counters using batch counters +merge_request: 26973 +author: +type: performance diff --git a/changelogs/unreleased/210008-the-same-chart-appears-twice-for-different-embeds.yml b/changelogs/unreleased/210008-the-same-chart-appears-twice-for-different-embeds.yml new file mode 100644 index 0000000000000000000000000000000000000000..20b74415c222769a0613a664209571eb0b4a395a --- /dev/null +++ b/changelogs/unreleased/210008-the-same-chart-appears-twice-for-different-embeds.yml @@ -0,0 +1,5 @@ +--- +title: Fix embeds so that a chart appears only once +merge_request: 26997 +author: +type: fixed diff --git a/changelogs/unreleased/21811-group-create-deploy-tokens.yml b/changelogs/unreleased/21811-group-create-deploy-tokens.yml new file mode 100644 index 0000000000000000000000000000000000000000..74400d73166680ca719e7378d3758abebc97c5fc --- /dev/null +++ b/changelogs/unreleased/21811-group-create-deploy-tokens.yml @@ -0,0 +1,5 @@ +--- +title: Add api endpoint for creating group deploy tokens +merge_request: 25629 +author: +type: added diff --git a/changelogs/unreleased/26113-file-type-issue.yml b/changelogs/unreleased/26113-file-type-issue.yml new file mode 100644 index 0000000000000000000000000000000000000000..a63d34aca994f28785071da47b041d8f52fa57db --- /dev/null +++ b/changelogs/unreleased/26113-file-type-issue.yml @@ -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 diff --git a/changelogs/unreleased/28725-paginate-lfs-object-import.yml b/changelogs/unreleased/28725-paginate-lfs-object-import.yml new file mode 100644 index 0000000000000000000000000000000000000000..25f5956631626e49f6d7fceb0d4316688e54e5e2 --- /dev/null +++ b/changelogs/unreleased/28725-paginate-lfs-object-import.yml @@ -0,0 +1,5 @@ +--- +title: Batch processing LFS objects downloads +merge_request: 26434 +author: +type: changed diff --git a/changelogs/unreleased/jivanvl-add-edit-custom-metric-link.yml b/changelogs/unreleased/jivanvl-add-edit-custom-metric-link.yml new file mode 100644 index 0000000000000000000000000000000000000000..ca4dd7a0b504ef2cace834ae33de4336a48333e0 --- /dev/null +++ b/changelogs/unreleased/jivanvl-add-edit-custom-metric-link.yml @@ -0,0 +1,5 @@ +--- +title: Add edit custom metric link to metrics dashboard +merge_request: 26511 +author: +type: changed diff --git a/changelogs/unreleased/support-airgap-in-dependency-scanning-template.yml b/changelogs/unreleased/support-airgap-in-dependency-scanning-template.yml new file mode 100644 index 0000000000000000000000000000000000000000..0d70bb836c1413dc3d5c6221ee9f56b2c2d3d139 --- /dev/null +++ b/changelogs/unreleased/support-airgap-in-dependency-scanning-template.yml @@ -0,0 +1,5 @@ +--- +title: Add airgap support to Dependency Scanning template +merge_request: 26145 +author: +type: changed diff --git a/config/routes/project.rb b/config/routes/project.rb index 83575580321cca5428c78eae49178f657b2babae..23a13202cd75c2e7a3238d4ed1fad4d08f4fa75a 100644 --- a/config/routes/project.rb +++ b/config/routes/project.rb @@ -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 diff --git a/doc/api/deploy_tokens.md b/doc/api/deploy_tokens.md index c5c88619aa673a4ae254a973946996554e80f4be..49bfed3e43173b4f69145c457e3a2c98835175c5 100644 --- a/doc/api/deploy_tokens.md +++ b/doc/api/deploy_tokens.md @@ -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. diff --git a/doc/development/testing_guide/testing_migrations_guide.md b/doc/development/testing_guide/testing_migrations_guide.md index 0012c1bfc07db80e28cedf032922d81875cda656..05773f07b0f435320c1c7848c420471b39739b9f 100644 --- a/doc/development/testing_guide/testing_migrations_guide.md +++ b/doc/development/testing_guide/testing_migrations_guide.md @@ -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) } diff --git a/doc/user/group/saml_sso/index.md b/doc/user/group/saml_sso/index.md index 0d9c6024601cd6627a3a2f24a9eba3081adcfce5..fa9b820838e8ec2ccbce1a60d9aa1a33d551d3a4 100644 --- a/doc/user/group/saml_sso/index.md +++ b/doc/user/group/saml_sso/index.md @@ -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. diff --git a/lib/api/deploy_tokens.rb b/lib/api/deploy_tokens.rb index bc58cf0dd328d846c67a530a117d02c4430408b5..cb1ee7df4963bc3233dcdbe011fb38117243596f 100644 --- a/lib/api/deploy_tokens.rb +++ b/lib/api/deploy_tokens.rb @@ -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 diff --git a/lib/banzai/filter/inline_embeds_filter.rb b/lib/banzai/filter/inline_embeds_filter.rb index 79ac8555636cd3ba058ffa8f42b19bf58416e890..d7d78cf18664d7a6d057d58d017fb28c5c38a17f 100644 --- a/lib/banzai/filter/inline_embeds_filter.rb +++ b/lib/banzai/filter/inline_embeds_filter.rb @@ -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. diff --git a/lib/gitlab/ci/templates/Security/Dependency-Scanning.gitlab-ci.yml b/lib/gitlab/ci/templates/Security/Dependency-Scanning.gitlab-ci.yml index 4a9fa3091bed1625f6055bea742c40c8114a8743..3200220a33201ddd40e5635d1df5349cd2049f86 100644 --- a/lib/gitlab/ci/templates/Security/Dependency-Scanning.gitlab-ci.yml +++ b/lib/gitlab/ci/templates/Security/Dependency-Scanning.gitlab-ci.yml @@ -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 diff --git a/lib/gitlab/usage_data.rb b/lib/gitlab/usage_data.rb index 09ea1c49c22580a33b983278704d3c1372a65a4c..35c69099b019fd6853a08c73eeab33513610df3e 100644 --- a/lib/gitlab/usage_data.rb +++ b/lib/gitlab/usage_data.rb @@ -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 diff --git a/locale/gitlab.pot b/locale/gitlab.pot index 06eb51252f3b11f0443cfb285a1be8708e1ffc95..739f705e39819cc8c5c4e89e2874ff6becf7cdf4 100644 --- a/locale/gitlab.pot +++ b/locale/gitlab.pot @@ -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 "" diff --git a/spec/features/markdown/metrics_spec.rb b/spec/features/markdown/metrics_spec.rb index 81c6b6195c657e1fb19a09ca5ad3660863f57d6e..6ef4f6ddecc1fc0f2697328e800ee44165dbb39b 100644 --- a/spec/features/markdown/metrics_spec.rb +++ b/spec/features/markdown/metrics_spec.rb @@ -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 diff --git a/spec/frontend/boards/issue_card_spec.js b/spec/frontend/boards/issue_card_spec.js index f78e4dad2c0321227bbb8908a7603633bf0ee654..09b5c664beea1f12044c01f288c573748e4e388d 100644 --- a/spec/frontend/boards/issue_card_spec.js +++ b/spec/frontend/boards/issue_card_spec.js @@ -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( diff --git a/spec/frontend/ide/utils_spec.js b/spec/frontend/ide/utils_spec.js index 9d7926a4d069fc209f8bc24423c73cdf53916b5d..44eae7eacbe1ef49162db29190d424825702286e 100644 --- a/spec/frontend/ide/utils_spec.js +++ b/spec/frontend/ide/utils_spec.js @@ -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, diff --git a/spec/frontend/monitoring/components/panel_type_spec.js b/spec/frontend/monitoring/components/panel_type_spec.js index dbbe3f55298cdd7e45ff9918158d90e1b276e7a2..058c201d325e501e2f6dc92b1d3631ca381f391d 100644 --- a/spec/frontend/monitoring/components/panel_type_spec.js +++ b/spec/frontend/monitoring/components/panel_type_spec.js @@ -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 } }; diff --git a/spec/javascripts/collapsed_sidebar_todo_spec.js b/spec/javascripts/collapsed_sidebar_todo_spec.js index f75d63c8f5711c94d23cbae4acba71e75aae5e89..f2eb08fa1981aa8a92f88dda84d844310dea8563 100644 --- a/spec/javascripts/collapsed_sidebar_todo_spec.js +++ b/spec/javascripts/collapsed_sidebar_todo_spec.js @@ -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]; diff --git a/spec/javascripts/dirty_submit/dirty_submit_form_spec.js b/spec/javascripts/dirty_submit/dirty_submit_form_spec.js index b1017e0c4f09fda84139fbb5055623940c78cd34..2907d0383909a6e70c76881b2e96c20a6eac6522 100644 --- a/spec/javascripts/dirty_submit/dirty_submit_form_spec.js +++ b/spec/javascripts/dirty_submit/dirty_submit_form_spec.js @@ -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}"/>`; }); diff --git a/spec/javascripts/labels_issue_sidebar_spec.js b/spec/javascripts/labels_issue_sidebar_spec.js index 9d05bdeee20e918817a18387ba52cf081d058dc8..94e833ec83b8bf1981fda8c13618f72f64284d22 100644 --- a/spec/javascripts/labels_issue_sidebar_spec.js +++ b/spec/javascripts/labels_issue_sidebar_spec.js @@ -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(); diff --git a/spec/javascripts/releases/components/app_index_spec.js b/spec/javascripts/releases/components/app_index_spec.js index 8809391f135d0ec1eef03ddcbd9daaa213430051..83b0652d59b6cb7e8003e889657e81e42911f00f 100644 --- a/spec/javascripts/releases/components/app_index_spec.js +++ b/spec/javascripts/releases/components/app_index_spec.js @@ -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`, })); diff --git a/spec/javascripts/smart_interval_spec.js b/spec/javascripts/smart_interval_spec.js index 0f579bb32cce4e28e5cbdbf957a9064679ce1768..0dc9ee9d79ae1e1abf5d28c86464e463a0a55abd 100644 --- a/spec/javascripts/smart_interval_spec.js +++ b/spec/javascripts/smart_interval_spec.js @@ -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); diff --git a/spec/lib/gitlab/background_migration/add_merge_request_diff_commits_count_spec.rb b/spec/lib/gitlab/background_migration/add_merge_request_diff_commits_count_spec.rb index e299e2a366f29be2efbbf664c7b29083242761fd..b77c67b120f1bbe85624ab5f73a4e20fcf5d9c5b 100644 --- a/spec/lib/gitlab/background_migration/add_merge_request_diff_commits_count_spec.rb +++ b/spec/lib/gitlab/background_migration/add_merge_request_diff_commits_count_spec.rb @@ -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) } diff --git a/spec/lib/gitlab/background_migration/archive_legacy_traces_spec.rb b/spec/lib/gitlab/background_migration/archive_legacy_traces_spec.rb index 2a7cffb2f3eb20b0626838932dc618f9997a75d1..5c8dcb385110f6ebb69144f0b96185577f7854fe 100644 --- a/spec/lib/gitlab/background_migration/archive_legacy_traces_spec.rb +++ b/spec/lib/gitlab/background_migration/archive_legacy_traces_spec.rb @@ -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) } diff --git a/spec/lib/gitlab/background_migration/backfill_hashed_project_repositories_spec.rb b/spec/lib/gitlab/background_migration/backfill_hashed_project_repositories_spec.rb index e802613490b62226dc31909b371255bd4b802b21..f64c3ccc058988dabf189c106ab9e3aafb677dbd 100644 --- a/spec/lib/gitlab/background_migration/backfill_hashed_project_repositories_spec.rb +++ b/spec/lib/gitlab/background_migration/backfill_hashed_project_repositories_spec.rb @@ -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 diff --git a/spec/lib/gitlab/background_migration/backfill_legacy_project_repositories_spec.rb b/spec/lib/gitlab/background_migration/backfill_legacy_project_repositories_spec.rb index 947c99b860f9e30839a256c6605d173a719e5865..806d044ab407bc95452130df9845eee6596c70e7 100644 --- a/spec/lib/gitlab/background_migration/backfill_legacy_project_repositories_spec.rb +++ b/spec/lib/gitlab/background_migration/backfill_legacy_project_repositories_spec.rb @@ -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 diff --git a/spec/lib/gitlab/background_migration/backfill_project_fullpath_in_repo_config_spec.rb b/spec/lib/gitlab/background_migration/backfill_project_fullpath_in_repo_config_spec.rb index 4714712f7338c3b86299c632a0bdce51112d1e7e..91ede05f3953170605027635762fa8106586d6c5 100644 --- a/spec/lib/gitlab/background_migration/backfill_project_fullpath_in_repo_config_spec.rb +++ b/spec/lib/gitlab/background_migration/backfill_project_fullpath_in_repo_config_spec.rb @@ -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') } diff --git a/spec/lib/gitlab/background_migration/backfill_project_repositories_spec.rb b/spec/lib/gitlab/background_migration/backfill_project_repositories_spec.rb index 510a00745546cd19184b31ca7b2da60aee209235..d601b0f064d3ece820bb70595f74ecdd583dd310 100644 --- a/spec/lib/gitlab/background_migration/backfill_project_repositories_spec.rb +++ b/spec/lib/gitlab/background_migration/backfill_project_repositories_spec.rb @@ -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 diff --git a/spec/lib/gitlab/background_migration/backfill_project_settings_spec.rb b/spec/lib/gitlab/background_migration/backfill_project_settings_spec.rb index 718109bb7202881dffa986c84e1a81e746eda8fc..a2b4e003d82426921188dfcc5a8e614317183372 100644 --- a/spec/lib/gitlab/background_migration/backfill_project_settings_spec.rb +++ b/spec/lib/gitlab/background_migration/backfill_project_settings_spec.rb @@ -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') } diff --git a/spec/lib/gitlab/background_migration/digest_column_spec.rb b/spec/lib/gitlab/background_migration/digest_column_spec.rb index a25dcb060054329918a298623bc62d25e52d0183..0c76ebe9c6635a1be672ceecf54e107ca2670ab8 100644 --- a/spec/lib/gitlab/background_migration/digest_column_spec.rb +++ b/spec/lib/gitlab/background_migration/digest_column_spec.rb @@ -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) } diff --git a/spec/lib/gitlab/background_migration/encrypt_columns_spec.rb b/spec/lib/gitlab/background_migration/encrypt_columns_spec.rb index 3c2ed6d3a6dd152d46a972b07df8bc3d7b4a458a..6d3ccde7df26683853123689c2edf910816e401c 100644 --- a/spec/lib/gitlab/background_migration/encrypt_columns_spec.rb +++ b/spec/lib/gitlab/background_migration/encrypt_columns_spec.rb @@ -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) } diff --git a/spec/lib/gitlab/background_migration/encrypt_runners_tokens_spec.rb b/spec/lib/gitlab/background_migration/encrypt_runners_tokens_spec.rb index 54af9807e7b53e2cd3d53b5c49a9d645fae60130..89262788d9ba9c331a4ee1a2ca784af1868c8f04 100644 --- a/spec/lib/gitlab/background_migration/encrypt_runners_tokens_spec.rb +++ b/spec/lib/gitlab/background_migration/encrypt_runners_tokens_spec.rb @@ -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) } diff --git a/spec/lib/gitlab/background_migration/fix_cross_project_label_links_spec.rb b/spec/lib/gitlab/background_migration/fix_cross_project_label_links_spec.rb index f3127cbf5df564078c03308a7a1a57aabc6fb88e..cc4ce023f049e140e90b23f16d79ffa62d6888a9 100644 --- a/spec/lib/gitlab/background_migration/fix_cross_project_label_links_spec.rb +++ b/spec/lib/gitlab/background_migration/fix_cross_project_label_links_spec.rb @@ -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) } diff --git a/spec/lib/gitlab/background_migration/fix_projects_without_project_feature_spec.rb b/spec/lib/gitlab/background_migration/fix_projects_without_project_feature_spec.rb index 0dca542cb9f0b7f9dc3a9b0c099261c758eacfe6..056ddd7adf926b7ce97294878512e2adf27717cc 100644 --- a/spec/lib/gitlab/background_migration/fix_projects_without_project_feature_spec.rb +++ b/spec/lib/gitlab/background_migration/fix_projects_without_project_feature_spec.rb @@ -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) } diff --git a/spec/lib/gitlab/background_migration/fix_promoted_epics_discussion_ids_spec.rb b/spec/lib/gitlab/background_migration/fix_promoted_epics_discussion_ids_spec.rb index 73c855ac1841f76de0c3f2641a4ff6462e21d332..141a0af6c29c131fa12b33abdba7d26125b44f0e 100644 --- a/spec/lib/gitlab/background_migration/fix_promoted_epics_discussion_ids_spec.rb +++ b/spec/lib/gitlab/background_migration/fix_promoted_epics_discussion_ids_spec.rb @@ -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) } diff --git a/spec/lib/gitlab/background_migration/fix_user_namespace_names_spec.rb b/spec/lib/gitlab/background_migration/fix_user_namespace_names_spec.rb index 5938ecca4593742e21c9266de37c1d57a198ca76..52760cdd11594bd803808718b2a680a2e80558a5 100644 --- a/spec/lib/gitlab/background_migration/fix_user_namespace_names_spec.rb +++ b/spec/lib/gitlab/background_migration/fix_user_namespace_names_spec.rb @@ -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') } diff --git a/spec/lib/gitlab/background_migration/fix_user_project_route_names_spec.rb b/spec/lib/gitlab/background_migration/fix_user_project_route_names_spec.rb index d1d6d8411d1b796683088ec27878cf10395955ee..0fb7eea2bd7a411eca8f767e904fcbf50be28967 100644 --- a/spec/lib/gitlab/background_migration/fix_user_project_route_names_spec.rb +++ b/spec/lib/gitlab/background_migration/fix_user_project_route_names_spec.rb @@ -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) } diff --git a/spec/lib/gitlab/background_migration/legacy_upload_mover_spec.rb b/spec/lib/gitlab/background_migration/legacy_upload_mover_spec.rb index f2de73d5aea9e66ec4174a991a70e699d4bbb194..558209cc05c94e7c5f35ee1e63f30cc1412e90dc 100644 --- a/spec/lib/gitlab/background_migration/legacy_upload_mover_spec.rb +++ b/spec/lib/gitlab/background_migration/legacy_upload_mover_spec.rb @@ -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' } diff --git a/spec/lib/gitlab/background_migration/legacy_uploads_migrator_spec.rb b/spec/lib/gitlab/background_migration/legacy_uploads_migrator_spec.rb index 85187d039c1ee6e64f0bf478181e234cabdac1f3..0c0ce3acf0e5b89df935854af2952b96471d04f5 100644 --- a/spec/lib/gitlab/background_migration/legacy_uploads_migrator_spec.rb +++ b/spec/lib/gitlab/background_migration/legacy_uploads_migrator_spec.rb @@ -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) } diff --git a/spec/lib/gitlab/background_migration/merge_request_assignees_migration_progress_check_spec.rb b/spec/lib/gitlab/background_migration/merge_request_assignees_migration_progress_check_spec.rb index eecd290e3cac82c1a5f3bb81ad765909afad9ea2..0d8fc3e7c532a387d046a4e5dc30a738d42cc2d4 100644 --- a/spec/lib/gitlab/background_migration/merge_request_assignees_migration_progress_check_spec.rb +++ b/spec/lib/gitlab/background_migration/merge_request_assignees_migration_progress_check_spec.rb @@ -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 diff --git a/spec/lib/gitlab/background_migration/migrate_build_stage_spec.rb b/spec/lib/gitlab/background_migration/migrate_build_stage_spec.rb index a496f8416bfa373c4cff2b4464532b0971394f9a..adf358f5320d0c6b4fe187bc275a11f4a7d3e342 100644 --- a/spec/lib/gitlab/background_migration/migrate_build_stage_spec.rb +++ b/spec/lib/gitlab/background_migration/migrate_build_stage_spec.rb @@ -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) } diff --git a/spec/lib/gitlab/background_migration/migrate_fingerprint_sha256_within_keys_spec.rb b/spec/lib/gitlab/background_migration/migrate_fingerprint_sha256_within_keys_spec.rb index 3ccb2379936e020de4b6faf516d14ea4af3112f9..79a8cd926a7032279bb976d2191b61f28dc853cf 100644 --- a/spec/lib/gitlab/background_migration/migrate_fingerprint_sha256_within_keys_spec.rb +++ b/spec/lib/gitlab/background_migration/migrate_fingerprint_sha256_within_keys_spec.rb @@ -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) } diff --git a/spec/lib/gitlab/background_migration/migrate_issue_trackers_sensitive_data_spec.rb b/spec/lib/gitlab/background_migration/migrate_issue_trackers_sensitive_data_spec.rb index 4c70877befee26ca287df9a50e336fdb716b351b..7dae28f72a552eb4fdfd0f034358152c0e8ed71d 100644 --- a/spec/lib/gitlab/background_migration/migrate_issue_trackers_sensitive_data_spec.rb +++ b/spec/lib/gitlab/background_migration/migrate_issue_trackers_sensitive_data_spec.rb @@ -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 diff --git a/spec/lib/gitlab/background_migration/migrate_legacy_artifacts_spec.rb b/spec/lib/gitlab/background_migration/migrate_legacy_artifacts_spec.rb index 268626d58fd8c6a81203ad8292dfde54c5b22355..5f2a27acd9ba81917ebf5882016cf21ec44c32f2 100644 --- a/spec/lib/gitlab/background_migration/migrate_legacy_artifacts_spec.rb +++ b/spec/lib/gitlab/background_migration/migrate_legacy_artifacts_spec.rb @@ -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) } diff --git a/spec/lib/gitlab/background_migration/migrate_null_private_profile_to_false_spec.rb b/spec/lib/gitlab/background_migration/migrate_null_private_profile_to_false_spec.rb index c45c64f6a233ce46c71fcbad286bcffdb9908941..ff88d2a5d000d4ff700abf5d71ccef446ead83ef 100644 --- a/spec/lib/gitlab/background_migration/migrate_null_private_profile_to_false_spec.rb +++ b/spec/lib/gitlab/background_migration/migrate_null_private_profile_to_false_spec.rb @@ -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 diff --git a/spec/lib/gitlab/background_migration/migrate_pages_metadata_spec.rb b/spec/lib/gitlab/background_migration/migrate_pages_metadata_spec.rb index d94a312f6057b1e514e85f6d7ff5c63721b01c59..10a1d4ee1b96114399afdd30837dd34367b389c7 100644 --- a/spec/lib/gitlab/background_migration/migrate_pages_metadata_spec.rb +++ b/spec/lib/gitlab/background_migration/migrate_pages_metadata_spec.rb @@ -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 } diff --git a/spec/lib/gitlab/background_migration/migrate_stage_index_spec.rb b/spec/lib/gitlab/background_migration/migrate_stage_index_spec.rb index 1a8b0355fd9237f40a180a7a1d395dab6c695607..437be125cf00a7c965e0909e9ae32c4b3701c2fa 100644 --- a/spec/lib/gitlab/background_migration/migrate_stage_index_spec.rb +++ b/spec/lib/gitlab/background_migration/migrate_stage_index_spec.rb @@ -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) } diff --git a/spec/lib/gitlab/background_migration/populate_cluster_kubernetes_namespace_table_spec.rb b/spec/lib/gitlab/background_migration/populate_cluster_kubernetes_namespace_table_spec.rb index 128e118ac1700a51b3629426cd4230f61062c148..d445858b8e8ba381e3a5b4b01affeff874f65698 100644 --- a/spec/lib/gitlab/background_migration/populate_cluster_kubernetes_namespace_table_spec.rb +++ b/spec/lib/gitlab/background_migration/populate_cluster_kubernetes_namespace_table_spec.rb @@ -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 } diff --git a/spec/lib/gitlab/background_migration/populate_merge_request_assignees_table_spec.rb b/spec/lib/gitlab/background_migration/populate_merge_request_assignees_table_spec.rb index c1f6871a5682303cbae0305b687cfa97e1b1e77d..e65b3549de03bb44b83d41a978978e659b1e3b03 100644 --- a/spec/lib/gitlab/background_migration/populate_merge_request_assignees_table_spec.rb +++ b/spec/lib/gitlab/background_migration/populate_merge_request_assignees_table_spec.rb @@ -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) } diff --git a/spec/lib/gitlab/background_migration/populate_untracked_uploads_dependencies/untracked_file_spec.rb b/spec/lib/gitlab/background_migration/populate_untracked_uploads_dependencies/untracked_file_spec.rb index ea1eaa6417dc7aa556ad5bd83a57b962cf000355..0250ebd7759feac0aaf84d19174c1134bb26ab43 100644 --- a/spec/lib/gitlab/background_migration/populate_untracked_uploads_dependencies/untracked_file_spec.rb +++ b/spec/lib/gitlab/background_migration/populate_untracked_uploads_dependencies/untracked_file_spec.rb @@ -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) } diff --git a/spec/lib/gitlab/background_migration/populate_untracked_uploads_spec.rb b/spec/lib/gitlab/background_migration/populate_untracked_uploads_spec.rb index f25804c3ca2b0734e597ab8c06a50b4590f52f40..44cec112bfdf1bbc04fce700bdbe04c49eb23cc6 100644 --- a/spec/lib/gitlab/background_migration/populate_untracked_uploads_spec.rb +++ b/spec/lib/gitlab/background_migration/populate_untracked_uploads_spec.rb @@ -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 } diff --git a/spec/lib/gitlab/background_migration/prepare_untracked_uploads_spec.rb b/spec/lib/gitlab/background_migration/prepare_untracked_uploads_spec.rb index 9072431e8f63d6342d9a17e678ce1a1a03300d4e..2957d0bed1594b98bf9c4ba3bb0788c23db0c9ca 100644 --- a/spec/lib/gitlab/background_migration/prepare_untracked_uploads_spec.rb +++ b/spec/lib/gitlab/background_migration/prepare_untracked_uploads_spec.rb @@ -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) } diff --git a/spec/lib/gitlab/background_migration/recalculate_project_authorizations_spec.rb b/spec/lib/gitlab/background_migration/recalculate_project_authorizations_spec.rb index 1ef2c451aa210dbdd2061e954e6d4960bc32d01d..4699cc42b3834bf937f46d614c9bb85d3a03128b 100644 --- a/spec/lib/gitlab/background_migration/recalculate_project_authorizations_spec.rb +++ b/spec/lib/gitlab/background_migration/recalculate_project_authorizations_spec.rb @@ -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) } diff --git a/spec/lib/gitlab/background_migration/recalculate_project_authorizations_with_min_max_user_id_spec.rb b/spec/lib/gitlab/background_migration/recalculate_project_authorizations_with_min_max_user_id_spec.rb index 14ba57eecbf3ebfc1c616b02d8a22d46dfe76586..edb46efad7c108afadb44ae71e550c9c5833921d 100644 --- a/spec/lib/gitlab/background_migration/recalculate_project_authorizations_with_min_max_user_id_spec.rb +++ b/spec/lib/gitlab/background_migration/recalculate_project_authorizations_with_min_max_user_id_spec.rb @@ -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 } diff --git a/spec/lib/gitlab/background_migration/remove_restricted_todos_spec.rb b/spec/lib/gitlab/background_migration/remove_restricted_todos_spec.rb index dae754112dc1cede4e0545d2de31cbb40d4d68ed..3de24f577ab68c24bfdd56fa904b70e21f87246d 100644 --- a/spec/lib/gitlab/background_migration/remove_restricted_todos_spec.rb +++ b/spec/lib/gitlab/background_migration/remove_restricted_todos_spec.rb @@ -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) } diff --git a/spec/lib/gitlab/background_migration/reset_merge_status_spec.rb b/spec/lib/gitlab/background_migration/reset_merge_status_spec.rb index fd35ddc49a2c24a51aa3a6aa452415a545be3c2f..40340f89448d970ab6eaab65ce05935cc41ef648 100644 --- a/spec/lib/gitlab/background_migration/reset_merge_status_spec.rb +++ b/spec/lib/gitlab/background_migration/reset_merge_status_spec.rb @@ -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') } diff --git a/spec/lib/gitlab/background_migration/schedule_calculate_wiki_sizes_spec.rb b/spec/lib/gitlab/background_migration/schedule_calculate_wiki_sizes_spec.rb index cee9a3e88220c346fae7c28a3e07d856bc9a2acd..387e3343ede97d3ee41d8cfdd39024e37824f794 100644 --- a/spec/lib/gitlab/background_migration/schedule_calculate_wiki_sizes_spec.rb +++ b/spec/lib/gitlab/background_migration/schedule_calculate_wiki_sizes_spec.rb @@ -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 } diff --git a/spec/lib/gitlab/background_migration/set_confidential_note_events_on_services_spec.rb b/spec/lib/gitlab/background_migration/set_confidential_note_events_on_services_spec.rb index 3600755ada77c5c3edacec7a5a214e40607d6bbd..5ce4a322e51717398bec31759dc73ba900de24d1 100644 --- a/spec/lib/gitlab/background_migration/set_confidential_note_events_on_services_spec.rb +++ b/spec/lib/gitlab/background_migration/set_confidential_note_events_on_services_spec.rb @@ -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 diff --git a/spec/lib/gitlab/background_migration/set_confidential_note_events_on_webhooks_spec.rb b/spec/lib/gitlab/background_migration/set_confidential_note_events_on_webhooks_spec.rb index 5cd9c02fd3f61bef273e45985214997cc8438fe7..08f1f543f5de35ea5c1b0ebc6b8c53361abc6a15 100644 --- a/spec/lib/gitlab/background_migration/set_confidential_note_events_on_webhooks_spec.rb +++ b/spec/lib/gitlab/background_migration/set_confidential_note_events_on_webhooks_spec.rb @@ -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 diff --git a/spec/lib/gitlab/background_migration/update_existing_subgroup_to_match_visibility_level_of_parent_spec.rb b/spec/lib/gitlab/background_migration/update_existing_subgroup_to_match_visibility_level_of_parent_spec.rb index 37280110b91a5925fe21be24959001e0d2cba69e..70397ae1e3054d24807da595b547934d4a4034b8 100644 --- a/spec/lib/gitlab/background_migration/update_existing_subgroup_to_match_visibility_level_of_parent_spec.rb +++ b/spec/lib/gitlab/background_migration/update_existing_subgroup_to_match_visibility_level_of_parent_spec.rb @@ -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 diff --git a/spec/lib/gitlab/background_migration_spec.rb b/spec/lib/gitlab/background_migration_spec.rb index 71959f54b3820ea566c67f001bb3f626bc4995eb..cff6a42d242e84d084b0cce3d0aae61cc5c7f64b 100644 --- a/spec/lib/gitlab/background_migration_spec.rb +++ b/spec/lib/gitlab/background_migration_spec.rb @@ -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) diff --git a/spec/migrations/20190924152703_migrate_issue_trackers_data_spec.rb b/spec/migrations/20190924152703_migrate_issue_trackers_data_spec.rb index a84cac0623b13ec9adaa42cf875c4f9fbbd75c13..dfa4cc21d6310852a385d77b559b76c36485dd4b 100644 --- a/spec/migrations/20190924152703_migrate_issue_trackers_data_spec.rb +++ b/spec/migrations/20190924152703_migrate_issue_trackers_data_spec.rb @@ -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 } diff --git a/spec/migrations/20191015154408_drop_merge_requests_require_code_owner_approval_from_projects_spec.rb b/spec/migrations/20191015154408_drop_merge_requests_require_code_owner_approval_from_projects_spec.rb index e90d56cfeefc7837a68d0b0ecaeca49817be1032..ac9ff5632ebcec476308340fa1215dfa2ee28567 100644 --- a/spec/migrations/20191015154408_drop_merge_requests_require_code_owner_approval_from_projects_spec.rb +++ b/spec/migrations/20191015154408_drop_merge_requests_require_code_owner_approval_from_projects_spec.rb @@ -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 } diff --git a/spec/migrations/20191125114345_add_admin_mode_protected_path_spec.rb b/spec/migrations/20191125114345_add_admin_mode_protected_path_spec.rb index 110da221393b5b9d86a01fc79aa0c915da25e878..669e31618a3ab339f80a360e264cf44daeeb2e2d 100644 --- a/spec/migrations/20191125114345_add_admin_mode_protected_path_spec.rb +++ b/spec/migrations/20191125114345_add_admin_mode_protected_path_spec.rb @@ -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 } diff --git a/spec/migrations/20191204114127_delete_legacy_triggers_spec.rb b/spec/migrations/20191204114127_delete_legacy_triggers_spec.rb index c2660d699ca4f0913d62d6fb12e5be1e46672eeb..58061d80f218f4f5d335cab3b3b97b66e2c4774e 100644 --- a/spec/migrations/20191204114127_delete_legacy_triggers_spec.rb +++ b/spec/migrations/20191204114127_delete_legacy_triggers_spec.rb @@ -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) } diff --git a/spec/migrations/20200107172020_add_timestamp_softwarelicensespolicy_spec.rb b/spec/migrations/20200107172020_add_timestamp_softwarelicensespolicy_spec.rb index b0d2aea7015ea504c34cd23f10a9aec4d9f06947..7a6b21d485bb02b79cb7f45fcfc897842eb4999a 100644 --- a/spec/migrations/20200107172020_add_timestamp_softwarelicensespolicy_spec.rb +++ b/spec/migrations/20200107172020_add_timestamp_softwarelicensespolicy_spec.rb @@ -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) } diff --git a/spec/migrations/20200122123016_backfill_project_settings_spec.rb b/spec/migrations/20200122123016_backfill_project_settings_spec.rb index fec18d6d52b8284b8b568c36c48acf08d49d5122..ce86e94b6d547ab52ab584875b419b051422be7a 100644 --- a/spec/migrations/20200122123016_backfill_project_settings_spec.rb +++ b/spec/migrations/20200122123016_backfill_project_settings_spec.rb @@ -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) } diff --git a/spec/migrations/20200123155929_remove_invalid_jira_data_spec.rb b/spec/migrations/20200123155929_remove_invalid_jira_data_spec.rb index 0e640623ea91a9cdf2b5ad16402670f13aef527b..253e39c1647550901a9fbdbf6e2c86305198f049 100644 --- a/spec/migrations/20200123155929_remove_invalid_jira_data_spec.rb +++ b/spec/migrations/20200123155929_remove_invalid_jira_data_spec.rb @@ -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) } diff --git a/spec/migrations/20200127090233_remove_invalid_issue_tracker_data_spec.rb b/spec/migrations/20200127090233_remove_invalid_issue_tracker_data_spec.rb index d1b1dfb1904b52f8a7c954580c32effff2f373fb..ca7cde080719caaa95bf74acac79fbe8bd8a577c 100644 --- a/spec/migrations/20200127090233_remove_invalid_issue_tracker_data_spec.rb +++ b/spec/migrations/20200127090233_remove_invalid_issue_tracker_data_spec.rb @@ -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) } diff --git a/spec/migrations/20200130145430_reschedule_migrate_issue_trackers_data_spec.rb b/spec/migrations/20200130145430_reschedule_migrate_issue_trackers_data_spec.rb index b51708dd5cde5d831ca7f6e22d8d49c71a46bf89..8e3e55f3e19ef68dac13f0d1ad37f50b2da93504 100644 --- a/spec/migrations/20200130145430_reschedule_migrate_issue_trackers_data_spec.rb +++ b/spec/migrations/20200130145430_reschedule_migrate_issue_trackers_data_spec.rb @@ -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 } diff --git a/spec/migrations/active_record/schedule_set_confidential_note_events_on_services_spec.rb b/spec/migrations/active_record/schedule_set_confidential_note_events_on_services_spec.rb index 4de43e21ed3fca03bc5e36a768b8091ce1d74724..e973454ecc83003b110020a2e71e7781f088d2e6 100644 --- a/spec/migrations/active_record/schedule_set_confidential_note_events_on_services_spec.rb +++ b/spec/migrations/active_record/schedule_set_confidential_note_events_on_services_spec.rb @@ -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 } diff --git a/spec/migrations/active_record/schema_spec.rb b/spec/migrations/active_record/schema_spec.rb index 617e31f359b163c102647184ccf4aca2dfb51376..086d6317c320cafc784500eecbf42545052a1795 100644 --- a/spec/migrations/active_record/schema_spec.rb +++ b/spec/migrations/active_record/schema_spec.rb @@ -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, '*') } diff --git a/spec/migrations/add_default_and_free_plans_spec.rb b/spec/migrations/add_default_and_free_plans_spec.rb index ae40b5b10c2c1fa327f35c954c77601d66c14873..dffdeb8e71a465ac5660ad49c9ce462671e51f0f 100644 --- a/spec/migrations/add_default_and_free_plans_spec.rb +++ b/spec/migrations/add_default_and_free_plans_spec.rb @@ -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) } diff --git a/spec/migrations/add_deploy_token_type_to_deploy_tokens_spec.rb b/spec/migrations/add_deploy_token_type_to_deploy_tokens_spec.rb index fb8213a6bd6fb7ed593713b37d736f509d292a09..3bc3d3f8ee2fdd7b60da85725111bac2224a16fc 100644 --- a/spec/migrations/add_deploy_token_type_to_deploy_tokens_spec.rb +++ b/spec/migrations/add_deploy_token_type_to_deploy_tokens_spec.rb @@ -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', diff --git a/spec/migrations/add_foreign_key_from_notification_settings_to_users_spec.rb b/spec/migrations/add_foreign_key_from_notification_settings_to_users_spec.rb index 656d4f75e3b480ba02d461317f45edcfb524aa01..ceca38b148e683fb84ad9f65de13732b44309172 100644 --- a/spec/migrations/add_foreign_key_from_notification_settings_to_users_spec.rb +++ b/spec/migrations/add_foreign_key_from_notification_settings_to_users_spec.rb @@ -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) } diff --git a/spec/migrations/add_foreign_keys_to_todos_spec.rb b/spec/migrations/add_foreign_keys_to_todos_spec.rb index 9932113a003864e1bfb9f717793fb22da03bfb8b..49fb3c1a91116a8950a07fcdd5b9909de39f3f93 100644 --- a/spec/migrations/add_foreign_keys_to_todos_spec.rb +++ b/spec/migrations/add_foreign_keys_to_todos_spec.rb @@ -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) } diff --git a/spec/migrations/add_not_null_constraint_to_project_mirror_data_foreign_key_spec.rb b/spec/migrations/add_not_null_constraint_to_project_mirror_data_foreign_key_spec.rb index 24ae939afa799825744027d21e864f6691d00de6..03f65aba7c05e627389a7a7cdcf0962080047324 100644 --- a/spec/migrations/add_not_null_constraint_to_project_mirror_data_foreign_key_spec.rb +++ b/spec/migrations/add_not_null_constraint_to_project_mirror_data_foreign_key_spec.rb @@ -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) } diff --git a/spec/migrations/add_pages_access_level_to_project_feature_spec.rb b/spec/migrations/add_pages_access_level_to_project_feature_spec.rb index a5e2bf2de711c7235b11d739cbab66bf3f590aa1..69f1e3ba3d038502139a75f9f8d0e151945b3dcb 100644 --- a/spec/migrations/add_pages_access_level_to_project_feature_spec.rb +++ b/spec/migrations/add_pages_access_level_to_project_feature_spec.rb @@ -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) } diff --git a/spec/migrations/add_pipeline_build_foreign_key_spec.rb b/spec/migrations/add_pipeline_build_foreign_key_spec.rb index bb40ead9b93eb6cee720d73c7cb8025dddf7827a..dd0189b6bfc411641bd4b0541490c7e745aea860 100644 --- a/spec/migrations/add_pipeline_build_foreign_key_spec.rb +++ b/spec/migrations/add_pipeline_build_foreign_key_spec.rb @@ -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) } diff --git a/spec/migrations/add_temporary_partial_index_on_project_id_to_services_spec.rb b/spec/migrations/add_temporary_partial_index_on_project_id_to_services_spec.rb index 2d12fec5cb3232890290a1e0dca80c5221a4088d..ce790b0266ca01fee79ec71ce5f4c3e0bbcdbf67 100644 --- a/spec/migrations/add_temporary_partial_index_on_project_id_to_services_spec.rb +++ b/spec/migrations/add_temporary_partial_index_on_project_id_to_services_spec.rb @@ -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 diff --git a/spec/migrations/add_unique_constraint_to_approvals_user_id_and_merge_request_id_spec.rb b/spec/migrations/add_unique_constraint_to_approvals_user_id_and_merge_request_id_spec.rb index cad10ba30ef43055dee717db39d5a136f2bf547c..74830ab4ce215552f676ab157bd7b49284ef9144 100644 --- a/spec/migrations/add_unique_constraint_to_approvals_user_id_and_merge_request_id_spec.rb +++ b/spec/migrations/add_unique_constraint_to_approvals_user_id_and_merge_request_id_spec.rb @@ -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) } diff --git a/spec/migrations/add_unique_constraint_to_project_features_project_id_spec.rb b/spec/migrations/add_unique_constraint_to_project_features_project_id_spec.rb index 8b128ff5ab89723855139cf7933a51f6da6bcae6..91abf0f7d1cffb9696835f387811806047f50a2d 100644 --- a/spec/migrations/add_unique_constraint_to_project_features_project_id_spec.rb +++ b/spec/migrations/add_unique_constraint_to_project_features_project_id_spec.rb @@ -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) } diff --git a/spec/migrations/assure_commits_count_for_merge_request_diff_spec.rb b/spec/migrations/assure_commits_count_for_merge_request_diff_spec.rb index 17342dcaab3fbea3a8c989b3973f19fb19a8e8e0..e9ef6bf3e2da5b3d56fb65d95b31046ffeac1cfc 100644 --- a/spec/migrations/assure_commits_count_for_merge_request_diff_spec.rb +++ b/spec/migrations/assure_commits_count_for_merge_request_diff_spec.rb @@ -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 diff --git a/spec/migrations/backfill_and_add_not_null_constraint_to_released_at_column_on_releases_table_spec.rb b/spec/migrations/backfill_and_add_not_null_constraint_to_released_at_column_on_releases_table_spec.rb index 9cae1daacea9014c1c23726c312aad4a784d5b45..8fceba276cec5503e27b15d9317cfd45121a2da7 100644 --- a/spec/migrations/backfill_and_add_not_null_constraint_to_released_at_column_on_releases_table_spec.rb +++ b/spec/migrations/backfill_and_add_not_null_constraint_to_released_at_column_on_releases_table_spec.rb @@ -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) } diff --git a/spec/migrations/backfill_operations_feature_flags_active_spec.rb b/spec/migrations/backfill_operations_feature_flags_active_spec.rb index ad69b776052cdf2e4c423e5c2c1eb0350fd8a496..c51ed9fea8c53945a1329c31f6921c74b5a551f8 100644 --- a/spec/migrations/backfill_operations_feature_flags_active_spec.rb +++ b/spec/migrations/backfill_operations_feature_flags_active_spec.rb @@ -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) } diff --git a/spec/migrations/backfill_operations_feature_flags_iid_spec.rb b/spec/migrations/backfill_operations_feature_flags_iid_spec.rb index f7a223e794a413aab3116f6b019a56f79d12652b..4628780787cd912143037a27239c68df73417aab 100644 --- a/spec/migrations/backfill_operations_feature_flags_iid_spec.rb +++ b/spec/migrations/backfill_operations_feature_flags_iid_spec.rb @@ -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) } diff --git a/spec/migrations/backfill_releases_name_with_tag_name_spec.rb b/spec/migrations/backfill_releases_name_with_tag_name_spec.rb index 6f436de84b786cdaf26d62a3e309a565494498ca..b38b8dff3fa2b72a37d3672c7761f7fe841dceab 100644 --- a/spec/migrations/backfill_releases_name_with_tag_name_spec.rb +++ b/spec/migrations/backfill_releases_name_with_tag_name_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require Rails.root.join('db', 'migrate', '20181212104941_backfill_releases_name_with_tag_name.rb') -describe BackfillReleasesNameWithTagName, :migration do +describe BackfillReleasesNameWithTagName do let(:releases) { table(:releases) } let(:namespaces) { table(:namespaces) } let(:projects) { table(:projects) } diff --git a/spec/migrations/backfill_releases_table_updated_at_and_add_not_null_constraints_to_timestamps_spec.rb b/spec/migrations/backfill_releases_table_updated_at_and_add_not_null_constraints_to_timestamps_spec.rb index 3ca7af8ea37c2db95cafa1980a5eb8712bc08221..bf9a8154e1e247a33d826fe1caf2d442870a64a7 100644 --- a/spec/migrations/backfill_releases_table_updated_at_and_add_not_null_constraints_to_timestamps_spec.rb +++ b/spec/migrations/backfill_releases_table_updated_at_and_add_not_null_constraints_to_timestamps_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require Rails.root.join('db', 'migrate', '20190920194925_backfill_releases_table_updated_at_and_add_not_null_constraints_to_timestamps.rb') -describe BackfillReleasesTableUpdatedAtAndAddNotNullConstraintsToTimestamps, :migration do +describe BackfillReleasesTableUpdatedAtAndAddNotNullConstraintsToTimestamps do let(:releases) { table(:releases) } let(:namespaces) { table(:namespaces) } let(:projects) { table(:projects) } diff --git a/spec/migrations/backfill_store_project_full_path_in_repo_spec.rb b/spec/migrations/backfill_store_project_full_path_in_repo_spec.rb index 913b4d3f1140bb8ac153bbd24fc9626925f6256f..a2adde37f11572052b756fb069085b366e60a9b3 100644 --- a/spec/migrations/backfill_store_project_full_path_in_repo_spec.rb +++ b/spec/migrations/backfill_store_project_full_path_in_repo_spec.rb @@ -4,7 +4,7 @@ require 'spec_helper' require Rails.root.join('db', 'post_migrate', '20181010133639_backfill_store_project_full_path_in_repo.rb') -describe BackfillStoreProjectFullPathInRepo, :migration do +describe BackfillStoreProjectFullPathInRepo do let(:namespaces) { table(:namespaces) } let(:projects) { table(:projects) } let(:group) { namespaces.create!(name: 'foo', path: 'foo') } diff --git a/spec/migrations/backport_enterprise_schema_spec.rb b/spec/migrations/backport_enterprise_schema_spec.rb index 8d2d9d4953a6816fd69f019f6ba6d140d615ac57..c167301e1e3e9e54641110ead3332b5825c468f7 100644 --- a/spec/migrations/backport_enterprise_schema_spec.rb +++ b/spec/migrations/backport_enterprise_schema_spec.rb @@ -4,7 +4,7 @@ require 'spec_helper' require Rails.root.join('db', 'migrate', '20190402150158_backport_enterprise_schema.rb') -describe BackportEnterpriseSchema, :migration, schema: 20190329085614 do +describe BackportEnterpriseSchema, schema: 20190329085614 do include MigrationsHelpers def drop_if_exists(table) diff --git a/spec/migrations/change_default_value_for_dsa_key_restriction_spec.rb b/spec/migrations/change_default_value_for_dsa_key_restriction_spec.rb index 699708ad1d468f83a4b5ee3ebb2e7a32467943d1..448f1e2106e6249bf8ea2415fbe4b90fa8074415 100644 --- a/spec/migrations/change_default_value_for_dsa_key_restriction_spec.rb +++ b/spec/migrations/change_default_value_for_dsa_key_restriction_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require Rails.root.join('db', 'migrate', '20180531220618_change_default_value_for_dsa_key_restriction.rb') -describe ChangeDefaultValueForDsaKeyRestriction, :migration do +describe ChangeDefaultValueForDsaKeyRestriction do let(:application_settings) { table(:application_settings) } before do diff --git a/spec/migrations/change_outbound_local_requests_whitelist_default_spec.rb b/spec/migrations/change_outbound_local_requests_whitelist_default_spec.rb index 232f6f090c301995ec419f82cea85d0abd31935c..dd45cac4a70de2be448f5a3eb0bbc54440da5c0c 100644 --- a/spec/migrations/change_outbound_local_requests_whitelist_default_spec.rb +++ b/spec/migrations/change_outbound_local_requests_whitelist_default_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require Rails.root.join('db', 'migrate', '20190725012225_change_outbound_local_requests_whitelist_default.rb') -describe ChangeOutboundLocalRequestsWhitelistDefault, :migration do +describe ChangeOutboundLocalRequestsWhitelistDefault do let(:application_settings) { table(:application_settings) } it 'defaults to empty array' do diff --git a/spec/migrations/change_packages_size_defaults_in_project_statistics_spec.rb b/spec/migrations/change_packages_size_defaults_in_project_statistics_spec.rb index 93e7e9304b14646f4acaa0d81278fda03d0af024..c36506643de567be05597295a25f5e252de999cc 100644 --- a/spec/migrations/change_packages_size_defaults_in_project_statistics_spec.rb +++ b/spec/migrations/change_packages_size_defaults_in_project_statistics_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require Rails.root.join('db', 'migrate', '20190516155724_change_packages_size_defaults_in_project_statistics.rb') -describe ChangePackagesSizeDefaultsInProjectStatistics, :migration do +describe ChangePackagesSizeDefaultsInProjectStatistics do let(:project_statistics) { table(:project_statistics) } let(:projects) { table(:projects) } diff --git a/spec/migrations/clean_grafana_url_spec.rb b/spec/migrations/clean_grafana_url_spec.rb index 9f060fbaf7d8aca1513b3056dddc6174ab033991..f6ea88a6f8d5192c4a7d9c72acaf2f8d92af3410 100644 --- a/spec/migrations/clean_grafana_url_spec.rb +++ b/spec/migrations/clean_grafana_url_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require Rails.root.join('db', 'migrate', '20200214085940_clean_grafana_url.rb') -describe CleanGrafanaUrl, :migration do +describe CleanGrafanaUrl do let(:application_settings_table) { table(:application_settings) } [ diff --git a/spec/migrations/clean_up_noteable_id_for_notes_on_commits_spec.rb b/spec/migrations/clean_up_noteable_id_for_notes_on_commits_spec.rb index 572b7dfd0c812bc04264f417e22f7bc2f077f34e..602e1c1fe937e406efe4acfe3506b76fc2e3b40c 100644 --- a/spec/migrations/clean_up_noteable_id_for_notes_on_commits_spec.rb +++ b/spec/migrations/clean_up_noteable_id_for_notes_on_commits_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require Rails.root.join('db', 'post_migrate', '20190313092516_clean_up_noteable_id_for_notes_on_commits.rb') -describe CleanUpNoteableIdForNotesOnCommits, :migration do +describe CleanUpNoteableIdForNotesOnCommits do let(:notes) { table(:notes) } before do diff --git a/spec/migrations/cleanup_build_stage_migration_spec.rb b/spec/migrations/cleanup_build_stage_migration_spec.rb index 2142b7b52755949e7040c754fa2b129cfda9aa97..961e719e2fc45df11165dbd24fb2b31c0a5b2e5f 100644 --- a/spec/migrations/cleanup_build_stage_migration_spec.rb +++ b/spec/migrations/cleanup_build_stage_migration_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require Rails.root.join('db', 'migrate', '20180420010616_cleanup_build_stage_migration.rb') -describe CleanupBuildStageMigration, :migration, :redis do +describe CleanupBuildStageMigration, :redis do let(:migration) { spy('migration') } before do diff --git a/spec/migrations/cleanup_environments_external_url_spec.rb b/spec/migrations/cleanup_environments_external_url_spec.rb index bc20f936593c4cef776d0c396fc8518e1942deee..54fcb8c62cdd80d88b1b4cb11fc89b22ac0102df 100644 --- a/spec/migrations/cleanup_environments_external_url_spec.rb +++ b/spec/migrations/cleanup_environments_external_url_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require Rails.root.join('db', 'migrate', '20181108091549_cleanup_environments_external_url.rb') -describe CleanupEnvironmentsExternalUrl, :migration do +describe CleanupEnvironmentsExternalUrl do let(:environments) { table(:environments) } let(:invalid_entries) { environments.where(environments.arel_table[:external_url].matches('javascript://%')) } let(:namespaces) { table(:namespaces) } diff --git a/spec/migrations/cleanup_legacy_artifact_migration_spec.rb b/spec/migrations/cleanup_legacy_artifact_migration_spec.rb index 0ab7d7ec05f025f7895480d57f18b3af0d22c2b8..29a5c34373cc36629d213fdaa0d1a4398e369609 100644 --- a/spec/migrations/cleanup_legacy_artifact_migration_spec.rb +++ b/spec/migrations/cleanup_legacy_artifact_migration_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require Rails.root.join('db', 'migrate', '20190104182041_cleanup_legacy_artifact_migration.rb') -describe CleanupLegacyArtifactMigration, :migration, :redis do +describe CleanupLegacyArtifactMigration, :redis do let(:migration) { spy('migration') } context 'when still legacy artifacts exist' do diff --git a/spec/migrations/cleanup_optimistic_locking_nulls_spec.rb b/spec/migrations/cleanup_optimistic_locking_nulls_spec.rb index bec8435b2f07da527ff3e8317276e502eb22a0ad..d32a374b9145e74245d289877d5ef0d0dd93a399 100644 --- a/spec/migrations/cleanup_optimistic_locking_nulls_spec.rb +++ b/spec/migrations/cleanup_optimistic_locking_nulls_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require Rails.root.join('db', 'post_migrate', '20200128210353_cleanup_optimistic_locking_nulls') -describe CleanupOptimisticLockingNulls, :migration do +describe CleanupOptimisticLockingNulls do TABLES = %w(epics merge_requests issues).freeze TABLES.each do |table| let(table.to_sym) { table(table.to_sym) } diff --git a/spec/migrations/cleanup_stages_position_migration_spec.rb b/spec/migrations/cleanup_stages_position_migration_spec.rb index c207762991995d7d3cc0bb700da0ec04813cb0a0..62b9c4e84e38f77de6bc22a17723cd049f69d06a 100644 --- a/spec/migrations/cleanup_stages_position_migration_spec.rb +++ b/spec/migrations/cleanup_stages_position_migration_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require Rails.root.join('db', 'post_migrate', '20180604123514_cleanup_stages_position_migration.rb') -describe CleanupStagesPositionMigration, :migration, :redis do +describe CleanupStagesPositionMigration, :redis do let(:migration) { spy('migration') } before do diff --git a/spec/migrations/create_environment_for_self_monitoring_project_spec.rb b/spec/migrations/create_environment_for_self_monitoring_project_spec.rb index ba1081c50067efb575d612d226fac699210269a9..aee0651dee09ea8ff342ffb0895643182c56f5d4 100644 --- a/spec/migrations/create_environment_for_self_monitoring_project_spec.rb +++ b/spec/migrations/create_environment_for_self_monitoring_project_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require Rails.root.join('db', 'post_migrate', '20200214214934_create_environment_for_self_monitoring_project') -describe CreateEnvironmentForSelfMonitoringProject, :migration do +describe CreateEnvironmentForSelfMonitoringProject do let(:application_settings_table) { table(:application_settings) } let(:environments) { table(:environments) } diff --git a/spec/migrations/create_missing_namespace_for_internal_users_spec.rb b/spec/migrations/create_missing_namespace_for_internal_users_spec.rb index 5df08a74e56ca9bfb8daddc4c8a9f7268d830311..0872f23c02ef0bcd285b99f920e85bffb42cd591 100644 --- a/spec/migrations/create_missing_namespace_for_internal_users_spec.rb +++ b/spec/migrations/create_missing_namespace_for_internal_users_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require Rails.root.join('db', 'migrate', '20180413022611_create_missing_namespace_for_internal_users.rb') -describe CreateMissingNamespaceForInternalUsers, :migration do +describe CreateMissingNamespaceForInternalUsers do let(:users) { table(:users) } let(:namespaces) { table(:namespaces) } let(:routes) { table(:routes) } diff --git a/spec/migrations/delete_internal_ids_where_feature_flags_usage_spec.rb b/spec/migrations/delete_internal_ids_where_feature_flags_usage_spec.rb index b9c6b489aca3fe1639c7497b5974f399e7c3d298..6eecd0870ed97ca8ceec1ee682eb5b686a19a13f 100644 --- a/spec/migrations/delete_internal_ids_where_feature_flags_usage_spec.rb +++ b/spec/migrations/delete_internal_ids_where_feature_flags_usage_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require Rails.root.join('db', 'post_migrate', '20200117194900_delete_internal_ids_where_feature_flags_usage') -describe DeleteInternalIdsWhereFeatureFlagsUsage, :migration do +describe DeleteInternalIdsWhereFeatureFlagsUsage do let(:namespaces) { table(:namespaces) } let(:projects) { table(:projects) } let(:internal_ids) { table(:internal_ids) } diff --git a/spec/migrations/delete_template_services_duplicated_by_type_spec.rb b/spec/migrations/delete_template_services_duplicated_by_type_spec.rb index 80645b1f1626ca6cc8b1f28da2f34c664570e3b1..64da0664e2cc829766e12690caa64161d32932f1 100644 --- a/spec/migrations/delete_template_services_duplicated_by_type_spec.rb +++ b/spec/migrations/delete_template_services_duplicated_by_type_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require Rails.root.join('db', 'migrate', '20200304160801_delete_template_services_duplicated_by_type.rb') -describe DeleteTemplateServicesDuplicatedByType, :migration do +describe DeleteTemplateServicesDuplicatedByType do let(:services) { table(:services) } before do diff --git a/spec/migrations/drop_activate_prometheus_services_background_jobs_spec.rb b/spec/migrations/drop_activate_prometheus_services_background_jobs_spec.rb index 0e9a3418e29a48c125e58a7143d529b7deb67d5e..a02a0819a7b742edacd2fe3c270eac981b72e9cf 100644 --- a/spec/migrations/drop_activate_prometheus_services_background_jobs_spec.rb +++ b/spec/migrations/drop_activate_prometheus_services_background_jobs_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require Rails.root.join('db', 'migrate', '20200221144534_drop_activate_prometheus_services_background_jobs.rb') -describe DropActivatePrometheusServicesBackgroundJobs, :sidekiq, :redis, :migration, schema: 2020_02_21_144534 do +describe DropActivatePrometheusServicesBackgroundJobs, :sidekiq, :redis, schema: 2020_02_21_144534 do subject(:migration) { described_class.new } describe '#up' do diff --git a/spec/migrations/drop_background_migration_jobs_spec.rb b/spec/migrations/drop_background_migration_jobs_spec.rb index ac76e897f6c491b50260483a033ee51c9b930fe6..d9e0561f32615adc2cb4b63184929efeb6c85e0a 100644 --- a/spec/migrations/drop_background_migration_jobs_spec.rb +++ b/spec/migrations/drop_background_migration_jobs_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require Rails.root.join('db', 'migrate', '20200116051619_drop_background_migration_jobs.rb') -describe DropBackgroundMigrationJobs, :sidekiq, :redis, :migration, schema: 2020_01_16_051619 do +describe DropBackgroundMigrationJobs, :sidekiq, :redis, schema: 2020_01_16_051619 do subject(:migration) { described_class.new } describe '#up' do diff --git a/spec/migrations/drop_duplicate_protected_tags_spec.rb b/spec/migrations/drop_duplicate_protected_tags_spec.rb index 7f0c7efbf6622beff15d4af1040070441ac8a442..7135a15484c75a893db91a50fe35b60a427f0744 100644 --- a/spec/migrations/drop_duplicate_protected_tags_spec.rb +++ b/spec/migrations/drop_duplicate_protected_tags_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require Rails.root.join('db', 'migrate', '20180711103851_drop_duplicate_protected_tags.rb') -describe DropDuplicateProtectedTags, :migration do +describe DropDuplicateProtectedTags do let(:namespaces) { table(:namespaces) } let(:projects) { table(:projects) } let(:protected_tags) { table(:protected_tags) } diff --git a/spec/migrations/drop_project_ci_cd_settings_merge_trains_enabled_spec.rb b/spec/migrations/drop_project_ci_cd_settings_merge_trains_enabled_spec.rb index 1b0e6e140ca3d8b901c859c596c5b279bd83df96..9166f6269220552e3817c7060f6d2722ee24e672 100644 --- a/spec/migrations/drop_project_ci_cd_settings_merge_trains_enabled_spec.rb +++ b/spec/migrations/drop_project_ci_cd_settings_merge_trains_enabled_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require Rails.root.join('db', 'post_migrate', '20191128162854_drop_project_ci_cd_settings_merge_trains_enabled.rb') -describe DropProjectCiCdSettingsMergeTrainsEnabled, :migration do +describe DropProjectCiCdSettingsMergeTrainsEnabled do let!(:project_ci_cd_setting) { table(:project_ci_cd_settings) } it 'correctly migrates up and down' do diff --git a/spec/migrations/encrypt_deploy_tokens_tokens_spec.rb b/spec/migrations/encrypt_deploy_tokens_tokens_spec.rb index a398e079731b719eac3b26b21514ac1d39471462..4d0a0b31571c4cfefce4d51edf1827452ee89be6 100644 --- a/spec/migrations/encrypt_deploy_tokens_tokens_spec.rb +++ b/spec/migrations/encrypt_deploy_tokens_tokens_spec.rb @@ -4,7 +4,7 @@ require 'spec_helper' require Rails.root.join('db', 'post_migrate', '20190711201818_encrypt_deploy_tokens_tokens.rb') -describe EncryptDeployTokensTokens, :migration do +describe EncryptDeployTokensTokens do let(:migration) { described_class.new } let(:deployment_tokens) { table(:deploy_tokens) } let(:plaintext) { "secret-token" } diff --git a/spec/migrations/encrypt_feature_flags_clients_tokens_spec.rb b/spec/migrations/encrypt_feature_flags_clients_tokens_spec.rb index 95b02d20594c8b08ea46231cd221632fac8b1e44..9b139c4b57b8290430d0c1b1c8f1d365e2b4f837 100644 --- a/spec/migrations/encrypt_feature_flags_clients_tokens_spec.rb +++ b/spec/migrations/encrypt_feature_flags_clients_tokens_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require Rails.root.join('db', 'post_migrate', '20190606175050_encrypt_feature_flags_clients_tokens.rb') -describe EncryptFeatureFlagsClientsTokens, :migration do +describe EncryptFeatureFlagsClientsTokens do let(:migration) { described_class.new } let(:feature_flags_clients) { table(:operations_feature_flags_clients) } let(:projects) { table(:projects) } diff --git a/spec/migrations/encrypt_plaintext_attributes_on_application_settings_spec.rb b/spec/migrations/encrypt_plaintext_attributes_on_application_settings_spec.rb index 122da7b3d72069e10988efcdaad1d7ba2cadc1bd..87a72ed0cf5036e6a966a96ab4d611eb20a8ef6b 100644 --- a/spec/migrations/encrypt_plaintext_attributes_on_application_settings_spec.rb +++ b/spec/migrations/encrypt_plaintext_attributes_on_application_settings_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require Rails.root.join('db', 'migrate', '20191120115530_encrypt_plaintext_attributes_on_application_settings.rb') -describe EncryptPlaintextAttributesOnApplicationSettings, :migration do +describe EncryptPlaintextAttributesOnApplicationSettings do let(:migration) { described_class.new } let(:application_settings) { table(:application_settings) } let(:plaintext) { 'secret-token' } diff --git a/spec/migrations/enqueue_reset_merge_status_second_run_spec.rb b/spec/migrations/enqueue_reset_merge_status_second_run_spec.rb index bdc248f2cf27e36435a5175acd06e3e52b4965bd..d4cf3d1575832028f0cd94dd066459baa72b9eff 100644 --- a/spec/migrations/enqueue_reset_merge_status_second_run_spec.rb +++ b/spec/migrations/enqueue_reset_merge_status_second_run_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require Rails.root.join('db', 'post_migrate', '20190620112608_enqueue_reset_merge_status_second_run.rb') -describe EnqueueResetMergeStatusSecondRun, :migration do +describe EnqueueResetMergeStatusSecondRun do let(:namespaces) { table(:namespaces) } let(:projects) { table(:projects) } let(:namespace) { namespaces.create(name: 'gitlab', path: 'gitlab-org') } diff --git a/spec/migrations/enqueue_reset_merge_status_spec.rb b/spec/migrations/enqueue_reset_merge_status_spec.rb index 4b312a3bc629b67ccdb102e6837dc66e1174ca59..9728ada14bafda1248b6242862190274397db388 100644 --- a/spec/migrations/enqueue_reset_merge_status_spec.rb +++ b/spec/migrations/enqueue_reset_merge_status_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require Rails.root.join('db', 'post_migrate', '20190528180441_enqueue_reset_merge_status.rb') -describe EnqueueResetMergeStatus, :migration do +describe EnqueueResetMergeStatus do let(:namespaces) { table(:namespaces) } let(:projects) { table(:projects) } let(:namespace) { namespaces.create(name: 'gitlab', path: 'gitlab-org') } diff --git a/spec/migrations/enqueue_verify_pages_domain_workers_spec.rb b/spec/migrations/enqueue_verify_pages_domain_workers_spec.rb index 8efaab871a12b7ed8735a25a2ace4749dc250695..ffb1c04a6c574df9d6f3c806d7d5be5e5062726e 100644 --- a/spec/migrations/enqueue_verify_pages_domain_workers_spec.rb +++ b/spec/migrations/enqueue_verify_pages_domain_workers_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require Rails.root.join('db', 'post_migrate', '20180216121030_enqueue_verify_pages_domain_workers') -describe EnqueueVerifyPagesDomainWorkers, :migration do +describe EnqueueVerifyPagesDomainWorkers do around do |example| Sidekiq::Testing.fake! do example.run diff --git a/spec/migrations/fill_empty_finished_at_in_deployments_spec.rb b/spec/migrations/fill_empty_finished_at_in_deployments_spec.rb index 50ecf083f27811e213b6b03b09aef2d459e00638..546a805dec8c518e8ea7305364c2d01e40e0d2a6 100644 --- a/spec/migrations/fill_empty_finished_at_in_deployments_spec.rb +++ b/spec/migrations/fill_empty_finished_at_in_deployments_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require Rails.root.join('db', 'post_migrate', '20181030135124_fill_empty_finished_at_in_deployments') -describe FillEmptyFinishedAtInDeployments, :migration do +describe FillEmptyFinishedAtInDeployments do let(:namespaces) { table(:namespaces) } let(:projects) { table(:projects) } let(:environments) { table(:environments) } diff --git a/spec/migrations/fill_file_store_spec.rb b/spec/migrations/fill_file_store_spec.rb index 806c928363475aba9360f73866541090b3288906..732fdc2a0bb3e90ac0f4fc3e69e82270093c21b3 100644 --- a/spec/migrations/fill_file_store_spec.rb +++ b/spec/migrations/fill_file_store_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require Rails.root.join('db', 'post_migrate', '20180424151928_fill_file_store') -describe FillFileStore, :migration do +describe FillFileStore do let(:namespaces) { table(:namespaces) } let(:projects) { table(:projects) } let(:builds) { table(:ci_builds) } diff --git a/spec/migrations/fill_productivity_analytics_start_date_spec.rb b/spec/migrations/fill_productivity_analytics_start_date_spec.rb index 7cbba9ef20e79b85f43678f317df2df6428d0fd2..4ae7b0eed2492e41d1b6dabf264dede233974129 100644 --- a/spec/migrations/fill_productivity_analytics_start_date_spec.rb +++ b/spec/migrations/fill_productivity_analytics_start_date_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require Rails.root.join('db', 'migrate', '20191004081520_fill_productivity_analytics_start_date.rb') -describe FillProductivityAnalyticsStartDate, :migration do +describe FillProductivityAnalyticsStartDate do let(:settings_table) { table('application_settings') } let(:metrics_table) { table('merge_request_metrics') } diff --git a/spec/migrations/fix_max_pages_size_spec.rb b/spec/migrations/fix_max_pages_size_spec.rb index 36b5445603edfe11a4bb370c4972cdcccd7e9fc6..9882cda7fba3faad861bb1f76ed8c46e9a006737 100644 --- a/spec/migrations/fix_max_pages_size_spec.rb +++ b/spec/migrations/fix_max_pages_size_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require Rails.root.join('db', 'migrate', '20191213120427_fix_max_pages_size.rb') -describe FixMaxPagesSize, :migration do +describe FixMaxPagesSize do let(:application_settings) { table(:application_settings) } let!(:default_setting) { application_settings.create! } let!(:max_possible_setting) { application_settings.create!(max_pages_size: described_class::MAX_SIZE) } diff --git a/spec/migrations/fix_null_type_labels_spec.rb b/spec/migrations/fix_null_type_labels_spec.rb index 462ae9b913f78bf183c4a31aa274b19f192731dc..b098141c5e96b0e07c9ab36370844124ac923e7b 100644 --- a/spec/migrations/fix_null_type_labels_spec.rb +++ b/spec/migrations/fix_null_type_labels_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require Rails.root.join('db', 'post_migrate', '20190131122559_fix_null_type_labels') -describe FixNullTypeLabels, :migration do +describe FixNullTypeLabels do let(:migration) { described_class.new } let(:projects) { table(:projects) } let(:namespaces) { table(:namespaces) } diff --git a/spec/migrations/fix_pool_repository_source_project_id_spec.rb b/spec/migrations/fix_pool_repository_source_project_id_spec.rb index 8ddee9bb575253b510e8e20ec08935bd00512501..5a878dba6e7d948ab899da49046b3f45ea9d951b 100644 --- a/spec/migrations/fix_pool_repository_source_project_id_spec.rb +++ b/spec/migrations/fix_pool_repository_source_project_id_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require Rails.root.join('db', 'migrate', '20190604184643_fix_pool_repository_source_project_id.rb') -describe FixPoolRepositorySourceProjectId, :migration do +describe FixPoolRepositorySourceProjectId do let(:projects) { table(:projects) } let(:pool_repositories) { table(:pool_repositories) } let(:shards) { table(:shards) } diff --git a/spec/migrations/fix_projects_without_project_feature_spec.rb b/spec/migrations/fix_projects_without_project_feature_spec.rb index 6e0345da078c0aafeba7ea68b3f3586e412f5484..0141326100863eb1354d9c2bfc6fb3a06008e61f 100644 --- a/spec/migrations/fix_projects_without_project_feature_spec.rb +++ b/spec/migrations/fix_projects_without_project_feature_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require Rails.root.join('db', 'post_migrate', '20200127111840_fix_projects_without_project_feature.rb') -describe FixProjectsWithoutProjectFeature, :migration do +describe FixProjectsWithoutProjectFeature do let(:namespace) { table(:namespaces).create(name: 'gitlab', path: 'gitlab-org') } let!(:projects) do diff --git a/spec/migrations/fix_wrong_pages_access_level_spec.rb b/spec/migrations/fix_wrong_pages_access_level_spec.rb index 73d8218b95c88f91d49a9df0d42bec859f7b6633..e0d09add740902a3de8e68792ef62ff985dfc345 100644 --- a/spec/migrations/fix_wrong_pages_access_level_spec.rb +++ b/spec/migrations/fix_wrong_pages_access_level_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require Rails.root.join('db', 'post_migrate', '20190703185326_fix_wrong_pages_access_level.rb') -describe FixWrongPagesAccessLevel, :migration, :sidekiq_might_not_need_inline, schema: 20190628185004 do +describe FixWrongPagesAccessLevel, :sidekiq_might_not_need_inline, schema: 20190628185004 do using RSpec::Parameterized::TableSyntax let(:migration_class) { described_class::MIGRATION } diff --git a/spec/migrations/generate_lets_encrypt_private_key_spec.rb b/spec/migrations/generate_lets_encrypt_private_key_spec.rb index 7746ba46446b9c9ea1f98fbffce8f5be0faf0e11..c0cb39fd5193f8e25124e5e3cdaa180f6d43039c 100644 --- a/spec/migrations/generate_lets_encrypt_private_key_spec.rb +++ b/spec/migrations/generate_lets_encrypt_private_key_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require Rails.root.join('db', 'migrate', '20190524062810_generate_lets_encrypt_private_key.rb') -describe GenerateLetsEncryptPrivateKey, :migration do +describe GenerateLetsEncryptPrivateKey do describe '#up' do it 'does not fail' do expect do diff --git a/spec/migrations/generate_missing_routes_spec.rb b/spec/migrations/generate_missing_routes_spec.rb index a4a25951ff068eec060ee34c46c549c53e41b20f..3ff220aa8d3699e3d62a41e901c7bc91ed1b3d83 100644 --- a/spec/migrations/generate_missing_routes_spec.rb +++ b/spec/migrations/generate_missing_routes_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require Rails.root.join('db', 'migrate', '20180702134423_generate_missing_routes.rb') -describe GenerateMissingRoutes, :migration do +describe GenerateMissingRoutes do describe '#up' do let(:namespaces) { table(:namespaces) } let(:projects) { table(:projects) } diff --git a/spec/migrations/import_common_metrics_spec.rb b/spec/migrations/import_common_metrics_spec.rb index 1001629007cdcc8c2d3444ad3c436bde11e9509f..8c28b46cb388ead9d77d5baea55b2279dfb3eac7 100644 --- a/spec/migrations/import_common_metrics_spec.rb +++ b/spec/migrations/import_common_metrics_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require Rails.root.join('db', 'migrate', '20180831164910_import_common_metrics.rb') -describe ImportCommonMetrics, :migration do +describe ImportCommonMetrics do describe '#up' do it "imports all prometheus metrics" do expect(PrometheusMetric.common).to be_empty diff --git a/spec/migrations/insert_project_hooks_plan_limits_spec.rb b/spec/migrations/insert_project_hooks_plan_limits_spec.rb index abc2ccd05075a9a4701460ddae5803648c703a2b..e4bdda4cf5e02d040cae5927cc9ed2daf7eae763 100644 --- a/spec/migrations/insert_project_hooks_plan_limits_spec.rb +++ b/spec/migrations/insert_project_hooks_plan_limits_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require Rails.root.join('db', 'migrate', '20191216183532_insert_project_hooks_plan_limits.rb') -describe InsertProjectHooksPlanLimits, :migration do +describe InsertProjectHooksPlanLimits do let(:migration) { described_class.new } let(:plans) { table(:plans) } let(:plan_limits) { table(:plan_limits) } diff --git a/spec/migrations/migrate_auto_dev_ops_domain_to_cluster_domain_spec.rb b/spec/migrations/migrate_auto_dev_ops_domain_to_cluster_domain_spec.rb index 349cffea70efba33cd35606c49c5aae942841d3f..9188c19f76abfda503203d7b1f8573aef4eeda04 100644 --- a/spec/migrations/migrate_auto_dev_ops_domain_to_cluster_domain_spec.rb +++ b/spec/migrations/migrate_auto_dev_ops_domain_to_cluster_domain_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require Rails.root.join('db', 'post_migrate', '20190204115450_migrate_auto_dev_ops_domain_to_cluster_domain.rb') -describe MigrateAutoDevOpsDomainToClusterDomain, :migration do +describe MigrateAutoDevOpsDomainToClusterDomain do include MigrationHelpers::ClusterHelpers let(:migration) { described_class.new } diff --git a/spec/migrations/migrate_code_owner_approval_status_to_protected_branches_in_batches_spec.rb b/spec/migrations/migrate_code_owner_approval_status_to_protected_branches_in_batches_spec.rb index 67ac40d4d3909bb7813759927aeeb9594ed6e618..cda965135b0e65be7b8e7dc723332715123a49a6 100644 --- a/spec/migrations/migrate_code_owner_approval_status_to_protected_branches_in_batches_spec.rb +++ b/spec/migrations/migrate_code_owner_approval_status_to_protected_branches_in_batches_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require Rails.root.join('db', 'post_migrate', '20190827102026_migrate_code_owner_approval_status_to_protected_branches_in_batches.rb') -describe MigrateCodeOwnerApprovalStatusToProtectedBranchesInBatches, :migration do +describe MigrateCodeOwnerApprovalStatusToProtectedBranchesInBatches do let(:namespaces) { table(:namespaces) } let(:projects) { table(:projects) } let(:protected_branches) { table(:protected_branches) } diff --git a/spec/migrations/migrate_discussion_id_on_promoted_epics_spec.rb b/spec/migrations/migrate_discussion_id_on_promoted_epics_spec.rb index deeea74bd3b11bf1d2c58fba47b8387e01ebfff2..0a8975402da5c9dd614ef352921700f7becedadb 100644 --- a/spec/migrations/migrate_discussion_id_on_promoted_epics_spec.rb +++ b/spec/migrations/migrate_discussion_id_on_promoted_epics_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require Rails.root.join('db', 'post_migrate', '20190715193142_migrate_discussion_id_on_promoted_epics.rb') -describe MigrateDiscussionIdOnPromotedEpics, :migration do +describe MigrateDiscussionIdOnPromotedEpics do let(:migration_class) { described_class::MIGRATION } let(:migration_name) { migration_class.to_s.demodulize } diff --git a/spec/migrations/migrate_forbidden_redirect_uris_spec.rb b/spec/migrations/migrate_forbidden_redirect_uris_spec.rb index 0bc13a3974a2b0fd85e597a34ee20de0b1577c7e..7c3cc9f07c8093794fd05d59e2a665fda1e5879d 100644 --- a/spec/migrations/migrate_forbidden_redirect_uris_spec.rb +++ b/spec/migrations/migrate_forbidden_redirect_uris_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require Rails.root.join('db', 'post_migrate', '20181026091631_migrate_forbidden_redirect_uris.rb') -describe MigrateForbiddenRedirectUris, :migration do +describe MigrateForbiddenRedirectUris do let(:oauth_application) { table(:oauth_applications) } let(:oauth_access_grant) { table(:oauth_access_grants) } diff --git a/spec/migrations/migrate_k8s_service_integration_spec.rb b/spec/migrations/migrate_k8s_service_integration_spec.rb index 4dd0c09632a3baf58165fef2bac51d9547de315b..660e958eb42f45f63644ae3b44915d020832c603 100644 --- a/spec/migrations/migrate_k8s_service_integration_spec.rb +++ b/spec/migrations/migrate_k8s_service_integration_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require Rails.root.join('db', 'post_migrate', '20190517153211_migrate_k8s_service_integration.rb') -describe MigrateK8sServiceIntegration, :migration do +describe MigrateK8sServiceIntegration do context 'template service' do context 'with namespace' do let!(:service) do diff --git a/spec/migrations/migrate_legacy_artifacts_to_job_artifacts_spec.rb b/spec/migrations/migrate_legacy_artifacts_to_job_artifacts_spec.rb index d6259023c019a8fbd90293f5e60544b85b42bbb7..5133afdf5b0596c5d5c669f25cdb4ca1a3a8d2bc 100644 --- a/spec/migrations/migrate_legacy_artifacts_to_job_artifacts_spec.rb +++ b/spec/migrations/migrate_legacy_artifacts_to_job_artifacts_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require Rails.root.join('db', 'post_migrate', '20180816161409_migrate_legacy_artifacts_to_job_artifacts.rb') -describe MigrateLegacyArtifactsToJobArtifacts, :migration do +describe MigrateLegacyArtifactsToJobArtifacts do let(:migration_class) { Gitlab::BackgroundMigration::MigrateLegacyArtifacts } let(:migration_name) { migration_class.to_s.demodulize } diff --git a/spec/migrations/migrate_legacy_managed_clusters_to_unmanaged_spec.rb b/spec/migrations/migrate_legacy_managed_clusters_to_unmanaged_spec.rb index 93426f1f2733fc5898abbdd16e8da3dfbc3deae4..e3462e1d6bd0b714b7ada8d2749271a46633157d 100644 --- a/spec/migrations/migrate_legacy_managed_clusters_to_unmanaged_spec.rb +++ b/spec/migrations/migrate_legacy_managed_clusters_to_unmanaged_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require Rails.root.join('db', 'post_migrate', '20190606163724_migrate_legacy_managed_clusters_to_unmanaged.rb') -describe MigrateLegacyManagedClustersToUnmanaged, :migration do +describe MigrateLegacyManagedClustersToUnmanaged do let(:cluster_type) { 'project_type' } let(:created_at) { 1.hour.ago } diff --git a/spec/migrations/migrate_managed_clusters_with_no_token_to_unmanaged_spec.rb b/spec/migrations/migrate_managed_clusters_with_no_token_to_unmanaged_spec.rb index b73bd16cb60ba02e1b2176cec1c44e0fae330fcc..2931fba3eb22fed3e26180faa126c3cb5f10374d 100644 --- a/spec/migrations/migrate_managed_clusters_with_no_token_to_unmanaged_spec.rb +++ b/spec/migrations/migrate_managed_clusters_with_no_token_to_unmanaged_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require Rails.root.join('db', 'post_migrate', '20190613231640_migrate_managed_clusters_with_no_token_to_unmanaged.rb') -describe MigrateManagedClustersWithNoTokenToUnmanaged, :migration do +describe MigrateManagedClustersWithNoTokenToUnmanaged do let(:cluster_type) { 'project_type' } let(:created_at) { Date.new(2018, 11, 1).midnight } diff --git a/spec/migrations/migrate_null_wiki_access_levels_spec.rb b/spec/migrations/migrate_null_wiki_access_levels_spec.rb index f99273072a2f03a9ff7857813c87f428a3436569..f4753f67e1783a767c25eef6c6af47f2bfe3b937 100644 --- a/spec/migrations/migrate_null_wiki_access_levels_spec.rb +++ b/spec/migrations/migrate_null_wiki_access_levels_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require Rails.root.join('db', 'post_migrate', '20180809195358_migrate_null_wiki_access_levels.rb') -describe MigrateNullWikiAccessLevels, :migration do +describe MigrateNullWikiAccessLevels do let(:namespaces) { table('namespaces') } let(:projects) { table(:projects) } let(:project_features) { table(:project_features) } diff --git a/spec/migrations/migrate_ops_feature_flags_scopes_target_user_ids_spec.rb b/spec/migrations/migrate_ops_feature_flags_scopes_target_user_ids_spec.rb index 5f865579c967a587831d58bbcba96e15ff9745f8..fc5d814a2de5f9aa5a76d13277bdbb282576e8b1 100644 --- a/spec/migrations/migrate_ops_feature_flags_scopes_target_user_ids_spec.rb +++ b/spec/migrations/migrate_ops_feature_flags_scopes_target_user_ids_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require Rails.root.join('db', 'post_migrate', '20191118211629_migrate_ops_feature_flags_scopes_target_user_ids.rb') -describe MigrateOpsFeatureFlagsScopesTargetUserIds, :migration do +describe MigrateOpsFeatureFlagsScopesTargetUserIds do let(:namespaces) { table(:namespaces) } let(:projects) { table(:projects) } let(:flags) { table(:operations_feature_flags) } diff --git a/spec/migrations/move_limits_from_plans_spec.rb b/spec/migrations/move_limits_from_plans_spec.rb index 693d6ecb2c108a7e7b7c0ab757c27e985b80c58c..aeb36100205593ddd78566d97b3cc6044333304d 100644 --- a/spec/migrations/move_limits_from_plans_spec.rb +++ b/spec/migrations/move_limits_from_plans_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require Rails.root.join('db', 'migrate', '20191030152934_move_limits_from_plans.rb') -describe MoveLimitsFromPlans, :migration do +describe MoveLimitsFromPlans do let(:plans) { table(:plans) } let(:plan_limits) { table(:plan_limits) } diff --git a/spec/migrations/nullify_users_role_spec.rb b/spec/migrations/nullify_users_role_spec.rb index ad25e4885efe77b08e74ccd13f51ac4e3dcbe138..487d84e2a35e1f6ac95eeaa8c2bde03d6c8b9b4d 100644 --- a/spec/migrations/nullify_users_role_spec.rb +++ b/spec/migrations/nullify_users_role_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require Rails.root.join('db', 'post_migrate', '20191104142124_nullify_users_role.rb') -describe NullifyUsersRole, :migration do +describe NullifyUsersRole do let(:users) { table(:users) } before do diff --git a/spec/migrations/populate_project_statistics_packages_size_spec.rb b/spec/migrations/populate_project_statistics_packages_size_spec.rb index 4ad91342f258f86137159aafb3506673c3cb4e81..c316a4bc8b7de8d9892df91cafe4c287a3fd41c1 100644 --- a/spec/migrations/populate_project_statistics_packages_size_spec.rb +++ b/spec/migrations/populate_project_statistics_packages_size_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require Rails.root.join('db', 'post_migrate', '20190418132125_populate_project_statistics_packages_size.rb') -describe PopulateProjectStatisticsPackagesSize, :migration do +describe PopulateProjectStatisticsPackagesSize do let(:project_statistics) { table(:project_statistics) } let(:namespaces) { table(:namespaces) } let(:projects) { table(:projects) } diff --git a/spec/migrations/populate_rule_type_on_approval_merge_request_rules_spec.rb b/spec/migrations/populate_rule_type_on_approval_merge_request_rules_spec.rb index 99dfb16517303e6881d02701dc9c577e331361c2..d63625280688af8bed0ff834a695906d48b4bd17 100644 --- a/spec/migrations/populate_rule_type_on_approval_merge_request_rules_spec.rb +++ b/spec/migrations/populate_rule_type_on_approval_merge_request_rules_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require Rails.root.join('db', 'post_migrate', '20190520201748_populate_rule_type_on_approval_merge_request_rules.rb') -describe PopulateRuleTypeOnApprovalMergeRequestRules, :migration do +describe PopulateRuleTypeOnApprovalMergeRequestRules do let(:migration) { described_class.new } describe '#up' do diff --git a/spec/migrations/remove_empty_extern_uid_auth0_identities_spec.rb b/spec/migrations/remove_empty_extern_uid_auth0_identities_spec.rb index ad1bcf3773230ae7cdc9f2767892949ae1e026a4..5be8706cacff34f3a0de8f38917703522c734d1e 100644 --- a/spec/migrations/remove_empty_extern_uid_auth0_identities_spec.rb +++ b/spec/migrations/remove_empty_extern_uid_auth0_identities_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require Rails.root.join('db', 'post_migrate', '20180220150310_remove_empty_extern_uid_auth0_identities.rb') -describe RemoveEmptyExternUidAuth0Identities, :migration do +describe RemoveEmptyExternUidAuth0Identities do let(:identities) { table(:identities) } before do diff --git a/spec/migrations/remove_empty_github_service_templates_spec.rb b/spec/migrations/remove_empty_github_service_templates_spec.rb index c128c8538dbf0ed118a68cdf377cc33329391357..51b29ec6efcfe9aacceb42ed6953acdffcebcbaf 100644 --- a/spec/migrations/remove_empty_github_service_templates_spec.rb +++ b/spec/migrations/remove_empty_github_service_templates_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require Rails.root.join('db', 'post_migrate', '20191021101942_remove_empty_github_service_templates.rb') -describe RemoveEmptyGithubServiceTemplates, :migration do +describe RemoveEmptyGithubServiceTemplates do subject(:migration) { described_class.new } let(:services) do diff --git a/spec/migrations/remove_packages_deprecated_dependencies_spec.rb b/spec/migrations/remove_packages_deprecated_dependencies_spec.rb index 0b7efe371a6586222043679f44ed836cfd577b44..2ba7a3b268b6f68fdcbfbcaae0d733299ace494b 100644 --- a/spec/migrations/remove_packages_deprecated_dependencies_spec.rb +++ b/spec/migrations/remove_packages_deprecated_dependencies_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require Rails.root.join('db', 'migrate', '20200210135504_remove_packages_deprecated_dependencies.rb') -describe RemovePackagesDeprecatedDependencies, :migration do +describe RemovePackagesDeprecatedDependencies do let(:projects) { table(:projects) } let(:packages) { table(:packages_packages) } let(:dependency_links) { table(:packages_dependency_links) } diff --git a/spec/migrations/remove_redundant_pipeline_stages_spec.rb b/spec/migrations/remove_redundant_pipeline_stages_spec.rb index ad905d7eb8a380d641d375dcd23b22bf9d8e7693..9bcbb6022a72c0a4baf2fbd300903f02b88e0147 100644 --- a/spec/migrations/remove_redundant_pipeline_stages_spec.rb +++ b/spec/migrations/remove_redundant_pipeline_stages_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require Rails.root.join('db', 'post_migrate', '20180119121225_remove_redundant_pipeline_stages.rb') -describe RemoveRedundantPipelineStages, :migration do +describe RemoveRedundantPipelineStages do let(:projects) { table(:projects) } let(:pipelines) { table(:ci_pipelines) } let(:stages) { table(:ci_stages) } diff --git a/spec/migrations/remove_security_dashboard_feature_flag_spec.rb b/spec/migrations/remove_security_dashboard_feature_flag_spec.rb index 7ef43134d24d85fa1631c9f730de2786b681f27a..fa0489526e284c45a147d8076577f819b4371c0b 100644 --- a/spec/migrations/remove_security_dashboard_feature_flag_spec.rb +++ b/spec/migrations/remove_security_dashboard_feature_flag_spec.rb @@ -4,7 +4,7 @@ require 'spec_helper' require Rails.root.join('db', 'post_migrate', '20200214034836_remove_security_dashboard_feature_flag.rb') -describe RemoveSecurityDashboardFeatureFlag, :migration do +describe RemoveSecurityDashboardFeatureFlag do let(:feature_gates) { table(:feature_gates) } subject(:migration) { described_class.new } diff --git a/spec/migrations/rename_security_dashboard_feature_flag_to_instance_security_dashboard_spec.rb b/spec/migrations/rename_security_dashboard_feature_flag_to_instance_security_dashboard_spec.rb index bc982e8952e2f063cb7db5337f2fcae02b9147f6..07be7a4ad519fd669c4f8776f377c82871384116 100644 --- a/spec/migrations/rename_security_dashboard_feature_flag_to_instance_security_dashboard_spec.rb +++ b/spec/migrations/rename_security_dashboard_feature_flag_to_instance_security_dashboard_spec.rb @@ -4,7 +4,7 @@ require 'spec_helper' require Rails.root.join('db', 'migrate', '20200212014653_rename_security_dashboard_feature_flag_to_instance_security_dashboard.rb') -describe RenameSecurityDashboardFeatureFlagToInstanceSecurityDashboard, :migration do +describe RenameSecurityDashboardFeatureFlagToInstanceSecurityDashboard do let(:feature_gates) { table(:feature_gates) } subject(:migration) { described_class.new } diff --git a/spec/migrations/reschedule_builds_stages_migration_spec.rb b/spec/migrations/reschedule_builds_stages_migration_spec.rb index 8127934afab0382c9b774f96a5ba68d8ab014ce2..18ea16f97bc53d8decc8b59c45e675f1a6063b6a 100644 --- a/spec/migrations/reschedule_builds_stages_migration_spec.rb +++ b/spec/migrations/reschedule_builds_stages_migration_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require Rails.root.join('db', 'post_migrate', '20180405101928_reschedule_builds_stages_migration') -describe RescheduleBuildsStagesMigration, :migration do +describe RescheduleBuildsStagesMigration do let(:namespaces) { table(:namespaces) } let(:projects) { table(:projects) } let(:pipelines) { table(:ci_pipelines) } diff --git a/spec/migrations/reschedule_commits_count_for_merge_request_diff_spec.rb b/spec/migrations/reschedule_commits_count_for_merge_request_diff_spec.rb index 0e34e63fcc1449de535894b3c27774f5dee2092b..dcb31dff9b76a617371e70a60853d3a109d4b102 100644 --- a/spec/migrations/reschedule_commits_count_for_merge_request_diff_spec.rb +++ b/spec/migrations/reschedule_commits_count_for_merge_request_diff_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require Rails.root.join('db', 'migrate', '20180309121820_reschedule_commits_count_for_merge_request_diff') -describe RescheduleCommitsCountForMergeRequestDiff, :migration do +describe RescheduleCommitsCountForMergeRequestDiff do let(:merge_request_diffs) { table(:merge_request_diffs) } let(:merge_requests) { table(:merge_requests) } let(:projects) { table(:projects) } diff --git a/spec/migrations/save_instance_administrators_group_id_spec.rb b/spec/migrations/save_instance_administrators_group_id_spec.rb index eab410174807ec5df99b2c996d6f92b4163db632..74ced009fa55b2d7d8cb7db4070acb51724721a4 100644 --- a/spec/migrations/save_instance_administrators_group_id_spec.rb +++ b/spec/migrations/save_instance_administrators_group_id_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require Rails.root.join('db', 'post_migrate', '20200210092405_save_instance_administrators_group_id') -describe SaveInstanceAdministratorsGroupId, :migration do +describe SaveInstanceAdministratorsGroupId do let(:application_settings_table) { table(:application_settings) } let(:instance_administrators_group) do diff --git a/spec/migrations/schedule_digest_personal_access_tokens_spec.rb b/spec/migrations/schedule_digest_personal_access_tokens_spec.rb index 915397f0f4f9fac2798fd38cf153ca313d0de04f..d8e1b089d31691f57a68d78a2319a1981365b32d 100644 --- a/spec/migrations/schedule_digest_personal_access_tokens_spec.rb +++ b/spec/migrations/schedule_digest_personal_access_tokens_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require Rails.root.join('db', 'post_migrate', '20180913142237_schedule_digest_personal_access_tokens.rb') -describe ScheduleDigestPersonalAccessTokens, :migration do +describe ScheduleDigestPersonalAccessTokens do let(:personal_access_tokens) { table(:personal_access_tokens) } let(:users) { table(:users) } diff --git a/spec/migrations/schedule_fill_valid_time_for_pages_domain_certificates_spec.rb b/spec/migrations/schedule_fill_valid_time_for_pages_domain_certificates_spec.rb index 43333ab98378a5ed11a2433fe97415915d91fcd3..30cb68c742c65fd3d825a9409edcfddd53fea94e 100644 --- a/spec/migrations/schedule_fill_valid_time_for_pages_domain_certificates_spec.rb +++ b/spec/migrations/schedule_fill_valid_time_for_pages_domain_certificates_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require Rails.root.join('db', 'post_migrate', '20190524073827_schedule_fill_valid_time_for_pages_domain_certificates.rb') -describe ScheduleFillValidTimeForPagesDomainCertificates, :migration do +describe ScheduleFillValidTimeForPagesDomainCertificates do let(:migration_class) { described_class::MIGRATION } let(:migration_name) { migration_class.to_s.demodulize } diff --git a/spec/migrations/schedule_migrate_security_scans_spec.rb b/spec/migrations/schedule_migrate_security_scans_spec.rb index ae066e8f91c8c2e7f02d1c241cafd84665e037fc..29e4e2b5cacf22cb42fd5fd7ef61ff102986d1b3 100644 --- a/spec/migrations/schedule_migrate_security_scans_spec.rb +++ b/spec/migrations/schedule_migrate_security_scans_spec.rb @@ -4,7 +4,7 @@ require 'spec_helper' require Rails.root.join('db', 'post_migrate', '20200217225719_schedule_migrate_security_scans.rb') # rubocop: disable RSpec/FactoriesInMigrationSpecs -describe ScheduleMigrateSecurityScans, :migration, :sidekiq do +describe ScheduleMigrateSecurityScans, :sidekiq do let(:migration) { described_class.new } let(:namespaces) { table(:namespaces) } let(:projects) { table(:projects) } diff --git a/spec/migrations/schedule_pages_metadata_migration_spec.rb b/spec/migrations/schedule_pages_metadata_migration_spec.rb index bf9442808bc3b25f71e23b2ec0751257e598ce6b..748b9fe1cd1a7f36dc565d03ffb3ca0a301ac8f1 100644 --- a/spec/migrations/schedule_pages_metadata_migration_spec.rb +++ b/spec/migrations/schedule_pages_metadata_migration_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require Rails.root.join('db', 'post_migrate', '20191002031332_schedule_pages_metadata_migration') -describe SchedulePagesMetadataMigration, :migration do +describe SchedulePagesMetadataMigration do let(:namespaces) { table(:namespaces) } let(:projects) { table(:projects) } diff --git a/spec/migrations/schedule_populate_merge_request_assignees_table_spec.rb b/spec/migrations/schedule_populate_merge_request_assignees_table_spec.rb index 44ef72baa86a1caf2e18897170854a10e3ba4b91..d778b47179f48d9f7664e227372721f06abcc921 100644 --- a/spec/migrations/schedule_populate_merge_request_assignees_table_spec.rb +++ b/spec/migrations/schedule_populate_merge_request_assignees_table_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require Rails.root.join('db', 'post_migrate', '20190322132835_schedule_populate_merge_request_assignees_table.rb') -describe SchedulePopulateMergeRequestAssigneesTable, :migration do +describe SchedulePopulateMergeRequestAssigneesTable do let(:namespaces) { table(:namespaces) } let(:projects) { table(:projects) } let(:namespace) { namespaces.create(name: 'gitlab', path: 'gitlab-org') } diff --git a/spec/migrations/schedule_recalculate_project_authorizations_second_run_spec.rb b/spec/migrations/schedule_recalculate_project_authorizations_second_run_spec.rb index 04726f98c899487fab16d83adeb3e5b2da234a8d..4c05f7d57a1581225fbfb44f86703a38f2b2dc39 100644 --- a/spec/migrations/schedule_recalculate_project_authorizations_second_run_spec.rb +++ b/spec/migrations/schedule_recalculate_project_authorizations_second_run_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require Rails.root.join('db', 'post_migrate', '20200204113224_schedule_recalculate_project_authorizations_second_run.rb') -describe ScheduleRecalculateProjectAuthorizationsSecondRun, :migration do +describe ScheduleRecalculateProjectAuthorizationsSecondRun do let(:users_table) { table(:users) } before do diff --git a/spec/migrations/schedule_recalculate_project_authorizations_spec.rb b/spec/migrations/schedule_recalculate_project_authorizations_spec.rb index 77ad2b2dc8e7b6c7215b8cd1ce023aa708a6a272..d30ebf825ef8bb015441ea636dbab85eed3fccc9 100644 --- a/spec/migrations/schedule_recalculate_project_authorizations_spec.rb +++ b/spec/migrations/schedule_recalculate_project_authorizations_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require Rails.root.join('db', 'post_migrate', '20200204113223_schedule_recalculate_project_authorizations.rb') -describe ScheduleRecalculateProjectAuthorizations, :migration do +describe ScheduleRecalculateProjectAuthorizations do let(:users_table) { table(:users) } let(:namespaces_table) { table(:namespaces) } let(:projects_table) { table(:projects) } diff --git a/spec/migrations/schedule_runners_token_encryption_spec.rb b/spec/migrations/schedule_runners_token_encryption_spec.rb index 60abb98f629d24e21761cab33c04e4f78c5625d0..4121a8409b4e859b60dc47eeedc47ac4c979a862 100644 --- a/spec/migrations/schedule_runners_token_encryption_spec.rb +++ b/spec/migrations/schedule_runners_token_encryption_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require Rails.root.join('db', 'post_migrate', '20181121111200_schedule_runners_token_encryption') -describe ScheduleRunnersTokenEncryption, :migration do +describe ScheduleRunnersTokenEncryption do let(:settings) { table(:application_settings) } let(:namespaces) { table(:namespaces) } let(:projects) { table(:projects) } diff --git a/spec/migrations/schedule_set_confidential_note_events_on_webhooks_spec.rb b/spec/migrations/schedule_set_confidential_note_events_on_webhooks_spec.rb index c022610be08f022fea34f33249e1600ebc9745da..ea1e16a0a351dc2152bdf926cc1c4a3d182b773b 100644 --- a/spec/migrations/schedule_set_confidential_note_events_on_webhooks_spec.rb +++ b/spec/migrations/schedule_set_confidential_note_events_on_webhooks_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require Rails.root.join('db', 'post_migrate', '20180104131052_schedule_set_confidential_note_events_on_webhooks.rb') -describe ScheduleSetConfidentialNoteEventsOnWebhooks, :migration do +describe ScheduleSetConfidentialNoteEventsOnWebhooks do let(:web_hooks_table) { table(:web_hooks) } let(:migration_class) { Gitlab::BackgroundMigration::SetConfidentialNoteEventsOnWebhooks } let(:migration_name) { migration_class.to_s.demodulize } diff --git a/spec/migrations/schedule_stages_index_migration_spec.rb b/spec/migrations/schedule_stages_index_migration_spec.rb index f2e9abe1eb8ebfab4657e56e0b5253d6970113bd..5ca857087e79ae4f8b0dc50bf5eaad4e336a4dc4 100644 --- a/spec/migrations/schedule_stages_index_migration_spec.rb +++ b/spec/migrations/schedule_stages_index_migration_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require Rails.root.join('db', 'post_migrate', '20180420080616_schedule_stages_index_migration') -describe ScheduleStagesIndexMigration, :migration do +describe ScheduleStagesIndexMigration do let(:namespaces) { table(:namespaces) } let(:projects) { table(:projects) } let(:pipelines) { table(:ci_pipelines) } diff --git a/spec/migrations/schedule_sync_issuables_state_id_spec.rb b/spec/migrations/schedule_sync_issuables_state_id_spec.rb index 21844edeb40131dc5bf62333631d550def3e1b0d..408e7e6d19d8d8dfbe0f7db6aa269f4807df1c5e 100644 --- a/spec/migrations/schedule_sync_issuables_state_id_spec.rb +++ b/spec/migrations/schedule_sync_issuables_state_id_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require Rails.root.join('db', 'post_migrate', '20190214112022_schedule_sync_issuables_state_id.rb') -describe ScheduleSyncIssuablesStateId, :migration do +describe ScheduleSyncIssuablesStateId do let(:namespaces) { table(:namespaces) } let(:projects) { table(:projects) } let(:merge_requests) { table(:merge_requests) } diff --git a/spec/migrations/schedule_sync_issuables_state_id_where_nil_spec.rb b/spec/migrations/schedule_sync_issuables_state_id_where_nil_spec.rb index 5dbe0d973aedea6f86bbf375414db3f800880d68..e26a864b8ba7155321d63a662f49af263c98b265 100644 --- a/spec/migrations/schedule_sync_issuables_state_id_where_nil_spec.rb +++ b/spec/migrations/schedule_sync_issuables_state_id_where_nil_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require Rails.root.join('db', 'post_migrate', '20190506135400_schedule_sync_issuables_state_id_where_nil') -describe ScheduleSyncIssuablesStateIdWhereNil, :migration do +describe ScheduleSyncIssuablesStateIdWhereNil do let(:namespaces) { table(:namespaces) } let(:projects) { table(:projects) } let(:merge_requests) { table(:merge_requests) } diff --git a/spec/migrations/schedule_to_archive_legacy_traces_spec.rb b/spec/migrations/schedule_to_archive_legacy_traces_spec.rb index a81fb1494c752da7f646eebc1fc2864bd35860b4..e9158df01c4702a4f6c016defe567eac77f5e8fe 100644 --- a/spec/migrations/schedule_to_archive_legacy_traces_spec.rb +++ b/spec/migrations/schedule_to_archive_legacy_traces_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require Rails.root.join('db', 'post_migrate', '20180529152628_schedule_to_archive_legacy_traces') -describe ScheduleToArchiveLegacyTraces, :migration do +describe ScheduleToArchiveLegacyTraces do include TraceHelpers let(:namespaces) { table(:namespaces) } diff --git a/spec/migrations/schedule_update_existing_subgroup_to_match_visibility_level_of_parent_spec.rb b/spec/migrations/schedule_update_existing_subgroup_to_match_visibility_level_of_parent_spec.rb index 221f266cb70903c58c0038a514c38c72cbf88eee..098fe68927c22118a897429822cda1dabc21ba7e 100644 --- a/spec/migrations/schedule_update_existing_subgroup_to_match_visibility_level_of_parent_spec.rb +++ b/spec/migrations/schedule_update_existing_subgroup_to_match_visibility_level_of_parent_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require Rails.root.join('db', 'post_migrate', '20200110121314_schedule_update_existing_subgroup_to_match_visibility_level_of_parent.rb') -describe ScheduleUpdateExistingSubgroupToMatchVisibilityLevelOfParent, :migration do +describe ScheduleUpdateExistingSubgroupToMatchVisibilityLevelOfParent do include MigrationHelpers::NamespacesHelpers let(:migration_class) { described_class::MIGRATION } let(:migration_name) { migration_class.to_s.demodulize } diff --git a/spec/migrations/services_remove_temporary_index_on_project_id_spec.rb b/spec/migrations/services_remove_temporary_index_on_project_id_spec.rb index f730d7aecfdc17bcda5aa1d590c2123126ca9c12..d4f9969b71b8191628101f20141012aaa2c57a1f 100644 --- a/spec/migrations/services_remove_temporary_index_on_project_id_spec.rb +++ b/spec/migrations/services_remove_temporary_index_on_project_id_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require Rails.root.join('db', 'post_migrate', '20200203104214_services_remove_temporary_index_on_project_id.rb') -describe ServicesRemoveTemporaryIndexOnProjectId, :migration do +describe ServicesRemoveTemporaryIndexOnProjectId do let(:migration_instance) { described_class.new } it 'adds and removes temporary partial index in up and down methods' do diff --git a/spec/migrations/set_issue_id_for_all_versions_spec.rb b/spec/migrations/set_issue_id_for_all_versions_spec.rb index bfc2731181bf2d24fdabe0664c933ecc401d59b0..ff281947db85a34e2812b96106c776f08e07888a 100644 --- a/spec/migrations/set_issue_id_for_all_versions_spec.rb +++ b/spec/migrations/set_issue_id_for_all_versions_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require Rails.root.join('db', 'migrate', '20190715043954_set_issue_id_for_all_versions.rb') -describe SetIssueIdForAllVersions, :migration do +describe SetIssueIdForAllVersions do let(:projects) { table(:projects) } let(:issues) { table(:issues) } let(:designs) { table(:design_management_designs) } diff --git a/spec/migrations/steal_fill_store_upload_spec.rb b/spec/migrations/steal_fill_store_upload_spec.rb index ed809baf2b5458e7e91a4f3e2c56315d541ff7d7..b5e3de1864c519e9afb6f1adec84fb4dbdea7255 100644 --- a/spec/migrations/steal_fill_store_upload_spec.rb +++ b/spec/migrations/steal_fill_store_upload_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require Rails.root.join('db', 'post_migrate', '20181105201455_steal_fill_store_upload.rb') -describe StealFillStoreUpload, :migration do +describe StealFillStoreUpload do let(:uploads) { table(:uploads) } describe '#up' do diff --git a/spec/migrations/sync_issuables_state_id_spec.rb b/spec/migrations/sync_issuables_state_id_spec.rb index 3138d2bec3398c24541c486724890c7ce8ff20d3..4bd30172cbeba26f22b885b2fcfc843f586d811f 100644 --- a/spec/migrations/sync_issuables_state_id_spec.rb +++ b/spec/migrations/sync_issuables_state_id_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require Rails.root.join('db', 'post_migrate', '20190911251732_sync_issuables_state_id') -describe SyncIssuablesStateId, :migration do +describe SyncIssuablesStateId do let(:migration) { described_class.new } describe '#up' do diff --git a/spec/migrations/truncate_user_fullname_spec.rb b/spec/migrations/truncate_user_fullname_spec.rb index 65b870de7b88ce06d5d2265783e35fec51da3bd6..a5e6a0a4fcebfd798b38b45c82331ae45121090d 100644 --- a/spec/migrations/truncate_user_fullname_spec.rb +++ b/spec/migrations/truncate_user_fullname_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require Rails.root.join('db', 'migrate', '20190325080727_truncate_user_fullname.rb') -describe TruncateUserFullname, :migration do +describe TruncateUserFullname do let(:users) { table(:users) } let(:user_short) { create_user(name: 'abc', email: 'test_short@example.com') } diff --git a/spec/migrations/update_application_setting_npm_package_requests_forwarding_default_spec.rb b/spec/migrations/update_application_setting_npm_package_requests_forwarding_default_spec.rb index dfe14b40c6e86ab363beb9192dfce3ebc1a74bb5..f9523e0e5826129f6f540da34b7ae5e66389ee91 100644 --- a/spec/migrations/update_application_setting_npm_package_requests_forwarding_default_spec.rb +++ b/spec/migrations/update_application_setting_npm_package_requests_forwarding_default_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require Rails.root.join('db', 'migrate', '20200221105436_update_application_setting_npm_package_requests_forwarding_default.rb') -describe UpdateApplicationSettingNpmPackageRequestsForwardingDefault, :migration do +describe UpdateApplicationSettingNpmPackageRequestsForwardingDefault do # Create test data - pipeline and CI/CD jobs. let(:application_settings) { table(:application_settings) } diff --git a/spec/migrations/update_fingerprint_sha256_within_keys_spec.rb b/spec/migrations/update_fingerprint_sha256_within_keys_spec.rb index 20a506ea976e4513ca2432978c7e72aff95bc3f8..d149ec230a74c5a04332b8ec7db8649fc736d9fd 100644 --- a/spec/migrations/update_fingerprint_sha256_within_keys_spec.rb +++ b/spec/migrations/update_fingerprint_sha256_within_keys_spec.rb @@ -4,7 +4,7 @@ require 'spec_helper' require Rails.root.join('db', 'post_migrate', '20200106071113_update_fingerprint_sha256_within_keys.rb') -describe UpdateFingerprintSha256WithinKeys, :migration do +describe UpdateFingerprintSha256WithinKeys do let(:key_table) { table(:keys) } describe '#up' do diff --git a/spec/migrations/update_minimum_password_length_spec.rb b/spec/migrations/update_minimum_password_length_spec.rb index 0a763e5ce0ff13bf5f3719286e55f96b5afb6ea7..ed9c85362f5d9bdd6fe17dbdfdc7a65f8e80e3dc 100644 --- a/spec/migrations/update_minimum_password_length_spec.rb +++ b/spec/migrations/update_minimum_password_length_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require Rails.root.join('db', 'post_migrate', '20191205084057_update_minimum_password_length') -describe UpdateMinimumPasswordLength, :migration do +describe UpdateMinimumPasswordLength do let(:application_settings) { table(:application_settings) } let(:application_setting) do application_settings.create!( diff --git a/spec/migrations/update_project_import_visibility_level_spec.rb b/spec/migrations/update_project_import_visibility_level_spec.rb index 9ea9b956f672270391409571c1bad6d9b64c6e88..f8439fc4204edaec668691be641727899b2fc942 100644 --- a/spec/migrations/update_project_import_visibility_level_spec.rb +++ b/spec/migrations/update_project_import_visibility_level_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require Rails.root.join('db', 'post_migrate', '20181219130552_update_project_import_visibility_level.rb') -describe UpdateProjectImportVisibilityLevel, :migration do +describe UpdateProjectImportVisibilityLevel do let(:namespaces) { table(:namespaces) } let(:projects) { table(:projects) } let(:project) { projects.find_by_name(name) } diff --git a/spec/migrations/update_timestamp_softwarelicensespolicy_spec.rb b/spec/migrations/update_timestamp_softwarelicensespolicy_spec.rb index 539da8ac92a461b384f5c3e29de4d849f8aa5b4f..918c5fb567fc85f4ef70f0559d792ff52b0ca93e 100644 --- a/spec/migrations/update_timestamp_softwarelicensespolicy_spec.rb +++ b/spec/migrations/update_timestamp_softwarelicensespolicy_spec.rb @@ -4,7 +4,7 @@ require 'spec_helper' require Rails.root.join('db', 'migrate', '20200116175538_update_timestamp_softwarelicensespolicy.rb') -describe UpdateTimestampSoftwarelicensespolicy, :migration do +describe UpdateTimestampSoftwarelicensespolicy do let(:software_licenses_policy) { table(:software_license_policies) } let(:projects) { table(:projects) } let(:licenses) { table(:software_licenses) } diff --git a/spec/requests/api/deploy_tokens_spec.rb b/spec/requests/api/deploy_tokens_spec.rb index 01810e333c157a25dc6b6cede7a03d777b9cb023..fa46b8017cb08dab4015a4a0f9d1ad8ff2655a72 100644 --- a/spec/requests/api/deploy_tokens_spec.rb +++ b/spec/requests/api/deploy_tokens_spec.rb @@ -195,56 +195,71 @@ describe API::DeployTokens do end end - describe 'POST /projects/:id/deploy_tokens' do - let(:params) do - { - name: 'Foo', - expires_at: 1.year.from_now, - scopes: [ - 'read_repository' - ], - username: 'Bar' - } - end + context 'deploy token creation' do + shared_examples 'creating a deploy token' do |entity, unauthenticated_response| + let(:params) do + { + name: 'Foo', + expires_at: 1.year.from_now, + scopes: [ + 'read_repository' + ], + username: 'Bar' + } + end - subject do - post api("/projects/#{project.id}/deploy_tokens", user), params: params - response - end + context 'when unauthenticated' do + let(:user) { nil } - context 'when unauthenticated' do - let(:user) { nil } + it { is_expected.to have_gitlab_http_status(unauthenticated_response) } + end - it { is_expected.to have_gitlab_http_status(:not_found) } - end + context 'when authenticated as non-admin user' do + before do + send(entity).add_developer(user) + end - context 'when authenticated as non-admin user' do - before do - project.add_developer(user) + it { is_expected.to have_gitlab_http_status(:forbidden) } end - it { is_expected.to have_gitlab_http_status(:forbidden) } - end + context 'when authenticated as maintainer' do + before do + send(entity).add_maintainer(user) + end - context 'when authenticated as maintainer' do - before do - project.add_maintainer(user) - end + it 'creates the deploy token' do + expect { subject }.to change { DeployToken.count }.by(1) - it 'creates the deploy token' do - expect { subject }.to change { DeployToken.count }.by(1) + expect(response).to have_gitlab_http_status(:created) + expect(response).to match_response_schema('public_api/v4/deploy_token') + end - expect(response).to have_gitlab_http_status(:created) - expect(response).to match_response_schema('public_api/v4/deploy_token') - end + context 'with an invalid scope' do + before do + params[:scopes] = %w[read_repository all_access] + end - context 'with an invalid scope' do - before do - params[:scopes] = %w[read_repository all_access] + it { is_expected.to have_gitlab_http_status(:bad_request) } end + end + end + + describe 'POST /projects/:id/deploy_tokens' do + subject do + post api("/projects/#{project.id}/deploy_tokens", user), params: params + response + end + + it_behaves_like 'creating a deploy token', :project, :not_found + end - it { is_expected.to have_gitlab_http_status(:bad_request) } + describe 'POST /groups/:id/deploy_tokens' do + subject do + post api("/groups/#{group.id}/deploy_tokens", user), params: params + response end + + it_behaves_like 'creating a deploy token', :group, :forbidden end end end diff --git a/spec/routing/project_routing_spec.rb b/spec/routing/project_routing_spec.rb index 449c4c07b08e9db396d70aec2b5ee63179a9314c..1a43342d278a01fc16e04342256f996abe5c3296 100644 --- a/spec/routing/project_routing_spec.rb +++ b/spec/routing/project_routing_spec.rb @@ -488,6 +488,7 @@ describe 'project routing' do end it_behaves_like 'redirecting a legacy project path', "/gitlab/gitlabhq/project_members", "/gitlab/gitlabhq/-/project_members" + it_behaves_like 'redirecting a legacy project path', "/gitlab/gitlabhq/-/settings/members", "/gitlab/gitlabhq/-/project_members" end # project_milestones GET /:project_id/milestones(.:format) milestones#index diff --git a/spec/services/projects/lfs_pointers/lfs_download_link_list_service_spec.rb b/spec/services/projects/lfs_pointers/lfs_download_link_list_service_spec.rb index dabfd61d3f5613873f32eb235242e6d6df27b311..99d35fdc7f724af7d749bb3806a9146f182ac3ea 100644 --- a/spec/services/projects/lfs_pointers/lfs_download_link_list_service_spec.rb +++ b/spec/services/projects/lfs_pointers/lfs_download_link_list_service_spec.rb @@ -8,18 +8,27 @@ describe Projects::LfsPointers::LfsDownloadLinkListService do let(:new_oids) { { 'oid1' => 123, 'oid2' => 125 } } let(:remote_uri) { URI.parse(lfs_endpoint) } - let(:objects_response) do - body = new_oids.map do |oid, size| + let(:request_object) { HTTParty::Request.new(Net::HTTP::Post, '/') } + let(:parsed_block) { lambda {} } + let(:success_net_response) { Net::HTTPOK.new('', '', '') } + let(:response) { Gitlab::HTTP::Response.new(request_object, net_response, parsed_block) } + + def objects_response(oids) + body = oids.map do |oid, size| { - 'oid' => oid, - 'size' => size, + 'oid' => oid, 'size' => size, 'actions' => { 'download' => { 'href' => "#{import_url}/gitlab-lfs/objects/#{oid}" } } } end - Struct.new(:success?, :objects).new(true, body) + Struct.new(:success?, :objects).new(true, body).to_json + end + + def custom_response(net_response, body = nil) + allow(net_response).to receive(:body).and_return(body) + Gitlab::HTTP::Response.new(request_object, net_response, parsed_block) end let(:invalid_object_response) do @@ -33,9 +42,8 @@ describe Projects::LfsPointers::LfsDownloadLinkListService do before do allow(project).to receive(:lfs_enabled?).and_return(true) - response = instance_double(Gitlab::HTTP::Response) - allow(response).to receive(:body).and_return(objects_response.to_json) - allow(response).to receive(:success?).and_return(true) + + response = custom_response(success_net_response, objects_response(new_oids)) allow(Gitlab::HTTP).to receive(:post).and_return(response) end @@ -46,6 +54,102 @@ describe Projects::LfsPointers::LfsDownloadLinkListService do end end + context 'when lfs objects size is larger than the batch size' do + def stub_successful_request(batch) + response = custom_response(success_net_response, objects_response(batch)) + stub_request(batch, response) + end + + def stub_entity_too_large_error_request(batch) + entity_too_large_net_response = Net::HTTPRequestEntityTooLarge.new('', '', '') + response = custom_response(entity_too_large_net_response) + stub_request(batch, response) + end + + def stub_request(batch, response) + expect(Gitlab::HTTP).to receive(:post).with( + remote_uri, + { + body: { operation: 'download', objects: batch.map { |k, v| { oid: k, size: v } } }.to_json, + headers: subject.send(:headers) + } + ).and_return(response) + end + + let(:new_oids) { { 'oid1' => 123, 'oid2' => 125, 'oid3' => 126, 'oid4' => 127, 'oid5' => 128 } } + + context 'when batch size' do + before do + stub_const("#{described_class.name}::REQUEST_BATCH_SIZE", 2) + + data = new_oids.to_a + stub_successful_request([data[0], data[1]]) + stub_successful_request([data[2], data[3]]) + stub_successful_request([data[4]]) + end + + it 'retreives them in batches' do + subject.execute(new_oids).each do |lfs_download_object| + expect(lfs_download_object.link).to eq "#{import_url}/gitlab-lfs/objects/#{lfs_download_object.oid}" + end + end + end + + context 'when request fails with PayloadTooLarge error' do + let(:error_class) { described_class::DownloadLinksRequestEntityTooLargeError } + + context 'when the smaller batch eventually works' do + before do + stub_const("#{described_class.name}::REQUEST_BATCH_SIZE", 5) + + data = new_oids.to_a + + # with the batch size of 5 + stub_entity_too_large_error_request(data) + + # with the batch size of 2 + stub_successful_request([data[0], data[1]]) + stub_successful_request([data[2], data[3]]) + stub_successful_request([data[4]]) + end + + it 'retreives them eventually and logs exceptions' do + expect(Gitlab::ErrorTracking).to receive(:track_exception).with( + an_instance_of(error_class), project_id: project.id, batch_size: 5, oids_count: 5 + ) + + subject.execute(new_oids).each do |lfs_download_object| + expect(lfs_download_object.link).to eq "#{import_url}/gitlab-lfs/objects/#{lfs_download_object.oid}" + end + end + end + + context 'when batch size cannot be any smaller' do + before do + stub_const("#{described_class.name}::REQUEST_BATCH_SIZE", 5) + + data = new_oids.to_a + + # with the batch size of 5 + stub_entity_too_large_error_request(data) + + # with the batch size of 2 + stub_entity_too_large_error_request([data[0], data[1]]) + end + + it 'raises an error and logs exceptions' do + expect(Gitlab::ErrorTracking).to receive(:track_exception).with( + an_instance_of(error_class), project_id: project.id, batch_size: 5, oids_count: 5 + ) + expect(Gitlab::ErrorTracking).to receive(:track_exception).with( + an_instance_of(error_class), project_id: project.id, batch_size: 2, oids_count: 5 + ) + expect { subject.execute(new_oids) }.to raise_error(described_class::DownloadLinksError) + end + end + end + end + context 'credentials' do context 'when the download link and the lfs_endpoint have the same host' do context 'when lfs_endpoint has credentials' do @@ -87,17 +191,22 @@ describe Projects::LfsPointers::LfsDownloadLinkListService do end describe '#get_download_links' do - it 'raise error if request fails' do - allow(Gitlab::HTTP).to receive(:post).and_return(Struct.new(:success?, :message).new(false, 'Failed request')) + context 'if request fails' do + before do + request_timeout_net_response = Net::HTTPRequestTimeout.new('', '', '') + response = custom_response(request_timeout_net_response) + allow(Gitlab::HTTP).to receive(:post).and_return(response) + end - expect { subject.send(:get_download_links, new_oids) }.to raise_error(described_class::DownloadLinksError) + it 'raises an error' do + expect { subject.send(:get_download_links, new_oids) }.to raise_error(described_class::DownloadLinksError) + end end shared_examples 'JSON parse errors' do |body| - it 'raises error' do - response = instance_double(Gitlab::HTTP::Response) + it 'raises an error' do + response = custom_response(success_net_response) allow(response).to receive(:body).and_return(body) - allow(response).to receive(:success?).and_return(true) allow(Gitlab::HTTP).to receive(:post).and_return(response) expect { subject.send(:get_download_links, new_oids) }.to raise_error(described_class::DownloadLinksError) diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index d379fd494fa7a00d8d25259b4ca08ea16f76de1d..3f6503a60a9d64758569f248f16ff20c0e850cfb 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -76,11 +76,16 @@ RSpec.configure do |config| metadata[:level] = quality_level.level_for(location) metadata[:api] = true if location =~ %r{/spec/requests/api/} - # do not overwrite type if it's already set - next if metadata.key?(:type) + # Do not overwrite migration if it's already set + unless metadata.key?(:migration) + metadata[:migration] = true if metadata[:level] == :migration + end - match = location.match(%r{/spec/([^/]+)/}) - metadata[:type] = match[1].singularize.to_sym if match + # Do not overwrite type if it's already set + unless metadata.key?(:type) + match = location.match(%r{/spec/([^/]+)/}) + metadata[:type] = match[1].singularize.to_sym if match + end end config.include LicenseHelpers