Commit 4ab54c22 authored by 🤖 GitLab Bot 🤖's avatar 🤖 GitLab Bot 🤖

Add latest changes from gitlab-org/gitlab@master

parent bd860c22
image: "dev.gitlab.org:5005/gitlab/gitlab-build-images:ruby-2.6.3-golang-1.11-git-2.22-chrome-73.0-node-12.x-yarn-1.16-postgresql-9.6-graphicsmagick-1.3.33"
stages:
- build
- prepare
- quick-test
- test
......
......@@ -11,5 +11,6 @@ cloud-native-image:
- CNG_PROJECT_PATH="gitlab-org/build/CNG" BUILD_TRIGGER_TOKEN=$CI_JOB_TOKEN ./scripts/trigger-build cng
only:
refs:
- tags@gitlab-org/gitlab-foss
- tags@gitlab-org/gitlab
- tags
variables:
- $CI_SERVER_HOST == "gitlab.com" && $CI_PROJECT_NAMESPACE == "gitlab-org"
......@@ -2,6 +2,12 @@
extends:
- .default-tags
- .default-retry
- .only-docs-changes
only:
refs:
- merge_requests
variables:
- $CI_SERVER_HOST == "gitlab.com" && $CI_PROJECT_NAMESPACE == "gitlab-org"
image: ruby:2.6-alpine
stage: review
dependencies: []
......@@ -19,55 +25,32 @@
- apk add --update openssl
- wget $CI_PROJECT_URL/raw/$CI_COMMIT_SHA/scripts/trigger-build-docs
- chmod 755 trigger-build-docs
# Trigger a manual docs build in gitlab-docs only on non docs-only branches.
# Useful to preview the docs changes live.
review-docs-deploy-manual:
extends:
- .review-docs
- .except-docs-qa
script:
- gem install gitlab --no-document
- ./trigger-build-docs deploy
when: manual
only:
- branches@gitlab-org/gitlab-foss
- branches@gitlab-org/gitlab
# Always trigger a docs build in gitlab-docs only on docs-only branches.
# Useful to preview the docs changes live.
review-docs-deploy:
extends:
- .review-docs
- .except-qa
extends: .review-docs
script:
- gem install gitlab --no-document
- ./trigger-build-docs deploy
only:
- /(^docs[\/-].+|.+-docs$)/@gitlab-org/gitlab-foss
- /(^docs[\/-].+|.+-docs$)/@gitlab-org/gitlab
when: manual
# Cleanup remote environment of gitlab-docs
review-docs-cleanup:
extends:
- .review-docs
- .except-qa
extends: .review-docs
environment:
name: review-docs/$CI_COMMIT_REF_SLUG
action: stop
script:
- gem install gitlab --no-document
- ./trigger-build-docs cleanup
when: manual
only:
- branches@gitlab-org/gitlab-foss
- branches@gitlab-org/gitlab
docs lint:
extends:
- .default-tags
- .default-retry
- .except-qa
- .default-only
- .only-docs-changes
image: "registry.gitlab.com/gitlab-org/gitlab-build-images:gitlab-docs-lint"
stage: test
dependencies: []
......
......@@ -9,9 +9,10 @@
extends:
- .default-tags
- .default-retry
- .assets-compile-cache
- .default-only
- .default-before_script
- .except-docs
- .assets-compile-cache
- .only-code-qa-changes
image: dev.gitlab.org:5005/gitlab/gitlab-build-images:ruby-2.6.3-git-2.22-chrome-73.0-node-12.x-yarn-1.16-graphicsmagick-1.3.33-docker-18.06.1
stage: test
dependencies: ["setup-test-env"]
......@@ -45,10 +46,9 @@
- scripts/clean-old-cached-assets
- rm -f /etc/apt/sources.list.d/google*.list # We don't need to update Chrome here
only:
- /.+/@gitlab-org/gitlab-foss
- /.+/@gitlab-org/gitlab
- /.+/@gitlab/gitlabhq
- /.+/@gitlab/gitlab-ee
variables:
- $CI_SERVER_HOST == "gitlab.com" && $CI_PROJECT_NAMESPACE == "gitlab-org"
- $CI_SERVER_HOST == "dev.gitlab.org"
tags:
- gitlab-org
- docker
......@@ -57,8 +57,7 @@ gitlab:assets:compile:
extends: .gitlab:assets:compile-metadata
only:
refs:
- master@gitlab-org/gitlab-foss
- master@gitlab-org/gitlab
- master
cache:
policy: pull-push
......@@ -66,9 +65,7 @@ gitlab:assets:compile pull-cache:
extends: .gitlab:assets:compile-metadata
except:
refs:
- master@gitlab-org/gitlab-foss
- master@gitlab-org/gitlab
- /(^docs[\/-].+|.+-docs$)/
- master
cache:
policy: pull
......@@ -76,8 +73,10 @@ gitlab:assets:compile pull-cache:
extends:
- .default-tags
- .default-retry
- .assets-compile-cache
- .default-only
- .default-before_script
- .assets-compile-cache
- .only-code-qa-changes
- .use-pg
stage: prepare
script:
......@@ -98,12 +97,10 @@ gitlab:assets:compile pull-cache:
- public/assets
compile-assets:
extends:
- .compile-assets-metadata
extends: .compile-assets-metadata
only:
refs:
- master@gitlab-org/gitlab-foss
- master@gitlab-org/gitlab
- master
cache:
policy: pull-push
......@@ -111,21 +108,23 @@ compile-assets pull-cache:
extends: .compile-assets-metadata
except:
refs:
- master@gitlab-org/gitlab-foss
- master@gitlab-org/gitlab
- /(^docs[\/-].+|.+-docs$)/
- master
cache:
policy: pull
karma:
.only-code-frontend-job-base:
extends:
- .default-tags
- .default-retry
- .default-cache
- .default-only
- .default-before_script
- .only-code-changes
- .use-pg
- .except-docs
dependencies: ["compile-assets", "compile-assets pull-cache", "setup-test-env"]
karma:
extends: .only-code-frontend-job-base
variables:
# we override the max_old_space_size to prevent OOM errors
NODE_OPTIONS: --max_old_space_size=3584
......@@ -148,14 +147,7 @@ karma:
junit: junit_karma.xml
jest:
extends:
- .default-tags
- .default-retry
- .default-cache
- .default-before_script
- .use-pg
- .except-docs-qa
dependencies: ["compile-assets", "compile-assets pull-cache", "setup-test-env"]
extends: .only-code-frontend-job-base
script:
- scripts/gitaly-test-spawn
- date
......@@ -178,27 +170,26 @@ jest:
- tmp/jest/jest/
policy: pull-push
.qa:
.qa-job-base:
extends:
- .default-tags
- .default-retry
- .default-cache
- .except-docs
- .default-only
- .only-code-qa-changes
dependencies: []
stage: test
variables:
SETUP_DB: "false"
before_script:
- cd qa/
- bundle install
qa:internal:
extends: .qa
extends: .qa-job-base
script:
- bundle exec rspec
qa:selectors:
extends: .qa
extends: .qa-job-base
script:
- bundle exec bin/qa Test::Sanity::Selectors
......@@ -207,7 +198,8 @@ qa:selectors:
- .default-tags
- .default-retry
- .default-cache
- .except-docs
- .default-only
- .only-code-changes
dependencies: []
cache:
key: "$CI_JOB_NAME"
......@@ -238,10 +230,9 @@ webpack-dev-server:
- .default-tags
- .default-retry
- .default-cache
- .except-docs-qa
dependencies: ["compile-assets", "compile-assets pull-cache", "setup-test-env"]
- .only-code-changes
dependencies: ["setup-test-env", "compile-assets", "compile-assets pull-cache"]
variables:
SETUP_DB: "false"
WEBPACK_MEMORY_TEST: "true"
script:
- node --version
......
......@@ -27,40 +27,83 @@
- vendor/gitaly-ruby
policy: pull
.except-docs:
except:
.default-only:
only:
refs:
- /(^docs[\/-].+|.+-docs$)/
- master
- /^[\d-]+-stable(-ee)?$/
- /^\d+-\d+-auto-deploy-\d+$/
- merge_requests
- tags
.except-qa:
except:
refs:
- /(^qa[\/-].*|.*-qa$)/
.only-code-changes:
only:
changes:
- ".gitlab/ci/**/*"
- ".{eslintignore,gitattributes,nvmrc,prettierrc,stylelintrc,yamllint}"
- ".{codeclimate,eslintrc,gitlab-ci,haml-lint,haml-lint_todo,rubocop,rubocop_todo,scss-lint}.yml"
- ".csscomb.json"
- "Dangerfile"
- "Dockerfile.assets"
- "*_VERSION"
- "Gemfile{,.lock}"
- "Rakefile"
- "{babel.config,jest.config}.js"
- "config.ru"
- "{package.json,yarn.lock}"
- "{app,bin,config,danger,db,ee,fixtures,haml_lint,lib,public,rubocop,scripts,spec,symbol,vendor}/**/*"
- "doc/README.md" # Some RSpec test rely on this file
.except-docs-qa:
except:
refs:
- /(^docs[\/-].+|.+-docs$)/
- /(^qa[\/-].*|.*-qa$)/
.only-qa-changes:
only:
changes:
- ".dockerignore"
- "qa/**/*"
.except-docs-qa-geo:
except:
refs:
- /(^docs[\/-].+|.+-docs$)/
- /(^qa[\/-].*|.*-qa$)/
- /(^geo[\/-].*|.*-geo$)/
.only-docs-changes:
only:
changes:
- ".gitlab/route-map.yml"
- "doc/**/*"
- ".markdownlint.json"
.review-only:
.only-code-qa-changes:
only:
refs:
- branches@gitlab-org/gitlab-foss
- branches@gitlab-org/gitlab
changes:
- ".gitlab/ci/**/*"
- ".{eslintignore,gitattributes,nvmrc,prettierrc,stylelintrc,yamllint}"
- ".{codeclimate,eslintrc,gitlab-ci,haml-lint,haml-lint_todo,rubocop,rubocop_todo,scss-lint}.yml"
- ".csscomb.json"
- "Dangerfile"
- "Dockerfile.assets"
- "*_VERSION"
- "Gemfile{,.lock}"
- "Rakefile"
- "{babel.config,jest.config}.js"
- "config.ru"
- "{package.json,yarn.lock}"
- "{app,bin,config,danger,db,ee,fixtures,haml_lint,lib,public,rubocop,scripts,spec,symbol,vendor}/**/*"
- "doc/README.md" # Some RSpec test rely on this file
- ".dockerignore"
- "qa/**/*"
.only-review:
only:
variables:
- $CI_SERVER_HOST == "gitlab.com" && $CI_PROJECT_NAMESPACE == "gitlab-org"
kubernetes: active
except:
refs:
- master
- /^\d+-\d+-auto-deploy-\d+$/
- /(^docs[\/-].+|.+-docs$)/
.only-review-schedules:
only:
refs:
- schedules
variables:
- $REVIEW_APP_CLEANUP && $CI_SERVER_HOST == "gitlab.com" && $CI_PROJECT_NAMESPACE == "gitlab-org"
kubernetes: active
.use-pg:
services:
......@@ -74,3 +117,9 @@
- name: postgres:10.9
command: ["postgres", "-c", "fsync=off", "-c", "synchronous_commit=off", "-c", "full_page_writes=off"]
- name: redis:alpine
.only-ee:
only:
variables:
- $CI_PROJECT_NAME == "gitlab-ee"
- $CI_PROJECT_NAME == "gitlab" # New name of gitlab-ee after the single codebase migration
memory-static:
.only-code-memory-job-base:
extends:
- .default-tags
- .default-retry
- .default-cache
- .default-only
- .default-before_script
- .except-docs
- .only-code-changes
memory-static:
extends: .only-code-memory-job-base
variables:
SETUP_DB: "false"
script:
......@@ -31,12 +35,8 @@ memory-static:
# All tests are run without a webserver (directly using Rack::Mock by default).
memory-on-boot:
extends:
- .default-tags
- .default-retry
- .default-cache
- .default-before_script
- .only-code-memory-job-base
- .use-pg-10
- .except-docs-qa
variables:
NODE_ENV: "production"
RAILS_ENV: "production"
......
......@@ -3,11 +3,12 @@ pages:
- .default-tags
- .default-retry
- .default-cache
- .except-docs
- .default-only
only:
refs:
- master@gitlab-org/gitlab-foss
- master@gitlab-org/gitlab
- master
variables:
- $CI_SERVER_HOST == "gitlab.com" && $CI_PROJECT_NAMESPACE == "gitlab-org"
stage: pages
dependencies: ["coverage", "karma", "gitlab:assets:compile"]
script:
......
.package-and-qa-base:
extends: .default-only
image: ruby:2.6-alpine
stage: qa
dependencies: []
......@@ -10,17 +11,16 @@
- install_gitlab_gem
- ./scripts/trigger-build omnibus
only:
refs:
- branches@gitlab-org/gitlab-foss
- branches@gitlab-org/gitlab
variables:
- $CI_SERVER_HOST == "gitlab.com" && $CI_PROJECT_NAMESPACE == "gitlab-org"
package-and-qa-manual:
extends: .package-and-qa-base
extends:
- .package-and-qa-base
- .only-code-changes
except:
refs:
- master
- /(^docs[\/-].+|.+-docs$)/
- /(^qa[\/-].*|.*-qa$)/
when: manual
needs: ["build-qa-image", "gitlab:assets:compile pull-cache"]
......@@ -34,10 +34,11 @@ package-and-qa-manual:master:
needs: ["build-qa-image", "gitlab:assets:compile"]
package-and-qa:
extends: .package-and-qa-base
only:
extends:
- .package-and-qa-base
- .only-qa-changes
except:
refs:
- /(^qa[\/-].*|.*-qa$)/@gitlab-org/gitlab-foss
- /(^qa[\/-].*|.*-qa$)/@gitlab-org/gitlab
- master
needs: ["build-qa-image", "gitlab:assets:compile pull-cache"]
allow_failure: true
.only-schedules-master:
.only-master:
only:
refs:
- schedules@gitlab-org/gitlab-foss
- schedules@gitlab-org/gitlab
- master@gitlab-org/gitlab-foss
- master@gitlab-org/gitlab
- master@gitlab/gitlabhq
- master@gitlab/gitlab-ee
.only-gitlab-ee:
only:
- branches@gitlab-org/gitlab
- tags@gitlab-org/gitlab
- master
.rake-exec:
extends:
- .default-tags
- .default-retry
- .default-cache
- .default-only
- .default-before_script
variables:
SETUP_DB: "false"
script:
- bundle exec rake $CI_JOB_NAME
.rspec-base:
.only-code-rails-job-base:
extends:
- .default-tags
- .default-retry
- .default-cache
- .default-only
- .default-before_script
- .only-code-changes
.only-code-qa-rails-job-base:
extends:
- .default-tags
- .default-retry
- .default-cache
- .default-only
- .default-before_script
- .except-docs-qa
- .only-code-qa-changes
.rspec-base:
extends: .only-code-rails-job-base
stage: test
script:
- JOB_NAME=( $CI_JOB_NAME )
......@@ -79,12 +83,8 @@
setup-test-env:
extends:
- .default-tags
- .default-retry
- .default-cache
- .default-before_script
- .only-code-qa-rails-job-base
- .use-pg
- .except-docs
stage: prepare
script:
- bundle exec ruby -Ispec -e 'require "spec_helper" ; TestEnv.init'
......@@ -111,19 +111,19 @@ rspec system pg:
rspec unit pg-10:
extends:
- .rspec-base-pg-10
- .only-schedules-master
- .only-master
parallel: 20
rspec integration pg-10:
extends:
- .rspec-base-pg-10
- .only-schedules-master
- .only-master
parallel: 6
rspec system pg-10:
extends:
- .rspec-base-pg-10
- .only-schedules-master
- .only-master
parallel: 24
rspec-fast-spec-helper:
......@@ -133,9 +133,8 @@ rspec-fast-spec-helper:
rspec quarantine pg:
extends:
- .default-before_script
- .rspec-base-pg
- .only-schedules-master
- .only-master
script:
- export NO_KNAPSACK=1 CACHE_CLASSES=true
- scripts/gitaly-test-spawn
......@@ -143,12 +142,7 @@ rspec quarantine pg:
allow_failure: true
static-analysis:
extends:
- .default-tags
- .default-retry
- .default-cache
- .default-before_script
- .except-docs
extends: .only-code-qa-rails-job-base
dependencies: ["setup-test-env", "compile-assets", "compile-assets pull-cache"]
variables:
SETUP_DB: "false"
......@@ -162,81 +156,48 @@ static-analysis:
policy: pull-push
downtime_check:
extends: .rake-exec
extends:
- .rake-exec
- .only-code-changes
except:
refs:
- master
- tags
- /^[\d-]+-stable(-ee)?$/
- /(^docs[\/-].+|.+-docs$)/
- /(^qa[\/-].*|.*-qa$)/
variables:
- $CI_COMMIT_REF_NAME =~ /^[\d-]+-stable(-ee)?$/
stage: test
dependencies: ["setup-test-env"]
needs: ["setup-test-env"]
ee_compat_check:
extends: .rake-exec
dependencies: []
except:
refs:
- master
- tags
- branches@gitlab-org/gitlab
- branches@gitlab/gitlab-ee
- /^[\d-]+-stable(-ee)?$/
- /(^docs[\/-].+|.+-docs$)/
- /^security-/
artifacts:
name: "${CI_JOB_NAME}_${CI_COMIT_REF_NAME}_${CI_COMMIT_SHA}"
when: always
expire_in: 10d
paths:
- ee_compat_check/patches/*.patch
# DB migration, rollback, and seed jobs
db:migrate:reset:
.db-job-base:
extends:
- .default-tags
- .default-retry
- .default-cache
- .default-before_script
- .only-code-rails-job-base
- .use-pg
- .except-docs-qa
stage: test
dependencies: ["setup-test-env"]
needs: ["setup-test-env"]
# DB migration, rollback, and seed jobs
db:migrate:reset:
extends: .db-job-base
script:
- bundle exec rake db:migrate:reset
db:check-schema:
extends:
- .default-tags
- .default-retry
- .default-cache
- .default-before_script
- .use-pg
- .except-docs-qa
stage: test
dependencies: ["setup-test-env"]
needs: ["setup-test-env"]
extends: .db-job-base
script:
- source scripts/schema_changed.sh
db:migrate-from-v11.11.0:
extends:
- .default-tags
- .default-retry
- .default-cache
- .default-before_script
- .use-pg
- .except-docs-qa
stage: test
dependencies: ["setup-test-env"]
needs: ["setup-test-env"]
extends: .db-job-base
variables:
SETUP_DB: "false"
script:
- git fetch https://gitlab.com/gitlab-org/gitlab.git v11.11.0-ee
- export PROJECT_TO_CHECKOUT="gitlab-foss"
- export TAG_TO_CHECKOUT="v11.11.0"
- '[[ ! -d "ee/" ]] || export PROJECT_TO_CHECKOUT="gitlab"'
- '[[ ! -d "ee/" ]] || export TAG_TO_CHECKOUT="v11.11.0-ee"'
- git fetch https://gitlab.com/gitlab-org/$PROJECT_TO_CHECKOUT.git $TAG_TO_CHECKOUT
- git checkout -f FETCH_HEAD
- sed -i "s/gem 'oj', '~> 2.17.4'//" Gemfile
- sed -i "s/gem 'bootsnap', '~> 1.0.0'/gem 'bootsnap'/" Gemfile
......@@ -254,31 +215,13 @@ db:migrate-from-v11.11.0:
- bundle exec rake db:migrate
db:rollback:
extends:
- .default-tags
- .default-retry
- .default-cache
- .default-before_script
- .use-pg
- .except-docs-qa
stage: test
dependencies: ["setup-test-env"]
needs: ["setup-test-env"]
extends: .db-job-base
script:
- bundle exec rake db:migrate VERSION=20180101160629
- bundle exec rake db:migrate SKIP_SCHEMA_VERSION_CHECK=true
gitlab:setup:
extends:
- .default-tags
- .default-retry
- .default-cache
- .default-before_script
- .use-pg
- .except-docs-qa
stage: test
dependencies: ["setup-test-env"]
needs: ["setup-test-env"]
extends: .db-job-base
variables:
SETUP_DB: "false"
script:
......@@ -295,14 +238,7 @@ gitlab:setup:
- log/development.log
coverage:
# Don't include dedicated-no-docs-no-db-pull-cache-job here since we need to
# download artifacts from all the rspec jobs instead of from setup-test-env only
extends:
- .default-tags
- .default-retry
- .default-cache
- .default-before_script
- .except-docs-qa
extends: .only-code-rails-job-base
cache:
policy: pull
variables: