diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-09-20 03:10:08 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-09-20 03:10:08 +0300 |
commit | 05e8f05317356d094906344c27b2abc25aadd4eb (patch) | |
tree | f62dd7541a5584cedf5f00a660450a32c03ca57c | |
parent | 9adb0b9ffb2d4a552f8c6f32d16fe863cc2975b0 (diff) |
Add latest changes from gitlab-org/gitlab@master
22 files changed, 101 insertions, 77 deletions
diff --git a/app/assets/javascripts/diffs/components/diff_file_header.vue b/app/assets/javascripts/diffs/components/diff_file_header.vue index d62d0e11bff..a9e63ad53bb 100644 --- a/app/assets/javascripts/diffs/components/diff_file_header.vue +++ b/app/assets/javascripts/diffs/components/diff_file_header.vue @@ -337,7 +337,7 @@ export default { :title="filePath" class="file-title-name" data-container="body" - data-qa-selector="file_name_content" + data-testid="file-name-content" > {{ filePath }} </strong> diff --git a/app/assets/javascripts/merge_requests/components/compare_app.vue b/app/assets/javascripts/merge_requests/components/compare_app.vue index 20c95174989..c7c16e91e4c 100644 --- a/app/assets/javascripts/merge_requests/components/compare_app.vue +++ b/app/assets/javascripts/merge_requests/components/compare_app.vue @@ -32,9 +32,6 @@ export default { toggleClass: { default: () => ({}), }, - branchQaSelector: { - default: '', - }, }, props: { currentBranch: { @@ -119,7 +116,6 @@ export default { :input-name="inputs.branch.name" :default="currentBranch" :toggle-class="toggleClass.branch" - :qa-selector="branchQaSelector" data-testid="compare-dropdown" @selected="selectBranch" /> diff --git a/app/assets/javascripts/merge_requests/components/compare_dropdown.vue b/app/assets/javascripts/merge_requests/components/compare_dropdown.vue index 6f46b41ee5b..2855d704507 100644 --- a/app/assets/javascripts/merge_requests/components/compare_dropdown.vue +++ b/app/assets/javascripts/merge_requests/components/compare_dropdown.vue @@ -46,11 +46,6 @@ export default { required: false, default: '', }, - qaSelector: { - type: String, - required: false, - default: null, - }, }, data() { return { @@ -142,7 +137,7 @@ export default { 'gl-align-items-flex-start! gl-justify-content-start! mr-compare-dropdown', toggleClass, ]" - :data-qa-selector="qaSelector" + data-testid="source-branch-dropdown" @shown="fetchData" @search="searchData" @select="selectItem" diff --git a/app/assets/javascripts/pages/projects/merge_requests/creations/new/index.js b/app/assets/javascripts/pages/projects/merge_requests/creations/new/index.js index 9db400b3b0a..d23a0615bb8 100644 --- a/app/assets/javascripts/pages/projects/merge_requests/creations/new/index.js +++ b/app/assets/javascripts/pages/projects/merge_requests/creations/new/index.js @@ -43,7 +43,6 @@ if (mrNewCompareNode) { project: 'js-source-project', branch: 'js-source-branch gl-font-monospace', }, - branchQaSelector: 'source_branch_dropdown', }, methods: { async selectedBranch(branchName) { diff --git a/app/assets/javascripts/vue_shared/components/file_row.vue b/app/assets/javascripts/vue_shared/components/file_row.vue index 721f87ff4d6..cecd1be82e9 100644 --- a/app/assets/javascripts/vue_shared/components/file_row.vue +++ b/app/assets/javascripts/vue_shared/components/file_row.vue @@ -141,7 +141,6 @@ export default { ref="textOutput" class="file-row-name" :title="file.name" - data-qa-selector="file_name_content" :data-qa-file-name="file.name" data-testid="file-row-name-container" :class="[fileClasses, { 'str-truncated': !truncateMiddle, 'gl-min-w-0': truncateMiddle }]" diff --git a/app/views/projects/blob/_header_content.html.haml b/app/views/projects/blob/_header_content.html.haml index 9cd2f583fdd..8c132a16797 100644 --- a/app/views/projects/blob/_header_content.html.haml +++ b/app/views/projects/blob/_header_content.html.haml @@ -3,7 +3,7 @@ .js-table-contents = blob_icon blob.mode, blob.name - %strong.file-title-name.gl-word-break-all{ data: { qa_selector: 'file_name_content' } } + %strong.file-title-name.gl-word-break-all{ data: { testid: 'file-name-content' } } = blob.name = copy_file_path_button(blob.path) diff --git a/app/views/projects/diffs/_file_header.html.haml b/app/views/projects/diffs/_file_header.html.haml index c3a300958f7..17e55699615 100644 --- a/app/views/projects/diffs/_file_header.html.haml +++ b/app/views/projects/diffs/_file_header.html.haml @@ -23,7 +23,7 @@ %strong.file-title-name.has-tooltip.gl-word-break-all{ data: { title: diff_file.new_path, container: 'body' } } = new_path - else - %strong.file-title-name.has-tooltip.gl-word-break-all{ data: { title: diff_file.file_path, container: 'body', qa_selector: 'file_name_content' } } + %strong.file-title-name.has-tooltip.gl-word-break-all{ data: { title: diff_file.file_path, container: 'body', testid: 'file-name-content' } } = diff_file.file_path - if diff_file.deleted_file? diff --git a/doc/administration/dedicated/index.md b/doc/administration/dedicated/index.md index 882e2d325e5..9008b5dbc11 100644 --- a/doc/administration/dedicated/index.md +++ b/doc/administration/dedicated/index.md @@ -217,14 +217,43 @@ To enable the Inbound Private Link: ### Outbound Private Link -Outbound Private Links allow the GitLab Dedicated instance to securely communicate with services running in your VPC on AWS. This type of connection can execute [webhooks](../../user/project/integrations/webhooks.md) where the targeted services are running in your VPC, import or mirror projects and repositories, or use any other GitLab functionality to access private services. +Consider the following when using Outbound Private Links: + +- Outbound Private Links allow the GitLab Dedicated instance to securely communicate with services running in your VPC on AWS. This type of connection + can execute [webhooks](../../user/project/integrations/webhooks.md) where the targeted services are running in your VPC, import or mirror projects + and repositories, or use any other GitLab functionality to access private services. +- You can only establish Private Links between VPCs in the same region. Therefore, you can only establish a connection in the regions you selected for + your Dedicated instance. +- The Network Load Balancer (NLB) that backs the Endpoint Service at your end must be enabled in at least one of the Availability Zones to which your Dedicated tenant was + deployed. This is not the user-facing name such as `us-east-1a`, but the underlying [Availability Zone ID](https://docs.aws.amazon.com/ram/latest/userguide/working-with-az-ids.html). + If you did not specify these during onboarding to Dedicated, you must either: + - Ask for the Availability Zone IDs in the ticket you raise to enable the link and ensure the NLB is enabled in those AZs, or + - Ensure the NLB has is enabled in every Availability Zone in the region. To enable an Outbound Private Link: -1. In your [support ticket](https://support.gitlab.com/hc/en-us/requests/new?ticket_form_id=4414917877650), GitLab provides you with an IAM role ARN that connects to your endpoint service. You can then add this ARN to the allowlist on your side to restrict connections to your endpoint service. -1. [Create the Endpoint service](https://docs.aws.amazon.com/vpc/latest/privatelink/create-endpoint-service.html) through which your internal service is available to GitLab Dedicated. Provide the associated `Service Endpoint Name` on the [support ticket](https://support.gitlab.com/hc/en-us/requests/new?ticket_form_id=4414917877650). -1. When creating the Endpoint service, you must provide GitLab with a [verified Private DNS Name](https://docs.aws.amazon.com/vpc/latest/privatelink/manage-dns-names.html#verify-domain-ownership) for your service. Optionally, if you would like GitLab Dedicated to reach your service via other aliases, you have the ability to specify a list of Private Hosted Zone (PHZ) entries. With this option, GitLab sets up a Private Hosted Zone with DNS names aliased to the verified Private DNS name. To enable this functionality, you must provide GitLab a list of PHZ entries on your support ticket. After the PHZ is created in the tenant environment, DNS resolution of any of the provided records correctly resolves to the PrivateLink endpoint. -1. GitLab then configures the tenant instance to create the necessary Endpoint Interfaces based on the service names you provided. Any outbound calls made from the tenant GitLab instance are directed through the PrivateLink into your VPC. +1. [Create the Endpoint service](https://docs.aws.amazon.com/vpc/latest/privatelink/create-endpoint-service.html) through which your internal service + will be available to GitLab Dedicated. Provide the associated `Service Endpoint Name` on a new + [support ticket](https://support.gitlab.com/hc/en-us/requests/new?ticket_form_id=4414917877650). +1. In your [support ticket](https://support.gitlab.com/hc/en-us/requests/new?ticket_form_id=4414917877650), GitLab will provide you with the ARN of an + IAM role that will be initiating the connection to your endpoint service. You must ensure this ARN is included, or otherwise covered by other + entries, in the list of "Allowed Principals" on the Endpoint Service, as described by the [AWS documentation](https://docs.aws.amazon.com/vpc/latest/privatelink/configure-endpoint-service.html#add-remove-permissions). + Though it's optional, you should you add it explicitly, allowing you to set `Acceptance required` to No so that Dedicated can connect in a single operation. + If you leave `Acceptance required` as Yes, then you must manually accept the connection after Dedicated has initiated it. +1. To connect to services using the Endpoint, the Dedicated services require a DNS name. Private Link automatically creates an internal name, but + it is machine-generated and not generally directly useful. There are two options available: + - In your Endpoint Service, enable [Private DNS name](https://docs.aws.amazon.com/vpc/latest/privatelink/manage-dns-names.html), perform the + required validation, and let GitLab know in the support ticket that you are using this option. If `Acceptance Required` is set to Yes on your + Endpoint Service, also note this on the support ticket because Dedicated will need to initiate the connection without Private DNS, wait for you + to confirm it has been accepted, and then update the connection to enable the use of Private DNS. + - Dedicated can manage a Private Hosted Zone (PHZ) within the Dedicated AWS Account and alias any arbitrary DNS names to the Endpoint, directing + requests for those names to your Endpoint Service. This may be useful if you have multiple DNS names/aliases that will be accessed using a + single Endpoint (for example, if you are running a reverse proxy to connect to more than one service in your environment), or if the domain you + want to use is not public and cannot be validated for use by Private DNS. Let GitLab know on the support ticket if you are using this option and + provide a list of DNS names that should resolve to the Private Link Endpoint. This list can be updated as needed in future. + +GitLab then configures the tenant instance to create the necessary Endpoint Interfaces based on the service names you provided. Any matching outbound +connections made from the tenant GitLab instance are directed through the PrivateLink into your VPC. #### Custom certificates diff --git a/doc/update/versions/gitlab_14_changes.md b/doc/update/versions/gitlab_14_changes.md index 0e59ba3be91..700baf4ef09 100644 --- a/doc/update/versions/gitlab_14_changes.md +++ b/doc/update/versions/gitlab_14_changes.md @@ -7,7 +7,10 @@ info: To determine the technical writer assigned to the Stage/Group associated w # GitLab 14 changes **(FREE SELF)** This page contains upgrade information for minor and patch versions of GitLab 14. -Ensure you review these instructions for all versions between your current version and your target version. +Ensure you review these instructions for: + +- Your installation type. +- All versions between your current version and your target version. For more information about upgrading GitLab Helm Chart, see [the release notes for 5.0](https://docs.gitlab.com/charts/releases/5_0.html). diff --git a/doc/update/versions/gitlab_15_changes.md b/doc/update/versions/gitlab_15_changes.md index 446c7588535..12cbf5c5ec1 100644 --- a/doc/update/versions/gitlab_15_changes.md +++ b/doc/update/versions/gitlab_15_changes.md @@ -7,7 +7,10 @@ info: To determine the technical writer assigned to the Stage/Group associated w # GitLab 15 changes **(FREE SELF)** This page contains upgrade information for minor and patch versions of GitLab 15. -Ensure you review these instructions for all versions between your current version and your target version. +Ensure you review these instructions for: + +- Your installation type. +- All versions between your current version and your target version. For more information about upgrading GitLab Helm Chart, see [the release notes for 6.0](https://docs.gitlab.com/charts/releases/6_0.html). diff --git a/doc/user/application_security/img/security_widget_v13_7.png b/doc/user/application_security/img/security_widget_v13_7.png Binary files differdeleted file mode 100644 index fb1eaf9a2be..00000000000 --- a/doc/user/application_security/img/security_widget_v13_7.png +++ /dev/null diff --git a/doc/user/application_security/img/security_widget_v16_4.png b/doc/user/application_security/img/security_widget_v16_4.png Binary files differnew file mode 100644 index 00000000000..dfed372ba31 --- /dev/null +++ b/doc/user/application_security/img/security_widget_v16_4.png diff --git a/doc/user/application_security/index.md b/doc/user/application_security/index.md index ef03aade8b0..62155e07fbc 100644 --- a/doc/user/application_security/index.md +++ b/doc/user/application_security/index.md @@ -246,7 +246,7 @@ Merge requests which have run security scans let you know that the generated reports are available to download. To download a report, select **Download results**, and select the desired report. -![Security widget](img/security_widget_v13_7.png) +![Security widget](img/security_widget_v16_4.png) Security scans produce at least one of these [CI `artifacts:reports` types](../../ci/yaml/artifacts_reports.md): @@ -258,6 +258,8 @@ Security scans produce at least one of these [CI `artifacts:reports` types](../. - `artifacts:reports:sast` - `artifacts:reports:secret_detection` +In the Free tier, the reports above aren't parsed by GitLab. As a result, the widget does not change based on the results of the security scans. + #### Ultimate A merge request contains a security widget which displays a summary of the _new_ results. New results are determined by comparing the findings of the merge request against the findings of the most recent completed pipeline (`success`, `failed`, `canceled` or `skipped`) for the commit when the feature branch was created from the target branch. diff --git a/qa/qa/page/blame/show.rb b/qa/qa/page/blame/show.rb index cbe8ef600dc..42fb217d2df 100644 --- a/qa/qa/page/blame/show.rb +++ b/qa/qa/page/blame/show.rb @@ -5,7 +5,7 @@ module QA module Blame class Show < Page::Base view 'app/views/projects/blob/_header_content.html.haml' do - element :file_name_content + element 'file-name-content' end view 'app/views/projects/blame/show.html.haml' do @@ -13,11 +13,11 @@ module QA end def has_file?(file_name) - within_element(:file_name_content) { has_text?(file_name) } + within_element('file-name-content') { has_text?(file_name) } end def has_no_file?(file_name) - within_element(:file_name_content) do + within_element('file-name-content') do has_no_text?(file_name) end end diff --git a/qa/qa/page/merge_request/new.rb b/qa/qa/page/merge_request/new.rb index c129cd10f16..6a59440fc28 100644 --- a/qa/qa/page/merge_request/new.rb +++ b/qa/qa/page/merge_request/new.rb @@ -15,7 +15,7 @@ module QA end view 'app/assets/javascripts/merge_requests/components/compare_dropdown.vue' do - element :source_branch_dropdown, ':data-qa-selector="qaSelector"' # rubocop:disable QA/ElementWithPattern + element 'source-branch-dropdown', ':data-testid="testid"' # rubocop:disable QA/ElementWithPattern end view 'app/views/projects/merge_requests/creations/_new_submit.html.haml' do @@ -23,7 +23,7 @@ module QA end view 'app/assets/javascripts/diffs/components/diff_file_header.vue' do - element :file_name_content + element 'file-name-content' end def has_secure_description?(scanner_name) @@ -46,11 +46,11 @@ module QA end def has_file?(file_name) - has_element?(:file_name_content, text: file_name) + has_element?('file-name-content', text: file_name) end def select_source_branch(branch) - click_element(:source_branch_dropdown) + click_element('source-branch-dropdown') search_and_select(branch) end end diff --git a/qa/qa/page/merge_request/show.rb b/qa/qa/page/merge_request/show.rb index 2107c09ee90..80541bd9283 100644 --- a/qa/qa/page/merge_request/show.rb +++ b/qa/qa/page/merge_request/show.rb @@ -36,12 +36,15 @@ module QA end view 'app/assets/javascripts/diffs/components/diff_file_header.vue' do - element :file_name_content element :file_title_container element :dropdown_button element :edit_in_ide_button end + view 'app/assets/javascripts/vue_shared/components/file_row.vue' do + element 'file-row-name-container' + end + view 'app/assets/javascripts/diffs/components/diff_row.vue' do element :diff_comment_button element :new_diff_line_link @@ -226,17 +229,17 @@ module QA def has_file?(file_name) open_file_tree - return true if has_element?(:file_name_content, file_name: file_name) + return true if has_element?('file-row-name-container', file_name: file_name) # Since the file tree uses virtual scrolling, search for file in case it is outside of viewport search_file_tree(file_name) - has_element?(:file_name_content, file_name: file_name) + has_element?('file-row-name-container', file_name: file_name) end def has_no_file?(file_name) # Since the file tree uses virtual scrolling, search for file to ensure non-existence search_file_tree(file_name) - has_no_element?(:file_name_content, file_name: file_name) + has_no_element?('file-row-name-container', file_name: file_name) end def search_file_tree(file_name) diff --git a/qa/qa/page/project/web_ide/edit.rb b/qa/qa/page/project/web_ide/edit.rb index 19802f846d8..16eaa7efba9 100644 --- a/qa/qa/page/project/web_ide/edit.rb +++ b/qa/qa/page/project/web_ide/edit.rb @@ -58,7 +58,7 @@ module QA end view 'app/assets/javascripts/vue_shared/components/file_row.vue' do - element :file_name_content + element 'file-row-name-container' element :file_row_container end @@ -123,7 +123,7 @@ module QA def has_file?(file_name) within_element(:file_list_container) do - has_element?(:file_name_content, file_name: file_name) + has_element?('file-row-name-container', file_name: file_name) end end @@ -289,7 +289,7 @@ module QA end def rename_file(file_name, new_file_name) - click_element(:file_name_content, file_name: file_name) + click_element('file-row-name-container', file_name: file_name) click_element(:dropdown_button) click_element(:rename_move_button, Page::Component::WebIDE::Modal::CreateNewFile) fill_element(:file_name_field, new_file_name) @@ -314,7 +314,7 @@ module QA end def delete_file(file_name) - click_element(:file_name_content, file_name: file_name) + click_element('file-row-name-container', file_name: file_name) click_element(:dropdown_button) click_element(:delete_button) end @@ -326,9 +326,9 @@ module QA def select_file(file_name) # wait for the list of files to load wait_until(reload: true) do - has_element?(:file_name_content, file_name: file_name) + has_element?('file-row-name-container', file_name: file_name) end - click_element(:file_name_content, file_name: file_name) + click_element('file-row-name-container', file_name: file_name) end def link_line(line_number) diff --git a/spec/lib/generators/gitlab/partitioning/foreign_keys_generator_spec.rb b/spec/lib/generators/gitlab/partitioning/foreign_keys_generator_spec.rb index 7c7ca8207ff..229100186be 100644 --- a/spec/lib/generators/gitlab/partitioning/foreign_keys_generator_spec.rb +++ b/spec/lib/generators/gitlab/partitioning/foreign_keys_generator_spec.rb @@ -33,8 +33,6 @@ feature_category: :continuous_integration do SQL end - let_it_be(:destination_root) { File.expand_path("../tmp", __dir__) } - let(:generator_config) { { destination_root: destination_root } } let(:generator_args) { ['--source', '_test_tmp_metadata', '--target', '_test_tmp_builds', '--database', 'main'] } @@ -124,4 +122,8 @@ feature_category: :continuous_integration do def schema_migrate_down! # no-op end + + def destination_root + File.expand_path("../tmp", __dir__) + end end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index af013830109..f53e930f529 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -487,6 +487,34 @@ RSpec.configure do |config| config.before(:each, :js) do allow_any_instance_of(VersionCheck).to receive(:response).and_return({ "severity" => "success" }) end + + [:migration, :delete].each do |spec_type| + message = <<~STRING + We detected an open transaction before running the example. This is not allowed with specs that rely on a table + deletion strategy like those marked as `:#{spec_type}`. + + A common scenario for this is using `test-prof` methods in your specs. `let_it_be` and `before_all` methods open + a transaction before all the specs in a context are run, and this is not compatible with these type of specs. + Consider replacing these methods with `let!` and `before(:all)`. + + For more information see + https://docs.gitlab.com/ee/development/testing_guide/best_practices.html#testprof-in-migration-specs + STRING + + config.around(:each, spec_type) do |example| + self.class.use_transactional_tests = false + + if DbCleaner.all_connection_classes.any? { |klass| klass.connection.transaction_open? } + raise message + end + + example.run + + delete_from_all_tables!(except: deletion_except_tables) + + self.class.use_transactional_tests = true + end + end end # Disabled because it's causing N+1 queries. diff --git a/spec/support/before_all_adapter.rb b/spec/support/before_all_adapter.rb index f4946ff271f..35846fcecb8 100644 --- a/spec/support/before_all_adapter.rb +++ b/spec/support/before_all_adapter.rb @@ -25,20 +25,9 @@ module TestProfBeforeAllAdapter end end - # This class is required so we can disable transactions on migration specs - module NoTransactionAdapter - def self.begin_transaction; end - - def self.rollback_transaction; end - end - def self.default_adapter MultipleDatabaseAdapter end - - def self.no_transaction_adapter - NoTransactionAdapter - end end TestProf::BeforeAll.adapter = ::TestProfBeforeAllAdapter.default_adapter diff --git a/spec/support/database_cleaner.rb b/spec/support/database_cleaner.rb index 7bd1f0c5dfa..1ffc1cc25fd 100644 --- a/spec/support/database_cleaner.rb +++ b/spec/support/database_cleaner.rb @@ -12,14 +12,4 @@ RSpec.configure do |config| setup_database_cleaner DatabaseCleaner.clean_with(:deletion) end - - config.around(:each, :delete) do |example| - self.class.use_transactional_tests = false - - example.run - - delete_from_all_tables!(except: deletion_except_tables) - - self.class.use_transactional_tests = true - end end diff --git a/spec/support/migration.rb b/spec/support/migration.rb index b1e75d9c9e2..fc8a4bb12fb 100644 --- a/spec/support/migration.rb +++ b/spec/support/migration.rb @@ -20,21 +20,11 @@ RSpec.configure do |config| Gitlab::CurrentSettings.clear_in_memory_application_settings! end - config.prepend_before(:all, :migration) do - TestProf::BeforeAll.adapter = ::TestProfBeforeAllAdapter.no_transaction_adapter - end - - config.append_after(:all, :migration) do - TestProf::BeforeAll.adapter = ::TestProfBeforeAllAdapter.default_adapter - end - config.append_after(:context, :migration) do recreate_databases_and_seed_if_needed || ensure_schema_and_empty_tables end config.around(:each, :migration) do |example| - self.class.use_transactional_tests = false - migration_schema = example.metadata[:migration] migration_schema = :gitlab_main if migration_schema == true base_model = Gitlab::Database.schemas_to_base_models.fetch(migration_schema).first @@ -52,10 +42,6 @@ RSpec.configure do |config| else example.run end - - delete_from_all_tables!(except: deletion_except_tables) - - self.class.use_transactional_tests = true end # Each example may call `migrate!`, so we must ensure we are migrated down every time |