diff --git a/.rubocop_todo/layout/argument_alignment.yml b/.rubocop_todo/layout/argument_alignment.yml index e4d1095b463..99911f6e9a7 100644 --- a/.rubocop_todo/layout/argument_alignment.yml +++ b/.rubocop_todo/layout/argument_alignment.yml @@ -1522,21 +1522,6 @@ Layout/ArgumentAlignment: - 'spec/components/previews/pajamas/alert_component_preview.rb' - 'spec/components/previews/pajamas/banner_component_preview.rb' - 'spec/components/previews/pajamas/button_component_preview.rb' - - 'spec/features/error_tracking/user_filters_errors_by_status_spec.rb' - - 'spec/features/error_tracking/user_searches_sentry_errors_spec.rb' - - 'spec/features/error_tracking/user_sees_error_details_spec.rb' - - 'spec/features/error_tracking/user_sees_error_index_spec.rb' - - 'spec/features/groups_spec.rb' - - 'spec/features/help_pages_spec.rb' - - 'spec/features/ics/dashboard_issues_spec.rb' - - 'spec/features/ics/group_issues_spec.rb' - - 'spec/features/ics/project_issues_spec.rb' - - 'spec/features/incidents/incident_timeline_events_spec.rb' - - 'spec/features/incidents/user_views_incident_spec.rb' - - 'spec/features/issuables/issuable_list_spec.rb' - - 'spec/features/issues/create_issue_for_single_discussion_in_merge_request_spec.rb' - - 'spec/features/issues/user_creates_branch_and_merge_request_spec.rb' - - 'spec/features/issues/user_filters_issues_spec.rb' - 'spec/features/jira_oauth_provider_authorize_spec.rb' - 'spec/features/markdown/gitlab_flavored_markdown_spec.rb' - 'spec/features/nav/top_nav_tooltip_spec.rb' diff --git a/db/migrate/20230626113908_add_project_id_to_scan_result_policies.rb b/db/migrate/20230626113908_add_project_id_to_scan_result_policies.rb new file mode 100644 index 00000000000..6066b945edf --- /dev/null +++ b/db/migrate/20230626113908_add_project_id_to_scan_result_policies.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +class AddProjectIdToScanResultPolicies < Gitlab::Database::Migration[2.1] + def up + add_column :scan_result_policies, :project_id, :bigint + end + + def down + remove_column :scan_result_policies, :project_id + end +end diff --git a/db/migrate/20230626113909_add_index_to_scan_result_policies_on_project_id.rb b/db/migrate/20230626113909_add_index_to_scan_result_policies_on_project_id.rb new file mode 100644 index 00000000000..63416765bfa --- /dev/null +++ b/db/migrate/20230626113909_add_index_to_scan_result_policies_on_project_id.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class AddIndexToScanResultPoliciesOnProjectId < Gitlab::Database::Migration[2.1] + INDEX_NAME = 'index_scan_result_policies_on_project_id' + + disable_ddl_transaction! + + def up + add_concurrent_index :scan_result_policies, :project_id, name: INDEX_NAME + end + + def down + remove_concurrent_index_by_name :scan_result_policies, INDEX_NAME + end +end diff --git a/db/migrate/20230626113910_add_project_id_foreign_key_to_scan_result_policies.rb b/db/migrate/20230626113910_add_project_id_foreign_key_to_scan_result_policies.rb new file mode 100644 index 00000000000..c5446e17ef3 --- /dev/null +++ b/db/migrate/20230626113910_add_project_id_foreign_key_to_scan_result_policies.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +class AddProjectIdForeignKeyToScanResultPolicies < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + def up + add_concurrent_foreign_key :scan_result_policies, + :projects, + column: :project_id, + on_delete: :cascade + end + + def down + remove_foreign_key_if_exists :scan_result_policies, column: :project_id + end +end diff --git a/db/schema_migrations/20230626113908 b/db/schema_migrations/20230626113908 new file mode 100644 index 00000000000..2d3f3205189 --- /dev/null +++ b/db/schema_migrations/20230626113908 @@ -0,0 +1 @@ +542e2345a171e46512d793cc764fdbb279d9bf40e65e021d249953b29ff66dcb \ No newline at end of file diff --git a/db/schema_migrations/20230626113909 b/db/schema_migrations/20230626113909 new file mode 100644 index 00000000000..2edeec73a10 --- /dev/null +++ b/db/schema_migrations/20230626113909 @@ -0,0 +1 @@ +633753a79a9d4f251c89b7fdbbf5fa17d2c85ceba091c450d377ab4e50bd9bce \ No newline at end of file diff --git a/db/schema_migrations/20230626113910 b/db/schema_migrations/20230626113910 new file mode 100644 index 00000000000..ee86f5c77c4 --- /dev/null +++ b/db/schema_migrations/20230626113910 @@ -0,0 +1 @@ +a702fd86f25c3044e7eb8195349aec6f0627e258946c996164880c0f72998176 \ No newline at end of file diff --git a/db/structure.sql b/db/structure.sql index 24d6f53b0d9..66df68e8b6c 100644 --- a/db/structure.sql +++ b/db/structure.sql @@ -22337,6 +22337,7 @@ CREATE TABLE scan_result_policies ( age_operator smallint, age_interval smallint, vulnerability_attributes jsonb DEFAULT '{}'::jsonb, + project_id bigint, CONSTRAINT age_value_null_or_positive CHECK (((age_value IS NULL) OR (age_value >= 0))) ); @@ -32812,6 +32813,8 @@ CREATE UNIQUE INDEX index_sbom_sources_on_source_type_and_source ON sbom_sources CREATE INDEX index_scan_result_policies_on_policy_configuration_id ON scan_result_policies USING btree (security_orchestration_policy_configuration_id); +CREATE INDEX index_scan_result_policies_on_project_id ON scan_result_policies USING btree (project_id); + CREATE INDEX index_schema_inconsistencies_on_issue_id ON schema_inconsistencies USING btree (issue_id); CREATE INDEX index_scim_identities_on_group_id ON scim_identities USING btree (group_id); @@ -35732,6 +35735,9 @@ ALTER TABLE ONLY lists ALTER TABLE ONLY protected_branches ADD CONSTRAINT fk_7a9c6d93e7 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; +ALTER TABLE ONLY scan_result_policies + ADD CONSTRAINT fk_7aa24439f1 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; + ALTER TABLE ONLY vulnerabilities ADD CONSTRAINT fk_7ac31eacb9 FOREIGN KEY (updated_by_id) REFERENCES users(id) ON DELETE SET NULL; diff --git a/doc/administration/audit_event_streaming/graphql_api.md b/doc/administration/audit_event_streaming/graphql_api.md index fba09ee4e01..e1d1b906b99 100644 --- a/doc/administration/audit_event_streaming/graphql_api.md +++ b/doc/administration/audit_event_streaming/graphql_api.md @@ -274,6 +274,7 @@ query { logIdName googleProjectIdName privateKey + clientEmail } } } @@ -392,7 +393,7 @@ by [listing all the external destinations](#list-streaming-destinations). ```graphql mutation { googleCloudLoggingConfigurationUpdate( - input: {id: "gid://gitlab/AuditEvents::GoogleCloudLoggingConfiguration/1", groupPath: "my-group", googleProjectIdName: "my-google-project", clientEmail: "my-email@my-google-project.iam.gservice.account.com", privateKey: "YOUR_PRIVATE_KEY", logIdName: "audit-events"} + input: {id: "gid://gitlab/AuditEvents::GoogleCloudLoggingConfiguration/1", googleProjectIdName: "my-google-project", clientEmail: "my-email@my-google-project.iam.gservice.account.com", privateKey: "YOUR_PRIVATE_KEY", logIdName: "audit-events"} ) { errors googleCloudLoggingConfiguration { @@ -400,6 +401,7 @@ mutation { logIdName privateKey googleProjectIdName + clientEmail } } } diff --git a/doc/ci/testing/code_quality.md b/doc/ci/testing/code_quality.md index 8fad41f163d..2ddd1122dc7 100644 --- a/doc/ci/testing/code_quality.md +++ b/doc/ci/testing/code_quality.md @@ -51,7 +51,8 @@ Code Quality results are shown in the: > [Moved](https://gitlab.com/gitlab-org/gitlab/-/issues/212499) to GitLab Free in 13.2. Code Quality analysis results display in the merge request widget area if a report from the target -branch is available for comparison. +branch is available for comparison. The merge request widget displays Code Quality findings and resolutions that +were introduced by the changes made in the merge request. ![Code Quality Widget](img/code_quality_widget_13_11.png) @@ -70,7 +71,8 @@ issues are marked by an indicator beside the gutter. Hover over the marker for d ### Pipeline details view **(PREMIUM)** The full list of Code Quality violations generated by a pipeline is shown in the **Code Quality** -tab of the pipeline's details page. +tab of the pipeline's details page. The pipeline details view displays all Code Quality findings +that were found on the branch it was run on. ![Code Quality Report](img/code_quality_report_13_11.png) diff --git a/doc/user/application_security/dependency_scanning/index.md b/doc/user/application_security/dependency_scanning/index.md index 9cc167e0496..f9a6ffa8228 100644 --- a/doc/user/application_security/dependency_scanning/index.md +++ b/doc/user/application_security/dependency_scanning/index.md @@ -339,7 +339,7 @@ The following package managers use lockfiles that GitLab analyzers are capable o | Composer | Not applicable | [1.x](https://gitlab.com/gitlab-org/security-products/analyzers/gemnasium/-/blob/master/qa/fixtures/php-composer/default/composer.lock) | | Conan | 0.4 | [1.x](https://gitlab.com/gitlab-org/security-products/analyzers/gemnasium/-/blob/master/qa/fixtures/c-conan/default/conan.lock#L38) | | Go | Not applicable | [1.x](https://gitlab.com/gitlab-org/security-products/analyzers/gemnasium/-/blob/master/qa/fixtures/go-modules/gosum/default/go.sum) 1 | -| NuGet | v1 | [4.9](https://gitlab.com/gitlab-org/security-products/analyzers/gemnasium/-/blob/master/qa/fixtures/csharp-nuget-dotnetcore/default/src/web.api/packages.lock.json#L2) | +| NuGet | v1, v2 | [4.9](https://gitlab.com/gitlab-org/security-products/analyzers/gemnasium/-/blob/master/qa/fixtures/csharp-nuget-dotnetcore/default/src/web.api/packages.lock.json#L2) | | npm | v1, v2, v32 | [6.x](https://gitlab.com/gitlab-org/security-products/analyzers/gemnasium/-/blob/master/qa/fixtures/js-npm/default/package-lock.json#L4), [7.x](https://gitlab.com/gitlab-org/security-products/analyzers/gemnasium/-/blob/master/qa/fixtures/js-npm/lockfileVersion2/package-lock.json#L4), [9.x](https://gitlab.com/gitlab-org/security-products/analyzers/gemnasium/-/blob/master/scanner/parser/npm/fixtures/lockfile-v3/simple/package-lock.json#L4) | | pnpm | v5.3, v5.4, v6 | [7.x](https://gitlab.com/gitlab-org/security-products/analyzers/gemnasium/-/blob/master/qa/fixtures/js-pnpm/default/pnpm-lock.yaml#L1), [8.x](https://gitlab.com/gitlab-org/security-products/analyzers/gemnasium/-/blob/master/scanner/parser/pnpm/fixtures/v6/simple/pnpm-lock.yaml#L1) | | yarn | v1, v23, v33 | [1.x](https://gitlab.com/gitlab-org/security-products/analyzers/gemnasium/-/blob/master/qa/fixtures/js-yarn/classic/default/yarn.lock#L2), [2.x](https://gitlab.com/gitlab-org/security-products/analyzers/gemnasium/-/blob/master/qa/fixtures/js-yarn/berry/v2/default/yarn.lock), [3.x](https://gitlab.com/gitlab-org/security-products/analyzers/gemnasium/-/blob/master/qa/fixtures/js-yarn/berry/v3/default/yarn.lock) | diff --git a/spec/features/error_tracking/user_filters_errors_by_status_spec.rb b/spec/features/error_tracking/user_filters_errors_by_status_spec.rb index 168c4f330ca..5efcb5f8b8e 100644 --- a/spec/features/error_tracking/user_filters_errors_by_status_spec.rb +++ b/spec/features/error_tracking/user_filters_errors_by_status_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' RSpec.describe 'When a user filters Sentry errors by status', :js, :use_clean_rails_memory_store_caching, :sidekiq_inline, -feature_category: :error_tracking do + feature_category: :error_tracking do include_context 'sentry error tracking context feature' let_it_be(:issues_response_body) { fixture_file('sentry/issues_sample_response.json') } diff --git a/spec/features/error_tracking/user_searches_sentry_errors_spec.rb b/spec/features/error_tracking/user_searches_sentry_errors_spec.rb index 6026b42f7de..d4c537f1939 100644 --- a/spec/features/error_tracking/user_searches_sentry_errors_spec.rb +++ b/spec/features/error_tracking/user_searches_sentry_errors_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' RSpec.describe 'When a user searches for Sentry errors', :js, :use_clean_rails_memory_store_caching, :sidekiq_inline, -feature_category: :error_tracking do + feature_category: :error_tracking do include_context 'sentry error tracking context feature' let_it_be(:issues_response_body) { fixture_file('sentry/issues_sample_response.json') } diff --git a/spec/features/error_tracking/user_sees_error_details_spec.rb b/spec/features/error_tracking/user_sees_error_details_spec.rb index d7676d90d21..8fcf5df41c7 100644 --- a/spec/features/error_tracking/user_sees_error_details_spec.rb +++ b/spec/features/error_tracking/user_sees_error_details_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' RSpec.describe 'View error details page', :js, :use_clean_rails_memory_store_caching, :sidekiq_inline, -feature_category: :error_tracking do + feature_category: :error_tracking do include_context 'sentry error tracking context feature' context 'with current user as project owner' do diff --git a/spec/features/error_tracking/user_sees_error_index_spec.rb b/spec/features/error_tracking/user_sees_error_index_spec.rb index f83c8ffe439..e86e89ad058 100644 --- a/spec/features/error_tracking/user_sees_error_index_spec.rb +++ b/spec/features/error_tracking/user_sees_error_index_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' RSpec.describe 'View error index page', :js, :use_clean_rails_memory_store_caching, :sidekiq_inline, -feature_category: :error_tracking do + feature_category: :error_tracking do include_context 'sentry error tracking context feature' let_it_be(:issues_response_body) { fixture_file('sentry/issues_sample_response.json') } diff --git a/spec/features/groups_spec.rb b/spec/features/groups_spec.rb index de4b9964b98..67133b1856f 100644 --- a/spec/features/groups_spec.rb +++ b/spec/features/groups_spec.rb @@ -461,9 +461,11 @@ RSpec.describe 'Group', feature_category: :groups_and_projects do describe 'new subgroup / project button' do let_it_be(:group, reload: true) do - create(:group, - project_creation_level: Gitlab::Access::NO_ONE_PROJECT_ACCESS, - subgroup_creation_level: Gitlab::Access::OWNER_SUBGROUP_ACCESS) + create( + :group, + project_creation_level: Gitlab::Access::NO_ONE_PROJECT_ACCESS, + subgroup_creation_level: Gitlab::Access::OWNER_SUBGROUP_ACCESS + ) end before do diff --git a/spec/features/help_pages_spec.rb b/spec/features/help_pages_spec.rb index 905c5e25f6e..627326dde18 100644 --- a/spec/features/help_pages_spec.rb +++ b/spec/features/help_pages_spec.rb @@ -47,9 +47,11 @@ RSpec.describe 'Help Pages', feature_category: :shared do describe 'when help page is customized' do before do - stub_application_setting(help_page_hide_commercial_content: true, - help_page_text: 'My Custom Text', - help_page_support_url: 'http://example.com/help') + stub_application_setting( + help_page_hide_commercial_content: true, + help_page_text: 'My Custom Text', + help_page_support_url: 'http://example.com/help' + ) sign_in(create(:user)) visit help_path diff --git a/spec/features/ics/dashboard_issues_spec.rb b/spec/features/ics/dashboard_issues_spec.rb index 7115bd7dff7..00318f83105 100644 --- a/spec/features/ics/dashboard_issues_spec.rb +++ b/spec/features/ics/dashboard_issues_spec.rb @@ -29,9 +29,11 @@ RSpec.describe 'Dashboard Issues Calendar Feed', feature_category: :team_plannin context 'with no referer' do it 'renders calendar feed' do sign_in user - visit issues_dashboard_path(:ics, - due_date: Issue::DueNextMonthAndPreviousTwoWeeks.name, - sort: 'closest_future_date') + visit issues_dashboard_path( + :ics, + due_date: Issue::DueNextMonthAndPreviousTwoWeeks.name, + sort: 'closest_future_date' + ) expect(response_headers['Content-Type']).to have_content('text/calendar') expect(body).to have_text('BEGIN:VCALENDAR') @@ -42,9 +44,11 @@ RSpec.describe 'Dashboard Issues Calendar Feed', feature_category: :team_plannin it 'renders calendar feed as text/plain' do sign_in user page.driver.header('Referer', issues_dashboard_url(host: Settings.gitlab.base_url)) - visit issues_dashboard_path(:ics, - due_date: Issue::DueNextMonthAndPreviousTwoWeeks.name, - sort: 'closest_future_date') + visit issues_dashboard_path( + :ics, + due_date: Issue::DueNextMonthAndPreviousTwoWeeks.name, + sort: 'closest_future_date' + ) expect(response_headers['Content-Type']).to have_content('text/plain') expect(body).to have_text('BEGIN:VCALENDAR') @@ -54,10 +58,12 @@ RSpec.describe 'Dashboard Issues Calendar Feed', feature_category: :team_plannin context 'when filtered by milestone' do it 'renders calendar feed' do sign_in user - visit issues_dashboard_path(:ics, - due_date: Issue::DueNextMonthAndPreviousTwoWeeks.name, - sort: 'closest_future_date', - milestone_title: milestone.title) + visit issues_dashboard_path( + :ics, + due_date: Issue::DueNextMonthAndPreviousTwoWeeks.name, + sort: 'closest_future_date', + milestone_title: milestone.title + ) expect(response_headers['Content-Type']).to have_content('text/calendar') expect(body).to have_text('BEGIN:VCALENDAR') @@ -69,10 +75,12 @@ RSpec.describe 'Dashboard Issues Calendar Feed', feature_category: :team_plannin it 'renders calendar feed' do personal_access_token = create(:personal_access_token, user: user) - visit issues_dashboard_path(:ics, - due_date: Issue::DueNextMonthAndPreviousTwoWeeks.name, - sort: 'closest_future_date', - private_token: personal_access_token.token) + visit issues_dashboard_path( + :ics, + due_date: Issue::DueNextMonthAndPreviousTwoWeeks.name, + sort: 'closest_future_date', + private_token: personal_access_token.token + ) expect(response_headers['Content-Type']).to have_content('text/calendar') expect(body).to have_text('BEGIN:VCALENDAR') @@ -81,10 +89,12 @@ RSpec.describe 'Dashboard Issues Calendar Feed', feature_category: :team_plannin context 'when authenticated via feed token' do it 'renders calendar feed' do - visit issues_dashboard_path(:ics, - due_date: Issue::DueNextMonthAndPreviousTwoWeeks.name, - sort: 'closest_future_date', - feed_token: user.feed_token) + visit issues_dashboard_path( + :ics, + due_date: Issue::DueNextMonthAndPreviousTwoWeeks.name, + sort: 'closest_future_date', + feed_token: user.feed_token + ) expect(response_headers['Content-Type']).to have_content('text/calendar') expect(body).to have_text('BEGIN:VCALENDAR') @@ -93,15 +103,24 @@ RSpec.describe 'Dashboard Issues Calendar Feed', feature_category: :team_plannin context 'issue with due date' do let!(:issue) do - create(:issue, author: user, assignees: [assignee], project: project, title: 'test title', - description: 'test desc', due_date: Date.tomorrow) + create( + :issue, + author: user, + assignees: [assignee], + project: project, + title: 'test title', + description: 'test desc', + due_date: Date.tomorrow + ) end it 'renders issue fields' do - visit issues_dashboard_path(:ics, - due_date: Issue::DueNextMonthAndPreviousTwoWeeks.name, - sort: 'closest_future_date', - feed_token: user.feed_token) + visit issues_dashboard_path( + :ics, + due_date: Issue::DueNextMonthAndPreviousTwoWeeks.name, + sort: 'closest_future_date', + feed_token: user.feed_token + ) expect(body).to have_text("SUMMARY:test title (in #{project.full_path})") # line length for ics is 75 chars diff --git a/spec/features/ics/group_issues_spec.rb b/spec/features/ics/group_issues_spec.rb index 164f5df7cc5..ce9f5638a00 100644 --- a/spec/features/ics/group_issues_spec.rb +++ b/spec/features/ics/group_issues_spec.rb @@ -71,8 +71,15 @@ RSpec.describe 'Group Issues Calendar Feed', feature_category: :groups_and_proje context 'issue with due date' do let!(:issue) do - create(:issue, author: user, assignees: [assignee], project: project, title: 'test title', - description: 'test desc', due_date: Date.tomorrow) + create( + :issue, + author: user, + assignees: [assignee], + project: project, + title: 'test title', + description: 'test desc', + due_date: Date.tomorrow + ) end it 'renders issue fields' do diff --git a/spec/features/ics/project_issues_spec.rb b/spec/features/ics/project_issues_spec.rb index daad6f1df2f..c26147e0310 100644 --- a/spec/features/ics/project_issues_spec.rb +++ b/spec/features/ics/project_issues_spec.rb @@ -70,8 +70,15 @@ RSpec.describe 'Project Issues Calendar Feed', feature_category: :groups_and_pro context 'issue with due date' do let!(:issue) do - create(:issue, author: user, assignees: [assignee], project: project, title: 'test title', - description: 'test desc', due_date: Date.tomorrow) + create( + :issue, + author: user, + assignees: [assignee], + project: project, + title: 'test title', + description: 'test desc', + due_date: Date.tomorrow + ) end it 'renders issue fields' do diff --git a/spec/features/incidents/incident_timeline_events_spec.rb b/spec/features/incidents/incident_timeline_events_spec.rb index 8829f21cabe..bd3658ab60f 100644 --- a/spec/features/incidents/incident_timeline_events_spec.rb +++ b/spec/features/incidents/incident_timeline_events_spec.rb @@ -93,7 +93,7 @@ RSpec.describe 'Incident timeline events', :js, feature_category: :incident_mana end it_behaves_like 'for each incident details route', - 'add, edit, and delete timeline events', - tab_text: s_('Incident|Timeline'), - tab: 'timeline' + 'add, edit, and delete timeline events', + tab_text: s_('Incident|Timeline'), + tab: 'timeline' end diff --git a/spec/features/incidents/user_views_incident_spec.rb b/spec/features/incidents/user_views_incident_spec.rb index 8739c99bdd0..bbf579b09a8 100644 --- a/spec/features/incidents/user_views_incident_spec.rb +++ b/spec/features/incidents/user_views_incident_spec.rb @@ -31,10 +31,12 @@ RSpec.describe "User views incident", feature_category: :incident_management do describe 'user actions' do it 'shows the merge request and incident actions', :js, :aggregate_failures do - expected_href = new_project_issue_path(project, - issuable_template: 'incident', - issue: { issue_type: 'incident' }, - add_related_issue: incident.iid) + expected_href = new_project_issue_path( + project, + issuable_template: 'incident', + issue: { issue_type: 'incident' }, + add_related_issue: incident.iid + ) click_button 'Incident actions' diff --git a/spec/features/issuables/issuable_list_spec.rb b/spec/features/issuables/issuable_list_spec.rb index c979aff2147..7bf9620f282 100644 --- a/spec/features/issuables/issuable_list_spec.rb +++ b/spec/features/issuables/issuable_list_spec.rb @@ -99,9 +99,7 @@ RSpec.describe 'issuable list', :js, feature_category: :team_planning do if issuable_type == :issue issue = Issue.reorder(:iid).first - merge_request = create(:merge_request, - source_project: project, - source_branch: generate(:branch)) + merge_request = create(:merge_request, source_project: project, source_branch: generate(:branch)) create(:merge_requests_closing_issues, issue: issue, merge_request: merge_request) end diff --git a/spec/features/issues/create_issue_for_single_discussion_in_merge_request_spec.rb b/spec/features/issues/create_issue_for_single_discussion_in_merge_request_spec.rb index 3a32bd34af8..73a920421a3 100644 --- a/spec/features/issues/create_issue_for_single_discussion_in_merge_request_spec.rb +++ b/spec/features/issues/create_issue_for_single_discussion_in_merge_request_spec.rb @@ -74,8 +74,11 @@ RSpec.describe 'Resolve an open thread in a merge request by creating an issue', before do project.add_reporter(user) sign_in user - visit new_project_issue_path(project, merge_request_to_resolve_discussions_of: merge_request.iid, - discussion_to_resolve: discussion.id) + visit new_project_issue_path( + project, + merge_request_to_resolve_discussions_of: merge_request.iid, + discussion_to_resolve: discussion.id + ) end it 'shows a notice to ask someone else to resolve the threads' do diff --git a/spec/features/issues/user_creates_branch_and_merge_request_spec.rb b/spec/features/issues/user_creates_branch_and_merge_request_spec.rb index 1050bc2456f..ecb899a7ca2 100644 --- a/spec/features/issues/user_creates_branch_and_merge_request_spec.rb +++ b/spec/features/issues/user_creates_branch_and_merge_request_spec.rb @@ -137,13 +137,25 @@ RSpec.describe 'User creates branch and merge request on issue page', :js, featu context "when there is a referenced merge request" do let!(:note) do - create(:note, :on_issue, :system, project: project, noteable: issue, - note: "mentioned in #{referenced_mr.to_reference}") + create( + :note, + :on_issue, + :system, + project: project, + noteable: issue, + note: "mentioned in #{referenced_mr.to_reference}" + ) end let(:referenced_mr) do - create(:merge_request, :simple, source_project: project, target_project: project, - description: "Fixes #{issue.to_reference}", author: user) + create( + :merge_request, + :simple, + source_project: project, + target_project: project, + description: "Fixes #{issue.to_reference}", + author: user + ) end before do diff --git a/spec/features/issues/user_filters_issues_spec.rb b/spec/features/issues/user_filters_issues_spec.rb index 9f69e94b86c..593b43698a2 100644 --- a/spec/features/issues/user_filters_issues_spec.rb +++ b/spec/features/issues/user_filters_issues_spec.rb @@ -8,11 +8,13 @@ RSpec.describe 'User filters issues', :js, feature_category: :team_planning do before do %w[foobar barbaz].each do |title| - create(:issue, - author: user, - assignees: [user], - project: project, - title: title) + create( + :issue, + author: user, + assignees: [user], + project: project, + title: title + ) end @issue = Issue.find_by(title: 'foobar') diff --git a/spec/lib/gitlab/import_export/all_models.yml b/spec/lib/gitlab/import_export/all_models.yml index 0340c7db75d..ab3a7dbb500 100644 --- a/spec/lib/gitlab/import_export/all_models.yml +++ b/spec/lib/gitlab/import_export/all_models.yml @@ -808,6 +808,7 @@ project: - design_management_repository - design_management_repository_state - compliance_standards_adherence +- scan_result_policy_reads award_emoji: - awardable - user diff --git a/spec/models/application_setting_spec.rb b/spec/models/application_setting_spec.rb index 08de31c3e2d..26bbe305dc5 100644 --- a/spec/models/application_setting_spec.rb +++ b/spec/models/application_setting_spec.rb @@ -59,8 +59,7 @@ RSpec.describe ApplicationSetting, feature_category: :shared, type: :model do it { is_expected.to allow_value("dev.gitlab.com").for(:commit_email_hostname) } it { is_expected.not_to allow_value("@dev.gitlab").for(:commit_email_hostname) } - it { is_expected.to allow_value(true).for(:container_expiration_policies_enable_historic_entries) } - it { is_expected.to allow_value(false).for(:container_expiration_policies_enable_historic_entries) } + it { is_expected.to allow_value(true, false).for(:container_expiration_policies_enable_historic_entries) } it { is_expected.not_to allow_value(nil).for(:container_expiration_policies_enable_historic_entries) } it { is_expected.to allow_value("myemail@gitlab.com").for(:lets_encrypt_notification_email) } @@ -100,8 +99,7 @@ RSpec.describe ApplicationSetting, feature_category: :shared, type: :model do it { is_expected.to validate_numericality_of(:container_registry_cleanup_tags_service_max_list_size).only_integer.is_greater_than_or_equal_to(0) } it { is_expected.to validate_numericality_of(:container_registry_data_repair_detail_worker_max_concurrency).only_integer.is_greater_than_or_equal_to(0) } it { is_expected.to validate_numericality_of(:container_registry_expiration_policies_worker_capacity).only_integer.is_greater_than_or_equal_to(0) } - it { is_expected.to allow_value(true).for(:container_registry_expiration_policies_caching) } - it { is_expected.to allow_value(false).for(:container_registry_expiration_policies_caching) } + it { is_expected.to allow_value(true, false).for(:container_registry_expiration_policies_caching) } it { is_expected.to validate_numericality_of(:container_registry_import_max_tags_count).only_integer.is_greater_than_or_equal_to(0) } it { is_expected.to validate_numericality_of(:container_registry_import_max_retries).only_integer.is_greater_than_or_equal_to(0) } @@ -134,8 +132,7 @@ RSpec.describe ApplicationSetting, feature_category: :shared, type: :model do it { is_expected.to validate_numericality_of(:snippet_size_limit).only_integer.is_greater_than(0) } it { is_expected.to validate_numericality_of(:wiki_page_max_content_bytes).only_integer.is_greater_than_or_equal_to(1024) } - it { is_expected.to allow_value(true).for(:wiki_asciidoc_allow_uri_includes) } - it { is_expected.to allow_value(false).for(:wiki_asciidoc_allow_uri_includes) } + it { is_expected.to allow_value(true, false).for(:wiki_asciidoc_allow_uri_includes) } it { is_expected.not_to allow_value(nil).for(:wiki_asciidoc_allow_uri_includes) } it { is_expected.to validate_presence_of(:max_artifacts_size) } it { is_expected.to validate_numericality_of(:max_artifacts_size).only_integer.is_greater_than(0) } @@ -148,8 +145,7 @@ RSpec.describe ApplicationSetting, feature_category: :shared, type: :model do it { is_expected.to validate_presence_of(:max_terraform_state_size_bytes) } it { is_expected.to validate_numericality_of(:max_terraform_state_size_bytes).only_integer.is_greater_than_or_equal_to(0) } - it { is_expected.to allow_value(true).for(:user_defaults_to_private_profile) } - it { is_expected.to allow_value(false).for(:user_defaults_to_private_profile) } + it { is_expected.to allow_value(true, false).for(:user_defaults_to_private_profile) } it { is_expected.not_to allow_value(nil).for(:user_defaults_to_private_profile) } it { is_expected.to allow_values([true, false]).for(:deny_all_requests_except_allowed) } @@ -250,16 +246,13 @@ RSpec.describe ApplicationSetting, feature_category: :shared, type: :model do it { is_expected.to allow_value(http).for(:jira_connect_proxy_url) } it { is_expected.to allow_value(https).for(:jira_connect_proxy_url) } - it { is_expected.to allow_value(true).for(:bulk_import_enabled) } - it { is_expected.to allow_value(false).for(:bulk_import_enabled) } + it { is_expected.to allow_value(true, false).for(:bulk_import_enabled) } it { is_expected.not_to allow_value(nil).for(:bulk_import_enabled) } - it { is_expected.to allow_value(true).for(:allow_runner_registration_token) } - it { is_expected.to allow_value(false).for(:allow_runner_registration_token) } + it { is_expected.to allow_value(true, false).for(:allow_runner_registration_token) } it { is_expected.not_to allow_value(nil).for(:allow_runner_registration_token) } - it { is_expected.to allow_value(true).for(:gitlab_dedicated_instance) } - it { is_expected.to allow_value(false).for(:gitlab_dedicated_instance) } + it { is_expected.to allow_value(true, false).for(:gitlab_dedicated_instance) } it { is_expected.not_to allow_value(nil).for(:gitlab_dedicated_instance) } it { is_expected.not_to allow_value(random: :value).for(:database_apdex_settings) }