Add latest changes from gitlab-org/gitlab@master

This commit is contained in:
GitLab Bot 2020-09-25 03:09:30 +00:00
parent 802594d2a7
commit c916c6f79b
63 changed files with 203 additions and 64 deletions

View File

@ -14,5 +14,11 @@ module Terraform
mount_file_store_uploader VersionedStateUploader
delegate :project_id, :uuid, to: :terraform_state, allow_nil: true
def local?
file_store == ObjectStorage::Store::LOCAL
end
end
end
Terraform::StateVersion.prepend_if_ee('EE::Terraform::StateVersion')

View File

@ -0,0 +1,5 @@
---
title: 'VSA: Replace fa-warning with GitLab SVG'
merge_request: 43262
author:
type: changed

View File

@ -24,11 +24,12 @@ ActiveSupport::Inflector.inflections do |inflect|
project_auto_devops
project_registry
project_statistics
snippet_repository_registry
system_note_metadata
terraform_state_registry
terraform_state_version_registry
vulnerabilities_feedback
vulnerability_feedback
snippet_repository_registry
)
inflect.acronym 'EE'
inflect.acronym 'CSP'

View File

@ -532,13 +532,9 @@ corresponding to each Gitaly server must be installed on that Gitaly server.
Additionally, the certificate (or its certificate authority) must be installed on all:
- Gitaly servers, including the Gitaly server using the certificate.
- Gitaly servers.
- Gitaly clients that communicate with it.
The process is documented in the
[GitLab custom certificate configuration](https://docs.gitlab.com/omnibus/settings/ssl.html#install-custom-public-certificates)
and repeated below.
Note the following:
- The certificate must specify the address you use to access the Gitaly server. If you are:

View File

@ -190,6 +190,12 @@ configuration option in `gitlab.yml`. These metrics are served from the
| `geo_terraform_states_synced` | Gauge | 13.3 | Number of syncable terraform states synced on secondary | `url` |
| `geo_terraform_states_failed` | Gauge | 13.3 | Number of syncable terraform states failed to sync on secondary | `url` |
| `geo_terraform_states_registry` | Gauge | 13.3 | Number of terraform states in the registry | `url` |
| `geo_terraform_state_versions` | Gauge | 13.5 | Number of terraform state versions on primary | `url` |
| `geo_terraform_state_versions_checksummed` | Gauge | 13.5 | Number of terraform state versions checksummed on primary | `url` |
| `geo_terraform_state_versions_checksum_failed` | Gauge | 13.5 | Number of terraform state versions failed to calculate the checksum on primary | `url` |
| `geo_terraform_state_versions_synced` | Gauge | 13.5 | Number of syncable terraform state versions synced on secondary | `url` |
| `geo_terraform_state_versions_failed` | Gauge | 13.5 | Number of syncable terraform state versions failed to sync on secondary | `url` |
| `geo_terraform_state_versions_registry` | Gauge | 13.5 | Number of terraform state versions in the registry | `url` |
| `global_search_bulk_cron_queue_size` | Gauge | 12.10 | Number of database records waiting to be synchronized to Elasticsearch | |
| `global_search_awaiting_indexing_queue_size` | Gauge | 13.2 | Number of database updates waiting to be synchronized to Elasticsearch while indexing is paused | |
| `geo_merge_request_diffs` | Gauge | 13.4 | Number of merge request diffs on primary | `url` |

View File

@ -465,7 +465,13 @@ Example response:
"terraform_states_checksum_failed_count": 0,
"terraform_states_registry_count": 10,
"terraform_states_synced_count": 6,
"terraform_states_failed_count": 3
"terraform_states_failed_count": 3,
"terraform_state_versions_count": 10,
"terraform_state_versions_checksummed_count": 10,
"terraform_state_versions_checksum_failed_count": 0,
"terraform_state_versions_registry_count": 10,
"terraform_state_versions_synced_count": 6,
"terraform_state_versions_failed_count": 3,
"snippet_repositories_count": 10,
"snippet_repositories_checksummed_count": 10,
"snippet_repositories_checksum_failed_count": 0,

View File

@ -15400,6 +15400,26 @@ type SastCiConfigurationAnalyzersEntityEdge {
node: SastCiConfigurationAnalyzersEntity
}
"""
Represents the analyzers entity in SAST CI configuration
"""
input SastCiConfigurationAnalyzersEntityInput {
"""
State of the analyzer
"""
enabled: Boolean!
"""
Name of analyzer
"""
name: String!
"""
List of variables for the analyzer
"""
variables: [SastCiConfigurationEntityInput!]
}
"""
Represents an entity in SAST CI configuration
"""
@ -15524,6 +15544,11 @@ input SastCiConfigurationEntityInput {
Represents a CI configuration of SAST
"""
input SastCiConfigurationInput {
"""
List of analyzers and related variables for the SAST configuration
"""
analyzers: [SastCiConfigurationAnalyzersEntityInput!]
"""
List of global entities related to SAST configuration
"""

View File

@ -44826,6 +44826,63 @@
"enumValues": null,
"possibleTypes": null
},
{
"kind": "INPUT_OBJECT",
"name": "SastCiConfigurationAnalyzersEntityInput",
"description": "Represents the analyzers entity in SAST CI configuration",
"fields": null,
"inputFields": [
{
"name": "name",
"description": "Name of analyzer",
"type": {
"kind": "NON_NULL",
"name": null,
"ofType": {
"kind": "SCALAR",
"name": "String",
"ofType": null
}
},
"defaultValue": null
},
{
"name": "enabled",
"description": "State of the analyzer",
"type": {
"kind": "NON_NULL",
"name": null,
"ofType": {
"kind": "SCALAR",
"name": "Boolean",
"ofType": null
}
},
"defaultValue": null
},
{
"name": "variables",
"description": "List of variables for the analyzer",
"type": {
"kind": "LIST",
"name": null,
"ofType": {
"kind": "NON_NULL",
"name": null,
"ofType": {
"kind": "INPUT_OBJECT",
"name": "SastCiConfigurationEntityInput",
"ofType": null
}
}
},
"defaultValue": null
}
],
"interfaces": null,
"enumValues": null,
"possibleTypes": null
},
{
"kind": "OBJECT",
"name": "SastCiConfigurationEntity",
@ -45196,6 +45253,24 @@
}
},
"defaultValue": null
},
{
"name": "analyzers",
"description": "List of analyzers and related variables for the SAST configuration",
"type": {
"kind": "LIST",
"name": null,
"ofType": {
"kind": "NON_NULL",
"name": null,
"ofType": {
"kind": "INPUT_OBJECT",
"name": "SastCiConfigurationAnalyzersEntityInput",
"ofType": null
}
}
},
"defaultValue": null
}
],
"interfaces": null,

View File

@ -474,6 +474,10 @@ More information on this particular change can be found at
of proposed changes can be found at
<https://gitlab.com/gitlab-com/infrastructure/-/issues?scope=all&utf8=%E2%9C%93&state=opened&label_name[]=database&label_name[]=change>.
## Puma
GitLab.com uses the default of 60 seconds for [Puma request timeouts](https://docs.gitlab.com/omnibus/settings/puma.html#worker-timeout).
## Unicorn
GitLab.com adjusts the memory limits for the [unicorn-worker-killer](https://rubygems.org/gems/unicorn-worker-killer) gem.

View File

@ -1,7 +1,7 @@
# frozen_string_literal: true
module QA
context 'Framework sanity checks', :orchestrated, :framework do
RSpec.describe 'Framework sanity checks', :orchestrated, :framework do
describe 'Passing orchestrated example' do
it 'succeeds' do
Runtime::Browser.visit(:gitlab, Page::Main::Login)

View File

@ -1,6 +1,6 @@
# frozen_string_literal: true
describe QA::Resource::User do
RSpec.describe QA::Resource::User do
describe "#fabricate_via_api!" do
response = Struct.new(:code, :body)

View File

@ -1,6 +1,6 @@
# frozen_string_literal: true
describe QA::Git::Location do
RSpec.describe QA::Git::Location do
describe '.new' do
context 'when URI starts with ssh://' do
context 'when URI has port' do

View File

@ -1,6 +1,6 @@
# frozen_string_literal: true
describe QA::Git::Repository do
RSpec.describe QA::Git::Repository do
include Helpers::StubENV
shared_context 'unresolvable git directory' do

View File

@ -1,6 +1,6 @@
# frozen_string_literal: true
describe QA::Page::Base do
RSpec.describe QA::Page::Base do
describe 'page helpers' do
it 'exposes helpful page helpers' do
expect(subject).to respond_to :refresh, :wait_until, :scroll_to

View File

@ -1,6 +1,6 @@
# frozen_string_literal: true
describe QA::Page::Element do
RSpec.describe QA::Page::Element do
describe '#selector' do
it 'transforms element name into QA-specific selector' do
expect(described_class.new(:sign_in_button).selector)

View File

@ -3,7 +3,7 @@
require 'capybara/dsl'
require 'logger'
describe QA::Support::Page::Logging do
RSpec.describe QA::Support::Page::Logging do
let(:page) { double.as_null_object }
before do

View File

@ -1,6 +1,6 @@
# frozen_string_literal: true
describe QA::Page::Validator do
RSpec.describe QA::Page::Validator do
describe '#constants' do
subject do
described_class.new(QA::Page::Project)

View File

@ -1,6 +1,6 @@
# frozen_string_literal: true
describe QA::Page::View do
RSpec.describe QA::Page::View do
let(:element) do
double('element', name: :something, pattern: /some element/)
end

View File

@ -1,6 +1,6 @@
# frozen_string_literal: true
describe QA::Resource::ApiFabricator do
RSpec.describe QA::Resource::ApiFabricator do
let(:resource_without_api_support) do
Class.new do
def self.name

View File

@ -1,6 +1,6 @@
# frozen_string_literal: true
describe QA::Resource::Base do
RSpec.describe QA::Resource::Base do
include Helpers::StubENV
let(:resource) { spy('resource') }

View File

@ -1,6 +1,6 @@
# frozen_string_literal: true
describe QA::Resource::Events::Base do
RSpec.describe QA::Resource::Events::Base do
let(:resource) do
Class.new(QA::Resource::Base) do
def api_get_path

View File

@ -1,6 +1,6 @@
# frozen_string_literal: true
describe QA::Resource::Events::Project do
RSpec.describe QA::Resource::Events::Project do
let(:resource) do
Class.new(QA::Resource::Base) do
def api_get_path

View File

@ -1,6 +1,6 @@
# frozen_string_literal: true
describe QA::Resource::Repository::Push do
RSpec.describe QA::Resource::Repository::Push do
describe '.files=' do
let(:files) do
[

View File

@ -1,6 +1,6 @@
# frozen_string_literal: true
describe QA::Resource::SSHKey do
RSpec.describe QA::Resource::SSHKey do
describe '#key' do
it 'generates a default key' do
expect(subject.key).to be_a(QA::Runtime::Key::RSA)

View File

@ -1,6 +1,6 @@
# frozen_string_literal: true
describe QA::Resource::User do
RSpec.describe QA::Resource::User do
let(:api_resource) do
{
name: "GitLab QA",

View File

@ -1,6 +1,6 @@
# frozen_string_literal: true
describe QA::Runtime::API::Client do
RSpec.describe QA::Runtime::API::Client do
include Helpers::StubENV
describe 'initialization' do

View File

@ -1,6 +1,6 @@
# frozen_string_literal: true
describe QA::Runtime::API::Request do
RSpec.describe QA::Runtime::API::Request do
let(:client) { QA::Runtime::API::Client.new('http://example.com') }
let(:request) { described_class.new(client, '/users') }

View File

@ -1,6 +1,6 @@
# frozen_string_literal: true
describe QA::Runtime::ApplicationSettings do
RSpec.describe QA::Runtime::ApplicationSettings do
let(:api_client) { double('QA::Runtime::API::Client') }
let(:request) { Struct.new(:url).new('http://api') }
let(:get_response) { Struct.new(:body).new("{}") }

View File

@ -1,6 +1,6 @@
# frozen_string_literal: true
describe QA::Runtime::Env do
RSpec.describe QA::Runtime::Env do
include Helpers::StubENV
shared_examples 'boolean method' do |**kwargs|

View File

@ -1,6 +1,6 @@
# frozen_string_literal: true
describe QA::Runtime::Feature do
RSpec.describe QA::Runtime::Feature do
let(:api_client) { double('QA::Runtime::API::Client') }
let(:request) { Struct.new(:url).new('http://api') }
let(:response_post) { Struct.new(:code).new(201) }

View File

@ -1,6 +1,6 @@
# frozen_string_literal: true
describe QA::Runtime::Key::ECDSA do
RSpec.describe QA::Runtime::Key::ECDSA do
describe '#public_key' do
[256, 384, 521].each do |bits|
it "generates a public #{bits}-bits ECDSA key" do

View File

@ -1,6 +1,6 @@
# frozen_string_literal: true
describe QA::Runtime::Key::ED25519 do
RSpec.describe QA::Runtime::Key::ED25519 do
describe '#public_key' do
subject { described_class.new.public_key }

View File

@ -1,6 +1,6 @@
# frozen_string_literal: true
describe QA::Runtime::Key::RSA do
RSpec.describe QA::Runtime::Key::RSA do
describe '#public_key' do
subject { described_class.new.public_key }

View File

@ -1,6 +1,6 @@
# frozen_string_literal: true
describe QA::Runtime::Logger do
RSpec.describe QA::Runtime::Logger do
before do
logger = Logger.new $stdout
logger.level = ::Logger::DEBUG

View File

@ -1,6 +1,6 @@
# frozen_string_literal: true
describe QA::Runtime::Namespace do
RSpec.describe QA::Runtime::Namespace do
include Helpers::StubENV
describe '.name' do

View File

@ -1,6 +1,6 @@
# frozen_string_literal: true
describe QA::Runtime::Release do
RSpec.describe QA::Runtime::Release do
context 'when release version has extension strategy' do
let(:strategy) { spy('strategy') }

View File

@ -1,6 +1,6 @@
# frozen_string_literal: true
describe QA::Runtime::Scenario do
RSpec.describe QA::Runtime::Scenario do
subject do
Module.new.extend(described_class)
end

View File

@ -1,6 +1,6 @@
# frozen_string_literal: true
describe QA::Scenario::Actable do
RSpec.describe QA::Scenario::Actable do
subject do
Class.new do
include QA::Scenario::Actable

View File

@ -1,6 +1,6 @@
# frozen_string_literal: true
describe QA::Scenario::Bootable do
RSpec.describe QA::Scenario::Bootable do
subject do
Class.new(QA::Scenario::Template)
.include(described_class)

View File

@ -1,6 +1,6 @@
# frozen_string_literal: true
describe QA::Scenario::Template do
RSpec.describe QA::Scenario::Template do
let(:feature) { spy('Runtime::Feature') }
let(:release) { spy('Runtime::Release') }

View File

@ -1,6 +1,6 @@
# frozen_string_literal: true
describe QA::Scenario::Test::Instance::Airgapped do
RSpec.describe QA::Scenario::Test::Instance::Airgapped do
describe '#perform' do
it_behaves_like 'a QA scenario class' do
end

View File

@ -1,5 +1,5 @@
# frozen_string_literal: true
describe QA::Scenario::Test::Instance::All do
RSpec.describe QA::Scenario::Test::Instance::All do
it_behaves_like 'a QA scenario class'
end

View File

@ -1,6 +1,6 @@
# frozen_string_literal: true
describe QA::Scenario::Test::Instance::Smoke do
RSpec.describe QA::Scenario::Test::Instance::Smoke do
it_behaves_like 'a QA scenario class' do
let(:tags) { [:smoke] }
end

View File

@ -1,6 +1,6 @@
# frozen_string_literal: true
describe QA::Scenario::Test::Integration::Github do
RSpec.describe QA::Scenario::Test::Integration::Github do
describe '#perform' do
let(:env) { spy('Runtime::Env') }

View File

@ -1,6 +1,6 @@
# frozen_string_literal: true
describe QA::Scenario::Test::Integration::InstanceSAML do
RSpec.describe QA::Scenario::Test::Integration::InstanceSAML do
describe '#perform' do
it_behaves_like 'a QA scenario class' do
let(:tags) { [:instance_saml] }

View File

@ -1,6 +1,6 @@
# frozen_string_literal: true
describe QA::Scenario::Test::Integration::Kubernetes do
RSpec.describe QA::Scenario::Test::Integration::Kubernetes do
describe '#perform' do
it_behaves_like 'a QA scenario class' do
let(:tags) { [:kubernetes] }

View File

@ -1,6 +1,6 @@
# frozen_string_literal: true
describe QA::Scenario::Test::Integration::LDAPNoTLS do
RSpec.describe QA::Scenario::Test::Integration::LDAPNoTLS do
describe '#perform' do
it_behaves_like 'a QA scenario class' do
let(:tags) { [:ldap_no_tls] }
@ -8,7 +8,7 @@ describe QA::Scenario::Test::Integration::LDAPNoTLS do
end
end
describe QA::Scenario::Test::Integration::LDAPNoServer do
RSpec.describe QA::Scenario::Test::Integration::LDAPNoServer do
describe '#perform' do
it_behaves_like 'a QA scenario class' do
let(:tags) { [:ldap_no_server] }
@ -16,7 +16,7 @@ describe QA::Scenario::Test::Integration::LDAPNoServer do
end
end
describe QA::Scenario::Test::Integration::LDAPTLS do
RSpec.describe QA::Scenario::Test::Integration::LDAPTLS do
describe '#perform' do
it_behaves_like 'a QA scenario class' do
let(:tags) { [:ldap_tls] }

View File

@ -1,6 +1,6 @@
# frozen_string_literal: true
describe QA::Scenario::Test::Integration::Mattermost do
RSpec.describe QA::Scenario::Test::Integration::Mattermost do
describe '#perform' do
it_behaves_like 'a QA scenario class' do
let(:args) { %w[gitlab_address mattermost_address] }

View File

@ -1,6 +1,6 @@
# frozen_string_literal: true
describe QA::Scenario::Test::Integration::ObjectStorage do
RSpec.describe QA::Scenario::Test::Integration::ObjectStorage do
describe '#perform' do
it_behaves_like 'a QA scenario class' do
let(:tags) { [:object_storage] }

View File

@ -1,6 +1,6 @@
# frozen_string_literal: true
describe QA::Scenario::Test::Sanity::Framework do
RSpec.describe QA::Scenario::Test::Sanity::Framework do
it_behaves_like 'a QA scenario class' do
let(:tags) { [:framework] }
end

View File

@ -1,6 +1,6 @@
# frozen_string_literal: true
describe QA::Scenario::Test::Sanity::Selectors do
RSpec.describe QA::Scenario::Test::Sanity::Selectors do
let(:validator) { spy('validator') }
before do

View File

@ -36,7 +36,7 @@ RSpec.configure do |c|
end
end
describe QA::Specs::Helpers::Quarantine do
RSpec.describe QA::Specs::Helpers::Quarantine do
describe '.skip_or_run_quarantined_contexts' do
context 'with no tag focused' do
before do

View File

@ -1,6 +1,6 @@
# frozen_string_literal: true
describe QA::Specs::ParallelRunner do
RSpec.describe QA::Specs::ParallelRunner do
include Helpers::StubENV
before do

View File

@ -2,7 +2,7 @@
require 'active_support/core_ext/hash'
describe QA::Specs::Runner do
RSpec.describe QA::Specs::Runner do
shared_examples 'excludes orchestrated' do
it 'excludes the orchestrated tag and includes default args' do
expect_rspec_runner_arguments(['--tag', '~orchestrated', *described_class::DEFAULT_TEST_PATH_ARGS])

View File

@ -4,7 +4,7 @@ require 'logger'
require 'timecop'
require 'active_support/core_ext/integer/time'
describe QA::Support::Repeater do
RSpec.describe QA::Support::Repeater do
before do
logger = ::Logger.new $stdout
logger.level = ::Logger::DEBUG

View File

@ -3,7 +3,7 @@
require 'logger'
require 'timecop'
describe QA::Support::Retrier do
RSpec.describe QA::Support::Retrier do
before do
logger = ::Logger.new $stdout
logger.level = ::Logger::DEBUG

View File

@ -1,6 +1,6 @@
# frozen_string_literal: true
describe QA::Support::WaitForRequests do
RSpec.describe QA::Support::WaitForRequests do
describe '.wait_for_requests' do
before do
allow(subject).to receive(:finished_all_ajax_requests?).and_return(true)

View File

@ -2,7 +2,7 @@
require 'logger'
describe QA::Support::Waiter do
RSpec.describe QA::Support::Waiter do
before do
logger = ::Logger.new $stdout
logger.level = ::Logger::DEBUG

View File

@ -7,5 +7,13 @@ FactoryBot.define do
sequence(:version)
file { fixture_file_upload('spec/fixtures/terraform/terraform.tfstate', 'application/json') }
trait(:checksummed) do
verification_checksum { 'abc' }
end
trait(:checksum_failure) do
verification_failure { 'Could not calculate the checksum' }
end
end
end

View File

@ -15,7 +15,7 @@ RSpec.describe Terraform::State do
it { is_expected.to validate_presence_of(:project_id) }
before do
stub_terraform_state_object_storage(Terraform::StateUploader)
stub_terraform_state_object_storage
end
describe '#file' do
@ -43,7 +43,7 @@ RSpec.describe Terraform::State do
context 'when file is stored locally' do
before do
stub_terraform_state_object_storage(Terraform::StateUploader, enabled: false)
stub_terraform_state_object_storage(enabled: false)
end
it_behaves_like 'mounted file in local store'

View File

@ -29,7 +29,7 @@ RSpec.describe Terraform::StateVersion do
subject { create(:terraform_state_version) }
before do
stub_terraform_state_object_storage(Terraform::StateUploader)
stub_terraform_state_object_storage
end
describe '#file' do

View File

@ -18,7 +18,7 @@ RSpec.describe API::Terraform::State do
let(:state_path) { "/projects/#{project_id}/terraform/state/#{state_name}" }
before do
stub_terraform_state_object_storage(Terraform::StateUploader)
stub_terraform_state_object_storage
end
describe 'GET /projects/:id/terraform/state/:name' do

View File

@ -82,9 +82,16 @@ module StubObjectStorage
**params)
end
def stub_terraform_state_object_storage(uploader = described_class, **params)
def stub_terraform_state_object_storage(**params)
stub_object_storage_uploader(config: Gitlab.config.terraform_state.object_store,
uploader: uploader,
uploader: Terraform::VersionedStateUploader,
remote_directory: 'terraform',
**params)
end
def stub_terraform_state_version_object_storage(**params)
stub_object_storage_uploader(config: Gitlab.config.terraform_state.object_store,
uploader: Terraform::StateUploader,
remote_directory: 'terraform',
**params)
end