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>2020-01-16 06:08:47 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-01-16 06:08:47 +0300
commit08ed6a867b690a04fe7a74c9ba697cf18f6107d7 (patch)
tree9561a9aeee9a57cec168b143a76e6f65fd92ae0b
parentb0f27742e78a4aa4208c271536b6b9d84c53b49e (diff)
Add latest changes from gitlab-org/gitlab@master
-rw-r--r--app/models/merge_request.rb4
-rw-r--r--app/models/project_wiki.rb3
-rw-r--r--changelogs/unreleased/118816-remove-translation-from-constant.yml5
-rw-r--r--changelogs/unreleased/19688-allow-org-mode-in-wiki.yml5
-rw-r--r--config/initializers/database_config.rb42
-rw-r--r--config/initializers/sidekiq.rb13
-rw-r--r--doc/api/wikis.md4
-rw-r--r--doc/user/project/merge_requests/getting_started.md43
-rw-r--r--doc/user/project/wiki/index.md2
-rw-r--r--lib/api/wikis.rb2
-rw-r--r--lib/gitlab/git/commit.rb2
-rw-r--r--lib/gitlab/git/tag.rb2
-rw-r--r--lib/gitlab/runtime.rb10
-rw-r--r--qa/qa/specs/features/browser_ui/2_plan/issue/close_issue_spec.rb7
-rw-r--r--spec/controllers/projects/merge_requests_controller_spec.rb2
-rw-r--r--spec/features/projects/wiki/user_creates_wiki_page_spec.rb18
-rw-r--r--spec/initializers/database_config_spec.rb24
-rw-r--r--spec/lib/gitlab/runtime_spec.rb32
-rw-r--r--spec/requests/api/merge_requests_spec.rb2
19 files changed, 147 insertions, 75 deletions
diff --git a/app/models/merge_request.rb b/app/models/merge_request.rb
index 6be14abe744..1f7760276bc 100644
--- a/app/models/merge_request.rb
+++ b/app/models/merge_request.rb
@@ -262,8 +262,6 @@ class MergeRequest < ApplicationRecord
RebaseLockTimeout = Class.new(StandardError)
- REBASE_LOCK_MESSAGE = _("Failed to enqueue the rebase operation, possibly due to a long-lived transaction. Try again later.")
-
def self.reference_prefix
'!'
end
@@ -1514,7 +1512,7 @@ class MergeRequest < ApplicationRecord
end
rescue ActiveRecord::LockWaitTimeout => e
Gitlab::ErrorTracking.track_exception(e)
- raise RebaseLockTimeout, REBASE_LOCK_MESSAGE
+ raise RebaseLockTimeout, _('Failed to enqueue the rebase operation, possibly due to a long-lived transaction. Try again later.')
end
def source_project_variables
diff --git a/app/models/project_wiki.rb b/app/models/project_wiki.rb
index 48c96203921..f4666197def 100644
--- a/app/models/project_wiki.rb
+++ b/app/models/project_wiki.rb
@@ -7,7 +7,8 @@ class ProjectWiki
MARKUPS = {
'Markdown' => :markdown,
'RDoc' => :rdoc,
- 'AsciiDoc' => :asciidoc
+ 'AsciiDoc' => :asciidoc,
+ 'Org' => :org
}.freeze unless defined?(MARKUPS)
CouldNotCreateWikiError = Class.new(StandardError)
diff --git a/changelogs/unreleased/118816-remove-translation-from-constant.yml b/changelogs/unreleased/118816-remove-translation-from-constant.yml
new file mode 100644
index 00000000000..74167153ce3
--- /dev/null
+++ b/changelogs/unreleased/118816-remove-translation-from-constant.yml
@@ -0,0 +1,5 @@
+---
+title: Fix rebase error message translation in merge requests
+merge_request: 22952
+author: briankabiro
+type: fixed
diff --git a/changelogs/unreleased/19688-allow-org-mode-in-wiki.yml b/changelogs/unreleased/19688-allow-org-mode-in-wiki.yml
new file mode 100644
index 00000000000..2b7e02a998b
--- /dev/null
+++ b/changelogs/unreleased/19688-allow-org-mode-in-wiki.yml
@@ -0,0 +1,5 @@
+---
+title: Add Org to the list of available markups for project wikis
+merge_request: 22898
+author: Alexander Oleynikov
+type: added
diff --git a/config/initializers/database_config.rb b/config/initializers/database_config.rb
index 509f04c9b02..b5490fc4719 100644
--- a/config/initializers/database_config.rb
+++ b/config/initializers/database_config.rb
@@ -1,18 +1,40 @@
# frozen_string_literal: true
-# when running on puma, scale connection pool size with the number
-# of threads per worker process
-if Gitlab::Runtime.puma?
+def log_pool_size(db, previous_pool_size, current_pool_size)
+ log_message = ["#{db} connection pool size: #{current_pool_size}"]
+
+ if previous_pool_size && current_pool_size > previous_pool_size
+ log_message << "(increased from #{previous_pool_size} to match thread count)"
+ end
+
+ Gitlab::AppLogger.debug(log_message.join(' '))
+end
+
+# When running on multi-threaded runtimes like Puma or Sidekiq,
+# set the number of threads per process as the minimum DB connection pool size.
+# This is to avoid connectivity issues as was documented here:
+# https://github.com/rails/rails/pull/23057
+if Gitlab::Runtime.multi_threaded?
+ max_threads = Gitlab::Runtime.max_threads
db_config = Gitlab::Database.config ||
Rails.application.config.database_configuration[Rails.env]
- puma_options = Puma.cli_config.options
+ previous_db_pool_size = db_config['pool']
- # We use either the maximum number of threads per worker process, or
- # the user specified value, whichever is larger.
- desired_pool_size = [db_config['pool'].to_i, puma_options[:max_threads]].max
+ db_config['pool'] = [db_config['pool'].to_i, max_threads].max
- db_config['pool'] = desired_pool_size
-
- # recreate the connection pool from the new config
ActiveRecord::Base.establish_connection(db_config)
+
+ current_db_pool_size = ActiveRecord::Base.connection.pool.size
+
+ log_pool_size('DB', previous_db_pool_size, current_db_pool_size)
+
+ Gitlab.ee do
+ if Gitlab::Runtime.sidekiq? && Gitlab::Geo.geo_database_configured?
+ previous_geo_db_pool_size = Rails.configuration.geo_database['pool']
+ Rails.configuration.geo_database['pool'] = max_threads
+ Geo::TrackingBase.establish_connection(Rails.configuration.geo_database)
+ current_geo_db_pool_size = Geo::TrackingBase.connection_pool.size
+ log_pool_size('Geo DB', previous_geo_db_pool_size, current_geo_db_pool_size)
+ end
+ end
end
diff --git a/config/initializers/sidekiq.rb b/config/initializers/sidekiq.rb
index b4a1e0da41a..b90a04a19e1 100644
--- a/config/initializers/sidekiq.rb
+++ b/config/initializers/sidekiq.rb
@@ -88,23 +88,10 @@ Sidekiq.configure_server do |config|
Gitlab::SidekiqVersioning.install!
- db_config = Gitlab::Database.config ||
- Rails.application.config.database_configuration[Rails.env]
- db_config['pool'] = Sidekiq.options[:concurrency]
- ActiveRecord::Base.establish_connection(db_config)
- Rails.logger.debug("Connection Pool size for Sidekiq Server is now: #{ActiveRecord::Base.connection.pool.instance_variable_get('@size')}") # rubocop:disable Gitlab/RailsLogger
-
Gitlab.ee do
Gitlab::Mirror.configure_cron_job!
Gitlab::Geo.configure_cron_jobs!
-
- if Gitlab::Geo.geo_database_configured?
- Rails.configuration.geo_database['pool'] = Sidekiq.options[:concurrency]
- Geo::TrackingBase.establish_connection(Rails.configuration.geo_database)
-
- Rails.logger.debug("Connection Pool size for Sidekiq Server is now: #{Geo::TrackingBase.connection_pool.size} (Geo tracking database)") # rubocop:disable Gitlab/RailsLogger
- end
end
# Avoid autoload issue such as 'Mail::Parsers::AddressStruct'
diff --git a/doc/api/wikis.md b/doc/api/wikis.md
index 570fb2168b2..035a89d80a5 100644
--- a/doc/api/wikis.md
+++ b/doc/api/wikis.md
@@ -86,7 +86,7 @@ POST /projects/:id/wikis
| `id` | integer/string | yes | The ID or [URL-encoded path of the project](README.md#namespaced-path-encoding) |
| `content` | string | yes | The content of the wiki page |
| `title` | string | yes | The title of the wiki page |
-| `format` | string | no | The format of the wiki page. Available formats are: `markdown` (default), `rdoc`, and `asciidoc` |
+| `format` | string | no | The format of the wiki page. Available formats are: `markdown` (default), `rdoc`, `asciidoc` and `org` |
```bash
curl --data "format=rdoc&title=Hello&content=Hello world" --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/1/wikis"
@@ -116,7 +116,7 @@ PUT /projects/:id/wikis/:slug
| `id` | integer/string | yes | The ID or [URL-encoded path of the project](README.md#namespaced-path-encoding) |
| `content` | string | yes if `title` is not provided | The content of the wiki page |
| `title` | string | yes if `content` is not provided | The title of the wiki page |
-| `format` | string | no | The format of the wiki page. Available formats are: `markdown` (default), `rdoc`, and `asciidoc` |
+| `format` | string | no | The format of the wiki page. Available formats are: `markdown` (default), `rdoc`, `asciidoc` and `org` |
| `slug` | string | yes | The slug (a unique string) of the wiki page |
```bash
diff --git a/doc/user/project/merge_requests/getting_started.md b/doc/user/project/merge_requests/getting_started.md
index a1bc3232ed1..0ab8d31403e 100644
--- a/doc/user/project/merge_requests/getting_started.md
+++ b/doc/user/project/merge_requests/getting_started.md
@@ -26,7 +26,7 @@ it to GitLab, you have the option to create a **Merge Request**,
which is essentially a _request_ to merge one branch into another.
The branch you added your changes into is called _source branch_
-while the branch you'll request to merge your changes into is
+while the branch you request to merge your changes into is
called _target branch_.
The target branch can be the default or any other branch, depending
@@ -46,19 +46,18 @@ Learn the various ways to [create a merge request](creating_merge_requests.md).
## What you can do with merge requests
-When you start a new merge request, you'll have the following
-options to include straightaway (you can also add them later by
-clicking the **Edit** button on the merge request's page at the
-top-right side):
+When you start a new merge request, you can immediately include the following
+options, or add them later by clicking the **Edit** button on the merge
+request's page at the top-right side:
-- [Assign](#assignee) the merge request to a colleague for review.With GitLab Starter and higher tiers, you can [assign it to more than one person at a time](#multiple-assignees-starter).
+- [Assign](#assignee) the merge request to a colleague for review. With GitLab Starter and higher tiers, you can [assign it to more than one person at a time](#multiple-assignees-starter).
- Set a [milestone](../milestones/index.md) to track time-sensitive changes.
- Add [labels](../labels.md) to help contextualize and filter your merge requests over time.
- Require [approval](merge_request_approvals.md) from your team. **(STARTER)**
-- [Close issues automatically](#merge-requests-to-close-issues) when it's merged.
+- [Close issues automatically](#merge-requests-to-close-issues) when they are merged.
- Enable the [delete source branch when merge request is accepted](#deleting-the-source-branch) option to keep your repository clean.
- Enable the [squash commits when merge request is accepted](squash_and_merge.md) option to combine all the commits into one before merging, thus keep a clean commit history in your repository.
-- Set the merge request as a [Work In Progress (WIP)](work_in_progress_merge_requests.md) to avoid accidental merges before it's ready.
+- Set the merge request as a [Work In Progress (WIP)](work_in_progress_merge_requests.md) to avoid accidental merges before it is ready.
Once you have created the merge request, you can also:
@@ -98,12 +97,13 @@ to indicate everyone that is reviewing or accountable for it.
To assign multiple assignees to a merge request:
1. From a merge request, expand the right sidebar and locate the **Assignees** section.
-1. Click on **Edit** and from the dropdown menu, select as many users as you want to assign the merge request to.
+1. Click on **Edit** and from the dropdown menu, select as many users as you want
+ to assign the merge request to.
Similarly, assignees are removed by deselecting them from the same
dropdown menu.
-It's also possible to manage multiple assignees:
+It is also possible to manage multiple assignees:
- When creating a merge request.
- Using [quick actions](../quick_actions.md#quick-actions-for-issues-merge-requests-and-epics).
@@ -111,7 +111,7 @@ It's also possible to manage multiple assignees:
### Merge requests to close issues
If the merge request is being created to resolve an issue, you can
-add a note in the description which will set it to
+add a note in the description which sets it to
[automatically close the issue](../issues/managing_issues.md#closing-issues-automatically)
when merged.
@@ -122,27 +122,30 @@ to prevent confidential information from being exposed.
### Deleting the source branch
-When creating a merge request, select the "Delete source branch
-when merge request accepted" option and the source branch will be
-deleted when the merge request is merged. To make this option
+When creating a merge request, select the
+**Delete source branch when merge request accepted** option, and the source
+branch is deleted when the merge request is merged. To make this option
enabled by default for all new merge requests, enable it in the
[project's settings](../settings/index.md#merge-request-settings).
This option is also visible in an existing merge request next to
-the merge request button and can be selected/deselected before merging.
-It's only visible to users with [Maintainer permissions](../../permissions.md)
+the merge request button and can be selected or deselected before merging.
+It is only visible to users with [Maintainer permissions](../../permissions.md)
in the source project.
If the user viewing the merge request does not have the correct
permissions to delete the source branch and the source branch
-is set for deletion, the merge request widget will show the
+is set for deletion, the merge request widget displays the
**Deletes source branch** text.
![Delete source branch status](img/remove_source_branch_status.png)
## Recommendations and best practices for Merge Requests
-- When working locally in your branch, add multiple commits and only push when you're done, so GitLab will run only one pipeline for all the commits pushed at once. By doing so, you save pipeline minutes.
+- When working locally in your branch, add multiple commits and only push when
+ you're done, so GitLab runs only one pipeline for all the commits pushed
+ at once. By doing so, you save pipeline minutes.
- Delete feature branches on merge or after merging them to keep your repository clean.
-- Take one thing at a time and ship the smallest changes possible. By doing so, you'll have faster reviews and your changes will be less prone to errors.
-- Don't use capital letters nor special chars in branch names.
+- Take one thing at a time and ship the smallest changes possible. By doing so,
+ you'll have faster reviews and your changes will be less prone to errors.
+- Do not use capital letters nor special chars in branch names.
diff --git a/doc/user/project/wiki/index.md b/doc/user/project/wiki/index.md
index 687e1850289..80f5823c095 100644
--- a/doc/user/project/wiki/index.md
+++ b/doc/user/project/wiki/index.md
@@ -38,7 +38,7 @@ automatically. For example, a title of `docs/my-page` will create a wiki
page with a path `/wikis/docs/my-page`.
Once you enter the page name, it's time to fill in its content. GitLab wikis
-support Markdown, RDoc and AsciiDoc. For Markdown based pages, all the
+support Markdown, RDoc, AsciiDoc and Org. For Markdown based pages, all the
[Markdown features](../../markdown.md) are supported and for links there is
some [wiki specific](../../markdown.md#wiki-specific-markdown) behavior.
diff --git a/lib/api/wikis.rb b/lib/api/wikis.rb
index c5a5488950d..eb36779e1d7 100644
--- a/lib/api/wikis.rb
+++ b/lib/api/wikis.rb
@@ -26,7 +26,7 @@ module API
type: String,
values: ProjectWiki::MARKUPS.values.map(&:to_s),
default: 'markdown',
- desc: 'Format of a wiki page. Available formats are markdown, rdoc, and asciidoc'
+ desc: 'Format of a wiki page. Available formats are markdown, rdoc, asciidoc and org'
end
end
diff --git a/lib/gitlab/git/commit.rb b/lib/gitlab/git/commit.rb
index b2dc9a8a3c8..c6f762c3ee6 100644
--- a/lib/gitlab/git/commit.rb
+++ b/lib/gitlab/git/commit.rb
@@ -18,7 +18,7 @@ module Gitlab
:committed_date, :committer_name, :committer_email
].freeze
- attr_accessor *SERIALIZE_KEYS # rubocop:disable Lint/AmbiguousOperator
+ attr_accessor(*SERIALIZE_KEYS)
def ==(other)
return false unless other.is_a?(Gitlab::Git::Commit)
diff --git a/lib/gitlab/git/tag.rb b/lib/gitlab/git/tag.rb
index 0218f6e6232..08dbd52e3fb 100644
--- a/lib/gitlab/git/tag.rb
+++ b/lib/gitlab/git/tag.rb
@@ -10,7 +10,7 @@ module Gitlab
MAX_TAG_MESSAGE_DISPLAY_SIZE = 10.megabytes
SERIALIZE_KEYS = %i[name target target_commit message].freeze
- attr_accessor *SERIALIZE_KEYS # rubocop:disable Lint/AmbiguousOperator
+ attr_accessor(*SERIALIZE_KEYS)
class << self
def get_message(repository, tag_id)
diff --git a/lib/gitlab/runtime.rb b/lib/gitlab/runtime.rb
index c9e5d71c107..97f7a8e2800 100644
--- a/lib/gitlab/runtime.rb
+++ b/lib/gitlab/runtime.rb
@@ -67,6 +67,16 @@ module Gitlab
def process_name
File.basename($0)
end
+
+ def max_threads
+ if puma?
+ Puma.cli_config.options[:max_threads]
+ elsif sidekiq?
+ Sidekiq.options[:concurrency]
+ else
+ 1
+ end
+ end
end
end
end
diff --git a/qa/qa/specs/features/browser_ui/2_plan/issue/close_issue_spec.rb b/qa/qa/specs/features/browser_ui/2_plan/issue/close_issue_spec.rb
index 664b62db888..2543c0091fb 100644
--- a/qa/qa/specs/features/browser_ui/2_plan/issue/close_issue_spec.rb
+++ b/qa/qa/specs/features/browser_ui/2_plan/issue/close_issue_spec.rb
@@ -4,12 +4,9 @@ module QA
context 'Plan' do
describe 'Close issue' do
let(:issue) do
- Resource::Issue.fabricate_via_api! do |issue|
- issue.title = 'Issue to be closed via pushing a commit'
- end
+ Resource::Issue.fabricate_via_api!
end
- let(:project) { issue.project }
let(:issue_id) { issue.api_response[:iid] }
before do
@@ -39,7 +36,7 @@ module QA
push.commit_message = commit_message
push.new_branch = new_branch
push.file_content = commit_message
- push.project = project
+ push.project = issue.project
end
end
end
diff --git a/spec/controllers/projects/merge_requests_controller_spec.rb b/spec/controllers/projects/merge_requests_controller_spec.rb
index 2476cf43678..46f7b610e5a 100644
--- a/spec/controllers/projects/merge_requests_controller_spec.rb
+++ b/spec/controllers/projects/merge_requests_controller_spec.rb
@@ -1412,7 +1412,7 @@ describe Projects::MergeRequestsController do
post_rebase
expect(response.status).to eq(409)
- expect(json_response['merge_error']).to eq(MergeRequest::REBASE_LOCK_MESSAGE)
+ expect(json_response['merge_error']).to eq('Failed to enqueue the rebase operation, possibly due to a long-lived transaction. Try again later.')
end
end
diff --git a/spec/features/projects/wiki/user_creates_wiki_page_spec.rb b/spec/features/projects/wiki/user_creates_wiki_page_spec.rb
index 499c459621a..7503c8aa52e 100644
--- a/spec/features/projects/wiki/user_creates_wiki_page_spec.rb
+++ b/spec/features/projects/wiki/user_creates_wiki_page_spec.rb
@@ -145,6 +145,24 @@ describe "User creates wiki page" do
end
end
+ it 'creates a wiki page with Org markup', :aggregate_failures do
+ org_content = <<~ORG
+ * Heading
+ ** Subheading
+ [[home][Link to Home]]
+ ORG
+
+ page.within('.wiki-form') do
+ find('#wiki_format option[value=org]').select_option
+ fill_in(:wiki_content, with: org_content)
+ click_button('Create page')
+ end
+
+ expect(page).to have_selector('h1', text: 'Heading')
+ expect(page).to have_selector('h2', text: 'Subheading')
+ expect(page).to have_link('Link to Home', href: "/#{project.full_path}/-/wikis/home")
+ end
+
it_behaves_like 'wiki file attachments', :quarantine
end
diff --git a/spec/initializers/database_config_spec.rb b/spec/initializers/database_config_spec.rb
index 9200a625b38..85577ce007a 100644
--- a/spec/initializers/database_config_spec.rb
+++ b/spec/initializers/database_config_spec.rb
@@ -11,14 +11,12 @@ describe 'Database config initializer' do
allow(ActiveRecord::Base).to receive(:establish_connection)
end
- context "when using Puma" do
- let(:puma) { double('puma') }
- let(:puma_options) { { max_threads: 8 } }
+ context "when using multi-threaded runtime" do
+ let(:max_threads) { 8 }
before do
- allow(Gitlab::Runtime).to receive(:puma?).and_return(true)
- stub_const("Puma", puma)
- allow(puma).to receive_message_chain(:cli_config, :options).and_return(puma_options)
+ allow(Gitlab::Runtime).to receive(:multi_threaded?).and_return(true)
+ allow(Gitlab::Runtime).to receive(:max_threads).and_return(max_threads)
end
context "and no existing pool size is set" do
@@ -27,23 +25,23 @@ describe 'Database config initializer' do
end
it "sets it to the max number of worker threads" do
- expect { subject }.to change { Gitlab::Database.config['pool'] }.from(nil).to(8)
+ expect { subject }.to change { Gitlab::Database.config['pool'] }.from(nil).to(max_threads)
end
end
context "and the existing pool size is smaller than the max number of worker threads" do
before do
- stub_database_config(pool_size: 7)
+ stub_database_config(pool_size: max_threads - 1)
end
it "sets it to the max number of worker threads" do
- expect { subject }.to change { Gitlab::Database.config['pool'] }.from(7).to(8)
+ expect { subject }.to change { Gitlab::Database.config['pool'] }.by(1)
end
end
context "and the existing pool size is larger than the max number of worker threads" do
before do
- stub_database_config(pool_size: 9)
+ stub_database_config(pool_size: max_threads + 1)
end
it "keeps the configured pool size" do
@@ -52,11 +50,7 @@ describe 'Database config initializer' do
end
end
- context "when not using Puma" do
- before do
- stub_database_config(pool_size: 7)
- end
-
+ context "when using single-threaded runtime" do
it "does nothing" do
expect { subject }.not_to change { Gitlab::Database.config['pool'] }
end
diff --git a/spec/lib/gitlab/runtime_spec.rb b/spec/lib/gitlab/runtime_spec.rb
index 6059644a1b2..194ed49bb32 100644
--- a/spec/lib/gitlab/runtime_spec.rb
+++ b/spec/lib/gitlab/runtime_spec.rb
@@ -26,9 +26,15 @@ describe Gitlab::Runtime do
context "puma" do
let(:puma_type) { double('::Puma') }
+ let(:options) do
+ {
+ max_threads: 2
+ }
+ end
before do
stub_const('::Puma', puma_type)
+ allow(puma_type).to receive_message_chain(:cli_config, :options).and_return(options)
end
it "identifies itself" do
@@ -43,6 +49,10 @@ describe Gitlab::Runtime do
expect(subject.rake?).to be(false)
expect(subject.rspec?).to be(false)
end
+
+ it "reports its maximum concurrency" do
+ expect(subject.max_threads).to eq(2)
+ end
end
context "unicorn" do
@@ -66,14 +76,24 @@ describe Gitlab::Runtime do
expect(subject.rake?).to be(false)
expect(subject.rspec?).to be(false)
end
+
+ it "reports its maximum concurrency" do
+ expect(subject.max_threads).to eq(1)
+ end
end
context "sidekiq" do
let(:sidekiq_type) { double('::Sidekiq') }
+ let(:options) do
+ {
+ concurrency: 2
+ }
+ end
before do
stub_const('::Sidekiq', sidekiq_type)
allow(sidekiq_type).to receive(:server?).and_return(true)
+ allow(sidekiq_type).to receive(:options).and_return(options)
end
it "identifies itself" do
@@ -88,6 +108,10 @@ describe Gitlab::Runtime do
expect(subject.rake?).to be(false)
expect(subject.rspec?).to be(false)
end
+
+ it "reports its maximum concurrency" do
+ expect(subject.max_threads).to eq(2)
+ end
end
context "console" do
@@ -109,6 +133,10 @@ describe Gitlab::Runtime do
expect(subject.rake?).to be(false)
expect(subject.rspec?).to be(false)
end
+
+ it "reports its maximum concurrency" do
+ expect(subject.max_threads).to eq(1)
+ end
end
context "rspec" do
@@ -127,5 +155,9 @@ describe Gitlab::Runtime do
expect(subject.rake?).to be(false)
expect(subject.puma?).to be(false)
end
+
+ it "reports its maximum concurrency" do
+ expect(subject.max_threads).to eq(1)
+ end
end
end
diff --git a/spec/requests/api/merge_requests_spec.rb b/spec/requests/api/merge_requests_spec.rb
index d322c6de6bf..f604b13d3cc 100644
--- a/spec/requests/api/merge_requests_spec.rb
+++ b/spec/requests/api/merge_requests_spec.rb
@@ -2260,7 +2260,7 @@ describe API::MergeRequests do
put api("/projects/#{project.id}/merge_requests/#{merge_request.iid}/rebase", user)
expect(response).to have_gitlab_http_status(409)
- expect(json_response['message']).to eq(MergeRequest::REBASE_LOCK_MESSAGE)
+ expect(json_response['message']).to eq('Failed to enqueue the rebase operation, possibly due to a long-lived transaction. Try again later.')
end
end