From 74b0522ed8b86edee204643c5484da1724a5a31b Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Thu, 17 Oct 2019 06:07:30 +0000 Subject: [PATCH] Add latest changes from gitlab-org/gitlab@master --- .../geo/replication/object_storage.md | 3 ++ doc/ci/yaml/README.md | 19 ++++++++++ doc/user/clusters/environments.md | 3 +- qa/qa.rb | 1 + qa/qa/runtime/fixtures.rb | 15 ++++++++ qa/qa/service/docker_run/node_js.rb | 38 +++++++++++++++++++ spec/frontend/fixtures/abuse_reports.rb | 2 + spec/frontend/fixtures/admin_users.rb | 2 + .../frontend/fixtures/application_settings.rb | 2 + spec/frontend/fixtures/blob.rb | 2 + spec/frontend/fixtures/boards.rb | 2 + spec/frontend/fixtures/branches.rb | 2 + spec/frontend/fixtures/clusters.rb | 2 + spec/frontend/fixtures/commit.rb | 2 + spec/frontend/fixtures/deploy_keys.rb | 2 + spec/frontend/fixtures/groups.rb | 2 + spec/frontend/fixtures/issues.rb | 2 + spec/frontend/fixtures/jobs.rb | 2 + spec/frontend/fixtures/labels.rb | 2 + spec/frontend/fixtures/merge_requests.rb | 2 + .../frontend/fixtures/merge_requests_diffs.rb | 2 + spec/frontend/fixtures/pipeline_schedules.rb | 2 + spec/frontend/fixtures/pipelines.rb | 2 + spec/frontend/fixtures/projects.rb | 2 + spec/frontend/fixtures/prometheus_service.rb | 2 + spec/frontend/fixtures/raw.rb | 2 + spec/frontend/fixtures/search.rb | 2 + spec/frontend/fixtures/services.rb | 2 + spec/frontend/fixtures/sessions.rb | 2 + spec/frontend/fixtures/snippet.rb | 2 + spec/frontend/fixtures/todos.rb | 2 + spec/frontend/fixtures/u2f.rb | 2 + 32 files changed, 130 insertions(+), 1 deletion(-) create mode 100644 qa/qa/service/docker_run/node_js.rb diff --git a/doc/administration/geo/replication/object_storage.md b/doc/administration/geo/replication/object_storage.md index c85005a3f91..ad95255f2a9 100644 --- a/doc/administration/geo/replication/object_storage.md +++ b/doc/administration/geo/replication/object_storage.md @@ -16,6 +16,9 @@ To have: > - [Introduced](https://gitlab.com/gitlab-org/gitlab/issues/10586) in GitLab 12.4. +CAUTION: **Caution:** +This is a [**beta** feature](https://about.gitlab.com/handbook/product/#beta) and is not ready yet for production use at any scale. + **Secondary** nodes can replicate files stored on the **primary** node regardless of whether they are stored on the local filesystem or in object storage. diff --git a/doc/ci/yaml/README.md b/doc/ci/yaml/README.md index 628c3f01043..41fdfa6557a 100644 --- a/doc/ci/yaml/README.md +++ b/doc/ci/yaml/README.md @@ -318,6 +318,17 @@ There are also two edge cases worth mentioning: `test` and `deploy` are allowed to be used as job's stage by default. 1. If a job doesn't specify a `stage`, the job is assigned the `test` stage. +#### `.pre` and `.post` + +> [Introduced](https://gitlab.com/gitlab-org/gitlab/issues/31441) in GitLab 12.4. + +The following stages are available to every pipeline: + +- `.pre`, which is guaranteed to always be the first stage in a pipeline. +- `.post`, which is guaranteed to always be the last stage in a pipeline. + +User-defined stages are executed after `.pre` and before `.post`. + ### `stage` `stage` is defined per-job and relies on [`stages`](#stages) which is defined @@ -330,6 +341,10 @@ stages: - test - deploy +job 0: + stage: .pre + script: make something useful before build stage + job 1: stage: build script: make build dependencies @@ -345,6 +360,10 @@ job 3: job 4: stage: deploy script: make deploy + +job 5: + stage: .post + script: make something useful at the end of pipeline ``` #### Using your own Runners diff --git a/doc/user/clusters/environments.md b/doc/user/clusters/environments.md index bbf01dc27f9..f83be85726a 100644 --- a/doc/user/clusters/environments.md +++ b/doc/user/clusters/environments.md @@ -1,6 +1,7 @@ # Cluster Environments **(PREMIUM)** -> [Introduced](https://gitlab.com/gitlab-org/gitlab/issues/13392) in [GitLab Premium](https://about.gitlab.com/pricing/) 12.3. +> - [Introduced](https://gitlab.com/gitlab-org/gitlab/issues/13392) for group-level clusters in [GitLab Premium](https://about.gitlab.com/pricing/) 12.3. +> - [Introduced](https://gitlab.com/gitlab-org/gitlab/issues/14809) for instance-level clusters in [GitLab Premium](https://about.gitlab.com/pricing/) 12.4. Cluster environments provide a consolidated view of which CI [environments](../../ci/environments.md) are deployed to the Kubernetes cluster and it: diff --git a/qa/qa.rb b/qa/qa.rb index 85ee017ccd4..a628c0e0e3f 100644 --- a/qa/qa.rb +++ b/qa/qa.rb @@ -407,6 +407,7 @@ module QA module DockerRun autoload :Base, 'qa/service/docker_run/base' autoload :LDAP, 'qa/service/docker_run/ldap' + autoload :NodeJs, 'qa/service/docker_run/node_js' autoload :GitlabRunner, 'qa/service/docker_run/gitlab_runner' end end diff --git a/qa/qa/runtime/fixtures.rb b/qa/qa/runtime/fixtures.rb index 02cecffd4df..f91218ea0b5 100644 --- a/qa/qa/runtime/fixtures.rb +++ b/qa/qa/runtime/fixtures.rb @@ -1,5 +1,7 @@ # frozen_string_literal: true +require 'tmpdir' + module QA module Runtime module Fixtures @@ -18,6 +20,19 @@ module QA parse_body(response)[:content] end + def with_fixtures(fixtures) + dir = Dir.mktmpdir + fixtures.each do |file_def| + path = File.join(dir, file_def[:file_path]) + FileUtils.mkdir_p(File.dirname(path)) + File.write(path, file_def[:content]) + end + + yield dir + ensure + FileUtils.remove_entry(dir) + end + private def api_client diff --git a/qa/qa/service/docker_run/node_js.rb b/qa/qa/service/docker_run/node_js.rb new file mode 100644 index 00000000000..642f1d1a33a --- /dev/null +++ b/qa/qa/service/docker_run/node_js.rb @@ -0,0 +1,38 @@ +# frozen_string_literal: true + +module QA + module Service + module DockerRun + class NodeJs < Base + def initialize(volume_host_path) + @image = 'node:12.11.1-alpine' + @name = "qa-node-#{SecureRandom.hex(8)}" + @volume_host_path = volume_host_path + + super() + end + + def publish! + # When we run the tests via gitlab-qa, we use docker-in-docker + # which means that host of a volume mount would be the host that + # started the gitlab-qa QA container (e.g., the CI runner), + # not the gitlab-qa container itself. That means we can't + # mount a volume from the file system inside the gitlab-qa + # container. + # + # Instead, we copy the files into the container. + shell <<~CMD.tr("\n", ' ') + docker run -d --rm + --network #{network} + --hostname #{host_name} + --name #{@name} + --volume #{@volume_host_path}:/home/node + #{@image} sh -c "sleep 60" + CMD + shell "docker cp #{@volume_host_path}/. #{@name}:/home/node" + shell "docker exec -t #{@name} sh -c 'cd /home/node && npm publish'" + end + end + end + end +end diff --git a/spec/frontend/fixtures/abuse_reports.rb b/spec/frontend/fixtures/abuse_reports.rb index 21356390cae..712ed2e8d7e 100644 --- a/spec/frontend/fixtures/abuse_reports.rb +++ b/spec/frontend/fixtures/abuse_reports.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'spec_helper' describe Admin::AbuseReportsController, '(JavaScript fixtures)', type: :controller do diff --git a/spec/frontend/fixtures/admin_users.rb b/spec/frontend/fixtures/admin_users.rb index 0209594dadc..b0f7d69f091 100644 --- a/spec/frontend/fixtures/admin_users.rb +++ b/spec/frontend/fixtures/admin_users.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'spec_helper' describe Admin::UsersController, '(JavaScript fixtures)', type: :controller do diff --git a/spec/frontend/fixtures/application_settings.rb b/spec/frontend/fixtures/application_settings.rb index afe5949ed3b..a16888d8f03 100644 --- a/spec/frontend/fixtures/application_settings.rb +++ b/spec/frontend/fixtures/application_settings.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'spec_helper' describe Admin::ApplicationSettingsController, '(JavaScript fixtures)', type: :controller do diff --git a/spec/frontend/fixtures/blob.rb b/spec/frontend/fixtures/blob.rb index ce5030efbf8..28a3badaa17 100644 --- a/spec/frontend/fixtures/blob.rb +++ b/spec/frontend/fixtures/blob.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'spec_helper' describe Projects::BlobController, '(JavaScript fixtures)', type: :controller do diff --git a/spec/frontend/fixtures/boards.rb b/spec/frontend/fixtures/boards.rb index f257d80390f..b3c7865a088 100644 --- a/spec/frontend/fixtures/boards.rb +++ b/spec/frontend/fixtures/boards.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'spec_helper' describe Projects::BoardsController, '(JavaScript fixtures)', type: :controller do diff --git a/spec/frontend/fixtures/branches.rb b/spec/frontend/fixtures/branches.rb index 197fe42c52a..2dc8cde625a 100644 --- a/spec/frontend/fixtures/branches.rb +++ b/spec/frontend/fixtures/branches.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'spec_helper' describe Projects::BranchesController, '(JavaScript fixtures)', type: :controller do diff --git a/spec/frontend/fixtures/clusters.rb b/spec/frontend/fixtures/clusters.rb index f15ef010807..fd64d3c0e28 100644 --- a/spec/frontend/fixtures/clusters.rb +++ b/spec/frontend/fixtures/clusters.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'spec_helper' describe Projects::ClustersController, '(JavaScript fixtures)', type: :controller do diff --git a/spec/frontend/fixtures/commit.rb b/spec/frontend/fixtures/commit.rb index a328c455356..2c4bf6fbd3d 100644 --- a/spec/frontend/fixtures/commit.rb +++ b/spec/frontend/fixtures/commit.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'spec_helper' describe Projects::CommitController, '(JavaScript fixtures)', type: :controller do diff --git a/spec/frontend/fixtures/deploy_keys.rb b/spec/frontend/fixtures/deploy_keys.rb index fca233c6f59..f491c424bcf 100644 --- a/spec/frontend/fixtures/deploy_keys.rb +++ b/spec/frontend/fixtures/deploy_keys.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'spec_helper' describe Projects::DeployKeysController, '(JavaScript fixtures)', type: :controller do diff --git a/spec/frontend/fixtures/groups.rb b/spec/frontend/fixtures/groups.rb index c1bb2d43332..237fc711594 100644 --- a/spec/frontend/fixtures/groups.rb +++ b/spec/frontend/fixtures/groups.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'spec_helper' describe 'Groups (JavaScript fixtures)', type: :controller do diff --git a/spec/frontend/fixtures/issues.rb b/spec/frontend/fixtures/issues.rb index b5eb38e0023..7e524990863 100644 --- a/spec/frontend/fixtures/issues.rb +++ b/spec/frontend/fixtures/issues.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'spec_helper' describe Projects::IssuesController, '(JavaScript fixtures)', type: :controller do diff --git a/spec/frontend/fixtures/jobs.rb b/spec/frontend/fixtures/jobs.rb index a3a7759c85b..787ab517f75 100644 --- a/spec/frontend/fixtures/jobs.rb +++ b/spec/frontend/fixtures/jobs.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'spec_helper' describe Projects::JobsController, '(JavaScript fixtures)', type: :controller do diff --git a/spec/frontend/fixtures/labels.rb b/spec/frontend/fixtures/labels.rb index a312287970f..e4d66dbcd0a 100644 --- a/spec/frontend/fixtures/labels.rb +++ b/spec/frontend/fixtures/labels.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'spec_helper' describe 'Labels (JavaScript fixtures)' do diff --git a/spec/frontend/fixtures/merge_requests.rb b/spec/frontend/fixtures/merge_requests.rb index 88706e96676..8fbdb534b3d 100644 --- a/spec/frontend/fixtures/merge_requests.rb +++ b/spec/frontend/fixtures/merge_requests.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'spec_helper' describe Projects::MergeRequestsController, '(JavaScript fixtures)', type: :controller do diff --git a/spec/frontend/fixtures/merge_requests_diffs.rb b/spec/frontend/fixtures/merge_requests_diffs.rb index b633a0495a6..9493cba03bb 100644 --- a/spec/frontend/fixtures/merge_requests_diffs.rb +++ b/spec/frontend/fixtures/merge_requests_diffs.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'spec_helper' describe Projects::MergeRequests::DiffsController, '(JavaScript fixtures)', type: :controller do diff --git a/spec/frontend/fixtures/pipeline_schedules.rb b/spec/frontend/fixtures/pipeline_schedules.rb index a70091a3919..e00a35d5362 100644 --- a/spec/frontend/fixtures/pipeline_schedules.rb +++ b/spec/frontend/fixtures/pipeline_schedules.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'spec_helper' describe Projects::PipelineSchedulesController, '(JavaScript fixtures)', type: :controller do diff --git a/spec/frontend/fixtures/pipelines.rb b/spec/frontend/fixtures/pipelines.rb index ed57eb0aa80..83fc13af7d3 100644 --- a/spec/frontend/fixtures/pipelines.rb +++ b/spec/frontend/fixtures/pipelines.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'spec_helper' describe Projects::PipelinesController, '(JavaScript fixtures)', type: :controller do diff --git a/spec/frontend/fixtures/projects.rb b/spec/frontend/fixtures/projects.rb index 91e3b65215a..af5b70fbbeb 100644 --- a/spec/frontend/fixtures/projects.rb +++ b/spec/frontend/fixtures/projects.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'spec_helper' describe 'Projects (JavaScript fixtures)', type: :controller do diff --git a/spec/frontend/fixtures/prometheus_service.rb b/spec/frontend/fixtures/prometheus_service.rb index 93ee81120d7..c404b8260d2 100644 --- a/spec/frontend/fixtures/prometheus_service.rb +++ b/spec/frontend/fixtures/prometheus_service.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'spec_helper' describe Projects::ServicesController, '(JavaScript fixtures)', type: :controller do diff --git a/spec/frontend/fixtures/raw.rb b/spec/frontend/fixtures/raw.rb index 801c80a0112..9c9fa4ec40b 100644 --- a/spec/frontend/fixtures/raw.rb +++ b/spec/frontend/fixtures/raw.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'spec_helper' describe 'Raw files', '(JavaScript fixtures)' do diff --git a/spec/frontend/fixtures/search.rb b/spec/frontend/fixtures/search.rb index c26c6998ae9..025cc53c745 100644 --- a/spec/frontend/fixtures/search.rb +++ b/spec/frontend/fixtures/search.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'spec_helper' describe SearchController, '(JavaScript fixtures)', type: :controller do diff --git a/spec/frontend/fixtures/services.rb b/spec/frontend/fixtures/services.rb index ee1e088f158..1b81a83ca49 100644 --- a/spec/frontend/fixtures/services.rb +++ b/spec/frontend/fixtures/services.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'spec_helper' describe Projects::ServicesController, '(JavaScript fixtures)', type: :controller do diff --git a/spec/frontend/fixtures/sessions.rb b/spec/frontend/fixtures/sessions.rb index 18574ea06b5..a4dc0aef79c 100644 --- a/spec/frontend/fixtures/sessions.rb +++ b/spec/frontend/fixtures/sessions.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'spec_helper' describe 'Sessions (JavaScript fixtures)' do diff --git a/spec/frontend/fixtures/snippet.rb b/spec/frontend/fixtures/snippet.rb index 23bcdb47ac6..34a6fade9c9 100644 --- a/spec/frontend/fixtures/snippet.rb +++ b/spec/frontend/fixtures/snippet.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'spec_helper' describe SnippetsController, '(JavaScript fixtures)', type: :controller do diff --git a/spec/frontend/fixtures/todos.rb b/spec/frontend/fixtures/todos.rb index a7c183d2414..e5bdb4998ed 100644 --- a/spec/frontend/fixtures/todos.rb +++ b/spec/frontend/fixtures/todos.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'spec_helper' describe 'Todos (JavaScript fixtures)' do diff --git a/spec/frontend/fixtures/u2f.rb b/spec/frontend/fixtures/u2f.rb index 8ecbc0390cd..dded6ce6380 100644 --- a/spec/frontend/fixtures/u2f.rb +++ b/spec/frontend/fixtures/u2f.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'spec_helper' context 'U2F' do -- GitLab