Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2023-06-07 06:09:37 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2023-06-07 06:09:37 +0300
commit3e59f1f11a387ab3e0383f7beea8ea599291a293 (patch)
tree6fbbe3ba17b30e60e535d73912b99f794d746d01
parent1e19d757e8a088e9d4aa67cc092fda87aba1cd35 (diff)
Add latest changes from gitlab-org/gitlab@master
-rw-r--r--.rubocop_todo/layout/line_length.yml1
-rw-r--r--app/models/note.rb1
-rw-r--r--config/sidekiq_queues.yml2
-rw-r--r--doc/development/import_project.md6
-rw-r--r--doc/operations/incident_management/slack.md32
-rw-r--r--doc/user/project/import/github.md14
-rw-r--r--doc/user/project/import/img/import_projects_from_github_importer_v12_3.pngbin17532 -> 0 bytes
-rw-r--r--doc/user/project/import/img/import_projects_from_github_importer_v16_0.pngbin0 -> 42352 bytes
-rw-r--r--doc/user/project/settings/index.md3
-rw-r--r--locale/gitlab.pot3
-rw-r--r--qa/Dockerfile2
-rw-r--r--qa/Gemfile3
-rw-r--r--qa/Gemfile.lock11
-rw-r--r--qa/lib/gitlab/page/group/settings/usage_quotas.rb12
-rw-r--r--qa/qa/runtime/browser.rb105
-rw-r--r--qa/tasks/webdrivers.rake3
-rw-r--r--spec/helpers/storage_helper_spec.rb5
-rw-r--r--spec/models/note_spec.rb24
18 files changed, 103 insertions, 124 deletions
diff --git a/.rubocop_todo/layout/line_length.yml b/.rubocop_todo/layout/line_length.yml
index d9f18726897..edaf6d4b669 100644
--- a/.rubocop_todo/layout/line_length.yml
+++ b/.rubocop_todo/layout/line_length.yml
@@ -3721,7 +3721,6 @@ Layout/LineLength:
- 'spec/helpers/snippets_helper_spec.rb'
- 'spec/helpers/sorting_helper_spec.rb'
- 'spec/helpers/sourcegraph_helper_spec.rb'
- - 'spec/helpers/storage_helper_spec.rb'
- 'spec/helpers/submodule_helper_spec.rb'
- 'spec/helpers/tab_helper_spec.rb'
- 'spec/helpers/time_zone_helper_spec.rb'
diff --git a/app/models/note.rb b/app/models/note.rb
index ac2b54629ae..4b65103aa9f 100644
--- a/app/models/note.rb
+++ b/app/models/note.rb
@@ -141,6 +141,7 @@ class Note < ApplicationRecord
scope :with_discussion_ids, ->(discussion_ids) { where(discussion_id: discussion_ids) }
scope :with_suggestions, -> { joins(:suggestions) }
scope :inc_author, -> { includes(:author) }
+ scope :authored_by, ->(user) { where(author: user) }
scope :inc_note_diff_file, -> { includes(:note_diff_file) }
scope :with_api_entity_associations, -> { preload(:note_diff_file, :author) }
scope :inc_relations_for_view, ->(noteable = nil) do
diff --git a/config/sidekiq_queues.yml b/config/sidekiq_queues.yml
index 5c6ec888e54..477fd42b941 100644
--- a/config/sidekiq_queues.yml
+++ b/config/sidekiq_queues.yml
@@ -543,6 +543,8 @@
- 1
- - security_auto_fix
- 1
+- - security_generate_policy_violation_comment
+ - 1
- - security_orchestration_configuration_create_bot
- 1
- - security_orchestration_policy_rule_schedule_namespace
diff --git a/doc/development/import_project.md b/doc/development/import_project.md
index ed5854f8833..0be17ea5873 100644
--- a/doc/development/import_project.md
+++ b/doc/development/import_project.md
@@ -52,6 +52,12 @@ There is also an option to [import the project via GitHub](../user/project/impor
This method takes longer to import than the other methods and depends on several factors. It's recommended to use the other methods.
+To test importing from GitHub Enterprise (GHE) to GitLab, you need a GHE instance. You can request a
+[GitHub Enterprise Server trial](https://docs.github.com/en/get-started/signing-up-for-github/setting-up-a-trial-of-github-enterprise-server) and install it on Google Cloud Platform.
+
+- GitLab team members can use [Sandbox Cloud Realm](https://about.gitlab.com/handbook/infrastructure-standards/realms/sandbox/) for this purpose.
+- Others can request a [Google Cloud Platforms free trial](https://cloud.google.com/free).
+
### Import by using a Rake task
To import the test project by using a Rake task, see
diff --git a/doc/operations/incident_management/slack.md b/doc/operations/incident_management/slack.md
index 1f6097ccbdb..d04332ddcaf 100644
--- a/doc/operations/incident_management/slack.md
+++ b/doc/operations/incident_management/slack.md
@@ -19,8 +19,6 @@ Use the GitLab for Slack app to:
- Create GitLab incidents from Slack.
- Receive incident notifications.
-<!-- The below content is commented out until these features are implemented in https://gitlab.com/groups/gitlab-org/-/epics/8545 -->
-<!-- - Send important updates between Slack and GitLab incidents. -->
Incident management for Slack is only available for GitLab.com. Some of the functionality
described might be available for
@@ -44,18 +42,6 @@ Prerequisites:
The `<project-alias>` you select must be a project that has the GitLab for Slack app set up.
For more information, see [issue 377548](https://gitlab.com/gitlab-org/gitlab/-/issues/377548).
-<!-- The below content is commented out until these features are implemented in https://gitlab.com/groups/gitlab-org/-/epics/8545 -->
-<!--
-To manage incidents, use the following slash commands in Slack:
-
-| Command | Description |
-| ---------------------------------- | ------------------------------------------- |
-| `/gitlab incident declare` | Creates an incident in GitLab. |
-| `/gitlab incident comment <text>` | Adds a comment on a GitLab incident. |
-| `/gitlab incident timeline <text>` | Adds a timeline event to a GitLab incident. |
-| `/gitlab incident close` | Closes an incident in GitLab. |
--->
-
After the GitLab for Slack app is configured, you can also use any of the existing [Slack slash commands](../../user/project/integrations/slack_slash_commands.md).
## Declare an incident
@@ -94,24 +80,6 @@ a GitLab incident from Slack. The following quick actions might be most relevant
| `/link <URL> <text>` | Adds a link to a dedicated Slack channel, runbook, or any relevant resource to the `Related resources` section of an incident. |
| `/zoom <URL>` | Adds a Zoom meeting link to the incident. |
-<!-- The below content is commented out until these features are implemented in https://gitlab.com/groups/gitlab-org/-/epics/8545 -->
-<!-- ### Comment on a GitLab incident
-
-To comment on a GitLab incident from Slack, enter the `/gitlab incident comment <text>` slash command.
-Slack shows a prompt asking you to confirm which incident you'd like to post your comment to.
-
-### Add a timeline event
-
-To add a [timeline event](incident_timeline_events.md) to a GitLab incident from Slack, enter the
-`/gitlab incident timeline <text>` slash command.
-Slack shows a prompt asking you to confirm which incident you'd like to add your timeline event to.
-
-### Close an incident
-
-To close a GitLab incident from Slack when it is resolved, enter the `/gitlab incident close`
-slash command.
-Slack shows a prompt asking you to confirm which incident you'd like to close. -->
-
## Send GitLab incident notifications to Slack
If you have [enabled notifications](#manage-an-incident-from-slack) for incidents, you should receive
diff --git a/doc/user/project/import/github.md b/doc/user/project/import/github.md
index e7732c02fdf..6b88e87cf5a 100644
--- a/doc/user/project/import/github.md
+++ b/doc/user/project/import/github.md
@@ -17,9 +17,11 @@ The namespace is a user or group in GitLab, such as `gitlab.com/sidney-jones` or
`gitlab.com/customer-success`. You can use bulk actions in the rails console to move projects to
different namespaces.
-If you are importing to a self-managed GitLab instance, you can use the
-[GitHub Rake task](../../../administration/raketasks/github_import.md) instead. This allows you to import projects
-without the constraints of a [Sidekiq](../../../development/sidekiq/index.md) worker.
+- If you are importing to a self-managed GitLab instance, you can use the [GitHub Rake task](../../../administration/raketasks/github_import.md) instead. The
+ Rake task imports projects without the constraints of a [Sidekiq](../../../development/sidekiq/index.md) worker.
+- If you are importing from GitHub Enterprise to GitLab.com, use the
+ [GitLab Import API](../../../api/import.md#import-repository-from-github) GitHub endpoint instead. This allows you to provide a different domain to import the project from.
+ Using the UI, the GitHub importer always imports from the `github.com` domain.
When importing projects:
@@ -185,7 +187,7 @@ To open an repository in GitLab URL after it has been imported, select its GitLa
Completed imports can be re-imported by selecting **Re-import** and specifying new name. This creates a new copy of the source project.
-![GitHub importer page](img/import_projects_from_github_importer_v12_3.png)
+![GitHub importer page](img/import_projects_from_github_importer_v16_0.png)
### Check status of imports
@@ -193,9 +195,9 @@ Completed imports can be re-imported by selecting **Re-import** and specifying n
After imports are completed, they can be in one of three states:
-- **Completed**: GitLab imported all repository entities.
+- **Complete**: GitLab imported all repository entities.
- **Partially completed**: GitLab failed to import some repository entities.
-- **Failed**: GitLab imported no repository entities.
+- **Failed**: GitLab aborted the import after a critical error occurred.
Expand **Details** to see a list of [repository entities](#imported-data) that failed to import.
diff --git a/doc/user/project/import/img/import_projects_from_github_importer_v12_3.png b/doc/user/project/import/img/import_projects_from_github_importer_v12_3.png
deleted file mode 100644
index 3ac03c0ecc5..00000000000
--- a/doc/user/project/import/img/import_projects_from_github_importer_v12_3.png
+++ /dev/null
Binary files differ
diff --git a/doc/user/project/import/img/import_projects_from_github_importer_v16_0.png b/doc/user/project/import/img/import_projects_from_github_importer_v16_0.png
new file mode 100644
index 00000000000..190474c4d89
--- /dev/null
+++ b/doc/user/project/import/img/import_projects_from_github_importer_v16_0.png
Binary files differ
diff --git a/doc/user/project/settings/index.md b/doc/user/project/settings/index.md
index 2df86038789..47500673b99 100644
--- a/doc/user/project/settings/index.md
+++ b/doc/user/project/settings/index.md
@@ -59,6 +59,9 @@ compliance framework using either:
compliance frameworks on subgroups with GraphQL, the framework is created on the root ancestor if the user has the
correct permissions. The GitLab UI presents a read-only view to discourage this behavior.
+NOTE:
+Frameworks can not be added to projects in personal namespaces.
+
## Configure project visibility, features, and permissions
To configure visibility, features, and permissions for a project:
diff --git a/locale/gitlab.pot b/locale/gitlab.pot
index ef2498be7b2..bbdb6f5c1a0 100644
--- a/locale/gitlab.pot
+++ b/locale/gitlab.pot
@@ -19508,6 +19508,9 @@ msgstr ""
msgid "Framework successfully deleted"
msgstr ""
+msgid "Frameworks can not be added to projects in personal namespaces. %{linkStart}What are personal namespaces?%{linkEnd}"
+msgstr ""
+
msgid "Free Trial of GitLab.com Ultimate"
msgstr ""
diff --git a/qa/Dockerfile b/qa/Dockerfile
index 2bf668abc49..bd9cd166701 100644
--- a/qa/Dockerfile
+++ b/qa/Dockerfile
@@ -9,8 +9,6 @@ LABEL maintainer="GitLab Quality Department <quality@gitlab.com>"
ENV DEBIAN_FRONTEND="noninteractive"
# Override config path to make sure local config doesn't override it when building image locally
ENV BUNDLE_APP_CONFIG=/home/gitlab/.bundle
-# Use webdriver preinstalled in the base image
-ENV WD_INSTALL_DIR=/usr/local/bin
##
# Install system libs
diff --git a/qa/Gemfile b/qa/Gemfile
index 9660c6b7b03..598bc92fce6 100644
--- a/qa/Gemfile
+++ b/qa/Gemfile
@@ -3,7 +3,7 @@
source 'https://rubygems.org'
gem 'gitlab-qa', '~> 11', '>= 11.1.0', require: 'gitlab/qa'
-gem 'gitlab_quality-test_tooling', '~> 0.6.1', require: false
+gem 'gitlab_quality-test_tooling', '~> 0.6.2', require: false
gem 'activesupport', '~> 6.1.7.2' # This should stay in sync with the root's Gemfile
gem 'allure-rspec', '~> 2.20.0'
gem 'capybara', '~> 3.39.1'
@@ -25,7 +25,6 @@ gem 'rainbow', '~> 3.1.1'
gem 'rspec-parameterized', '~> 1.0.0'
gem 'octokit', '~> 6.1.1'
gem "faraday-retry", "~> 2.1"
-gem 'webdrivers', '~> 5.2'
gem 'zeitwerk', '~> 2.6', '>= 2.6.8'
gem 'influxdb-client', '~> 2.9'
gem 'terminal-table', '~> 3.0.2', require: false
diff --git a/qa/Gemfile.lock b/qa/Gemfile.lock
index edcaa3b9b91..debff346086 100644
--- a/qa/Gemfile.lock
+++ b/qa/Gemfile.lock
@@ -111,7 +111,7 @@ GEM
rainbow (>= 3, < 4)
table_print (= 1.5.7)
zeitwerk (>= 2, < 3)
- gitlab_quality-test_tooling (0.6.1)
+ gitlab_quality-test_tooling (0.6.2)
activesupport (~> 6.1)
gitlab (~> 4.19)
http (~> 5.0)
@@ -201,7 +201,7 @@ GEM
parallel (1.23.0)
parallel_tests (4.2.1)
parallel
- parser (3.1.3.0)
+ parser (3.2.2.1)
ast (~> 2.4.1)
proc_to_ast (0.1.0)
coderay
@@ -300,10 +300,6 @@ GEM
watir (7.1.0)
regexp_parser (>= 1.2, < 3)
selenium-webdriver (~> 4.0)
- webdrivers (5.2.0)
- nokogiri (~> 1.6)
- rubyzip (>= 1.3.0)
- selenium-webdriver (~> 4.0)
webrick (1.7.0)
websocket (1.2.9)
xpath (3.2.0)
@@ -328,7 +324,7 @@ DEPENDENCIES
fog-core (= 2.1.0)
fog-google (~> 1.19)
gitlab-qa (~> 11, >= 11.1.0)
- gitlab_quality-test_tooling (~> 0.6.1)
+ gitlab_quality-test_tooling (~> 0.6.2)
influxdb-client (~> 2.9)
knapsack (~> 4.0)
nokogiri (~> 1.15, >= 1.15.2)
@@ -349,7 +345,6 @@ DEPENDENCIES
slack-notifier (~> 2.4)
terminal-table (~> 3.0.2)
warning (~> 1.3)
- webdrivers (~> 5.2)
zeitwerk (~> 2.6, >= 2.6.8)
BUNDLED WITH
diff --git a/qa/lib/gitlab/page/group/settings/usage_quotas.rb b/qa/lib/gitlab/page/group/settings/usage_quotas.rb
index 5fc40a64722..5248852f6ba 100644
--- a/qa/lib/gitlab/page/group/settings/usage_quotas.rb
+++ b/qa/lib/gitlab/page/group/settings/usage_quotas.rb
@@ -35,7 +35,6 @@ module Gitlab
span :container_registry_size
div :purchased_usage_total
div :storage_purchase_successful_alert, text: /You have successfully purchased a storage/
- div :additional_storage_alert, text: /purchase additional storage/
# Pending members
div :pending_members
@@ -56,15 +55,6 @@ module Gitlab
additional_ci_minutes?
end
- # Waits and Checks if storage available alert presents on the page
- #
- # @return [Boolean] True if the alert presents, false if not after 5 second wait
- def additional_storage_available?
- additional_storage_alert_element.wait_until(timeout: 5, &:present?)
- rescue Watir::Wait::TimeoutError
- false
- end
-
# Waits and Checks if storage project data loaded
#
# @return [Boolean] True if the alert presents, false if not after 5 second wait
@@ -78,7 +68,7 @@ module Gitlab
#
# @return [Float] Total purchased storage value in GiB
def total_purchased_storage
- additional_storage_alert_element.wait_until(&:present?)
+ ::QA::Support::WaitForRequests.wait_for_requests
purchased_usage_total[/(\d+){2}.\d+/].to_f
end
diff --git a/qa/qa/runtime/browser.rb b/qa/qa/runtime/browser.rb
index b67db792419..4297c62e904 100644
--- a/qa/qa/runtime/browser.rb
+++ b/qa/qa/runtime/browser.rb
@@ -4,8 +4,6 @@ require 'rspec/core'
require 'rspec/expectations'
require 'capybara/rspec'
require 'capybara-screenshot/rspec'
-require 'webdrivers/chromedriver'
-require 'webdrivers/geckodriver'
require 'gitlab_handbook'
@@ -46,8 +44,7 @@ module QA
new.visit(address, page_class, &block)
end
- # rubocop: disable Metrics/AbcSize
- def self.configure!
+ def self.configure! # rubocop:disable Metrics/AbcSize, Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity
return if @configured
RSpec.configure do |config|
@@ -64,45 +61,31 @@ module QA
end
Capybara.server_port = 9887 + ENV['TEST_ENV_NUMBER'].to_i
-
Capybara.register_driver QA::Runtime::Env.browser do |app|
- capabilities = Selenium::WebDriver::Remote::Capabilities.send(QA::Runtime::Env.browser)
+ webdriver_options = Selenium::WebDriver::Options.send(QA::Runtime::Env.browser)
case QA::Runtime::Env.browser
when :chrome
- capabilities['acceptInsecureCerts'] = true if QA::Runtime::Env.accept_insecure_certs?
-
- # set logging preferences
- # this enables access to logs with `page.driver.manage.get_log(:browser)`
- capabilities['goog:loggingPrefs'] = {
- browser: 'ALL',
- client: 'ALL',
- driver: 'ALL',
- server: 'ALL'
- }
-
# Chrome won't work properly in a Docker container in sandbox mode
- capabilities['goog:chromeOptions'] = {
- args: %w[no-sandbox]
- }
+ chrome_options = { args: %w[no-sandbox] }
# Run headless by default unless WEBDRIVER_HEADLESS is false
if QA::Runtime::Env.webdriver_headless?
- capabilities['goog:chromeOptions'][:args] << 'headless'
+ chrome_options[:args] << 'headless'
# Chrome documentation says this flag is needed for now
# https://developers.google.com/web/updates/2017/04/headless-chrome#cli
- capabilities['goog:chromeOptions'][:args] << 'disable-gpu'
+ chrome_options[:args] << 'disable-gpu'
end
# Disable /dev/shm use in CI. See https://gitlab.com/gitlab-org/gitlab/issues/4252
- capabilities['goog:chromeOptions'][:args] << 'disable-dev-shm-usage' if QA::Runtime::Env.disable_dev_shm?
+ chrome_options[:args] << 'disable-dev-shm-usage' if QA::Runtime::Env.disable_dev_shm?
# Set chrome default download path
# TODO: Set for remote grid as well once Sauce Labs tests are deprecated and Options.chrome is added
# See https://gitlab.com/gitlab-org/gitlab/-/merge_requests/112258
unless QA::Runtime::Env.remote_grid
- capabilities['goog:chromeOptions'][:prefs] = {
+ chrome_options[:prefs] = {
'download.default_directory' => File.expand_path(QA::Runtime::Env.chrome_default_download_path),
'download.prompt_for_download' => false
}
@@ -111,16 +94,16 @@ module QA
# Specify the user-agent to allow challenges to be bypassed
# See https://gitlab.com/gitlab-com/gl-infra/infrastructure/-/issues/11938
unless QA::Runtime::Env.user_agent.blank?
- capabilities['goog:chromeOptions'][:args] << "user-agent=#{QA::Runtime::Env.user_agent}"
+ chrome_options[:args] << "user-agent=#{QA::Runtime::Env.user_agent}"
end
if QA::Runtime::Env.remote_mobile_device_name
- capabilities['platformName'] = 'Android'
- capabilities['appium:automationName'] = 'UiAutomator2'
- capabilities['appium:deviceName'] = QA::Runtime::Env.remote_mobile_device_name
- capabilities['appium:platformVersion'] = 'latest'
+ webdriver_options.platform_name = 'Android'
+ webdriver_options.add_option('appium:automationName', 'UiAutomator2')
+ webdriver_options.add_option('appium:deviceName', QA::Runtime::Env.remote_mobile_device_name)
+ webdriver_options.add_option('appium:platformVersion', 'latest')
else
- capabilities['goog:chromeOptions'][:args] << "window-size=#{DEFAULT_WINDOW_SIZE}"
+ chrome_options[:args] << "window-size=#{DEFAULT_WINDOW_SIZE}"
end
# Slack tries to open an external URL handler
@@ -138,7 +121,7 @@ module QA
}
default_profile = File.join("#{chrome_profile_location}/Default")
- FileUtils.mkdir_p(default_profile) unless Dir.exist?(default_profile)
+ FileUtils.mkdir_p(default_profile)
preferences = slack_default_preference
# mutate the preferences if it exists
@@ -152,56 +135,63 @@ module QA
end
File.write("#{default_profile}/Preferences", preferences.to_json)
- append_chrome_profile_to_capabilities(capabilities)
+ append_chrome_profile_to_capabilities(chrome_options)
end
+ # Use the same profile on QA runs if CHROME_REUSE_PROFILE is true.
+ # Useful to speed up local QA.
+ append_chrome_profile_to_capabilities(chrome_options) if QA::Runtime::Env.reuse_chrome_profile?
+
+ webdriver_options.args = chrome_options[:args]
+ webdriver_options.prefs = chrome_options[:prefs]
+ webdriver_options.accept_insecure_certs = true if QA::Runtime::Env.accept_insecure_certs?
+ # set logging preferences
+ # this enables access to logs with `page.driver.manage.get_log(:browser)`
+ webdriver_options.logging_prefs = {
+ browser: 'ALL',
+ client: 'ALL',
+ driver: 'ALL',
+ server: 'ALL'
+ }
when :safari
if QA::Runtime::Env.remote_mobile_device_name
- capabilities['platformName'] = 'iOS'
- capabilities['appium:automationName'] = 'XCUITest'
- capabilities['appium:deviceName'] = QA::Runtime::Env.remote_mobile_device_name
- capabilities['appium:platformVersion'] = 'latest'
+ webdriver_options.platform_name = 'iOS'
+ webdriver_options.add_option('appium:automationName', 'XCUITest')
+ webdriver_options.add_option('appium:deviceName', QA::Runtime::Env.remote_mobile_device_name)
+ webdriver_options.add_option('appium:platformVersion', 'latest')
end
-
when :firefox
- capabilities['acceptInsecureCerts'] = true if QA::Runtime::Env.accept_insecure_certs?
-
+ webdriver_options.add_option('acceptInsecureCerts', true) if QA::Runtime::Env.accept_insecure_certs?
when :edge
- capabilities['ms:edgeOptions'] = { args: ["--window-size=#{DEFAULT_WINDOW_SIZE}"] }
+ webdriver_options.args << "--window-size=#{DEFAULT_WINDOW_SIZE}"
end
- # Use the same profile on QA runs if CHROME_REUSE_PROFILE is true.
- # Useful to speed up local QA.
- append_chrome_profile_to_capabilities(capabilities) if QA::Runtime::Env.reuse_chrome_profile?
-
selenium_options = {
browser: QA::Runtime::Env.browser,
- clear_local_storage: true,
- capabilities: capabilities
+ clear_local_storage: true
}
if QA::Runtime::Env.remote_grid
selenium_options[:browser] = :remote
selenium_options[:url] = QA::Runtime::Env.remote_grid
- capabilities[:browserVersion] = QA::Runtime::Env.browser_version
+ webdriver_options.browser_version = QA::Runtime::Env.browser_version
end
if QA::Runtime::Env.remote_tunnel_id
- capabilities['sauce:options'] = { tunnelIdentifier: QA::Runtime::Env.remote_tunnel_id }
+ webdriver_options.add_option('sauce:options', {
+ tunnelIdentifier: QA::Runtime::Env.remote_tunnel_id
+ })
end
if QA::Runtime::Env.record_video?
- capabilities['selenoid:options'] = {
+ webdriver_options.add_option('selenoid:options', {
enableVideo: true,
videoScreenSize: video_screen_size,
videoName: "#{QA::Runtime::Env.browser}-#{QA::Runtime::Env.browser_version}-#{Time.now}.mp4"
- }
+ })
end
- Capybara::Selenium::Driver.new(
- app,
- **selenium_options
- )
+ Capybara::Selenium::Driver.new(app, options: webdriver_options, **selenium_options)
end
# Keep only the screenshots generated from the last failing test suite
@@ -241,12 +231,11 @@ module QA
@configured = true
end
- # rubocop: enable Metrics/AbcSize
- def self.append_chrome_profile_to_capabilities(capabilities)
- return if capabilities['goog:chromeOptions'][:args].include?(chrome_profile_location)
+ def self.append_chrome_profile_to_capabilities(chrome_options)
+ return if chrome_options[:args].include?(chrome_profile_location)
- capabilities['goog:chromeOptions'][:args] << "user-data-dir=#{chrome_profile_location}"
+ chrome_options[:args] << "user-data-dir=#{chrome_profile_location}"
end
def self.chrome_profile_location
diff --git a/qa/tasks/webdrivers.rake b/qa/tasks/webdrivers.rake
deleted file mode 100644
index cd2a36ddf6b..00000000000
--- a/qa/tasks/webdrivers.rake
+++ /dev/null
@@ -1,3 +0,0 @@
-# frozen_string_literal: true
-
-load 'webdrivers/Rakefile'
diff --git a/spec/helpers/storage_helper_spec.rb b/spec/helpers/storage_helper_spec.rb
index d37ab7f14a5..b2da9fa8801 100644
--- a/spec/helpers/storage_helper_spec.rb
+++ b/spec/helpers/storage_helper_spec.rb
@@ -42,7 +42,10 @@ RSpec.describe StorageHelper do
)
end
- let(:message) { 'Repository: 10 KiB / Wikis: 10 B / Build Artifacts: 30 MiB / Pipeline Artifacts: 11 MiB / LFS: 20 GiB / Snippets: 40 MiB / Packages: 12 MiB / Uploads: 15 MiB' }
+ let(:message) do
+ 'Repository: 10 KiB / Wikis: 10 B / Build Artifacts: 30 MiB / Pipeline Artifacts: 11 MiB / ' \
+ 'LFS: 20 GiB / Snippets: 40 MiB / Packages: 12 MiB / Uploads: 15 MiB'
+ end
it 'works on ProjectStatistics' do
expect(helper.storage_counters_details(project.statistics)).to eq(message)
diff --git a/spec/models/note_spec.rb b/spec/models/note_spec.rb
index f722415d428..1453ce9709f 100644
--- a/spec/models/note_spec.rb
+++ b/spec/models/note_spec.rb
@@ -1695,6 +1695,30 @@ RSpec.describe Note, feature_category: :team_planning do
end
end
end
+
+ describe '.authored_by' do
+ subject(:notes_by_author) { described_class.authored_by(author) }
+
+ let(:author) { create(:user) }
+
+ it 'returns the notes with the matching author' do
+ note = create(:note, author: author)
+ create(:note)
+
+ expect(notes_by_author).to contain_exactly(note)
+ end
+
+ context 'With ID integer' do
+ subject(:notes_by_author) { described_class.authored_by(author.id) }
+
+ it 'returns the notes with the matching author' do
+ note = create(:note, author: author)
+ create(:note)
+
+ expect(notes_by_author).to contain_exactly(note)
+ end
+ end
+ end
end
describe 'banzai_render_context' do