Add latest changes from gitlab-org/gitlab@master

This commit is contained in:
GitLab Bot 2021-06-24 00:07:35 +00:00
parent 87e9d9675a
commit 1d78b1f77a
15 changed files with 83 additions and 41 deletions

View file

@ -6,7 +6,7 @@ import * as types from './mutation_types';
export const fetchGroups = ({ commit }, search) => {
commit(types.REQUEST_GROUPS);
Api.groups(search)
Api.groups(search, { order_by: 'similarity' })
.then((data) => {
commit(types.RECEIVE_GROUPS_SUCCESS, data);
})

View file

@ -0,0 +1,17 @@
# frozen_string_literal: true
class AddPartialIndexForCiBuildsToken < ActiveRecord::Migration[6.1]
include Gitlab::Database::MigrationHelpers
disable_ddl_transaction!
NAME = 'index_ci_builds_on_token_partial'
def up
add_concurrent_index :ci_builds, :token, unique: true, where: 'token IS NOT NULL', name: NAME
end
def down
remove_concurrent_index_by_name :ci_builds, NAME
end
end

View file

@ -0,0 +1 @@
525fbdd66dcabbf1e6d0430468600f86fbc3c00dcfdab1c5a052294d7d73de37

View file

@ -22830,6 +22830,8 @@ CREATE UNIQUE INDEX index_ci_builds_on_token ON ci_builds USING btree (token);
CREATE UNIQUE INDEX index_ci_builds_on_token_encrypted ON ci_builds USING btree (token_encrypted) WHERE (token_encrypted IS NOT NULL);
CREATE UNIQUE INDEX index_ci_builds_on_token_partial ON ci_builds USING btree (token) WHERE (token IS NOT NULL);
CREATE INDEX index_ci_builds_on_updated_at ON ci_builds USING btree (updated_at);
CREATE INDEX index_ci_builds_on_upstream_pipeline_id ON ci_builds USING btree (upstream_pipeline_id) WHERE (upstream_pipeline_id IS NOT NULL);

View file

@ -752,9 +752,8 @@ For example:
| App A | Description text. <sup>1</sup> |
| App B | Description text. <sup>2</sup> |
**1** This is the footnote.
**2** This is the other footnote.
1. This is the footnote.
1. This is the other footnote.
```
This text renders this output:
@ -764,9 +763,8 @@ This text renders this output:
| App A | Description text. <sup>1</sup> |
| App B | Description text. <sup>2</sup> |
**1** This is the footnote.
**2** This is the other footnote.
1. This is the footnote.
1. This is the other footnote.
## Quotes

View file

@ -1,6 +1,6 @@
---
stage: Release
group: Release
stage: Configure
group: Configure
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#assignments
type: reference
---

View file

@ -138,6 +138,7 @@ link in the issue sidebar.
> - Introduced in [GitLab Ultimate](https://about.gitlab.com/pricing/) 10.5.
> - [Moved](https://gitlab.com/gitlab-org/gitlab/-/issues/37081) to the [Premium](https://about.gitlab.com/pricing/) tier in GitLab 12.8.
> - Searching by the user's reaction emoji [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/325630) in GitLab 13.11.
> - Sorting by epic titles [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/331625) in GitLab 14.1.
You can search for an epic from the list of epics using filtered search bar (similar to
that of issues and merge requests) based on following parameters:
@ -160,6 +161,7 @@ You can also sort epics list by:
- Last updated
- Start date
- Due date
- Title
Each option contains a button that can toggle the order between **Ascending** and **Descending**.
The sort option and order is saved and used wherever you browse epics, including the

View file

@ -6,7 +6,7 @@ module Gitlab
APDEX_EXCLUDE = %w[brpop blpop brpoplpush bzpopmin bzpopmax xread xreadgroup].freeze
def call(*args, &block)
start = Time.now # must come first so that 'start' is always defined
start = Gitlab::Metrics::System.monotonic_time # must come first so that 'start' is always defined
instrumentation_class.instance_count_request
instrumentation_class.redis_cluster_validate!(args.first)
@ -15,7 +15,7 @@ module Gitlab
instrumentation_class.instance_count_exception(ex)
raise ex
ensure
duration = Time.now - start
duration = Gitlab::Metrics::System.monotonic_time - start
unless APDEX_EXCLUDE.include?(command_from_args(args))
instrumentation_class.instance_observe_duration(duration)

View file

@ -14,7 +14,7 @@ module Gitlab
end
def drop_jobs!(search_metadata, timeout:)
start_time = Gitlab::Metrics::System.monotonic_time
start_time = monotonic_time
completed = true
deleted_jobs = 0
@ -62,7 +62,11 @@ module Gitlab
end
def timeout_exceeded?(start_time, timeout)
(Gitlab::Metrics::System.monotonic_time - start_time) > timeout
(monotonic_time - start_time) > timeout
end
def monotonic_time
Gitlab::Metrics::System.monotonic_time
end
end
end

View file

@ -30564,6 +30564,9 @@ msgstr ""
msgid "SortOptions|Start soon"
msgstr ""
msgid "SortOptions|Title"
msgstr ""
msgid "SortOptions|Type"
msgstr ""

View file

@ -9,7 +9,7 @@ gem 'capybara', '~> 3.29.0'
gem 'capybara-screenshot', '~> 1.0.23'
gem 'rake', '~> 12.3.3'
gem 'rspec', '~> 3.7'
gem 'selenium-webdriver', '~> 3.12'
gem 'selenium-webdriver', '~> 4.0.0.beta4'
gem 'airborne', '~> 0.3.4'
gem 'rest-client', '~> 2.1.0'
gem 'nokogiri', '~> 1.11.1'

View file

@ -47,7 +47,7 @@ GEM
watir (~> 6.17)
chemlab-library-www-gitlab-com (0.1.1)
chemlab (~> 0.4)
childprocess (3.0.0)
childprocess (4.1.0)
coderay (1.1.2)
concord (0.1.5)
adamantium (~> 0.2.0)
@ -136,6 +136,7 @@ GEM
http-cookie (>= 1.0.2, < 2.0)
mime-types (>= 1.16, < 4.0)
netrc (~> 0.8)
rexml (3.2.5)
rotp (3.1.0)
rspec (3.9.0)
rspec-core (~> 3.9.0)
@ -162,9 +163,10 @@ GEM
rspec-core (>= 2, < 4, != 2.12.0)
ruby-debug-ide (0.7.2)
rake (>= 0.8.1)
rubyzip (1.3.0)
selenium-webdriver (3.142.6)
childprocess (>= 0.5, < 4.0)
rubyzip (2.3.0)
selenium-webdriver (4.0.0.beta4)
childprocess (>= 0.5, < 5.0)
rexml (~> 3.2)
rubyzip (>= 1.2.2)
systemu (2.6.5)
thread_safe (0.3.6)
@ -218,7 +220,7 @@ DEPENDENCIES
rspec-retry (~> 0.6.1)
rspec_junit_formatter (~> 0.4.1)
ruby-debug-ide (~> 0.7.0)
selenium-webdriver (~> 3.12)
selenium-webdriver (~> 4.0.0.beta4)
timecop (~> 0.9.1)
BUNDLED WITH

View file

@ -66,58 +66,58 @@ module QA
return if Capybara.drivers.include?(:chrome)
Capybara.register_driver QA::Runtime::Env.browser do |app|
capabilities = Selenium::WebDriver::Remote::Capabilities.send(QA::Runtime::Env.browser,
# This enables access to logs with `page.driver.manage.get_log(:browser)`
loggingPrefs: {
browser: "ALL",
client: "ALL",
driver: "ALL",
server: "ALL"
})
capabilities = Selenium::WebDriver::Remote::Capabilities.send(QA::Runtime::Env.browser)
if QA::Runtime::Env.accept_insecure_certs?
capabilities['acceptInsecureCerts'] = true
end
# QA::Runtime::Env.browser.capitalize will work for every driver type except PhantomJS.
# We will have no use to use PhantomJS so this shouldn't be a problem.
options = Selenium::WebDriver.const_get(QA::Runtime::Env.browser.capitalize, false)::Options.new
if QA::Runtime::Env.browser == :chrome
options.add_argument("window-size=1480,2200")
# 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'
}
# size window
capabilities['goog:chromeOptions'] = {
args: %w[window-size=1480,2200]
}
# Chrome won't work properly in a Docker container in sandbox mode
options.add_argument("no-sandbox")
capabilities['goog:chromeOptions'][:args] << 'no-sandbox'
# Run headless by default unless WEBDRIVER_HEADLESS is false
if QA::Runtime::Env.webdriver_headless?
options.add_argument("headless")
capabilities['goog:chromeOptions'][:args] << 'headless'
# Chrome documentation says this flag is needed for now
# https://developers.google.com/web/updates/2017/04/headless-chrome#cli
options.add_argument("disable-gpu")
capabilities['goog:chromeOptions'][:args] << 'disable-gpu'
end
# Disable /dev/shm use in CI. See https://gitlab.com/gitlab-org/gitlab/issues/4252
options.add_argument("disable-dev-shm-usage") if QA::Runtime::Env.running_in_ci?
capabilities['goog:chromeOptions'][:args] << 'disable-dev-shm-usage' if QA::Runtime::Env.running_in_ci?
# Specify the user-agent to allow challenges to be bypassed
# See https://gitlab.com/gitlab-com/gl-infra/infrastructure/-/issues/11938
options.add_argument("user-agent=#{QA::Runtime::Env.user_agent}") if QA::Runtime::Env.user_agent
capabilities['goog:chromeOptions'][:args] << "user-agent=#{QA::Runtime::Env.user_agent}" if QA::Runtime::Env.user_agent
end
# Use the same profile on QA runs if CHROME_REUSE_PROFILE is true.
# Useful to speed up local QA.
if QA::Runtime::Env.reuse_chrome_profile?
qa_profile_dir = ::File.expand_path('../../tmp/qa-profile', __dir__)
options.add_argument("user-data-dir=#{qa_profile_dir}")
capabilities['goog:chromeOptions'][:args] << "user-data-dir=#{qa_profile_dir}"
end
selenium_options = {
browser: QA::Runtime::Env.browser,
clear_local_storage: true,
desired_capabilities: capabilities,
options: options
capabilities: capabilities
}
selenium_options[:url] = QA::Runtime::Env.remote_grid if QA::Runtime::Env.remote_grid

View file

@ -56,6 +56,19 @@ describe('Global Search Store Actions', () => {
});
});
describe('getGroupsData', () => {
const mockCommit = () => {};
beforeEach(() => {
jest.spyOn(Api, 'groups').mockResolvedValue(MOCK_GROUPS);
});
it('calls Api.groups with order_by set to similarity', () => {
actions.fetchGroups({ commit: mockCommit }, 'test');
expect(Api.groups).toHaveBeenCalledWith('test', { order_by: 'similarity' });
});
});
describe('getProjectsData', () => {
const mockCommit = () => {};
beforeEach(() => {

View file

@ -31,7 +31,7 @@ RSpec.describe Gitlab::SidekiqQueue, :clean_gitlab_redis_queues do
context 'when the queue is not processed in time' do
before do
allow(Gitlab::Metrics::System).to receive(:monotonic_time).and_return(1, 2, 12)
allow(sidekiq_queue).to receive(:monotonic_time).and_return(1, 2, 12)
end
it 'returns a non-completion flag, the number of jobs deleted, and the remaining queue size' do