Коммит 51a0166a создал по автору Greg Myers's avatar Greg Myers
Просмотр файлов

Merge branch 'master' into 'api-curl-quote-url-docs'

# Conflicts:
#   doc/api/events.md
владельцы f7066773 27c222d1
# `build_from_dir` can't find Dockerfile when `.dockerignore` is "*"
# See https://github.com/swipely/docker-api/issues/484
# Ignore all folders except qa/, config/initializers and the root of lib/ since
# the files we need to build the QA image are in these folders.
# Following are the files we need:
# - ./config/initializers/0_inject_enterprise_edition_module.rb
# - ./ee/app/models/license.rb
# - ./lib/gitlab.rb
# - ./qa/
# - ./INSTALLATION_TYPE
# - ./VERSION
/app/
/bin/
/builds/
/changelogs/
/config/environments/
/config/helpers/
/config/knative/
/config/locales/
/config/prometheus/
/config/routes/
/danger/
/db/
/doc/
/docker/
/ee/bin/
/ee/changelogs/
/ee/config/
/ee/db/
/ee/fixtures/
/ee/lib/
/ee/locale/
/ee/spec/
/fixtures/
/templates/
/lint/
/lib/api/
/lib/assets/
/lib/backup/
/lib/banzai/
/lib/bitbucket/
/lib/server/
/lib/constraints/
/lib/registry/
/lib/policy/
/lib/feature/
/lib/flowdock/
/lib/generators/
/lib/gitaly/
/lib/gitlab/
/lib/api/
/lib/token/
/lib/mattermost/
/lib/teams/
/lib/storage/
/lib/auth/
/lib/peek/
/lib/prometheus/
/lib/quality/
/lib/rouge/
/lib/flaky/
/lib/zip/
/lib/sentry/
/lib/serializers/
/lib/support/
/lib/check/
/lib/tasks/
/locale/
/log/
/modules/
/plugins/
/public/
/rubocop/
/scripts/
/shared/
/spec/
/symbol/
/tmp/
/vendor/
......@@ -5,16 +5,20 @@ globals:
gl: false
gon: false
localStorage: false
IS_EE: false
plugins:
- import
- html
- "@gitlab/i18n"
- "@gitlab/vue-i18n"
settings:
import/resolver:
webpack:
config: './config/webpack.config.js'
rules:
"@gitlab/i18n/no-non-i18n-strings": error
"@gitlab/vue-i18n/no-bare-strings": error
"@gitlab/vue-i18n/no-bare-attribute-strings": error
import/no-commonjs: error
no-underscore-dangle:
- error
......@@ -35,9 +39,6 @@ rules:
vue/use-v-on-exact: off
overrides:
files:
# Vue is temporarily being disabled until the autofix errors are resolved
# Follow up issue https://gitlab.com/gitlab-org/gitlab-ce/issues/57969
- '*.vue'
- '**/spec/**/*'
rules:
"@gitlab/i18n/no-non-i18n-strings": off
......@@ -75,6 +75,8 @@ eslint-report.html
/.rspec
/plugins/*
/.gitlab_pages_secret
/.gitlab_smime_key
/.gitlab_smime_cert
package-lock.json
/junit_*.xml
/coverage-frontend/
......
image: "dev.gitlab.org:5005/gitlab/gitlab-build-images:ruby-2.6.3-golang-1.11-git-2.21-chrome-73.0-node-12.x-yarn-1.16-postgresql-9.6-graphicsmagick-1.3.29"
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
- review
- qa
- post-test
- pages
variables:
RAILS_ENV: "test"
......@@ -11,26 +21,9 @@ variables:
FLAKY_RSPEC_SUITE_REPORT_PATH: rspec_flaky/report-suite.json
BUILD_ASSETS_IMAGE: "false"
before_script:
- date
- source scripts/utils.sh
- source scripts/prepare_build.sh
- date
after_script:
- date
stages:
- build
- prepare
- merge
- test
- review
- qa
- post-test
- pages
- post-cleanup
include:
- local: .gitlab/ci/global.gitlab-ci.yml
- local: .gitlab/ci/cng.gitlab-ci.yml
......
# Backend Maintainers are the default for all ruby files
*.rb @ashmckenzie @ayufan @dbalexandre @DouweM @dzaporozhets @godfat @grzesiek @mkozono @mayra-cabrera @nick.thomas @rspeicher @rymai @reprazent @smcgivern @tkuah
*.rake @ashmckenzie @ayufan @dbalexandre @DouweM @dzaporozhets @godfat @grzesiek @mkozono @mayra-cabrera @nick.thomas @rspeicher @rymai @reprazent @smcgivern @tkuah
*.rb @gitlab-org/maintainers/rails-backend
*.rake @gitlab-org/maintainers/rails-backend
# Technical writing team are the default reviewers for everything in `doc/`
/doc/ @axil @marcia @eread @mikelewis
# Frontend maintainers should see everything in `app/assets/`
app/assets/ @ClemMakesApps @fatihacet @filipa @iamphill @mikegreiling @timzallmann @kushalpandya
*.scss @annabeldunstone @ClemMakesApps @fatihacet @filipa @iamphill @mikegreiling @timzallmann @kushalpandya
app/assets/ @ClemMakesApps @fatihacet @filipa @mikegreiling @timzallmann @kushalpandya @pslaughter
*.scss @annabeldunstone @ClemMakesApps @fatihacet @filipa @mikegreiling @timzallmann @kushalpandya @pslaughter
# Someone from the database team should review changes in `db/`
db/ @abrandl @NikolayS
# Database maintainers should review changes in `db/`
db/ @gitlab-org/maintainers/database
lib/gitlab/background_migration/ @gitlab-org/maintainers/database
lib/gitlab/database/ @gitlab-org/maintainers/database
lib/gitlab/sql/ @gitlab-org/maintainers/database
lib/gitlab/github_import/ @gitlab-org/maintainers/database
/ee/db/ @gitlab-org/maintainers/database
# Feature specific owners
/ee/lib/gitlab/code_owners/ @reprazent
......
cloud-native-image:
image: ruby:2.6-alpine
before_script: []
dependencies: []
stage: post-test
allow_failure: true
variables:
GIT_DEPTH: "1"
cache: {}
when: manual
script:
- install_gitlab_gem
- CNG_PROJECT_PATH="gitlab-org/build/CNG" BUILD_TRIGGER_TOKEN=$CI_JOB_TOKEN ./scripts/trigger-build cng
only:
- tags@gitlab-org/gitlab-ce
- tags@gitlab-org/gitlab-ee
refs:
- tags@gitlab-org/gitlab-ce
- tags@gitlab-org/gitlab-ee
.review-docs: &review-docs
extends: .single-script-job-dedicated-runner
.review-docs:
extends:
- .default-tags
- .default-retry
image: ruby:2.6-alpine
stage: review
dependencies: []
variables:
SCRIPT_NAME: trigger-build-docs
GIT_STRATEGY: none
environment:
name: review-docs/$CI_COMMIT_REF_SLUG
# DOCS_REVIEW_APPS_DOMAIN and DOCS_GITLAB_REPO_SUFFIX are CI variables
# Discussion: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/14236/diffs#note_40140693
url: http://$CI_ENVIRONMENT_SLUG.$DOCS_REVIEW_APPS_DOMAIN/$DOCS_GITLAB_REPO_SUFFIX
on_stop: review-docs-cleanup
before_script:
# We don't clone the repo by using GIT_STRATEGY: none and only download the
# single script we need here so it's much faster than cloning.
- 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:
<<: *review-docs
stage: build
extends:
- .review-docs
- .except-docs-qa
script:
- gem install gitlab --no-document
- ./$SCRIPT_NAME deploy
- ./trigger-build-docs deploy
when: manual
only:
- branches@gitlab-org/gitlab-ce
- branches@gitlab-org/gitlab-ee
except:
- /(^docs[\/-].*|.*-docs$)/
- /(^qa[\/-].*|.*-qa$)/
# Always trigger a docs build in gitlab-docs only on docs-only branches.
# Useful to preview the docs changes live.
review-docs-deploy:
<<: *review-docs
stage: post-test
extends:
- .review-docs
- .except-qa
script:
- gem install gitlab --no-document
- ./$SCRIPT_NAME deploy
- ./trigger-build-docs deploy
only:
- /(^docs[\/-].*|.*-docs$)/@gitlab-org/gitlab-ce
- /(^docs[\/-].*|.*-docs$)/@gitlab-org/gitlab-ee
except:
- /(^qa[\/-].*|.*-qa$)/
- /(^docs[\/-].+|.+-docs$)/@gitlab-org/gitlab-ce
- /(^docs[\/-].+|.+-docs$)/@gitlab-org/gitlab-ee
# Cleanup remote environment of gitlab-docs
review-docs-cleanup:
<<: *review-docs
stage: post-cleanup
extends:
- .review-docs
- .except-qa
environment:
name: review-docs/$CI_COMMIT_REF_SLUG
action: stop
script:
- gem install gitlab --no-document
- ./$SCRIPT_NAME cleanup
- ./trigger-build-docs cleanup
when: manual
only:
- branches@gitlab-org/gitlab-ce
- branches@gitlab-org/gitlab-ee
docs lint:
extends: .dedicated-runner
extends:
- .default-tags
- .default-retry
- .except-qa
image: "registry.gitlab.com/gitlab-org/gitlab-build-images:gitlab-docs-lint"
stage: test
cache: {}
dependencies: []
before_script: []
script:
- scripts/lint-doc.sh
- scripts/lint-changelog-yaml
# Lint Markdown
- markdownlint --config .markdownlint.json doc/**/*.md
# Prepare docs for build
- mv doc/ /tmp/gitlab-docs/content/$DOCS_GITLAB_REPO_SUFFIX
- cd /tmp/gitlab-docs
# Lint Markdown
# https://github.com/markdownlint/markdownlint/blob/master/docs/RULES.md
- bundle exec mdl content/$DOCS_GITLAB_REPO_SUFFIX/**/*.md --rules \
MD032
# Build HTML from Markdown
- bundle exec nanoc
# Check the internal links
- bundle exec nanoc check internal_links
# Check the internal anchor links
- bundle exec nanoc check internal_anchors
except:
- /(^qa[\/-].*|.*-qa$)/
.assets-compile-cache: &assets-compile-cache
.assets-compile-cache:
cache:
key: "assets-compile:vendor_ruby:.yarn-cache:tmp_cache_assets_sprockets:v6"
paths:
- vendor/ruby/
- .yarn-cache/
- tmp/cache/assets/sprockets
.use-pg: &use-pg
services:
- name: postgres:9.6
command: ["postgres", "-c", "fsync=off", "-c", "synchronous_commit=off", "-c", "full_page_writes=off"]
- name: redis:alpine
.gitlab:assets:compile-metadata:
<<: *assets-compile-cache
extends: .dedicated-no-docs-pull-cache-job
image: dev.gitlab.org:5005/gitlab/gitlab-build-images:ruby-2.6.3-git-2.21-chrome-73.0-node-12.x-yarn-1.16-graphicsmagick-1.3.29-docker-18.06.1
dependencies:
- setup-test-env
extends:
- .default-tags
- .default-retry
- .assets-compile-cache
- .default-before_script
- .except-docs
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
dependencies: ["setup-test-env"]
services:
- docker:stable-dind
- docker:19.03.0-dind
variables:
NODE_ENV: "production"
RAILS_ENV: "production"
......@@ -30,9 +26,17 @@
NODE_OPTIONS: --max_old_space_size=3584
DOCKER_DRIVER: overlay2
DOCKER_HOST: tcp://docker:2375
cache:
key: "assets-compile:production:vendor_ruby:.yarn-cache:tmp_cache_assets_sprockets:v6"
artifacts:
name: webpack-report
expire_in: 31d
paths:
- webpack-report/
- public/assets/
script:
- node --version
- retry yarn install --frozen-lockfile --production --cache-folder .yarn-cache
- retry yarn install --frozen-lockfile --production --cache-folder .yarn-cache --prefer-offline
- free -m
- retry bundle exec rake gitlab:assets:compile
- time scripts/build_assets_image
......@@ -42,52 +46,53 @@
- install_api_client_dependencies_with_apt
- play_job "review-build-cng" || true # this job might not exist so ignore the failure if it cannot be played
- play_job "schedule:review-build-cng" || true # this job might not exist so ignore the failure if it cannot be played
artifacts:
name: webpack-report
expire_in: 31d
paths:
- webpack-report/
- public/assets/
only:
- /.+/@gitlab-org/gitlab-ce
- /.+/@gitlab-org/gitlab-ee
- /.+/@gitlab/gitlabhq
- /.+/@gitlab/gitlab-ee
tags:
- docker
- gitlab-org
- docker
gitlab:assets:compile:
extends: .gitlab:assets:compile-metadata
only:
refs:
- master@gitlab-org/gitlab-ce
- master@gitlab-org/gitlab-ee
cache:
policy: pull-push
only:
- master@gitlab-org/gitlab-ce
- master@gitlab-org/gitlab-ee
gitlab:assets:compile pull-cache:
extends: .gitlab:assets:compile-metadata
except:
refs:
- master@gitlab-org/gitlab-ce
- master@gitlab-org/gitlab-ee
- /(^docs[\/-].+|.+-docs$)/
cache:
policy: pull
except:
- master@gitlab-org/gitlab-ce
- master@gitlab-org/gitlab-ee
- /(^docs[\/-].*|.*-docs$)/
.compile-assets-metadata:
extends: .dedicated-runner
<<: *use-pg
<<: *assets-compile-cache
extends:
- .default-tags
- .default-retry
- .assets-compile-cache
- .default-before_script
- .use-pg
stage: prepare
script:
- node --version
- retry yarn install --frozen-lockfile --cache-folder .yarn-cache
- retry yarn install --frozen-lockfile --cache-folder .yarn-cache --prefer-offline
- free -m
- retry bundle exec rake gitlab:assets:compile
- scripts/clean-old-cached-assets
variables:
# we override the max_old_space_size to prevent OOM errors
NODE_OPTIONS: --max_old_space_size=3584
cache:
key: "assets-compile:test:vendor_ruby:.yarn-cache:tmp_cache_assets_sprockets:v6"
artifacts:
expire_in: 7d
paths:
......@@ -95,60 +100,34 @@ gitlab:assets:compile pull-cache:
- public/assets
compile-assets:
extends: .compile-assets-metadata
extends:
- .compile-assets-metadata
only:
refs:
- master@gitlab-org/gitlab-ce
- master@gitlab-org/gitlab-ee
cache:
policy: pull-push
only:
- master@gitlab-org/gitlab-ce
- master@gitlab-org/gitlab-ee
compile-assets pull-cache:
extends: .compile-assets-metadata
cache:
policy: pull
except:
- master@gitlab-org/gitlab-ce
- master@gitlab-org/gitlab-ee
- /(^docs[\/-].*|.*-docs$)/
gitlab:ui:visual:
extends: .dedicated-runner
before_script: []
allow_failure: true
dependencies:
- compile-assets
- compile-assets pull-cache
script:
# Remove node modules from GitLab that may conflict with gitlab-ui
- rm -r node_modules
- git clone https://gitlab.com/gitlab-org/gitlab-ui.git
- cp public/assets/application-*.css gitlab-ui/styles/application.css
- cd gitlab-ui
- yarn install
- CSS_URL=./application.css yarn test
only:
changes:
- app/assets/stylesheets/*.scss
- app/assets/stylesheets/**/*.scss
- app/assets/stylesheets/**/**/*.scss
except:
refs:
- /(^docs[\/-].*|.*-docs$)/
- master
variables:
- $CI_COMMIT_MESSAGE =~ /\[skip visual\]/i
artifacts:
paths:
- gitlab-ui/tests/__image_snapshots__/
when: always
- master@gitlab-org/gitlab-ce
- master@gitlab-org/gitlab-ee
- /(^docs[\/-].+|.+-docs$)/
cache:
policy: pull
karma:
extends: .dedicated-no-docs-pull-cache-job
<<: *use-pg
dependencies:
- compile-assets
- compile-assets pull-cache
- setup-test-env
extends:
- .default-tags
- .default-retry
- .default-cache
- .default-before_script
- .use-pg
- .except-docs
dependencies: ["compile-assets", "compile-assets pull-cache", "setup-test-env"]
variables:
# we override the max_old_space_size to prevent OOM errors
NODE_OPTIONS: --max_old_space_size=3584
......@@ -166,20 +145,23 @@ karma:
paths:
- chrome_debug.log
- coverage-javascript/
- tmp/tests/frontend/
reports:
junit: junit_karma.xml
jest:
extends: .dedicated-no-docs-and-no-qa-pull-cache-job
<<: *use-pg
dependencies:
- compile-assets
- compile-assets pull-cache
- setup-test-env
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"]
script:
- scripts/gitaly-test-spawn
- date
- bundle exec rake karma:fixtures
- bundle exec rake frontend:fixtures
- date
- yarn jest --ci --coverage
artifacts:
......@@ -189,6 +171,7 @@ jest:
paths:
- coverage-frontend/
- junit_jest.xml
- tmp/tests/frontend/
reports:
junit: junit_jest.xml
cache:
......@@ -197,60 +180,70 @@ jest:
- tmp/jest/jest/
policy: pull-push
qa:internal:
extends: .dedicated-no-docs-no-db-pull-cache-job
services: []
script:
.qa:
extends:
- .default-tags
- .default-retry
- .default-cache
- .except-docs
dependencies: ["setup-test-env"]
variables:
SETUP_DB: "false"
before_script:
- cd qa/
- bundle install
qa:internal:
extends: .qa
script:
- bundle exec rspec
dependencies:
- setup-test-env
qa:selectors:
extends: .dedicated-no-docs-no-db-pull-cache-job
services: []
extends: .qa
script:
- cd qa/
- bundle install
- bundle exec bin/qa Test::Sanity::Selectors
dependencies:
- setup-test-env
.qa-frontend-node: &qa-frontend-node
extends: .dedicated-no-docs-no-db-pull-cache-job
stage: test
.qa-frontend-node:
extends:
- .default-tags
- .default-retry
- .default-cache
- .except-docs
dependencies: []
cache:
key: "$CI_JOB_NAME"
paths:
- .yarn-cache/
policy: pull-push
dependencies: []
before_script: []
script:
- date
- yarn install --frozen-lockfile --cache-folder .yarn-cache
- yarn install --frozen-lockfile --cache-folder .yarn-cache --prefer-offline
- date
- yarn run webpack-prod
qa-frontend-node:8:
<<: *qa-frontend-node
image: node:8-alpine
extends: .qa-frontend-node
image: node:carbon
qa-frontend-node:10:
<<: *qa-frontend-node
image: node:10-alpine
extends: .qa-frontend-node
image: node:dubnium
qa-frontend-node:latest:
<<: *qa-frontend-node
image: node:alpine
extends: .qa-frontend-node
image: node:latest
allow_failure: true
lint:javascript:report:
extends: .dedicated-no-docs-no-db-pull-cache-job
extends:
- .default-tags
- .default-retry
- .default-cache
- .except-docs
variables:
SETUP_DB: "false"
stage: post-test
dependencies: []
before_script: []
script:
- date
- yarn run eslint-report || true # ignore exit code
......@@ -261,12 +254,15 @@ lint:javascript:report:
- eslint-report.html
jsdoc:
extends: .dedicated-no-docs-no-db-pull-cache-job
extends:
- .default-tags
- .default-retry
- .default-cache
- .except-docs
variables:
SETUP_DB: "false"
stage: post-test
dependencies:
- compile-assets
- compile-assets pull-cache
before_script: []
dependencies: ["compile-assets", "compile-assets pull-cache"]
script:
- date
- yarn run jsdoc || true # ignore exit code
......
.dedicated-runner:
.default-tags:
tags:
- gitlab-org
.default-retry:
retry:
max: 2 # This is confusing but this means "3 runs at max".
when:
- unknown_failure
- api_failure
- runner_system_failure
tags:
- gitlab-org
.default-cache: &default-cache
key: "debian-stretch-ruby-2.6.3-node-12.x"
paths:
- vendor/ruby
- .yarn-cache/
- vendor/gitaly-ruby
.dedicated-runner-default-cache:
extends: .dedicated-runner
cache:
<<: *default-cache
.default-before_script:
before_script:
- date
- source scripts/utils.sh
- source scripts/prepare_build.sh
- date
# Jobs that only need to pull cache
.dedicated-pull-cache-job:
extends: .dedicated-runner
.default-cache:
cache:
<<: *default-cache
key: "debian-stretch-ruby-2.6.3-node-12.x"
paths:
- vendor/ruby
- .yarn-cache/
- vendor/gitaly-ruby
policy: pull
stage: test
.no-docs:
.except-docs:
except:
refs:
- /(^docs[\/-].+|.+-docs$)/
.except-qa:
except:
- /(^docs[\/-].*|.*-docs$)/
refs:
- /(^qa[\/-].*|.*-qa$)/
.dedicated-no-docs-pull-cache-job:
extends:
- .dedicated-pull-cache-job
- .no-docs
.except-docs-qa:
except:
refs:
- /(^docs[\/-].+|.+-docs$)/
- /(^qa[\/-].*|.*-qa$)/
.dedicated-no-docs-and-no-qa-pull-cache-job:
extends: .dedicated-pull-cache-job
.except-docs-qa-geo:
except:
- /(^docs[\/-].*|.*-docs$)/
- /(^qa[\/-].*|.*-qa$)/
refs:
- /(^docs[\/-].+|.+-docs$)/
- /(^qa[\/-].*|.*-qa$)/
- /(^geo[\/-].*|.*-geo$)/
# Jobs that do not need a DB
.dedicated-no-docs-no-db-pull-cache-job:
extends: .dedicated-no-docs-pull-cache-job
variables:
SETUP_DB: "false"
.review-only:
only:
refs:
- branches@gitlab-org/gitlab-ce
- branches@gitlab-org/gitlab-ee
kubernetes: active
except:
refs:
- master
- /^\d+-\d+-auto-deploy-\d+$/
- /(^docs[\/-].+|.+-docs$)/
# Jobs that need a dedicated runner, with no cache
.dedicated-no-docs:
extends:
- .dedicated-runner
- .no-docs
.use-pg:
services:
- name: postgres:9.6.14
command: ["postgres", "-c", "fsync=off", "-c", "synchronous_commit=off", "-c", "full_page_writes=off"]
- name: redis:alpine
.single-script-job-dedicated-runner:
extends: .dedicated-runner
image: ruby:2.6-alpine
stage: test
cache: {}
dependencies: []
variables:
GIT_STRATEGY: none
before_script:
# We don't clone the repo by using GIT_STRATEGY: none and only download the
# single script we need here so it's much faster than cloning.
- export SCRIPT_NAME="${SCRIPT_NAME:-$CI_JOB_NAME}"
- apk add --update openssl
- wget $CI_PROJECT_URL/raw/$CI_COMMIT_SHA/scripts/$SCRIPT_NAME
- chmod 755 $(basename $SCRIPT_NAME)
.use-pg-10:
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-10-graphicsmagick-1.3.33"
services:
- name: postgres:10.9
command: ["postgres", "-c", "fsync=off", "-c", "synchronous_commit=off", "-c", "full_page_writes=off"]
- name: redis:alpine
memory-static:
extends: .dedicated-no-docs-no-db-pull-cache-job
extends:
- .default-tags
- .default-retry
- .default-cache
- .default-before_script
- .except-docs
variables:
SETUP_DB: "false"
script:
# Uses two different reports from the 'derailed_benchmars' gem.
......@@ -17,3 +24,32 @@ memory-static:
- tmp/memory_*.txt
reports:
metrics: tmp/memory_metrics.txt
# 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.
# The application is booted in `production` environment.
# 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
- .use-pg-10
- .except-docs-qa
variables:
NODE_ENV: "production"
RAILS_ENV: "production"
SETUP_DB: "true"
SKIP_STORAGE_VALIDATION: "true"
# we override the max_old_space_size to prevent OOM errors
NODE_OPTIONS: --max_old_space_size=3584
script:
# Both bootsnap and derailed monkey-patch Kernel#require, which leads to circular dependency
- ENABLE_BOOTSNAP=false PATH_TO_HIT="/users/sign_in" CUT_OFF=0.3 bundle exec derailed exec perf:mem >> 'tmp/memory_on_boot.txt'
- scripts/generate-memory-metrics-on-boot tmp/memory_on_boot.txt >> 'tmp/memory_on_boot_metrics.txt'
artifacts:
paths:
- tmp/memory_*.txt
reports:
metrics: tmp/memory_on_boot_metrics.txt
pages:
extends: .dedicated-no-docs-no-db-pull-cache-job
before_script: []
extends:
- .default-tags
- .default-retry
- .default-cache
- .except-docs
only:
refs:
- master@gitlab-org/gitlab-ce
- master@gitlab-org/gitlab-ee
stage: pages
dependencies:
- coverage
- karma
- gitlab:assets:compile
- lint:javascript:report
- jsdoc
dependencies: ["coverage", "karma", "gitlab:assets:compile", "lint:javascript:report", "jsdoc"]
script:
- mv public/ .public/
- mkdir public/
......@@ -21,6 +23,3 @@ pages:
artifacts:
paths:
- public
only:
- master@gitlab-org/gitlab-ce
- master@gitlab-org/gitlab-ee
package-and-qa:
.package-and-qa-base:
image: ruby:2.6-alpine
stage: review # So even if review-deploy failed we can still run this
when: manual
before_script: []
stage: qa
needs: ["build-qa-image", "gitlab:assets:compile pull-cache"]
dependencies: []
cache: {}
variables:
GIT_DEPTH: "1"
retry: 0
......@@ -13,5 +11,24 @@ package-and-qa:
- install_gitlab_gem
- ./scripts/trigger-build omnibus
only:
- /.+/@gitlab-org/gitlab-ce
- /.+/@gitlab-org/gitlab-ee
- branches@gitlab-org/gitlab-ce
- branches@gitlab-org/gitlab-ee
except:
- master
package-and-qa-manual:
extends:
- .package-and-qa-base
- .except-docs-qa
when: manual
except:
- master
- /(^docs[\/-].+|.+-docs$)/
- /(^qa[\/-].*|.*-qa$)
package-and-qa:
extends: .package-and-qa-base
allow_failure: true
only:
- /(^qa[\/-].*|.*-qa$)/@gitlab-org/gitlab-ce
- /(^qa[\/-].*|.*-qa$)/@gitlab-org/gitlab-ee
.use-pg: &use-pg
services:
- name: postgres:9.6
command: ["postgres", "-c", "fsync=off", "-c", "synchronous_commit=off", "-c", "full_page_writes=off"]
- name: redis:alpine
.use-pg-10: &use-pg-10
services:
- name: postgres:10.7
command: ["postgres", "-c", "fsync=off", "-c", "synchronous_commit=off", "-c", "full_page_writes=off"]
- name: redis:alpine
.only-schedules-master: &only-schedules-master
.only-schedules-master:
only:
- schedules@gitlab-org/gitlab-ce
- schedules@gitlab-org/gitlab-ee
- master@gitlab-org/gitlab-ce
- master@gitlab-org/gitlab-ee
- master@gitlab/gitlabhq
- master@gitlab/gitlab-ee
refs:
- schedules@gitlab-org/gitlab-ce
- schedules@gitlab-org/gitlab-ee
- master@gitlab-org/gitlab-ce
- master@gitlab-org/gitlab-ee
- master@gitlab/gitlabhq
- master@gitlab/gitlab-ee
.gitlab-setup: &gitlab-setup
extends: .dedicated-no-docs-and-no-qa-pull-cache-job
<<: *use-pg
.rake-exec:
extends:
- .default-tags
- .default-retry
- .default-cache
- .default-before_script
variables:
SETUP_DB: "false"
script:
# Manually clone gitlab-test and only seed this project in
# db/fixtures/development/04_project.rb thanks to SIZE=1 below
- git clone https://gitlab.com/gitlab-org/gitlab-test.git
/home/git/repositories/gitlab-org/gitlab-test.git
- scripts/gitaly-test-spawn
- force=yes SIZE=1 FIXTURE_PATH="db/fixtures/development" bundle exec rake gitlab:setup
artifacts:
when: on_failure
expire_in: 1d
paths:
- log/development.log
.rake-exec: &rake-exec
extends: .dedicated-no-docs-no-db-pull-cache-job
script:
- bundle exec rake $CI_JOB_NAME
.rspec-metadata: &rspec-metadata
extends: .dedicated-pull-cache-job
.rspec-base:
extends:
- .default-tags
- .default-retry
- .default-cache
- .default-before_script
- .except-docs-qa
stage: test
script:
- JOB_NAME=( $CI_JOB_NAME )
......@@ -63,6 +45,8 @@
- scripts/gitaly-test-spawn
- date
- 'export KNAPSACK_TEST_FILE_PATTERN=$(ruby -r./lib/quality/test_level.rb -e "puts Quality::TestLevel.new.pattern(:${TEST_LEVEL})")'
- mkdir -p tmp/memory_test
- export MEMORY_TEST_PATH="tmp/memory_test/${TEST_TOOL}_${TEST_LEVEL}_${DATABASE}_node_${CI_NODE_INDEX}_${CI_NODE_TOTAL}_memory.csv"
- knapsack rspec "--color --format documentation --format RspecJunitFormatter --out junit_rspec.xml --tag level:${TEST_LEVEL} --tag ~geo"
- date
artifacts:
......@@ -74,56 +58,28 @@
- rspec_flaky/
- rspec_profiling/
- tmp/capybara/
- tmp/memory_test/
reports:
junit: junit_rspec.xml
except:
- /(^docs[\/-].*|.*-docs$)/
- /(^qa[\/-].*|.*-qa$)/
.rspec-metadata-pg: &rspec-metadata-pg
<<: *rspec-metadata
<<: *use-pg
.rspec-metadata-pg-10: &rspec-metadata-pg-10
<<: *rspec-metadata
<<: *use-pg-10
image: "dev.gitlab.org:5005/gitlab/gitlab-build-images:ruby-2.6.3-golang-1.11-git-2.21-chrome-73.0-node-12.x-yarn-1.16-postgresql-10-graphicsmagick-1.3.29"
# DB migration, rollback, and seed jobs
.db-migrate-reset: &db-migrate-reset
extends: .dedicated-no-docs-and-no-qa-pull-cache-job
script:
- bundle exec rake db:migrate:reset
dependencies:
- setup-test-env
.rspec-base-pg:
extends:
- .rspec-base
- .use-pg
.migration-paths: &migration-paths
extends: .dedicated-no-docs-and-no-qa-pull-cache-job
variables:
SETUP_DB: "false"
script:
- git fetch https://gitlab.com/gitlab-org/gitlab-ce.git v11.11.0
- 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
- bundle update google-protobuf grpc bootsnap
- bundle install $BUNDLE_INSTALL_FLAGS
- date
- cp config/gitlab.yml.example config/gitlab.yml
- bundle exec rake db:drop db:create db:schema:load db:seed_fu
- date
- git checkout -f $CI_COMMIT_SHA
- bundle install $BUNDLE_INSTALL_FLAGS
- date
- . scripts/prepare_build.sh
- date
- bundle exec rake db:migrate
dependencies:
- setup-test-env
.rspec-base-pg-10:
extends:
- .rspec-base
- .use-pg-10
setup-test-env:
extends: .dedicated-runner-default-cache
<<: *use-pg
extends:
- .default-tags
- .default-retry
- .default-cache
- .default-before_script
- .use-pg
- .except-docs
stage: prepare
script:
- bundle exec ruby -Ispec -e 'require "spec_helper" ; TestEnv.init'
......@@ -134,91 +90,95 @@ setup-test-env:
- tmp/tests
- config/secrets.yml
- vendor/gitaly-ruby
except:
- /(^docs[\/-].*|.*-docs$)/
rspec unit pg:
<<: *rspec-metadata-pg
parallel: 25
extends: .rspec-base-pg
parallel: 20
rspec integration pg:
<<: *rspec-metadata-pg
extends: .rspec-base-pg
parallel: 6
rspec system pg:
<<: *rspec-metadata-pg
extends: .rspec-base-pg
parallel: 24
rspec unit pg-10:
<<: *rspec-metadata-pg-10
<<: *only-schedules-master
parallel: 25
extends:
- .rspec-base-pg-10
- .only-schedules-master
parallel: 20
rspec integration pg-10:
<<: *rspec-metadata-pg-10
<<: *only-schedules-master
extends:
- .rspec-base-pg-10
- .only-schedules-master
parallel: 6
rspec system pg-10:
<<: *rspec-metadata-pg-10
<<: *only-schedules-master
extends:
- .rspec-base-pg-10
- .only-schedules-master
parallel: 24
rspec-fast-spec-helper:
<<: *rspec-metadata-pg
extends: .rspec-base-pg
script:
- bundle exec rspec spec/fast_spec_helper.rb
.rspec-quarantine: &rspec-quarantine
<<: *only-schedules-master
rspec quarantine pg:
extends:
- .default-before_script
- .rspec-base-pg
- .only-schedules-master
script:
- export CACHE_CLASSES=true
- export NO_KNAPSACK=1 CACHE_CLASSES=true
- scripts/gitaly-test-spawn
- bin/rspec --color --format documentation --tag quarantine -- spec/
rspec quarantine pg:
<<: *rspec-metadata-pg
<<: *rspec-quarantine
allow_failure: true
static-analysis:
extends: .dedicated-no-docs-no-db-pull-cache-job
dependencies:
- compile-assets
- compile-assets pull-cache
- setup-test-env
extends:
- .default-tags
- .default-retry
- .default-cache
- .default-before_script
- .except-docs
dependencies: ["setup-test-env", "compile-assets", "compile-assets pull-cache"]
variables:
SETUP_DB: "false"
script:
- scripts/static-analysis
cache:
key: "debian-stretch-ruby-2.6.3-node-12.x-and-rubocop"
key: "debian-stretch-ruby-2.6.3-and-rubocop"
paths:
- vendor/ruby
- .yarn-cache/
- tmp/rubocop_cache
policy: pull-push
downtime_check:
<<: *rake-exec
extends: .rake-exec
except:
- master
- tags
- /^[\d-]+-stable(-ee)?$/
- /(^docs[\/-].*|.*-docs$)/
- /(^qa[\/-].*|.*-qa$)/
dependencies:
- setup-test-env
refs:
- master
- tags
- /^[\d-]+-stable(-ee)?$/
- /(^docs[\/-].+|.+-docs$)/
- /(^qa[\/-].*|.*-qa$)/
dependencies: ["setup-test-env"]
ee_compat_check:
<<: *rake-exec
extends: .rake-exec
dependencies: []
except:
- master
- tags
- /[\d-]+-stable(-ee)?/
- /^security-/
- branches@gitlab-org/gitlab-ee
- branches@gitlab/gitlab-ee
retry: 0
refs:
- master
- tags
- branches@gitlab-org/gitlab-ee
- branches@gitlab/gitlab-ee
- /^[\d-]+-stable(-ee)?$/
- /(^docs[\/-].+|.+-docs$)/
- /^security-/
artifacts:
name: "${CI_JOB_NAME}_${CI_COMIT_REF_NAME}_${CI_COMMIT_SHA}"
when: always
......@@ -226,42 +186,106 @@ ee_compat_check:
paths:
- ee_compat_check/patches/*.patch
db:migrate:reset-pg:
<<: *db-migrate-reset
<<: *use-pg
# DB migration, rollback, and seed jobs
db:migrate:reset:
extends:
- .default-tags
- .default-retry
- .default-cache
- .default-before_script
- .use-pg
- .except-docs-qa
dependencies: ["setup-test-env"]
script:
- bundle exec rake db:migrate:reset
db:check-schema-pg:
<<: *db-migrate-reset
<<: *use-pg
db:check-schema:
extends:
- .default-tags
- .default-retry
- .default-cache
- .default-before_script
- .use-pg
- .except-docs-qa
dependencies: ["setup-test-env"]
script:
- source scripts/schema_changed.sh
migration:path-pg:
<<: *migration-paths
<<: *use-pg
.db-rollback: &db-rollback
extends: .dedicated-no-docs-and-no-qa-pull-cache-job
db:migrate-from-v11.11.0:
extends:
- .default-tags
- .default-retry
- .default-cache
- .default-before_script
- .use-pg
- .except-docs-qa
dependencies: ["setup-test-env"]
variables:
SETUP_DB: "false"
script:
- bundle exec rake db:migrate VERSION=20170523121229
- git fetch https://gitlab.com/gitlab-org/gitlab-ce.git v11.11.0
- 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
- bundle update google-protobuf grpc bootsnap
- bundle install $BUNDLE_INSTALL_FLAGS
- date
- cp config/gitlab.yml.example config/gitlab.yml
- bundle exec rake db:drop db:create db:schema:load db:seed_fu
- date
- git checkout -f $CI_COMMIT_SHA
- bundle install $BUNDLE_INSTALL_FLAGS
- date
- . scripts/prepare_build.sh
- date
- bundle exec rake db:migrate
dependencies:
- setup-test-env
db:rollback-pg:
<<: *db-rollback
<<: *use-pg
db:rollback:
extends:
- .default-tags
- .default-retry
- .default-cache
- .default-before_script
- .use-pg
- .except-docs-qa
dependencies: ["setup-test-env"]
script:
- bundle exec rake db:migrate VERSION=20180101160629
- bundle exec rake db:migrate SKIP_SCHEMA_VERSION_CHECK=true
gitlab:setup-pg:
<<: *gitlab-setup
<<: *use-pg
dependencies:
- setup-test-env
gitlab:setup:
extends:
- .default-tags
- .default-retry
- .default-cache
- .default-before_script
- .use-pg
- .except-docs-qa
dependencies: ["setup-test-env"]
variables:
SETUP_DB: "false"
script:
# Manually clone gitlab-test and only seed this project in
# db/fixtures/development/04_project.rb thanks to SIZE=1 below
- git clone https://gitlab.com/gitlab-org/gitlab-test.git
/home/git/repositories/gitlab-org/gitlab-test.git
- scripts/gitaly-test-spawn
- force=yes SIZE=1 FIXTURE_PATH="db/fixtures/development" bundle exec rake gitlab:setup
artifacts:
when: on_failure
expire_in: 1d
paths:
- 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: .dedicated-runner-default-cache
extends:
- .default-tags
- .default-retry
- .default-cache
- .default-before_script
- .except-docs-qa
cache:
policy: pull
variables:
......@@ -269,6 +293,7 @@ coverage:
stage: post-test
script:
- bundle exec scripts/merge-simplecov
- bundle exec scripts/gather-test-memory-data
coverage: '/LOC \((\d+\.\d+%)\) covered.$/'
artifacts:
name: coverage
......@@ -276,6 +301,4 @@ coverage:
paths:
- coverage/index.html
- coverage/assets/
except:
- /(^docs[\/-].*|.*-docs$)/
- /(^qa[\/-].*|.*-qa$)/
- tmp/memory_test/
......@@ -2,25 +2,28 @@ include:
- template: Code-Quality.gitlab-ci.yml
- template: Security/SAST.gitlab-ci.yml
- template: Security/Dependency-Scanning.gitlab-ci.yml
- template: Security/DAST.gitlab-ci.yml
.reports:
extends:
- .default-retry
- .except-docs
code_quality:
extends: .dedicated-no-docs
# gitlab-org runners set `privileged: false` but we need to have it set to true
# since we're using Docker in Docker
tags: []
before_script: []
cache: {}
dependencies: []
extends: .reports
sast:
extends: .dedicated-no-docs
before_script: []
tags: []
extends: .reports
variables:
SAST_CONFIDENCE_LEVEL: 2
DOCKER_DRIVER: overlay2
SAST_BRAKEMAN_LEVEL: 2
SAST_EXCLUDED_PATHS: qa,spec,doc
dependency_scanning:
before_script: []
tags: []
extends: .dedicated-no-docs
extends: .reports
dast:
extends: .reports
stage: qa
dependencies: ["review-deploy"]
before_script:
- export DAST_WEBSITE="$(cat review_app_url.txt)"
.review-only: &review-only
only:
refs:
- branches@gitlab-org/gitlab-ce
- branches@gitlab-org/gitlab-ee
kubernetes: active
except:
refs:
- master
- /(^docs[\/-].*|.*-docs$)/
.review-schedules-only: &review-schedules-only
.review-schedules-only:
only:
refs:
- schedules@gitlab-org/gitlab-ce
......@@ -20,40 +9,41 @@
except:
refs:
- tags
- /(^docs[\/-].*|.*-docs$)/
- /(^docs[\/-].+|.+-docs$)/
.review-base: &review-base
extends: .dedicated-runner
<<: *review-only
.review-base:
extends:
- .default-tags
- .default-retry
- .review-only
image: registry.gitlab.com/gitlab-org/gitlab-build-images:gitlab-charts-build-base
cache: {}
dependencies: []
before_script:
- source scripts/utils.sh
.review-docker: &review-docker
<<: *review-base
.review-docker:
extends: .review-base
image: registry.gitlab.com/gitlab-org/gitlab-build-images:gitlab-qa-alpine
services:
- docker:stable-dind
- docker:19.03.0-dind
tags:
- gitlab-org
- docker
variables: &review-docker-variables
variables:
DOCKER_DRIVER: overlay2
DOCKER_HOST: tcp://docker:2375
LATEST_QA_IMAGE: "gitlab/${CI_PROJECT_NAME}-qa:nightly"
QA_IMAGE: "${CI_REGISTRY}/${CI_PROJECT_PATH}/gitlab/${CI_PROJECT_NAME}-qa:${CI_COMMIT_REF_SLUG}"
build-qa-image:
<<: *review-docker
extends: .review-docker
stage: test
script:
- time docker build --cache-from ${LATEST_QA_IMAGE} --tag ${QA_IMAGE} ./qa/
- time docker build --cache-from ${LATEST_QA_IMAGE} --tag ${QA_IMAGE} --file ./qa/Dockerfile ./
- echo "${CI_JOB_TOKEN}" | docker login --username gitlab-ci-token --password-stdin ${CI_REGISTRY}
- time docker push ${QA_IMAGE}
.review-build-cng-base: &review-build-cng-base
.review-build-cng-base:
image: ruby:2.6-alpine
stage: test
when: manual
......@@ -62,28 +52,29 @@ build-qa-image:
- install_api_client_dependencies_with_apk
- install_gitlab_gem
dependencies: []
cache: {}
script:
- BUILD_TRIGGER_TOKEN=$REVIEW_APPS_BUILD_TRIGGER_TOKEN ./scripts/trigger-build cng
review-build-cng:
<<: *review-only
<<: *review-build-cng-base
extends:
- .review-build-cng-base
- .review-only
schedule:review-build-cng:
<<: *review-schedules-only
<<: *review-build-cng-base
extends:
- .review-build-cng-base
- .review-schedules-only
.review-deploy-base: &review-deploy-base
<<: *review-base
review-deploy:
extends: .review-base
allow_failure: true
retry: 2
retry: 1
stage: review
variables:
HOST_SUFFIX: "${CI_ENVIRONMENT_SLUG}"
DOMAIN: "-${CI_ENVIRONMENT_SLUG}.${REVIEW_APPS_DOMAIN}"
GITLAB_HELM_CHART_REF: "master"
environment: &review-environment
environment:
name: review/${CI_COMMIT_REF_NAME}
url: https://gitlab-${CI_ENVIRONMENT_SLUG}.${REVIEW_APPS_DOMAIN}
on_stop: review-stop
......@@ -101,53 +92,52 @@ schedule:review-build-cng:
- install_tiller
- install_external_dns
- download_chart
- deploy || display_deployment_debug
- wait_for_review_app_to_be_accessible
- deploy || (display_deployment_debug && exit 1)
- add_license
artifacts:
paths: [review_app_url.txt]
expire_in: 2 days
when: always
review-deploy:
<<: *review-deploy-base
schedule:review-deploy:
<<: *review-deploy-base
<<: *review-schedules-only
extends:
- review-deploy
- .review-schedules-only
review-stop:
<<: *review-base
stage: review
extends: review-deploy
when: manual
allow_failure: true
variables:
GIT_DEPTH: "1"
environment:
<<: *review-environment
action: stop
variables:
GIT_STRATEGY: none
before_script:
# We don't clone the repo by using GIT_STRATEGY: none and only download the
# single script we need here so it's much faster than cloning.
- apk add --update openssl
- wget $CI_PROJECT_URL/raw/$CI_COMMIT_SHA/scripts/review_apps/review-apps.sh
- wget $CI_PROJECT_URL/raw/$CI_COMMIT_SHA/scripts/utils.sh
- source utils.sh
- source review-apps.sh
script:
- source scripts/review_apps/review-apps.sh
- delete
artifacts: {}
.review-qa-base: &review-qa-base
<<: *review-docker
allow_failure: true
.review-qa-base:
extends: .review-docker
retry: 2
stage: qa
variables:
<<: *review-docker-variables
QA_ARTIFACTS_DIR: "${CI_PROJECT_DIR}/qa"
QA_CAN_TEST_GIT_PROTOCOL_V2: "false"
QA_DEBUG: "true"
GITLAB_USERNAME: "root"
GITLAB_PASSWORD: "${REVIEW_APPS_ROOT_PASSWORD}"
GITLAB_ADMIN_USERNAME: "root"
GITLAB_ADMIN_PASSWORD: "${REVIEW_APPS_ROOT_PASSWORD}"
GITHUB_ACCESS_TOKEN: "${REVIEW_APPS_QA_GITHUB_ACCESS_TOKEN}"
EE_LICENSE: "${REVIEW_APPS_EE_LICENSE}"
QA_DEBUG: "true"
dependencies:
- review-deploy
dependencies: ["review-deploy"]
artifacts:
paths:
- ./qa/gitlab-qa-run-*
......@@ -162,22 +152,51 @@ review-stop:
- gem install gitlab-qa --no-document ${GITLAB_QA_VERSION:+ --version ${GITLAB_QA_VERSION}}
review-qa-smoke:
<<: *review-qa-base
extends: .review-qa-base
allow_failure: true
script:
- gitlab-qa Test::Instance::Smoke "${QA_IMAGE}" "${CI_ENVIRONMENT_URL}"
review-qa-all:
<<: *review-qa-base
extends: .review-qa-base
allow_failure: true
when: manual
parallel: 5
script:
- export KNAPSACK_REPORT_PATH=knapsack/${CI_PROJECT_NAME}/review-qa-all_master_report.json
- export KNAPSACK_TEST_FILE_PATTERN=qa/specs/features/**/*_spec.rb
- gitlab-qa Test::Instance::Any "${QA_IMAGE}" "${CI_ENVIRONMENT_URL}"
- gitlab-qa Test::Instance::Any "${QA_IMAGE}" "${CI_ENVIRONMENT_URL}" -- --format RspecJunitFormatter --out tmp/rspec-${CI_JOB_ID}.xml --format html --out tmp/rspec.htm --color --format documentation
.review-performance-base: &review-performance-base
<<: *review-qa-base
parallel-spec-reports:
extends:
- .default-tags
- .except-docs
image: ruby:2.6-alpine
stage: post-test
dependencies: ["review-qa-all"]
variables:
NEW_PARALLEL_SPECS_REPORT: qa/report-new.html
BASE_ARTIFACT_URL: "${CI_PROJECT_URL}/-/jobs/${CI_JOB_ID}/artifacts/file/qa/"
allow_failure: true
when: manual
artifacts:
when: always
paths:
- qa/report-new.html
- qa/gitlab-qa-run-*
reports:
junit: qa/gitlab-qa-run-*/**/rspec-*.xml
script:
- apk add --update build-base libxml2-dev libxslt-dev && rm -rf /var/cache/apk/*
- gem install nokogiri --no-document
- cd qa/gitlab-qa-run-*/gitlab-*
- ARTIFACT_DIRS=$(pwd |rev| awk -F / '{print $1,$2}' | rev | sed s_\ _/_)
- cd -
- '[[ -f $NEW_PARALLEL_SPECS_REPORT ]] || echo "{}" > ${NEW_PARALLEL_SPECS_REPORT}'
- scripts/merge-html-reports ${NEW_PARALLEL_SPECS_REPORT} ${BASE_ARTIFACT_URL}${ARTIFACT_DIRS} qa/gitlab-qa-run-*/**/rspec.htm
review-performance:
extends: .review-qa-base
allow_failure: true
before_script:
- export CI_ENVIRONMENT_URL="$(cat review_app_url.txt)"
......@@ -195,18 +214,16 @@ review-qa-all:
reports:
performance: performance.json
review-performance:
<<: *review-performance-base
schedule:review-performance:
<<: *review-performance-base
<<: *review-schedules-only
dependencies:
- schedule:review-deploy
extends:
- review-performance
- .review-schedules-only
dependencies: ["schedule:review-deploy"]
schedule:review-cleanup:
<<: *review-base
<<: *review-schedules-only
extends:
- .review-base
- .review-schedules-only
stage: build
allow_failure: true
environment:
......@@ -219,22 +236,25 @@ schedule:review-cleanup:
- ruby -rrubygems scripts/review_apps/automated_cleanup.rb
danger-review:
extends: .dedicated-pull-cache-job
extends:
- .default-tags
- .default-retry
- .default-cache
image: registry.gitlab.com/gitlab-org/gitlab-build-images:danger
stage: test
dependencies: []
before_script: []
only:
variables:
- $DANGER_GITLAB_API_TOKEN
except:
refs:
- master
variables:
- $CI_COMMIT_REF_NAME =~ /^ce-to-ee-.*/
- $CI_COMMIT_REF_NAME =~ /.*-stable(-ee)?-prepare-.*/
- /^\d+-\d+-auto-deploy-\d+$/
- /^[\d-]+-stable(-ee)?$/
- /^ce-to-ee-.*/
- /.*-stable(-ee)?-prepare-.*/
script:
- git version
- node --version
- yarn install --frozen-lockfile --cache-folder .yarn-cache
- yarn install --frozen-lockfile --cache-folder .yarn-cache --prefer-offline
- danger --fail-on-errors=true
# Insurance in case a gem needed by one of our releases gets yanked from
# rubygems.org in the future.
cache gems:
extends: .dedicated-no-docs-no-db-pull-cache-job
extends:
- .default-tags
- .default-retry
- .default-cache
- .default-before_script
- .except-docs
dependencies: ["setup-test-env"]
variables:
SETUP_DB: "false"
script:
- bundle package --all --all-platforms
artifacts:
paths:
- vendor/cache
only:
- master@gitlab-org/gitlab-ce
- master@gitlab-org/gitlab-ee
- tags
dependencies:
- setup-test-env
refs:
- master@gitlab-org/gitlab-ce
- master@gitlab-org/gitlab-ee
- tags
gitlab_git_test:
extends: .dedicated-runner
variables:
SETUP_DB: "false"
before_script: []
.minimal-job:
extends:
- .default-tags
- .default-retry
- .except-docs-qa
dependencies: []
cache: {}
gitlab_git_test:
extends: .minimal-job
script:
- spec/support/prepare-gitlab-git-test-for-commit --check-for-changes
except:
- /(^docs[\/-].*|.*-docs$)/
- /(^qa[\/-].*|.*-qa$)/
no_ee_check:
extends: .dedicated-runner
variables:
SETUP_DB: "false"
before_script: []
dependencies: []
cache: {}
extends: .minimal-job
script:
- scripts/no-ee-check
only:
- /.+/@gitlab-org/gitlab-ce
except:
- /(^docs[\/-].*|.*-docs$)/
- /(^qa[\/-].*|.*-qa$)/
refs:
- branches@gitlab-org/gitlab-ce
.tests-metadata-state: &tests-metadata-state
extends: .dedicated-runner
.tests-metadata-state:
variables:
TESTS_METADATA_S3_BUCKET: "gitlab-ce-cache"
before_script:
......@@ -12,7 +11,9 @@
- rspec_profiling/
retrieve-tests-metadata:
<<: *tests-metadata-state
extends:
- .tests-metadata-state
- .except-docs-qa
stage: prepare
cache:
key: tests_metadata
......@@ -25,12 +26,9 @@ retrieve-tests-metadata:
- mkdir -p rspec_profiling/
- wget -O $FLAKY_RSPEC_SUITE_REPORT_PATH http://${TESTS_METADATA_S3_BUCKET}.s3.amazonaws.com/$FLAKY_RSPEC_SUITE_REPORT_PATH || rm $FLAKY_RSPEC_SUITE_REPORT_PATH
- '[[ -f $FLAKY_RSPEC_SUITE_REPORT_PATH ]] || echo "{}" > ${FLAKY_RSPEC_SUITE_REPORT_PATH}'
except:
- /(^docs[\/-].*|.*-docs$)/
- /(^qa[\/-].*|.*-qa$)/
update-tests-metadata:
<<: *tests-metadata-state
extends: .tests-metadata-state
stage: post-test
cache:
key: tests_metadata
......@@ -40,6 +38,7 @@ update-tests-metadata:
policy: push
script:
- retry gem install fog-aws mime-types activesupport rspec_profiling postgres-copy --no-document
- echo "{}" > ${KNAPSACK_RSPEC_SUITE_REPORT_PATH}
- scripts/merge-reports ${KNAPSACK_RSPEC_SUITE_REPORT_PATH} knapsack/${CI_PROJECT_NAME}/rspec_*_pg_node_*.json
- '[[ -z ${TESTS_METADATA_S3_BUCKET} ]] || scripts/sync-reports put $TESTS_METADATA_S3_BUCKET $KNAPSACK_RSPEC_SUITE_REPORT_PATH'
- rm -f knapsack/${CI_PROJECT_NAME}/*_node_*.json
......@@ -49,29 +48,29 @@ update-tests-metadata:
- rm -f rspec_flaky/all_*.json rspec_flaky/new_*.json
- scripts/insert-rspec-profiling-data
only:
- master@gitlab-org/gitlab-ce
- master@gitlab-org/gitlab-ee
- master@gitlab/gitlabhq
- master@gitlab/gitlab-ee
refs:
- master@gitlab-org/gitlab-ce
- master@gitlab-org/gitlab-ee
- master@gitlab/gitlabhq
- master@gitlab/gitlab-ee
flaky-examples-check:
extends: .dedicated-runner
extends:
- .default-tags
- .default-retry
image: ruby:2.6-alpine
services: []
before_script: []
stage: post-test
variables:
SETUP_DB: "false"
USE_BUNDLE_INSTALL: "false"
NEW_FLAKY_SPECS_REPORT: rspec_flaky/report-new.json
stage: post-test
allow_failure: true
retry: 0
only:
- branches
refs:
- branches
except:
- master
- /(^docs[\/-].*|.*-docs$)/
- /(^qa[\/-].*|.*-qa$)/
refs:
- master
- /(^docs[\/-].+|.+-docs$)/
- /(^qa[\/-].*|.*-qa$)/
artifacts:
expire_in: 30d
paths:
......
# Yamllint of *.yml for .gitlab-ci.yml.
# This uses rules from project root `.yamllint`.
lint-ci-gitlab:
extends: .dedicated-runner
before_script: []
dependencies: []
extends:
- .default-tags
- .default-retry
image: sdesbure/yamllint:latest
dependencies: []
script:
- yamllint .gitlab-ci.yml .gitlab/ci lib/gitlab/ci/templates
- yamllint .gitlab-ci.yml .gitlab/ci lib/gitlab/ci/templates changelogs
......@@ -4,7 +4,7 @@
Note: Doc work as part of feature development is covered in the Feature Request template.
* For issues related to features of the docs.gitlab.com site, see
https://gitlab.com/gitlab-com/gitlab-docs/issues/
https://gitlab.com/gitlab-org/gitlab-docs/issues/
* For information about documentation content and process, see
https://docs.gitlab.com/ee/development/documentation/ -->
......
......@@ -39,5 +39,6 @@ If applicable, any groups/projects that are happy to have this feature turned on
- [ ] Cross post chatops slack command to `#support_gitlab-com` and in your team channel
- [ ] Announce on the issue that the flag has been enabled
- [ ] Remove feature flag and add changelog entry
- [ ] After the flag removal is deployed, [clean up the feature flag](https://docs.gitlab.com/ee/development/feature_flags/controls.html#cleaning-up) by running chatops command in `#production` channel
/label ~"feature flag"
Поддерживает Markdown
0% или .
You are about to add 0 people to the discussion. Proceed with caution.
Сначала завершите редактирование этого сообщения!
Пожалуйста, зарегистрируйтесь или чтобы прокомментировать