diff options
33 files changed, 129 insertions, 129 deletions
diff --git a/app/assets/javascripts/breakpoints.js b/app/assets/javascripts/breakpoints.js deleted file mode 100644 index 93aacba0e8e..00000000000 --- a/app/assets/javascripts/breakpoints.js +++ /dev/null @@ -1,22 +0,0 @@ -export const breakpoints = { - lg: 1200, - md: 992, - sm: 768, - xs: 0, -}; - -const BreakpointInstance = { - windowWidth: () => window.innerWidth, - getBreakpointSize() { - const windowWidth = this.windowWidth(); - - const breakpoint = Object.keys(breakpoints).find(key => windowWidth > breakpoints[key]); - - return breakpoint; - }, - isDesktop() { - return ['lg', 'md'].includes(this.getBreakpointSize()); - }, -}; - -export default BreakpointInstance; diff --git a/app/models/ci/job_artifact.rb b/app/models/ci/job_artifact.rb index 62bf2c3ac9c..9e5aa6691df 100644 --- a/app/models/ci/job_artifact.rb +++ b/app/models/ci/job_artifact.rb @@ -23,6 +23,7 @@ module Ci container_scanning: 'gl-container-scanning-report.json', dast: 'gl-dast-report.json', license_management: 'gl-license-management-report.json', + license_scanning: 'gl-license-management-report.json', performance: 'performance.json', metrics: 'metrics.txt' }.freeze @@ -46,6 +47,7 @@ module Ci container_scanning: :raw, dast: :raw, license_management: :raw, + license_scanning: :raw, performance: :raw }.freeze @@ -104,6 +106,7 @@ module Ci dast: 8, ## EE-specific codequality: 9, ## EE-specific license_management: 10, ## EE-specific + license_scanning: 101, ## EE-specific till 13.0 performance: 11, ## EE-specific metrics: 12 ## EE-specific } diff --git a/app/models/clusters/applications/runner.rb b/app/models/clusters/applications/runner.rb index fd05fd6bab9..a908ca28188 100644 --- a/app/models/clusters/applications/runner.rb +++ b/app/models/clusters/applications/runner.rb @@ -3,7 +3,7 @@ module Clusters module Applications class Runner < ApplicationRecord - VERSION = '0.11.0' + VERSION = '0.12.0' self.table_name = 'clusters_applications_runners' diff --git a/app/views/dashboard/projects/_projects.html.haml b/app/views/dashboard/projects/_projects.html.haml index 9e0e908e656..5122164dbcb 100644 --- a/app/views/dashboard/projects/_projects.html.haml +++ b/app/views/dashboard/projects/_projects.html.haml @@ -1 +1 @@ -= render 'shared/projects/list', projects: @projects, ci: true, user: current_user += render 'shared/projects/list', projects: @projects, pipeline_status: Feature.enabled?(:dashboard_pipeline_status, default_enabled: true), user: current_user diff --git a/app/views/explore/projects/_projects.html.haml b/app/views/explore/projects/_projects.html.haml index 35b32662b8a..d819c4ea554 100644 --- a/app/views/explore/projects/_projects.html.haml +++ b/app/views/explore/projects/_projects.html.haml @@ -1,2 +1,2 @@ - is_explore_page = defined?(explore_page) && explore_page -= render 'shared/projects/list', projects: projects, user: current_user, explore_page: is_explore_page += render 'shared/projects/list', projects: projects, user: current_user, explore_page: is_explore_page, pipeline_status: Feature.enabled?(:dashboard_pipeline_status, default_enabled: true) diff --git a/app/views/shared/projects/_list.html.haml b/app/views/shared/projects/_list.html.haml index fab7ee9d763..c0c009f2a86 100644 --- a/app/views/shared/projects/_list.html.haml +++ b/app/views/shared/projects/_list.html.haml @@ -6,7 +6,6 @@ - merge_requests = true unless local_assigns[:merge_requests] == false - issues = true unless local_assigns[:issues] == false - pipeline_status = true unless local_assigns[:pipeline_status] == false -- ci = false unless local_assigns[:ci] == true - skip_namespace = false unless local_assigns[:skip_namespace] == true - user = local_assigns[:user] - show_last_commit_as_description = false unless local_assigns[:show_last_commit_as_description] == true @@ -40,7 +39,7 @@ - projects.each_with_index do |project, i| - css_class = (i >= projects_limit) || project.pending_delete? ? 'hide' : nil = render "shared/projects/project", project: project, skip_namespace: skip_namespace, - avatar: avatar, stars: stars, css_class: css_class, ci: ci, use_creator_avatar: use_creator_avatar, + avatar: avatar, stars: stars, css_class: css_class, use_creator_avatar: use_creator_avatar, forks: forks, show_last_commit_as_description: show_last_commit_as_description, user: user, merge_requests: merge_requests, issues: issues, pipeline_status: pipeline_status, compact_mode: compact_mode = paginate_collection(projects, remote: remote) unless skip_pagination diff --git a/changelogs/unreleased/update-gitlab-runner-helm-chart-to-0-12-0.yml b/changelogs/unreleased/update-gitlab-runner-helm-chart-to-0-12-0.yml new file mode 100644 index 00000000000..3ba0e998e2b --- /dev/null +++ b/changelogs/unreleased/update-gitlab-runner-helm-chart-to-0-12-0.yml @@ -0,0 +1,5 @@ +--- +title: Update GitLab Runner Helm Chart to 0.12.0 +merge_request: 22566 +author: +type: other diff --git a/doc/development/dangerbot.md b/doc/development/dangerbot.md index 40eb4294617..51f7a18dd08 100644 --- a/doc/development/dangerbot.md +++ b/doc/development/dangerbot.md @@ -119,4 +119,16 @@ at GitLab so far: ## Limitations - [`danger local` does not work on GitLab](https://github.com/danger/danger/issues/458) -- Danger output is not added to a merge request comment if working on a fork. +- Danger output is not added to a merge request comment if working on + a fork. This happens because the secret variable from the canonical + project is not shared to forks. + To work around this, you can add an [environment + variable](../ci/variables/README.md) called + `DANGER_GITLAB_API_TOKEN` with a personal API token to your + fork. That way the danger comments will be made from CI using that + API token instead. + Making the variable + [masked](../ci/variables/README.md#masked-variables) will make sure + it doesn't show up in the job logs. The variable cannot be + [protected](../ci/variables/README.md#protected-environment-variables), + as it needs to be present for all feature branches. diff --git a/lib/gitlab/ci/config/entry/reports.rb b/lib/gitlab/ci/config/entry/reports.rb index eeaac52eefd..f984d7d397a 100644 --- a/lib/gitlab/ci/config/entry/reports.rb +++ b/lib/gitlab/ci/config/entry/reports.rb @@ -11,7 +11,7 @@ module Gitlab include ::Gitlab::Config::Entry::Validatable include ::Gitlab::Config::Entry::Attributable - ALLOWED_KEYS = %i[junit codequality sast dependency_scanning container_scanning dast performance license_management metrics].freeze + ALLOWED_KEYS = %i[junit codequality sast dependency_scanning container_scanning dast performance license_management license_scanning metrics].freeze attributes ALLOWED_KEYS @@ -28,6 +28,7 @@ module Gitlab validates :dast, array_of_strings_or_string: true validates :performance, array_of_strings_or_string: true validates :license_management, array_of_strings_or_string: true + validates :license_scanning, array_of_strings_or_string: true validates :metrics, array_of_strings_or_string: true end end diff --git a/lib/gitlab/database/migration_helpers.rb b/lib/gitlab/database/migration_helpers.rb index 1f246620a9c..b7d510c19f9 100644 --- a/lib/gitlab/database/migration_helpers.rb +++ b/lib/gitlab/database/migration_helpers.rb @@ -211,6 +211,18 @@ module Gitlab end # rubocop:enable Gitlab/RailsLogger + def validate_foreign_key(source, column, name: nil) + fk_name = name || concurrent_foreign_key_name(source, column) + + unless foreign_key_exists?(source, name: fk_name) + raise "cannot find #{fk_name} on #{source} table" + end + + disable_statement_timeout do + execute("ALTER TABLE #{source} VALIDATE CONSTRAINT #{fk_name};") + end + end + def foreign_key_exists?(source, target = nil, **options) foreign_keys(source).any? do |foreign_key| tables_match?(target.to_s, foreign_key.to_table.to_s) && diff --git a/spec/features/dashboard/projects_spec.rb b/spec/features/dashboard/projects_spec.rb index f10cdf6da1e..73f759f8a54 100644 --- a/spec/features/dashboard/projects_spec.rb +++ b/spec/features/dashboard/projects_spec.rb @@ -173,6 +173,19 @@ describe 'Dashboard Projects' do end end + shared_examples 'hidden pipeline status' do + it 'does not show the pipeline status' do + visit dashboard_projects_path + + page.within('.controls') do + expect(page).not_to have_xpath("//a[@href='#{pipelines_project_commit_path(project, project.commit, ref: pipeline.ref)}']") + expect(page).not_to have_css('.ci-status-link') + expect(page).not_to have_css('.ci-status-icon-success') + expect(page).not_to have_link('Pipeline: passed') + end + end + end + context 'guest user of project and project has private pipelines' do let(:guest_user) { create(:user) } @@ -182,16 +195,15 @@ describe 'Dashboard Projects' do sign_in(guest_user) end - it 'shows that the last pipeline passed' do - visit dashboard_projects_path + it_behaves_like 'hidden pipeline status' + end - page.within('.controls') do - expect(page).not_to have_xpath("//a[@href='#{pipelines_project_commit_path(project, project.commit, ref: pipeline.ref)}']") - expect(page).not_to have_css('.ci-status-link') - expect(page).not_to have_css('.ci-status-icon-success') - expect(page).not_to have_link('Pipeline: passed') - end + context 'when dashboard_pipeline_status is disabled' do + before do + stub_feature_flags(dashboard_pipeline_status: false) end + + it_behaves_like 'hidden pipeline status' end end diff --git a/spec/frontend/breakpoints_spec.js b/spec/frontend/breakpoints_spec.js deleted file mode 100644 index c9014ddd3e2..00000000000 --- a/spec/frontend/breakpoints_spec.js +++ /dev/null @@ -1,27 +0,0 @@ -import bp, { breakpoints } from '~/breakpoints'; - -describe('breakpoints', () => { - Object.keys(breakpoints).forEach(key => { - const size = breakpoints[key]; - - it(`returns ${key} when larger than ${size}`, () => { - jest.spyOn(bp, 'windowWidth').mockReturnValue(size + 10); - - expect(bp.getBreakpointSize()).toBe(key); - }); - }); - - describe('isDesktop', () => { - it('returns true when screen size is medium', () => { - jest.spyOn(bp, 'windowWidth').mockReturnValue(breakpoints.md + 10); - - expect(bp.isDesktop()).toBe(true); - }); - - it('returns false when screen size is small', () => { - jest.spyOn(bp, 'windowWidth').mockReturnValue(breakpoints.sm + 10); - - expect(bp.isDesktop()).toBe(false); - }); - }); -}); diff --git a/spec/frontend/notes/components/diff_discussion_header_spec.js b/spec/frontend/notes/components/diff_discussion_header_spec.js index be912777d64..e461ea9d9d3 100644 --- a/spec/frontend/notes/components/diff_discussion_header_spec.js +++ b/spec/frontend/notes/components/diff_discussion_header_spec.js @@ -1,4 +1,4 @@ -import { mount, createLocalVue } from '@vue/test-utils'; +import { mount } from '@vue/test-utils'; import createStore from '~/notes/stores'; import diffDiscussionHeader from '~/notes/components/diff_discussion_header.vue'; @@ -18,11 +18,9 @@ describe('diff_discussion_header component', () => { window.mrTabs = {}; store = createStore(); - const localVue = createLocalVue(); wrapper = mount(diffDiscussionHeader, { store, propsData: { discussion: discussionMock }, - localVue, sync: false, }); }); diff --git a/spec/frontend/notes/components/discussion_actions_spec.js b/spec/frontend/notes/components/discussion_actions_spec.js index 6198f8b3c1d..1aea6b97172 100644 --- a/spec/frontend/notes/components/discussion_actions_spec.js +++ b/spec/frontend/notes/components/discussion_actions_spec.js @@ -1,4 +1,4 @@ -import { shallowMount, mount, createLocalVue } from '@vue/test-utils'; +import { shallowMount, mount } from '@vue/test-utils'; import { discussionMock } from '../../notes/mock_data'; import DiscussionActions from '~/notes/components/discussion_actions.vue'; import ReplyPlaceholder from '~/notes/components/discussion_reply_placeholder.vue'; @@ -22,12 +22,10 @@ const createUnallowedNote = () => describe('DiscussionActions', () => { let wrapper; const createComponentFactory = (shallow = true) => props => { - const localVue = createLocalVue(); const store = createStore(); const mountFn = shallow ? shallowMount : mount; wrapper = mountFn(DiscussionActions, { - localVue, store, propsData: { discussion: discussionMock, diff --git a/spec/frontend/notes/components/discussion_notes_spec.js b/spec/frontend/notes/components/discussion_notes_spec.js index d259e79de84..a937aa171f3 100644 --- a/spec/frontend/notes/components/discussion_notes_spec.js +++ b/spec/frontend/notes/components/discussion_notes_spec.js @@ -1,4 +1,4 @@ -import { shallowMount, createLocalVue } from '@vue/test-utils'; +import { shallowMount } from '@vue/test-utils'; import '~/behaviors/markdown/render_gfm'; import { SYSTEM_NOTE } from '~/notes/constants'; import DiscussionNotes from '~/notes/components/discussion_notes.vue'; @@ -9,8 +9,6 @@ import SystemNote from '~/vue_shared/components/notes/system_note.vue'; import createStore from '~/notes/stores'; import { noteableDataMock, discussionMock, notesDataMock } from '../../notes/mock_data'; -const localVue = createLocalVue(); - describe('DiscussionNotes', () => { let wrapper; @@ -20,7 +18,6 @@ describe('DiscussionNotes', () => { store.dispatch('setNotesData', notesDataMock); wrapper = shallowMount(DiscussionNotes, { - localVue, store, propsData: { discussion: discussionMock, diff --git a/spec/frontend/notes/components/discussion_reply_placeholder_spec.js b/spec/frontend/notes/components/discussion_reply_placeholder_spec.js index f7fe758c390..a881e44a007 100644 --- a/spec/frontend/notes/components/discussion_reply_placeholder_spec.js +++ b/spec/frontend/notes/components/discussion_reply_placeholder_spec.js @@ -1,7 +1,6 @@ -import { shallowMount, createLocalVue } from '@vue/test-utils'; +import { shallowMount } from '@vue/test-utils'; import ReplyPlaceholder from '~/notes/components/discussion_reply_placeholder.vue'; -const localVue = createLocalVue(); const buttonText = 'Test Button Text'; describe('ReplyPlaceholder', () => { @@ -11,7 +10,6 @@ describe('ReplyPlaceholder', () => { beforeEach(() => { wrapper = shallowMount(ReplyPlaceholder, { - localVue, propsData: { buttonText, }, diff --git a/spec/frontend/notes/components/discussion_resolve_button_spec.js b/spec/frontend/notes/components/discussion_resolve_button_spec.js index 33a29992320..c64e299efc3 100644 --- a/spec/frontend/notes/components/discussion_resolve_button_spec.js +++ b/spec/frontend/notes/components/discussion_resolve_button_spec.js @@ -1,16 +1,13 @@ -import { createLocalVue, shallowMount } from '@vue/test-utils'; +import { shallowMount } from '@vue/test-utils'; import resolveDiscussionButton from '~/notes/components/discussion_resolve_button.vue'; const buttonTitle = 'Resolve discussion'; describe('resolveDiscussionButton', () => { let wrapper; - let localVue; const factory = options => { - localVue = createLocalVue(); wrapper = shallowMount(resolveDiscussionButton, { - localVue, ...options, }); }; @@ -69,7 +66,7 @@ describe('resolveDiscussionButton', () => { const button = wrapper.find({ ref: 'isResolvingIcon' }); - localVue.nextTick(() => { + wrapper.vm.$nextTick(() => { expect(button.exists()).toEqual(false); }); }); diff --git a/spec/frontend/notes/components/note_app_spec.js b/spec/frontend/notes/components/note_app_spec.js index b313c1186fd..b7e7d7d1d72 100644 --- a/spec/frontend/notes/components/note_app_spec.js +++ b/spec/frontend/notes/components/note_app_spec.js @@ -1,7 +1,7 @@ import $ from 'helpers/jquery'; import AxiosMockAdapter from 'axios-mock-adapter'; import Vue from 'vue'; -import { mount, createLocalVue } from '@vue/test-utils'; +import { mount } from '@vue/test-utils'; import { setTestTimeout } from 'helpers/timeout'; import axios from '~/lib/utils/axios_utils'; import NotesApp from '~/notes/components/notes_app.vue'; @@ -48,7 +48,6 @@ describe('note_app', () => { notesData: mockData.notesDataMock, userData: mockData.userDataMock, }; - const localVue = createLocalVue(); return mount( { @@ -63,7 +62,6 @@ describe('note_app', () => { attachToDocument: true, propsData, store, - localVue, sync: false, }, ); diff --git a/spec/frontend/notes/components/note_edited_text_spec.js b/spec/frontend/notes/components/note_edited_text_spec.js index e8d5a24e86a..8d05e8a3c31 100644 --- a/spec/frontend/notes/components/note_edited_text_spec.js +++ b/spec/frontend/notes/components/note_edited_text_spec.js @@ -1,7 +1,6 @@ -import { shallowMount, createLocalVue } from '@vue/test-utils'; +import { shallowMount } from '@vue/test-utils'; import NoteEditedText from '~/notes/components/note_edited_text.vue'; -const localVue = createLocalVue(); const propsData = { actionText: 'Edited', className: 'foo-bar', @@ -21,7 +20,6 @@ describe('NoteEditedText', () => { beforeEach(() => { wrapper = shallowMount(NoteEditedText, { - localVue, propsData, sync: false, attachToDocument: true, diff --git a/spec/frontend/snippets/components/app_spec.js b/spec/frontend/snippets/components/app_spec.js index f2800f9e6af..903290716cc 100644 --- a/spec/frontend/snippets/components/app_spec.js +++ b/spec/frontend/snippets/components/app_spec.js @@ -2,11 +2,10 @@ import SnippetApp from '~/snippets/components/app.vue'; import SnippetHeader from '~/snippets/components/snippet_header.vue'; import { GlLoadingIcon } from '@gitlab/ui'; -import { createLocalVue, shallowMount } from '@vue/test-utils'; +import { shallowMount } from '@vue/test-utils'; describe('Snippet view app', () => { let wrapper; - const localVue = createLocalVue(); const defaultProps = { snippetGid: 'gid://gitlab/PersonalSnippet/42', }; @@ -23,7 +22,6 @@ describe('Snippet view app', () => { wrapper = shallowMount(SnippetApp, { sync: false, mocks: { $apollo }, - localVue, propsData: { ...props, }, diff --git a/spec/frontend/snippets/components/snippet_header_spec.js b/spec/frontend/snippets/components/snippet_header_spec.js index 8847a3a6938..fce1628aab0 100644 --- a/spec/frontend/snippets/components/snippet_header_spec.js +++ b/spec/frontend/snippets/components/snippet_header_spec.js @@ -2,11 +2,10 @@ import SnippetHeader from '~/snippets/components/snippet_header.vue'; import DeleteSnippetMutation from '~/snippets/mutations/deleteSnippet.mutation.graphql'; import { ApolloMutation } from 'vue-apollo'; import { GlButton, GlModal } from '@gitlab/ui'; -import { createLocalVue, shallowMount } from '@vue/test-utils'; +import { shallowMount } from '@vue/test-utils'; describe('Snippet header component', () => { let wrapper; - const localVue = createLocalVue(); const snippet = { snippet: { id: 'gid://gitlab/PersonalSnippet/50', @@ -64,7 +63,6 @@ describe('Snippet header component', () => { wrapper = shallowMount(SnippetHeader, { sync: false, mocks: { $apollo }, - localVue, propsData: { ...defaultProps, }, diff --git a/spec/frontend/vue_mr_widget/components/artifacts_list_app_spec.js b/spec/frontend/vue_mr_widget/components/artifacts_list_app_spec.js index f979d173eff..adada264865 100644 --- a/spec/frontend/vue_mr_widget/components/artifacts_list_app_spec.js +++ b/spec/frontend/vue_mr_widget/components/artifacts_list_app_spec.js @@ -29,7 +29,7 @@ describe('Merge Requests Artifacts list app', () => { }); const createComponent = () => { - wrapper = mount(localVue.extend(ArtifactsListApp), { + wrapper = mount(ArtifactsListApp, { propsData: { endpoint: TEST_HOST, }, diff --git a/spec/frontend/vue_mr_widget/components/artifacts_list_spec.js b/spec/frontend/vue_mr_widget/components/artifacts_list_spec.js index 8c805faf574..ab701775a7c 100644 --- a/spec/frontend/vue_mr_widget/components/artifacts_list_spec.js +++ b/spec/frontend/vue_mr_widget/components/artifacts_list_spec.js @@ -1,23 +1,21 @@ -import { shallowMount, createLocalVue } from '@vue/test-utils'; +import { shallowMount } from '@vue/test-utils'; import { GlLink } from '@gitlab/ui'; import ArtifactsList from '~/vue_merge_request_widget/components/artifacts_list.vue'; import { artifactsList } from './mock_data'; describe('Artifacts List', () => { let wrapper; - const localVue = createLocalVue(); const data = { artifacts: artifactsList, }; const mountComponent = props => { - wrapper = shallowMount(localVue.extend(ArtifactsList), { + wrapper = shallowMount(ArtifactsList, { propsData: { ...props, }, sync: false, - localVue, }); }; diff --git a/spec/frontend/vue_mr_widget/components/mr_widget_container_spec.js b/spec/frontend/vue_mr_widget/components/mr_widget_container_spec.js index 16c8c939a6f..60f970e0018 100644 --- a/spec/frontend/vue_mr_widget/components/mr_widget_container_spec.js +++ b/spec/frontend/vue_mr_widget/components/mr_widget_container_spec.js @@ -1,4 +1,4 @@ -import { shallowMount, createLocalVue } from '@vue/test-utils'; +import { shallowMount } from '@vue/test-utils'; import MrWidgetContainer from '~/vue_merge_request_widget/components/mr_widget_container.vue'; const BODY_HTML = '<div class="test-body">Hello World</div>'; @@ -8,10 +8,7 @@ describe('MrWidgetContainer', () => { let wrapper; const factory = (options = {}) => { - const localVue = createLocalVue(); - - wrapper = shallowMount(localVue.extend(MrWidgetContainer), { - localVue, + wrapper = shallowMount(MrWidgetContainer, { ...options, }); }; diff --git a/spec/frontend/vue_mr_widget/components/mr_widget_icon_spec.js b/spec/frontend/vue_mr_widget/components/mr_widget_icon_spec.js index f7c2376eebf..662b1160b0c 100644 --- a/spec/frontend/vue_mr_widget/components/mr_widget_icon_spec.js +++ b/spec/frontend/vue_mr_widget/components/mr_widget_icon_spec.js @@ -1,4 +1,4 @@ -import { shallowMount, createLocalVue } from '@vue/test-utils'; +import { shallowMount } from '@vue/test-utils'; import MrWidgetIcon from '~/vue_merge_request_widget/components/mr_widget_icon.vue'; import Icon from '~/vue_shared/components/icon.vue'; @@ -8,14 +8,11 @@ describe('MrWidgetIcon', () => { let wrapper; beforeEach(() => { - const localVue = createLocalVue(); - - wrapper = shallowMount(localVue.extend(MrWidgetIcon), { + wrapper = shallowMount(MrWidgetIcon, { propsData: { name: TEST_ICON, }, sync: false, - localVue, }); }); diff --git a/spec/frontend/vue_mr_widget/components/states/commit_edit_spec.js b/spec/frontend/vue_mr_widget/components/states/commit_edit_spec.js index 6483fec4121..9ee497036c7 100644 --- a/spec/frontend/vue_mr_widget/components/states/commit_edit_spec.js +++ b/spec/frontend/vue_mr_widget/components/states/commit_edit_spec.js @@ -1,7 +1,6 @@ -import { createLocalVue, shallowMount } from '@vue/test-utils'; +import { shallowMount } from '@vue/test-utils'; import CommitEdit from '~/vue_merge_request_widget/components/states/commit_edit.vue'; -const localVue = createLocalVue(); const testCommitMessage = 'Test commit message'; const testLabel = 'Test label'; const testInputId = 'test-input-id'; @@ -10,8 +9,7 @@ describe('Commits edit component', () => { let wrapper; const createComponent = (slots = {}) => { - wrapper = shallowMount(localVue.extend(CommitEdit), { - localVue, + wrapper = shallowMount(CommitEdit, { sync: false, propsData: { value: testCommitMessage, diff --git a/spec/frontend/vue_mr_widget/components/states/mr_widget_commit_message_dropdown_spec.js b/spec/frontend/vue_mr_widget/components/states/mr_widget_commit_message_dropdown_spec.js index d1310515856..1096d5b3fa7 100644 --- a/spec/frontend/vue_mr_widget/components/states/mr_widget_commit_message_dropdown_spec.js +++ b/spec/frontend/vue_mr_widget/components/states/mr_widget_commit_message_dropdown_spec.js @@ -1,8 +1,7 @@ -import { createLocalVue, shallowMount } from '@vue/test-utils'; +import { shallowMount } from '@vue/test-utils'; import { GlDropdownItem } from '@gitlab/ui'; import CommitMessageDropdown from '~/vue_merge_request_widget/components/states/commit_message_dropdown.vue'; -const localVue = createLocalVue(); const commits = [ { title: 'Commit 1', @@ -25,8 +24,7 @@ describe('Commits message dropdown component', () => { let wrapper; const createComponent = () => { - wrapper = shallowMount(localVue.extend(CommitMessageDropdown), { - localVue, + wrapper = shallowMount(CommitMessageDropdown, { sync: false, propsData: { commits, diff --git a/spec/frontend/vue_mr_widget/components/states/mr_widget_commits_header_spec.js b/spec/frontend/vue_mr_widget/components/states/mr_widget_commits_header_spec.js index 3176a288d49..bc646d6dcd5 100644 --- a/spec/frontend/vue_mr_widget/components/states/mr_widget_commits_header_spec.js +++ b/spec/frontend/vue_mr_widget/components/states/mr_widget_commits_header_spec.js @@ -1,15 +1,12 @@ -import { createLocalVue, shallowMount } from '@vue/test-utils'; +import { shallowMount } from '@vue/test-utils'; import CommitsHeader from '~/vue_merge_request_widget/components/states/commits_header.vue'; import Icon from '~/vue_shared/components/icon.vue'; -const localVue = createLocalVue(); - describe('Commits header component', () => { let wrapper; const createComponent = props => { - wrapper = shallowMount(localVue.extend(CommitsHeader), { - localVue, + wrapper = shallowMount(CommitsHeader, { sync: false, propsData: { isSquashEnabled: false, diff --git a/spec/frontend/vue_mr_widget/deployment/deployment_view_button_spec.js b/spec/frontend/vue_mr_widget/deployment/deployment_view_button_spec.js index 6e3c6f64c68..b48c97341b2 100644 --- a/spec/frontend/vue_mr_widget/deployment/deployment_view_button_spec.js +++ b/spec/frontend/vue_mr_widget/deployment/deployment_view_button_spec.js @@ -1,4 +1,4 @@ -import { mount, createLocalVue } from '@vue/test-utils'; +import { mount } from '@vue/test-utils'; import DeploymentViewButton from '~/vue_merge_request_widget/components/deployment/deployment_view_button.vue'; import ReviewAppLink from '~/vue_merge_request_widget/components/review_app_link.vue'; import deploymentMockData from './deployment_mock_data'; @@ -7,10 +7,7 @@ describe('Deployment View App button', () => { let wrapper; const factory = (options = {}) => { - const localVue = createLocalVue(); - - wrapper = mount(localVue.extend(DeploymentViewButton), { - localVue, + wrapper = mount(DeploymentViewButton, { ...options, }); }; diff --git a/spec/javascripts/merge_request_tabs_spec.js b/spec/javascripts/merge_request_tabs_spec.js index 73b1ea4d36f..019aa191dc0 100644 --- a/spec/javascripts/merge_request_tabs_spec.js +++ b/spec/javascripts/merge_request_tabs_spec.js @@ -3,7 +3,6 @@ import MockAdapter from 'axios-mock-adapter'; import axios from '~/lib/utils/axios_utils'; import MergeRequestTabs from '~/merge_request_tabs'; import '~/commit/pipelines/pipelines_bundle'; -import '~/breakpoints'; import '~/lib/utils/common_utils'; import 'vendor/jquery.scrollTo'; import initMrPage from './helpers/init_vue_mr_page_helper'; diff --git a/spec/lib/gitlab/ci/config/entry/reports_spec.rb b/spec/lib/gitlab/ci/config/entry/reports_spec.rb index 3c352c30e55..060fc5c1fe0 100644 --- a/spec/lib/gitlab/ci/config/entry/reports_spec.rb +++ b/spec/lib/gitlab/ci/config/entry/reports_spec.rb @@ -41,6 +41,7 @@ describe Gitlab::Ci::Config::Entry::Reports do :container_scanning | 'gl-container-scanning-report.json' :dast | 'gl-dast-report.json' :license_management | 'gl-license-management-report.json' + :license_scanning | 'gl-license-management-report.json' :performance | 'performance.json' end diff --git a/spec/lib/gitlab/database/migration_helpers_spec.rb b/spec/lib/gitlab/database/migration_helpers_spec.rb index 9c8d53b0ed7..439f1343514 100644 --- a/spec/lib/gitlab/database/migration_helpers_spec.rb +++ b/spec/lib/gitlab/database/migration_helpers_spec.rb @@ -347,6 +347,48 @@ describe Gitlab::Database::MigrationHelpers do end end + describe '#validate_foreign_key' do + context 'when name is provided' do + it 'does not infer the foreign key constraint name' do + expect(model).to receive(:foreign_key_exists?).with(:projects, name: :foo).and_return(true) + + aggregate_failures do + expect(model).not_to receive(:concurrent_foreign_key_name) + expect(model).to receive(:disable_statement_timeout).and_call_original + expect(model).to receive(:execute).with(/statement_timeout/) + expect(model).to receive(:execute).ordered.with(/ALTER TABLE projects VALIDATE CONSTRAINT/) + expect(model).to receive(:execute).ordered.with(/RESET ALL/) + end + + model.validate_foreign_key(:projects, :user_id, name: :foo) + end + end + + context 'when name is not provided' do + it 'infers the foreign key constraint name' do + expect(model).to receive(:foreign_key_exists?).with(:projects, name: anything).and_return(true) + + aggregate_failures do + expect(model).to receive(:concurrent_foreign_key_name) + expect(model).to receive(:disable_statement_timeout).and_call_original + expect(model).to receive(:execute).with(/statement_timeout/) + expect(model).to receive(:execute).ordered.with(/ALTER TABLE projects VALIDATE CONSTRAINT/) + expect(model).to receive(:execute).ordered.with(/RESET ALL/) + end + + model.validate_foreign_key(:projects, :user_id) + end + + context 'when the inferred foreign key constraint does not exist' do + it 'raises an error' do + expect(model).to receive(:foreign_key_exists?).and_return(false) + + expect { model.validate_foreign_key(:projects, :user_id) }.to raise_error(/cannot find/) + end + end + end + end + describe '#concurrent_foreign_key_name' do it 'returns the name for a foreign key' do name = model.concurrent_foreign_key_name(:this_is_a_very_long_table_name, diff --git a/spec/services/ci/retry_build_service_spec.rb b/spec/services/ci/retry_build_service_spec.rb index 706649c1a8b..b0ba795841d 100644 --- a/spec/services/ci/retry_build_service_spec.rb +++ b/spec/services/ci/retry_build_service_spec.rb @@ -32,7 +32,8 @@ describe Ci::RetryBuildService do job_artifacts_metadata job_artifacts_trace job_artifacts_junit job_artifacts_sast job_artifacts_dependency_scanning job_artifacts_container_scanning job_artifacts_dast - job_artifacts_license_management job_artifacts_performance + job_artifacts_license_management job_artifacts_license_scanning + job_artifacts_performance job_artifacts_codequality job_artifacts_metrics scheduled_at job_variables waiting_for_resource_at].freeze |