Commit b53816c4 authored by GitLab Bot's avatar GitLab Bot
Browse files

Add latest changes from gitlab-org/gitlab@13-0-stable-ee

parent 7e939fce5f42
......@@ -9,6 +9,6 @@
/scripts/
/tmp/
/vendor/
jest.config.js
jest.config.*.js
karma.config.js
webpack.config.js
......@@ -22,17 +22,16 @@ rules:
- allow:
- __
- _links
# Disabled for now, to make the airbnb-base 12.1.0 -> 13.1.0 update smoother
no-else-return:
- error
- allowElseIf: true
import/no-unresolved:
- error
- ignore:
# https://gitlab.com/gitlab-org/gitlab/issues/38226
- '^ee_component/'
import/no-useless-path-segments: off
import/order: off
# Disabled for now, to make the airbnb-base 12.1.0 -> 13.1.0 update smoother
no-else-return:
- error
- allowElseIf: true
lines-between-class-members: off
# Disabled for now, to make the plugin-vue 4.5 -> 5.0 update smoother
vue/no-confusing-v-for-v-if: error
......@@ -45,8 +44,6 @@ rules:
no-jquery/no-serialize: error
promise/always-return: off
promise/no-callback-in-promise: off
# Make update to eslint@6 smoother:
prefer-object-spread: off
overrides:
- files:
- '**/spec/**/*'
......
image: "registry.gitlab.com/gitlab-org/gitlab-build-images:ruby-2.6.5-golang-1.14-git-2.26-lfs-2.9-chrome-73.0-node-12.x-yarn-1.21-postgresql-10-graphicsmagick-1.3.34"
stages:
- sync
- prepare
- build-images
- fixtures
- test
- post-test
......@@ -16,6 +15,7 @@ stages:
# in cases where jobs require Docker-in-Docker, the job
# definition must be extended with `.use-docker-in-docker`
default:
image: "registry.gitlab.com/gitlab-org/gitlab-build-images:ruby-2.6.6-golang-1.14-git-2.26-lfs-2.9-chrome-73.0-node-12.x-yarn-1.21-postgresql-9.6-graphicsmagick-1.3.34"
tags:
- gitlab-org
# All jobs are interruptible by default
......@@ -25,10 +25,17 @@ workflow:
rules:
# If `$FORCE_GITLAB_CI` is set, create a pipeline.
- if: '$FORCE_GITLAB_CI'
# As part of the process of creating RCs automatically, we update stable
# branches with the changes of the most recent production deployment. The
# merge requests used for this merge a branch release-tools/X into a stable
# branch. For these merge requests we don't want to run any pipelines, as
# they serve no purpose and will run anyway when the changes are merged.
- if: '$CI_MERGE_REQUEST_SOURCE_BRANCH_NAME =~ /^release-tools\/\d+\.\d+\.\d+-rc\d+$/ && $CI_MERGE_REQUEST_TARGET_BRANCH_NAME =~ /^[\d-]+-stable(-ee)?$/ && $CI_PROJECT_PATH == "gitlab-org/gitlab"'
when: never
# For merge requests, create a pipeline.
- if: '$CI_MERGE_REQUEST_IID'
# For `master` branch, create a pipeline (this includes on schedules, pushes, merges, etc.).
- if: '$CI_COMMIT_BRANCH == "master"'
- if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
# For tags, create a pipeline.
- if: '$CI_COMMIT_TAG'
# If `$GITLAB_INTERNAL` isn't set, don't create a pipeline.
......
......@@ -7,8 +7,12 @@
*.rake @gitlab-org/maintainers/rails-backend
# Technical writing team are the default reviewers for all markdown docs
*.md @gl-docsteam
/doc/ @gl-docsteam
# Dev and Doc guidelines
/doc/development/ @marcia @mjang1
/doc/development/documentation/ @mikelewis
/doc/ci @marcel.amirault @sselhorn
/doc/.linting @marcel.amirault @eread @aqualls @mikelewis
# Frontend maintainers should see everything in `app/assets/`
*.scss @annabeldunstone @gitlab-org/maintainers/frontend
......@@ -33,7 +37,7 @@
/ee/app/finders/ @gitlab-org/maintainers/database
# Feature specific owners
/ee/lib/gitlab/code_owners/ @reprazent
/ee/lib/gitlab/code_owners/ @reprazent @kerrizor
/ee/lib/ee/gitlab/auth/ldap/ @dblessing @mkozono
/lib/gitlab/auth/ldap/ @dblessing @mkozono
/lib/gitlab/ci/templates/ @nolith @zj
......
......@@ -21,7 +21,6 @@ cache-repo:
extends: .cache-repo:rules
image: gcr.io/google.com/cloudsdktool/cloud-sdk:alpine
stage: sync
allow_failure: true
variables:
GIT_STRATEGY: none
TAR_FILENAME: /tmp/gitlab-master.tar
......
......@@ -3,7 +3,6 @@ cloud-native-image:
image: ruby:2.6-alpine
dependencies: []
stage: post-test
allow_failure: true
variables:
GIT_DEPTH: "1"
script:
......
.run-dev-fixtures:
extends:
- .default-retry
- .default-cache
- .rails-cache
- .default-before_script
- .use-pg11
stage: test
needs: ["setup-test-env pg11"]
needs: ["setup-test-env"]
variables:
FIXTURE_PATH: "db/fixtures/development"
SEED_CYCLE_ANALYTICS: "true"
......@@ -19,8 +19,9 @@ run-dev-fixtures:
- .run-dev-fixtures
- .dev-fixtures:rules:ee-and-foss
script:
- scripts/gitaly-test-spawn
- RAILS_ENV=test bundle exec rake db:seed_fu
- run_timed_command "scripts/gitaly-test-build"
- run_timed_command "scripts/gitaly-test-spawn"
- run_timed_command "RAILS_ENV=test bundle exec rake db:seed_fu"
run-dev-fixtures-ee:
extends:
......@@ -28,6 +29,7 @@ run-dev-fixtures-ee:
- .dev-fixtures:rules:ee-only
- .use-pg11-ee
script:
- scripts/gitaly-test-spawn
- run_timed_command "scripts/gitaly-test-build"
- run_timed_command "scripts/gitaly-test-spawn"
- cp ee/db/fixtures/development/* $FIXTURE_PATH
- RAILS_ENV=test bundle exec rake db:seed_fu
- run_timed_command "RAILS_ENV=test bundle exec rake db:seed_fu"
......@@ -2,7 +2,6 @@
extends:
- .default-retry
- .docs:rules:review-docs
allow_failure: true
image: ruby:2.6-alpine
stage: review
dependencies: []
......@@ -68,7 +67,7 @@ graphql-reference-verify:
- .docs:rules:graphql-reference-verify
- .use-pg11
stage: test
needs: ["setup-test-env pg11"]
needs: ["setup-test-env"]
script:
- bundle exec rake gitlab:graphql:check_docs
- bundle exec rake gitlab:graphql:check_schema
......@@ -15,8 +15,7 @@
- .default-retry
- .default-before_script
- .assets-compile-cache
- .use-docker-in-docker
image: registry.gitlab.com/gitlab-org/gitlab-build-images:ruby-2.6.5-git-2.26-lfs-2.9-chrome-73.0-node-12.x-yarn-1.21-graphicsmagick-1.3.34-docker-19.03.1
image: registry.gitlab.com/gitlab-org/gitlab-build-images:ruby-2.6.6-git-2.26-lfs-2.9-chrome-73.0-node-12.x-yarn-1.21-graphicsmagick-1.3.34-docker-19.03.1
stage: prepare
variables:
NODE_ENV: "production"
......@@ -34,20 +33,16 @@
paths:
- webpack-report/
- assets-compile.log
# We consume these files in GitLab UI for integration tests:
# https://gitlab.com/gitlab-org/gitlab-ui/-/blob/e88493b3c855aea30bf60baee692a64606b0eb1e/.storybook/preview-head.pug#L1
- public/assets/application-*.css
- public/assets/application-*.css.gz
# These assets are used in multiple locations:
# - in `build-assets-image` job to create assets image for packaging systems
# - GitLab UI for integration tests: https://gitlab.com/gitlab-org/gitlab-ui/-/blob/e88493b3c855aea30bf60baee692a64606b0eb1e/.storybook/preview-head.pug#L1
- public/assets
when: always
script:
- node --version
- retry yarn install --frozen-lockfile --production --cache-folder .yarn-cache --prefer-offline
- free -m
- time bin/rake gitlab:assets:compile > assets-compile.log 2>&1
# TODO: Change the image tag to be the MD5 of assets files and skip image building if the image exists
# We'll also need to pass GITLAB_ASSETS_TAG to the trigerred omnibus-gitlab pipeline similarly to how we do it for trigerred CNG pipelines
# https://gitlab.com/gitlab-org/gitlab/issues/208389
- time scripts/build_assets_image
- scripts/clean-old-cached-assets
- rm -f /etc/apt/sources.list.d/google*.list # We don't need to update Chrome here
......@@ -65,6 +60,20 @@ gitlab:assets:compile pull-cache:
cache:
policy: pull
build-assets-image:
extends:
- .use-kaniko
- .frontend:rules:gitlab-assets-compile-pull-cache
stage: build-images
needs: ["gitlab:assets:compile pull-cache"]
variables:
GIT_DEPTH: "1"
script:
# TODO: Change the image tag to be the MD5 of assets files and skip image building if the image exists
# We'll also need to pass GITLAB_ASSETS_TAG to the trigerred omnibus-gitlab pipeline similarly to how we do it for trigerred CNG pipelines
# https://gitlab.com/gitlab-org/gitlab/issues/208389
- scripts/build_assets_image
.compile-assets-metadata:
extends:
- .default-retry
......@@ -127,16 +136,15 @@ compile-assets pull-cache as-if-foss:
.frontend-fixtures-base:
extends:
- .default-retry
- .default-cache
- .rails-cache
- .default-before_script
- .use-pg11
stage: fixtures
needs: ["setup-test-env pg11", "compile-assets pull-cache"]
needs: ["setup-test-env", "compile-assets pull-cache"]
script:
- date
- scripts/gitaly-test-spawn
- date
- bundle exec rake frontend:fixtures
- run_timed_command "scripts/gitaly-test-build"
- run_timed_command "scripts/gitaly-test-spawn"
- run_timed_command "bundle exec rake frontend:fixtures"
artifacts:
name: frontend-fixtures
expire_in: 31d
......@@ -154,7 +162,7 @@ frontend-fixtures:
frontend-fixtures-as-if-foss:
extends:
- .frontend-fixtures-base
- .frontend:rules:default-frontend-jobs-no-foss
- .frontend:rules:default-frontend-jobs-as-if-foss
- .as-if-foss
.frontend-job-base:
......@@ -197,7 +205,7 @@ karma:
karma-as-if-foss:
extends:
- .karma-base
- .frontend:rules:default-frontend-jobs-no-foss
- .frontend:rules:default-frontend-jobs-as-if-foss
- .as-if-foss
needs: ["frontend-fixtures-as-if-foss"]
......@@ -229,10 +237,24 @@ jest:
junit: junit_jest.xml
parallel: 2
jest-integration:
extends:
- .frontend-job-base
- .frontend:rules:default-frontend-jobs
script:
- date
- yarn jest:integration --ci
needs: ["frontend-fixtures"]
cache:
key: jest-integration
paths:
- tmp/cache/jest/
policy: pull-push
jest-as-if-foss:
extends:
- .jest-base
- .frontend:rules:default-frontend-jobs-no-foss
- .frontend:rules:default-frontend-jobs-as-if-foss
- .as-if-foss
needs: ["frontend-fixtures-as-if-foss"]
cache:
......@@ -241,11 +263,13 @@ jest-as-if-foss:
coverage-frontend:
extends:
- .default-retry
- .frontend:rules:default-frontend-jobs-no-foss
- .yarn-cache
- .frontend:rules:ee-mr-and-master-only
needs: ["jest"]
stage: post-test
before_script:
- yarn install --frozen-lockfile --cache-folder .yarn-cache --prefer-offline
- source scripts/utils.sh
- retry yarn install --frozen-lockfile
script:
- yarn node scripts/frontend/merge_coverage_frontend.js
artifacts:
......@@ -254,8 +278,7 @@ coverage-frontend:
paths:
- coverage-frontend/
cache:
paths:
- .yarn-cache/
policy: pull
.qa-frontend-node:
extends:
......@@ -279,22 +302,32 @@ qa-frontend-node:10:
image: node:dubnium
qa-frontend-node:latest:
extends: .qa-frontend-node
extends:
- .qa-frontend-node
- .frontend:rules:qa-frontend-node-latest
image: node:latest
allow_failure: true
webpack-dev-server:
extends:
- .default-retry
- .default-cache
- .frontend:rules:default-frontend-jobs
stage: test
needs: ["setup-test-env pg11", "compile-assets pull-cache"]
needs: []
variables:
WEBPACK_MEMORY_TEST: "true"
WEBPACK_VENDOR_DLL: "true"
cache:
key:
files:
- yarn.lock
prefix: "v1"
paths:
- node_modules/
- tmp/cache/webpack-dlls/
script:
- yarn webpack-vendor
- source scripts/utils.sh
- retry yarn install --frozen-lockfile
- retry yarn webpack-vendor
- node --expose-gc node_modules/.bin/webpack-dev-server --config config/webpack.config.js
artifacts:
name: webpack-dev-server
......
......@@ -21,7 +21,7 @@
# Jobs that only need to pull cache
.default-cache:
cache:
key: "debian-stretch-ruby-2.6.5-pg11-node-12.x"
key: "debian-stretch-ruby-2.6.6-pg11-node-12.x"
paths:
- .go/pkg/mod
- vendor/ruby
......@@ -29,65 +29,39 @@
- vendor/gitaly-ruby
policy: pull
.use-pg9:
image: "registry.gitlab.com/gitlab-org/gitlab-build-images:ruby-2.6.5-golang-1.14-git-2.26-lfs-2.9-chrome-73.0-node-12.x-yarn-1.21-postgresql-9.6-graphicsmagick-1.3.34"
services:
- name: postgres:9.6.17
command: ["postgres", "-c", "fsync=off", "-c", "synchronous_commit=off", "-c", "full_page_writes=off"]
- name: redis:alpine
variables:
POSTGRES_HOST_AUTH_METHOD: trust
.rails-cache:
cache:
key: "debian-stretch-ruby-2.6.5-pg9-node-12.x"
key:
files:
- Gemfile.lock
- GITALY_SERVER_VERSION
prefix: "ruby-go-cache-v1"
paths:
- vendor/ruby
- vendor/gitaly-ruby
- .go/pkg/mod
policy: pull
.use-pg10:
image: "registry.gitlab.com/gitlab-org/gitlab-build-images:ruby-2.6.5-golang-1.14-git-2.26-lfs-2.9-chrome-73.0-node-12.x-yarn-1.21-postgresql-10-graphicsmagick-1.3.34"
services:
- name: postgres:10.12
command: ["postgres", "-c", "fsync=off", "-c", "synchronous_commit=off", "-c", "full_page_writes=off"]
- name: redis:alpine
variables:
POSTGRES_HOST_AUTH_METHOD: trust
.yarn-cache:
cache:
key: "debian-stretch-ruby-2.6.5-pg10-node-12.x"
key:
files:
- yarn.lock
prefix: "v1"
paths:
- node_modules/
.use-pg11:
image: "registry.gitlab.com/gitlab-org/gitlab-build-images:ruby-2.6.5-golang-1.14-git-2.26-lfs-2.9-chrome-73.0-node-12.x-yarn-1.21-postgresql-11-graphicsmagick-1.3.34"
image: "registry.gitlab.com/gitlab-org/gitlab-build-images:ruby-2.6.6-golang-1.14-git-2.26-lfs-2.9-chrome-73.0-node-12.x-yarn-1.21-postgresql-11-graphicsmagick-1.3.34"
services:
- name: postgres:11.6
command: ["postgres", "-c", "fsync=off", "-c", "synchronous_commit=off", "-c", "full_page_writes=off"]
- name: redis:alpine
variables:
POSTGRES_HOST_AUTH_METHOD: trust
cache:
key: "debian-stretch-ruby-2.6.5-pg11-node-12.x"
.use-pg9-ee:
image: "registry.gitlab.com/gitlab-org/gitlab-build-images:ruby-2.6.5-golang-1.14-git-2.26-lfs-2.9-chrome-73.0-node-12.x-yarn-1.21-postgresql-9.6-graphicsmagick-1.3.34"
services:
- name: postgres:9.6.17
command: ["postgres", "-c", "fsync=off", "-c", "synchronous_commit=off", "-c", "full_page_writes=off"]
- name: redis:alpine
- name: elasticsearch:6.4.2
variables:
POSTGRES_HOST_AUTH_METHOD: trust
cache:
key: "debian-stretch-ruby-2.6.5-pg9-node-12.x"
.use-pg10-ee:
image: "registry.gitlab.com/gitlab-org/gitlab-build-images:ruby-2.6.5-golang-1.14-git-2.26-lfs-2.9-chrome-73.0-node-12.x-yarn-1.21-postgresql-10-graphicsmagick-1.3.34"
services:
- name: postgres:10.12
command: ["postgres", "-c", "fsync=off", "-c", "synchronous_commit=off", "-c", "full_page_writes=off"]
- name: redis:alpine
- name: elasticsearch:6.4.2
variables:
POSTGRES_HOST_AUTH_METHOD: trust
cache:
key: "debian-stretch-ruby-2.6.5-pg10-node-12.x"
.use-pg11-ee:
image: "registry.gitlab.com/gitlab-org/gitlab-build-images:ruby-2.6.5-golang-1.14-git-2.26-lfs-2.9-chrome-73.0-node-12.x-yarn-1.21-postgresql-11-graphicsmagick-1.3.34"
image: "registry.gitlab.com/gitlab-org/gitlab-build-images:ruby-2.6.6-golang-1.14-git-2.26-lfs-2.9-chrome-73.0-node-12.x-yarn-1.21-postgresql-11-graphicsmagick-1.3.34"
services:
- name: postgres:11.6
command: ["postgres", "-c", "fsync=off", "-c", "synchronous_commit=off", "-c", "full_page_writes=off"]
......@@ -95,15 +69,13 @@
- name: elasticsearch:6.4.2
variables:
POSTGRES_HOST_AUTH_METHOD: trust
cache:
key: "debian-stretch-ruby-2.6.5-pg11-node-12.x"
# Pin kaniko to v0.16.0 due to https://github.com/GoogleContainerTools/kaniko/issues/1162
.use-kaniko:
image:
name: gcr.io/kaniko-project/executor:debug-v0.16.0
name: gcr.io/kaniko-project/executor:debug-v0.20.0
entrypoint: [""]
before_script:
- mkdir -p /kaniko/.docker
- echo "{\"auths\":{\"$CI_REGISTRY\":{\"username\":\"$CI_REGISTRY_USER\",\"password\":\"$CI_REGISTRY_PASSWORD\"}}}" > /kaniko/.docker/config.json
.as-if-foss:
......
......@@ -8,7 +8,7 @@
memory-static:
extends: .only-code-memory-job-base
stage: test
needs: ["setup-test-env pg11"]
needs: ["setup-test-env"]
variables:
SETUP_DB: "false"
script:
......@@ -28,6 +28,7 @@ memory-static:
- tmp/memory_*.txt
reports:
metrics: tmp/memory_metrics.txt
expire_in: 31d
# Show memory usage caused by invoking require per gem.
# Unlike `memory-static`, it hits the app with one request to ensure that any last minute require-s have been called.
......@@ -38,7 +39,7 @@ memory-on-boot:
- .only-code-memory-job-base
- .use-pg11
stage: test
needs: ["setup-test-env pg11", "compile-assets pull-cache"]
needs: ["setup-test-env", "compile-assets pull-cache"]
variables:
NODE_ENV: "production"
RAILS_ENV: "production"
......@@ -54,3 +55,4 @@ memory-on-boot:
- tmp/memory_*.txt
reports:
metrics: tmp/memory_on_boot_metrics.txt
expire_in: 31d
......@@ -15,3 +15,4 @@ pages:
artifacts:
paths:
- public
expire_in: 31d
......@@ -23,7 +23,7 @@ qa:internal:
qa:internal-as-if-foss:
extends:
- .qa-job-base
- .qa:rules:ee-only
- .qa:rules:as-if-foss
- .as-if-foss
script:
- bundle exec rspec
......@@ -38,7 +38,7 @@ qa:selectors:
qa:selectors-as-if-foss:
extends:
- qa:selectors
- .qa:rules:ee-only
- .qa:rules:as-if-foss
- .as-if-foss
.package-and-qa-base:
......@@ -58,6 +58,5 @@ package-and-qa:
needs:
- job: build-qa-image
artifacts: false
- job: gitlab:assets:compile pull-cache
- job: build-assets-image
artifacts: false
allow_failure: true
.rails:needs:setup-and-assets:
needs: ["setup-test-env pg11", "compile-assets pull-cache"]
needs: ["setup-test-env", "compile-assets pull-cache"]
.rails-job-base:
extends:
- .default-retry
- .default-cache
- .default-before_script
- .rails-cache
####################
# EE and FOSS jobs #
.base-setup-test-env:
#######################################################
# EE/FOSS: default refs (MRs, master, schedules) jobs #
setup-test-env:
extends:
- .rails-job-base
- .rails:rules:default-refs-code-backstage-qa
- .use-pg11
stage: prepare
variables:
GITLAB_TEST_EAGER_LOAD: "0"
script:
- bundle exec ruby -Ispec -e 'require "spec_helper" ; TestEnv.init'
- scripts/gitaly-test-build # Do not use 'bundle exec' here
- run_timed_command "bundle exec ruby -I. -e 'require \"config/environment\"; TestEnv.init'"
- run_timed_command "scripts/gitaly-test-build" # Do not use 'bundle exec' here
- rm tmp/tests/gitaly/.ruby-bundle # This file prevents gems from being installed even if vendor/gitaly-ruby is missing
artifacts:
expire_in: 7d
paths:
- tmp/tests
- config/secrets.yml
- vendor/gitaly-ruby
- tmp/tests/gitaly
- tmp/tests/gitlab-elasticsearch-indexer
- tmp/tests/gitlab-shell
- tmp/tests/gitlab-test-fork
- tmp/tests/gitlab-test-fork_bare
- tmp/tests/gitlab-test
- tmp/tests/gitlab-workhorse
- tmp/tests/repositories
- tmp/tests/second_storage
when: always
cache:
policy: pull-push
setup-test-env pg11:
extends:
- .base-setup-test-env
- .rails:rules:default-refs-code-backstage-qa
- .use-pg11
setup-test-env pg10:
extends:
- .base-setup-test-env
- .rails:rules:master-refs-code-backstage
- .use-pg10
setup-test-env pg9:
extends:
- .base-setup-test-env
- .rails:rules:nightly-master-refs-code-backstage
- .use-pg9
static-analysis:
extends:
- .rails-job-base
......@@ -55,7 +50,7 @@ static-analysis:
script:
- scripts/static-analysis
cache:
key: "ruby-2.6.5-pg11-rubocop"
key: "ruby-2.6.6-pg11-rubocop"
paths:
- vendor/ruby
- tmp/rubocop_cache
......@@ -64,8 +59,8 @@ static-analysis:
downtime_check:
extends:
- .rails-job-base
- .rails:needs:setup-and-assets
- .rails:rules:downtime_check
needs: ["setup-test-env"]
stage: test
variables:
SETUP_DB: "false"
......@@ -75,8 +70,10 @@ downtime_check:
.rspec-base:
extends: .rails-job-base
stage: test
needs: ["setup-test-env pg11", "retrieve-tests-metadata", "compile-assets pull-cache"]
needs: ["setup-test-env", "retrieve-tests-metadata", "compile-assets pull-cache"]
script:
- run_timed_command "scripts/gitaly-test-build"
- run_timed_command "scripts/gitaly-test-spawn"
- source scripts/rspec_helpers.sh
- rspec_paralellized_job "--tag ~quarantine --tag ~geo --tag ~level:migration"
artifacts:
......@@ -89,7 +86,7 @@ downtime_check:
- rspec_profiling/
- tmp/capybara/
- tmp/memory_test/
- junit_rspec.xml