diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2019-10-22 11:31:16 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2019-10-22 11:31:16 +0000 |
commit | 905c1110b08f93a19661cf42a276c7ea90d0a0ff (patch) | |
tree | 756d138db422392c00471ab06acdff92c5a9b69c /.gitlab | |
parent | 50d93f8d1686950fc58dda4823c4835fd0d8c14b (diff) | |
download | gitlab-ce-905c1110b08f93a19661cf42a276c7ea90d0a0ff.tar.gz |
Add latest changes from gitlab-org/gitlab@12-4-stable-ee
Diffstat (limited to '.gitlab')
25 files changed, 512 insertions, 391 deletions
diff --git a/.gitlab/CODEOWNERS b/.gitlab/CODEOWNERS index 0f2dd081e9e..a02740373da 100644 --- a/.gitlab/CODEOWNERS +++ b/.gitlab/CODEOWNERS @@ -6,8 +6,8 @@ /doc/ @axil @marcia @eread @mikelewis # Frontend maintainers should see everything in `app/assets/` -app/assets/ @ClemMakesApps @fatihacet @filipa @mikegreiling @timzallmann @kushalpandya @pslaughter -*.scss @annabeldunstone @ClemMakesApps @fatihacet @filipa @mikegreiling @timzallmann @kushalpandya @pslaughter +app/assets/ @ClemMakesApps @fatihacet @filipa @mikegreiling @timzallmann @kushalpandya @pslaughter @wortschi @ntepluhina +*.scss @annabeldunstone @ClemMakesApps @fatihacet @filipa @mikegreiling @timzallmann @kushalpandya @pslaughter @wortschi @ntepluhina # Database maintainers should review changes in `db/` db/ @gitlab-org/maintainers/database @@ -23,6 +23,13 @@ lib/gitlab/github_import/ @gitlab-org/maintainers/database /lib/gitlab/auth/ldap/ @dblessing @mkozono /lib/gitlab/ci/templates/ @nolith @zj /lib/gitlab/ci/templates/Auto-DevOps.gitlab-ci.yml @DylanGriffith @mayra-cabrera @tkuah -/lib/gitlab/ci/templates/Security/ @plafoucriere @gonzoyumo @twoodham +/lib/gitlab/ci/templates/Security/ @plafoucriere @gonzoyumo @twoodham @sethgitlab /ee/app/models/project_alias.rb @patrickbajao /ee/lib/api/project_aliases.rb @patrickbajao + +# Engineering Productivity owned files +/.gitlab-ci.yml @gl-quality/eng-prod +/.gitlab/ci/ @gl-quality/eng-prod +Dangerfile @gl-quality/eng-prod +/danger/ @gl-quality/eng-prod +/scripts/ @gl-quality/eng-prod diff --git a/.gitlab/ci/docs.gitlab-ci.yml b/.gitlab/ci/docs.gitlab-ci.yml index 87023da3c24..14eeebb9db9 100644 --- a/.gitlab/ci/docs.gitlab-ci.yml +++ b/.gitlab/ci/docs.gitlab-ci.yml @@ -14,10 +14,10 @@ variables: GIT_STRATEGY: none environment: - name: review-docs/$CI_COMMIT_REF_SLUG + name: review-docs/$DOCS_GITLAB_REPO_SUFFIX-$CI_MERGE_REQUEST_IID # DOCS_REVIEW_APPS_DOMAIN and DOCS_GITLAB_REPO_SUFFIX are CI variables # Discussion: https://gitlab.com/gitlab-org/gitlab-foss/merge_requests/14236/diffs#note_40140693 - url: http://$CI_ENVIRONMENT_SLUG.$DOCS_REVIEW_APPS_DOMAIN/$DOCS_GITLAB_REPO_SUFFIX + url: http://docs-preview-$DOCS_GITLAB_REPO_SUFFIX-$CI_MERGE_REQUEST_IID.$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 @@ -39,7 +39,7 @@ review-docs-deploy: review-docs-cleanup: extends: .review-docs environment: - name: review-docs/$CI_COMMIT_REF_SLUG + name: review-docs/$DOCS_GITLAB_REPO_SUFFIX-$CI_MERGE_REQUEST_IID action: stop script: - ./trigger-build-docs cleanup @@ -67,3 +67,19 @@ docs lint: - bundle exec nanoc check internal_links # Check the internal anchor links - bundle exec nanoc check internal_anchors + +graphql-docs-verify: + extends: + - .only-ee + - .default-tags + - .default-retry + - .default-cache + - .default-only + - .default-before_script + - .only-graphql-changes + variables: + SETUP_DB: "false" + stage: test + needs: ["setup-test-env"] + script: + - bundle exec rake gitlab:graphql:check_docs diff --git a/.gitlab/ci/frontend.gitlab-ci.yml b/.gitlab/ci/frontend.gitlab-ci.yml index 2f53c6e3fcf..2f457bc0ee2 100644 --- a/.gitlab/ci/frontend.gitlab-ci.yml +++ b/.gitlab/ci/frontend.gitlab-ci.yml @@ -13,7 +13,7 @@ - .default-before_script - .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 + image: registry.gitlab.com/gitlab-org/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"] needs: ["setup-test-env"] @@ -47,13 +47,13 @@ - rm -f /etc/apt/sources.list.d/google*.list # We don't need to update Chrome here only: variables: - - $CI_SERVER_HOST == "gitlab.com" && $CI_PROJECT_NAMESPACE == "gitlab-org" + - $CI_SERVER_HOST == "gitlab.com" && $CI_PROJECT_NAMESPACE =~ /^gitlab-org($|\/)/ # Matches the gitlab-org group and its subgroups - $CI_SERVER_HOST == "dev.gitlab.org" tags: - gitlab-org - docker -gitlab:assets:compile: +gitlab:assets:compile pull-push-cache: extends: .gitlab:assets:compile-metadata only: refs: @@ -63,9 +63,6 @@ gitlab:assets:compile: gitlab:assets:compile pull-cache: extends: .gitlab:assets:compile-metadata - except: - refs: - - master cache: policy: pull @@ -77,7 +74,7 @@ gitlab:assets:compile pull-cache: - .default-before_script - .assets-compile-cache - .only-code-qa-changes - - .use-pg + - .use-pg9 stage: prepare script: - node --version @@ -89,14 +86,14 @@ gitlab:assets:compile pull-cache: # 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" + key: "assets-compile:v7" artifacts: expire_in: 7d paths: - node_modules - public/assets -compile-assets: +compile-assets pull-push-cache: extends: .compile-assets-metadata only: refs: @@ -104,13 +101,25 @@ compile-assets: cache: policy: pull-push -compile-assets pull-cache: - extends: .compile-assets-metadata - except: +compile-assets pull-push-cache foss: + extends: [".compile-assets-metadata", ".only-ee-as-if-foss"] + only: refs: - master cache: + policy: pull-push + key: "assets-compile:v7:foss" + +compile-assets pull-cache: + extends: .compile-assets-metadata + cache: + policy: pull + +compile-assets pull-cache foss: + extends: [".compile-assets-metadata", ".only-ee-as-if-foss"] + cache: policy: pull + key: "assets-compile:v7:foss" .only-code-frontend-job-base: extends: @@ -120,10 +129,12 @@ compile-assets pull-cache: - .default-only - .default-before_script - .only-code-changes - - .use-pg - dependencies: ["compile-assets", "compile-assets pull-cache", "setup-test-env"] + - .use-pg9 + stage: test + needs: ["setup-test-env", "compile-assets pull-cache"] + dependencies: ["setup-test-env", "compile-assets pull-cache"] -karma: +.karma-base: extends: .only-code-frontend-job-base variables: # we override the max_old_space_size to prevent OOM errors @@ -134,6 +145,9 @@ karma: - scripts/gitaly-test-spawn - date - bundle exec rake karma + +karma: + extends: .karma-base coverage: '/^Statements *: (\d+\.\d+%)/' artifacts: name: coverage-javascript @@ -146,7 +160,12 @@ karma: reports: junit: junit_karma.xml -jest: +karma-foss: + extends: + - .karma-base + - .only-ee-as-if-foss + +.jest-base: extends: .only-code-frontend-job-base script: - scripts/gitaly-test-spawn @@ -154,6 +173,14 @@ jest: - bundle exec rake frontend:fixtures - date - yarn jest --ci --coverage + cache: + key: jest + paths: + - tmp/jest/jest/ + policy: pull-push + +jest: + extends: .jest-base artifacts: name: coverage-frontend expire_in: 31d @@ -164,34 +191,13 @@ jest: - tmp/tests/frontend/ reports: junit: junit_jest.xml - cache: - key: jest - paths: - - tmp/jest/jest/ - policy: pull-push -.qa-job-base: +jest-foss: extends: - - .default-tags - - .default-retry - - .default-cache - - .default-only - - .only-code-qa-changes - dependencies: [] - stage: test - before_script: - - cd qa/ - - bundle install - -qa:internal: - extends: .qa-job-base - script: - - bundle exec rspec - -qa:selectors: - extends: .qa-job-base - script: - - bundle exec bin/qa Test::Sanity::Selectors + - .jest-base + - .only-ee-as-if-foss + cache: + policy: pull .qa-frontend-node: extends: @@ -200,6 +206,7 @@ qa:selectors: - .default-cache - .default-only - .only-code-changes + stage: test dependencies: [] cache: key: "$CI_JOB_NAME" @@ -232,7 +239,9 @@ webpack-dev-server: - .default-cache - .default-only - .only-code-changes - dependencies: ["setup-test-env", "compile-assets", "compile-assets pull-cache"] + stage: test + needs: ["setup-test-env", "compile-assets pull-cache"] + dependencies: ["setup-test-env", "compile-assets pull-cache"] variables: WEBPACK_MEMORY_TEST: "true" script: diff --git a/.gitlab/ci/global.gitlab-ci.yml b/.gitlab/ci/global.gitlab-ci.yml index 94d7d2cdaa4..fc9b00b5d3c 100644 --- a/.gitlab/ci/global.gitlab-ci.yml +++ b/.gitlab/ci/global.gitlab-ci.yml @@ -13,6 +13,8 @@ .default-before_script: before_script: - date + - export GOPATH=$CI_PROJECT_DIR/.go + - mkdir -p $GOPATH - source scripts/utils.sh - source scripts/prepare_build.sh - date @@ -22,6 +24,7 @@ cache: key: "debian-stretch-ruby-2.6.3-node-12.x" paths: + - .go/pkg/mod - vendor/ruby - .yarn-cache/ - vendor/gitaly-ruby @@ -33,6 +36,7 @@ - master - /^[\d-]+-stable(-ee)?$/ - /^\d+-\d+-auto-deploy-\d+$/ + - /^security\// - merge_requests - tags @@ -51,7 +55,7 @@ - "{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}/**/*" + - "{app,bin,config,danger,db,ee,fixtures,haml_lint,lib,locale,public,rubocop,scripts,spec,symbol,vendor}/**/*" - "doc/README.md" # Some RSpec test rely on this file .only-qa-changes: @@ -67,6 +71,12 @@ - "doc/**/*" - ".markdownlint.json" +.only-graphql-changes: + only: + changes: + - "{,ee/}app/graphql/**/*" + - "{,ee/}lib/gitlab/graphql/**/*" + .only-code-qa-changes: only: changes: @@ -82,7 +92,7 @@ - "{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}/**/*" + - "{app,bin,config,danger,db,ee,fixtures,haml_lint,lib,locale,public,rubocop,scripts,spec,symbol,vendor}/**/*" - "doc/README.md" # Some RSpec test rely on this file - ".dockerignore" - "qa/**/*" @@ -96,30 +106,57 @@ refs: - master - /^\d+-\d+-auto-deploy-\d+$/ + - /^[\d-]+-stable(-ee)?$/ .only-review-schedules: only: refs: - schedules variables: - - $REVIEW_APP_CLEANUP && $CI_SERVER_HOST == "gitlab.com" && $CI_PROJECT_NAMESPACE == "gitlab-org" + - $CI_SERVER_HOST == "gitlab.com" && $CI_PROJECT_NAMESPACE == "gitlab-org" kubernetes: active -.use-pg: +.only-canonical-schedules: + only: + refs: + - schedules@gitlab-org/gitlab + - schedules@gitlab-org/gitlab-foss + +.use-pg9: + services: + - name: postgres:9.6 + command: ["postgres", "-c", "fsync=off", "-c", "synchronous_commit=off", "-c", "full_page_writes=off"] + - name: redis:alpine + +.use-pg10: + image: "registry.gitlab.com/gitlab-org/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:9.6.14 + - name: postgres:10.9 command: ["postgres", "-c", "fsync=off", "-c", "synchronous_commit=off", "-c", "full_page_writes=off"] - name: redis:alpine -.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" +.use-pg9-ee: + services: + - name: postgres:9.6 + command: ["postgres", "-c", "fsync=off", "-c", "synchronous_commit=off", "-c", "full_page_writes=off"] + - name: redis:alpine + - name: docker.elastic.co/elasticsearch/elasticsearch:5.6.12 + +.use-pg10-ee: + image: "registry.gitlab.com/gitlab-org/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 + - name: docker.elastic.co/elasticsearch/elasticsearch:5.6.12 .only-ee: only: variables: - - $CI_PROJECT_NAME == "gitlab-ee" - - $CI_PROJECT_NAME == "gitlab" # New name of gitlab-ee after the single codebase migration + - $CI_PROJECT_NAME == "gitlab" + - $CI_PROJECT_NAME == "gitlab-ee" # Support former project name for forks/mirrors + +.only-ee-as-if-foss: + extends: .only-ee + variables: + FOSS_ONLY: '1' diff --git a/.gitlab/ci/memory.gitlab-ci.yml b/.gitlab/ci/memory.gitlab-ci.yml index d990c7eefa2..93bf87b24b2 100644 --- a/.gitlab/ci/memory.gitlab-ci.yml +++ b/.gitlab/ci/memory.gitlab-ci.yml @@ -36,7 +36,7 @@ memory-static: memory-on-boot: extends: - .only-code-memory-job-base - - .use-pg-10 + - .use-pg10 variables: NODE_ENV: "production" RAILS_ENV: "production" diff --git a/.gitlab/ci/notifications.gitlab-ci.yml b/.gitlab/ci/notifications.gitlab-ci.yml new file mode 100644 index 00000000000..8e00ba022d0 --- /dev/null +++ b/.gitlab/ci/notifications.gitlab-ci.yml @@ -0,0 +1,29 @@ +.notify: + image: alpine + stage: notification + dependencies: [] + cache: {} + before_script: + - apk update && apk add git curl bash + +schedule:package-and-qa:notify-success: + extends: + - .only-canonical-schedules + - .notify + variables: + COMMIT_NOTES_URL: "https://$CI_SERVER_HOST/$CI_PROJECT_PATH/commit/$CI_COMMIT_SHA#notes-list" + script: + - 'scripts/notify-slack qa-master ":tada: Scheduled QA against master passed! :tada: See $CI_PIPELINE_URL. For downstream pipelines, see $COMMIT_NOTES_URL" ci_passing' + needs: ["schedule:package-and-qa"] + when: on_success + +schedule:package-and-qa:notify-failure: + extends: + - .only-canonical-schedules + - .notify + variables: + COMMIT_NOTES_URL: "https://$CI_SERVER_HOST/$CI_PROJECT_PATH/commit/$CI_COMMIT_SHA#notes-list" + script: + - 'scripts/notify-slack qa-master ":skull_and_crossbones: Scheduled QA against master failed! :skull_and_crossbones: See $CI_PIPELINE_URL. For downstream pipelines, see $COMMIT_NOTES_URL" ci_failing' + needs: ["schedule:package-and-qa"] + when: on_failure diff --git a/.gitlab/ci/pages.gitlab-ci.yml b/.gitlab/ci/pages.gitlab-ci.yml index a59b84fe1cf..a30772d5664 100644 --- a/.gitlab/ci/pages.gitlab-ci.yml +++ b/.gitlab/ci/pages.gitlab-ci.yml @@ -11,7 +11,7 @@ pages: variables: - $CI_SERVER_HOST == "gitlab.com" && $CI_PROJECT_NAMESPACE == "gitlab-org" stage: pages - dependencies: ["coverage", "karma", "gitlab:assets:compile"] + dependencies: ["coverage", "karma", "gitlab:assets:compile pull-cache"] script: - mv public/ .public/ - mkdir public/ diff --git a/.gitlab/ci/qa.gitlab-ci.yml b/.gitlab/ci/qa.gitlab-ci.yml index 013af3d61a4..1194948a76f 100644 --- a/.gitlab/ci/qa.gitlab-ci.yml +++ b/.gitlab/ci/qa.gitlab-ci.yml @@ -1,10 +1,40 @@ +.qa-job-base: + extends: + - .default-tags + - .default-retry + - .default-only + - .only-code-qa-changes + stage: test + dependencies: [] + cache: + key: "qa-framework-jobs:v1" + paths: + - vendor/ruby + before_script: + - cd qa/ + - bundle install --clean --jobs=$(nproc) --path=vendor --retry=3 --quiet + - bundle check + +qa:internal: + extends: .qa-job-base + script: + - bundle exec rspec + +qa:selectors: + extends: .qa-job-base + script: + - bundle exec bin/qa Test::Sanity::Selectors + +qa:selectors-foss: + extends: + - qa:selectors + - .only-ee-as-if-foss + .package-and-qa-base: extends: .default-only image: ruby:2.6-alpine stage: qa dependencies: [] - variables: - GIT_DEPTH: "1" retry: 0 script: - source scripts/utils.sh @@ -12,7 +42,7 @@ - ./scripts/trigger-build omnibus only: variables: - - $CI_SERVER_HOST == "gitlab.com" && $CI_PROJECT_NAMESPACE == "gitlab-org" + - $CI_SERVER_HOST == "gitlab.com" && $CI_PROJECT_NAMESPACE =~ /^gitlab-org($|\/)/ # Matches the gitlab-org group or its subgroups package-and-qa-manual: extends: @@ -21,20 +51,10 @@ package-and-qa-manual: except: refs: - master + - /^\d+-\d+-auto-deploy-\d+$/ when: manual needs: ["build-qa-image", "gitlab:assets:compile pull-cache"] -package-and-qa-manual:master: - extends: - - .package-and-qa-base - - .only-code-qa-changes - only: - refs: - - master@gitlab-org/gitlab-foss - - master@gitlab-org/gitlab - when: manual - needs: ["build-qa-image", "gitlab:assets:compile"] - package-and-qa: extends: - .package-and-qa-base @@ -42,5 +62,13 @@ package-and-qa: except: refs: - master + - /^\d+-\d+-auto-deploy-\d+$/ needs: ["build-qa-image", "gitlab:assets:compile pull-cache"] allow_failure: true + +schedule:package-and-qa: + extends: + - .package-and-qa-base + - .only-code-qa-changes + - .only-canonical-schedules + needs: ["build-qa-image", "gitlab:assets:compile pull-cache"] diff --git a/.gitlab/ci/rails.gitlab-ci.yml b/.gitlab/ci/rails.gitlab-ci.yml index 04e81051031..bf478b68765 100644 --- a/.gitlab/ci/rails.gitlab-ci.yml +++ b/.gitlab/ci/rails.gitlab-ci.yml @@ -33,31 +33,31 @@ - .default-before_script - .only-code-qa-changes +setup-test-env: + extends: + - .only-code-qa-rails-job-base + - .use-pg9 + stage: prepare + script: + - bundle exec ruby -Ispec -e 'require "spec_helper" ; TestEnv.init' + - scripts/gitaly-test-build # Do not use 'bundle exec' here + artifacts: + expire_in: 7d + paths: + - tmp/tests + - config/secrets.yml + - vendor/gitaly-ruby + cache: + policy: pull-push + .rspec-base: extends: .only-code-rails-job-base stage: test + needs: ["setup-test-env", "retrieve-tests-metadata", "compile-assets pull-cache"] + dependencies: ["setup-test-env", "retrieve-tests-metadata", "compile-assets pull-cache"] script: - - JOB_NAME=( $CI_JOB_NAME ) - - TEST_TOOL=${JOB_NAME[0]} - - TEST_LEVEL=${JOB_NAME[1]} - - DATABASE=${JOB_NAME[2]} - - export KNAPSACK_REPORT_PATH=knapsack/${CI_PROJECT_NAME}/${TEST_TOOL}_${TEST_LEVEL}_${DATABASE}_node_${CI_NODE_INDEX}_${CI_NODE_TOTAL}_report.json - - export KNAPSACK_GENERATE_REPORT=true KNAPSACK_LOG_LEVEL=debug KNAPSACK_TEST_DIR=spec - - export SUITE_FLAKY_RSPEC_REPORT_PATH=${FLAKY_RSPEC_SUITE_REPORT_PATH} - - export FLAKY_RSPEC_REPORT_PATH=rspec_flaky/all_${TEST_TOOL}_${CI_NODE_INDEX}_${CI_NODE_TOTAL}_report.json - - export NEW_FLAKY_RSPEC_REPORT_PATH=rspec_flaky/new_${TEST_TOOL}_${CI_NODE_INDEX}_${CI_NODE_TOTAL}_report.json - - export FLAKY_RSPEC_GENERATE_REPORT=true - - export CACHE_CLASSES=true - - cp ${KNAPSACK_RSPEC_SUITE_REPORT_PATH} ${KNAPSACK_REPORT_PATH} - - '[[ -f $FLAKY_RSPEC_REPORT_PATH ]] || echo "{}" > ${FLAKY_RSPEC_REPORT_PATH}' - - '[[ -f $NEW_FLAKY_RSPEC_REPORT_PATH ]] || echo "{}" > ${NEW_FLAKY_RSPEC_REPORT_PATH}' - - 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 + - source scripts/rspec_helpers.sh + - rspec_paralellized_job "--tag ~quarantine --tag ~geo" artifacts: expire_in: 31d when: always @@ -71,79 +71,172 @@ reports: junit: junit_rspec.xml -.rspec-base-pg: +.rspec-base-foss: + extends: [".rspec-base", ".only-ee-as-if-foss"] + needs: ["setup-test-env", "retrieve-tests-metadata", "compile-assets pull-cache foss"] + dependencies: ["setup-test-env", "retrieve-tests-metadata", "compile-assets pull-cache foss"] + +.rspec-base-pg9: extends: - .rspec-base - - .use-pg + - .use-pg9 -.rspec-base-pg-10: +.rspec-base-pg9-foss: extends: - - .rspec-base - - .use-pg-10 + - .rspec-base-foss + - .use-pg9 -setup-test-env: +.rspec-base-pg10: extends: - - .only-code-qa-rails-job-base - - .use-pg - stage: prepare - script: - - bundle exec ruby -Ispec -e 'require "spec_helper" ; TestEnv.init' - - scripts/gitaly-test-build # Do not use 'bundle exec' here - artifacts: - expire_in: 7d - paths: - - tmp/tests - - config/secrets.yml - - vendor/gitaly-ruby + - .rspec-base + - .use-pg10 + - .only-master + +rspec unit pg9: + extends: .rspec-base-pg9 + parallel: 20 -rspec unit pg: - extends: .rspec-base-pg +rspec unit pg9-foss: + extends: .rspec-base-pg9-foss parallel: 20 -rspec integration pg: - extends: .rspec-base-pg +rspec integration pg9: + extends: .rspec-base-pg9 + parallel: 6 + +rspec integration pg9-foss: + extends: .rspec-base-pg9-foss parallel: 6 -rspec system pg: - extends: .rspec-base-pg +rspec system pg9: + extends: .rspec-base-pg9 parallel: 24 -rspec unit pg-10: +rspec system pg9-foss: + extends: .rspec-base-pg9-foss + parallel: 24 + +rspec unit pg10: + extends: .rspec-base-pg10 + parallel: 20 + +rspec integration pg10: + extends: .rspec-base-pg10 + parallel: 6 + +rspec system pg10: + extends: .rspec-base-pg10 + parallel: 24 + +.rspec-ee-base-pg9: + extends: + - .rspec-base + - .only-ee + - .use-pg9-ee + +.rspec-ee-base-pg10: extends: - - .rspec-base-pg-10 + - .rspec-base + - .only-ee + - .use-pg10-ee + +rspec-ee unit pg9: + extends: .rspec-ee-base-pg9 + parallel: 7 + +rspec-ee integration pg9: + extends: .rspec-ee-base-pg9 + parallel: 3 + +rspec-ee system pg9: + extends: .rspec-ee-base-pg9 + parallel: 5 + +rspec-ee unit pg10: + extends: + - .rspec-ee-base-pg10 - .only-master - parallel: 20 + parallel: 7 -rspec integration pg-10: +rspec-ee integration pg10: extends: - - .rspec-base-pg-10 + - .rspec-ee-base-pg10 - .only-master - parallel: 6 + parallel: 3 -rspec system pg-10: +rspec-ee system pg10: extends: - - .rspec-base-pg-10 + - .rspec-ee-base-pg10 - .only-master - parallel: 24 + parallel: 5 -rspec-fast-spec-helper: - extends: .rspec-base-pg +.rspec-ee-base-geo: + extends: + - .rspec-base + - .only-ee script: - - bundle exec rspec spec/fast_spec_helper.rb + - source scripts/rspec_helpers.sh + - scripts/prepare_postgres_fdw.sh + - rspec_paralellized_job "--tag ~quarantine --tag geo" + +.rspec-ee-base-geo-pg9: + extends: + - .rspec-ee-base-geo + - .use-pg9-ee -rspec quarantine pg: +.rspec-ee-base-geo-pg10: extends: - - .rspec-base-pg + - .rspec-ee-base-geo + - .use-pg10-ee + +rspec-ee unit pg9 geo: + extends: .rspec-ee-base-geo-pg9 + parallel: 2 + +rspec-ee integration pg9 geo: + extends: .rspec-ee-base-geo-pg9 + +rspec-ee system pg9 geo: + extends: .rspec-ee-base-geo-pg9 + +rspec-ee unit pg10 geo: + extends: .rspec-ee-base-geo-pg10 + parallel: 2 + +rspec-ee integration pg10 geo: + extends: .rspec-ee-base-geo-pg10 + +rspec-ee system pg10 geo: + extends: .rspec-ee-base-geo-pg10 + +rspec quarantine pg9: + extends: + - .rspec-base-pg9 - .only-master + variables: + RSPEC_OPTS: "--tag quarantine -- spec/" script: - - export NO_KNAPSACK=1 CACHE_CLASSES=true - - scripts/gitaly-test-spawn - - bin/rspec --color --format documentation --tag quarantine -- spec/ + - source scripts/rspec_helpers.sh + - rspec_simple_job "${RSPEC_OPTS}" allow_failure: true +rspec-ee quarantine pg9: + extends: + - rspec quarantine pg9 + - .only-ee + variables: + RSPEC_OPTS: "--tag quarantine -- ee/spec/" + +rspec fast_spec_helper: + extends: .rspec-base-pg9 + script: + - bin/rspec spec/fast_spec_helper.rb + static-analysis: extends: .only-code-qa-rails-job-base - dependencies: ["setup-test-env", "compile-assets", "compile-assets pull-cache"] + stage: test + needs: ["setup-test-env", "compile-assets pull-cache"] + dependencies: ["setup-test-env", "compile-assets pull-cache"] variables: SETUP_DB: "false" script: @@ -166,16 +259,16 @@ downtime_check: variables: - $CI_COMMIT_REF_NAME =~ /^[\d-]+-stable(-ee)?$/ stage: test - dependencies: ["setup-test-env"] needs: ["setup-test-env"] + dependencies: ["setup-test-env"] .db-job-base: extends: - .only-code-rails-job-base - - .use-pg + - .use-pg9 stage: test - dependencies: ["setup-test-env"] needs: ["setup-test-env"] + dependencies: ["setup-test-env"] # DB migration, rollback, and seed jobs db:migrate:reset: @@ -256,108 +349,6 @@ coverage: - coverage/assets/ - tmp/memory_test/ -## EE-specific content -.rspec-base-ee: - extends: - - .rspec-base - - .only-ee - script: - - JOB_NAME=( $CI_JOB_NAME ) - - TEST_TOOL=${JOB_NAME[0]} - - TEST_LEVEL=${JOB_NAME[1]} - - DATABASE=${JOB_NAME[2]} - - export KNAPSACK_REPORT_PATH=knapsack/${CI_PROJECT_NAME}/${TEST_TOOL}_${TEST_LEVEL}_${DATABASE}_ee_node_${CI_NODE_INDEX}_${CI_NODE_TOTAL}_report.json - - export KNAPSACK_GENERATE_REPORT=true KNAPSACK_LOG_LEVEL=debug KNAPSACK_TEST_DIR=spec - - export CACHE_CLASSES=true - - cp ${EE_KNAPSACK_RSPEC_SUITE_REPORT_PATH} ${KNAPSACK_REPORT_PATH} - - scripts/gitaly-test-spawn - - date - - 'export KNAPSACK_TEST_FILE_PATTERN=$(ruby -r./lib/quality/test_level.rb -e "puts Quality::TestLevel.new(%(ee/)).pattern(:${TEST_LEVEL})")' - - mkdir -p tmp/memory_test - - export MEMORY_TEST_PATH="tmp/memory_test/ee_${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 - -.rspec-base-pg-ee: - extends: .rspec-base-ee - services: - - name: postgres:9.6 - command: ["postgres", "-c", "fsync=off", "-c", "synchronous_commit=off", "-c", "full_page_writes=off"] - - name: redis:alpine - - name: docker.elastic.co/elasticsearch/elasticsearch:5.6.12 - -rspec unit pg ee: - extends: .rspec-base-pg-ee - parallel: 7 - -rspec integration pg ee: - extends: .rspec-base-pg-ee - parallel: 3 - -rspec system pg ee: - extends: .rspec-base-pg-ee - parallel: 5 - -.rspec-base-geo: - extends: .rspec-base-ee - parallel: 3 - script: - - JOB_NAME=( $CI_JOB_NAME ) - - TEST_TOOL=${JOB_NAME[0]} - - TEST_LEVEL=${JOB_NAME[1]} - - DATABASE=${JOB_NAME[2]} - - export KNAPSACK_TEST_FILE_PATTERN="ee/spec/**{,/*/**}/*_spec.rb" KNAPSACK_GENERATE_REPORT=true CACHE_CLASSES=true - - export KNAPSACK_REPORT_PATH=knapsack/${CI_PROJECT_NAME}/${TEST_TOOL}_node_${CI_NODE_INDEX}_${CI_NODE_TOTAL}_report.json - - cp ${EE_KNAPSACK_RSPEC_SUITE_REPORT_PATH} ${KNAPSACK_REPORT_PATH} - - source scripts/prepare_postgres_fdw.sh - - scripts/gitaly-test-spawn - - mkdir -p tmp/memory_test - - export MEMORY_TEST_PATH="tmp/memory_test/ee_${TEST_TOOL}_${TEST_LEVEL}_${DATABASE}_node_${CI_NODE_INDEX}_${CI_NODE_TOTAL}_memory.csv" - - knapsack rspec "-Ispec --color --format documentation --format RspecJunitFormatter --out junit_rspec.xml --tag geo" - -rspec geo pg ee: - extends: - - .rspec-base-geo - - .use-pg - except: - variables: - - $CI_COMMIT_REF_NAME =~ /(^geo[\/-].*|.*-geo$)/ - -rspec geo pg-10 ee: - extends: - - .rspec-base-geo - - .use-pg-10 - except: - variables: - - $CI_COMMIT_REF_NAME =~ /(^geo[\/-].*|.*-geo$)/ - -quick-rspec geo pg ee: - extends: - - .rspec-base-geo - - .use-pg - stage: quick-test - only: - variables: - - $CI_COMMIT_REF_NAME =~ /(^geo[\/-].*|.*-geo$)/ - -quick-rspec geo pg-10 ee: - extends: - - .rspec-base-geo - - .use-pg-10 - stage: quick-test - only: - variables: - - $CI_COMMIT_REF_NAME =~ /(^geo[\/-].*|.*-geo$)/ - -rspec quarantine pg ee: - extends: - - rspec quarantine pg - - .only-ee - script: - - export NO_KNAPSACK=1 CACHE_CLASSES=true - - scripts/gitaly-test-spawn - - bin/rspec --color --format documentation --format RspecJunitFormatter --out junit_rspec.xml --tag quarantine -- ee/spec/ - db:rollback geo: extends: - db:rollback @@ -365,5 +356,3 @@ db:rollback geo: script: - bundle exec rake geo:db:migrate VERSION=20170627195211 - bundle exec rake geo:db:migrate - -## END of EE-specific content diff --git a/.gitlab/ci/reports.gitlab-ci.yml b/.gitlab/ci/reports.gitlab-ci.yml index 38da73034d5..16c3f0e4f8c 100644 --- a/.gitlab/ci/reports.gitlab-ci.yml +++ b/.gitlab/ci/reports.gitlab-ci.yml @@ -44,6 +44,8 @@ code_quality: # We need to duplicate this job's definition because it seems it's impossible to # override an included `only.refs`. # See https://gitlab.com/gitlab-org/gitlab/issues/31371. +# Once https://gitlab.com/gitlab-org/gitlab/merge_requests/16487 will be deployed +# to GitLab.com, we should be able to use the template and set SAST_DISABLE_DIND: "true". sast: extends: - .default-retry @@ -196,6 +198,7 @@ dast: - .only-code-qa-changes - .only-review stage: qa + needs: ["review-deploy"] dependencies: ["review-deploy"] before_script: - export DAST_WEBSITE="$(cat review_app_url.txt)" diff --git a/.gitlab/ci/review.gitlab-ci.yml b/.gitlab/ci/review.gitlab-ci.yml index c7b79dac9dd..e041c6a8a5d 100644 --- a/.gitlab/ci/review.gitlab-ci.yml +++ b/.gitlab/ci/review.gitlab-ci.yml @@ -1,20 +1,14 @@ -.review-base: - extends: - - .default-tags - - .default-retry - - .default-only - - .only-review - - .only-code-qa-changes - image: registry.gitlab.com/gitlab-org/gitlab-build-images:gitlab-charts-build-base - dependencies: [] - before_script: - - source scripts/utils.sh +.except-deploys: + except: + refs: + - /^\d+-\d+-auto-deploy-\d+$/ .review-docker: extends: - .default-tags - .default-retry - .default-only + - .except-deploys image: registry.gitlab.com/gitlab-org/gitlab-build-images:gitlab-qa-alpine services: - docker:19.03.0-dind @@ -41,10 +35,31 @@ build-qa-image: - echo "${CI_JOB_TOKEN}" | docker login --username gitlab-ci-token --password-stdin ${CI_REGISTRY} - time docker push ${QA_IMAGE} +schedule:review-cleanup: + extends: + - .default-tags + - .default-retry + - .default-only + - .only-code-qa-changes + - .only-review-schedules + - .except-deploys + stage: prepare + image: registry.gitlab.com/gitlab-org/gitlab-build-images:gitlab-charts-build-base + allow_failure: true + environment: + name: review/auto-cleanup + action: stop + before_script: + - source scripts/utils.sh + - install_gitlab_gem + script: + - ruby -rrubygems scripts/review_apps/automated_cleanup.rb + .review-build-cng-base: extends: - .default-only - .only-code-qa-changes + - .except-deploys image: ruby:2.6-alpine stage: review-prepare before_script: @@ -65,16 +80,23 @@ schedule:review-build-cng: extends: - .review-build-cng-base - .only-review-schedules - needs: ["gitlab:assets:compile"] + needs: ["gitlab:assets:compile pull-cache"] .review-deploy-base: - extends: .review-base - allow_failure: true + extends: + - .default-tags + - .default-retry + - .default-only + - .only-code-qa-changes + - .except-deploys stage: review + image: registry.gitlab.com/gitlab-org/gitlab-build-images:gitlab-charts-build-base + dependencies: [] + allow_failure: true variables: HOST_SUFFIX: "${CI_ENVIRONMENT_SLUG}" DOMAIN: "-${CI_ENVIRONMENT_SLUG}.${REVIEW_APPS_DOMAIN}" - GITLAB_HELM_CHART_REF: "master" + GITLAB_HELM_CHART_REF: "v2.3.7" GITLAB_EDITION: "ce" environment: name: review/${CI_COMMIT_REF_NAME} @@ -90,13 +112,21 @@ schedule:review-build-cng: - install_api_client_dependencies_with_apk - source scripts/review_apps/review-apps.sh script: + - date - check_kube_domain + - date - ensure_namespace + - date - install_tiller + - date - install_external_dns + - date - download_chart + - date - deploy || (display_deployment_debug && exit 1) + - date - add_license + - date artifacts: paths: [review_app_url.txt] expire_in: 2 days @@ -105,6 +135,7 @@ schedule:review-build-cng: review-deploy: extends: - .review-deploy-base + - .only-review needs: ["review-build-cng"] schedule:review-deploy: @@ -148,6 +179,7 @@ review-cleanup-failed-deployment: - .only-review - .only-code-qa-changes stage: qa + allow_failure: true variables: QA_ARTIFACTS_DIR: "${CI_PROJECT_DIR}/qa" QA_CAN_TEST_GIT_PROTOCOL_V2: "false" @@ -158,6 +190,7 @@ review-cleanup-failed-deployment: GITLAB_ADMIN_PASSWORD: "${REVIEW_APPS_ROOT_PASSWORD}" GITHUB_ACCESS_TOKEN: "${REVIEW_APPS_QA_GITHUB_ACCESS_TOKEN}" EE_LICENSE: "${REVIEW_APPS_EE_LICENSE}" + needs: ["review-deploy"] dependencies: ["review-deploy"] artifacts: paths: @@ -176,53 +209,46 @@ review-cleanup-failed-deployment: review-qa-smoke: extends: .review-qa-base - allow_failure: true script: - gitlab-qa Test::Instance::Smoke "${QA_IMAGE}" "${CI_ENVIRONMENT_URL}" review-qa-all: 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_REPORT_PATH=knapsack/master_report.json - export KNAPSACK_TEST_FILE_PATTERN=qa/specs/features/**/*_spec.rb - 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 -parallel-spec-reports: +.review-performance-base: extends: - - .default-tags - - .default-only + - .review-docker - .only-code-qa-changes - - .only-review - 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/" + stage: qa allow_failure: true - when: manual + before_script: + - export CI_ENVIRONMENT_URL="$(cat review_app_url.txt)" + - echo "${CI_ENVIRONMENT_URL}" + - mkdir -p gitlab-exporter + - wget -O ./gitlab-exporter/index.js https://gitlab.com/gitlab-org/gl-performance/raw/master/index.js + - mkdir -p sitespeed-results + script: + - docker run --shm-size=1g --rm -v "$(pwd)":/sitespeed.io sitespeedio/sitespeed.io:6.3.1 --plugins.add ./gitlab-exporter --outputFolder sitespeed-results "${CI_ENVIRONMENT_URL}" + after_script: + - mv sitespeed-results/data/performance.json performance.json artifacts: - when: always paths: - - qa/report-new.html - - qa/gitlab-qa-run-* + - sitespeed-results/ 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 + performance: performance.json review-performance: - extends: .review-qa-base - allow_failure: true + extends: + - .review-performance-base + - .only-review + needs: ["review-deploy"] + dependencies: ["review-deploy"] before_script: - export CI_ENVIRONMENT_URL="$(cat review_app_url.txt)" - echo "${CI_ENVIRONMENT_URL}" @@ -241,24 +267,41 @@ review-performance: schedule:review-performance: extends: - - review-performance + - .review-performance-base - .only-review-schedules + needs: ["schedule:review-deploy"] dependencies: ["schedule:review-deploy"] -schedule:review-cleanup: +parallel-spec-reports: extends: - - .review-base - - .only-review-schedules - stage: prepare + - .default-tags + - .default-only + - .only-code-qa-changes + - .only-review + - .except-deploys + 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 - environment: - name: review/auto-cleanup - action: stop - before_script: - - source scripts/utils.sh - - install_gitlab_gem + when: manual + artifacts: + when: always + paths: + - qa/report-new.html + - qa/gitlab-qa-run-* + reports: + junit: qa/gitlab-qa-run-*/**/rspec-*.xml script: - - ruby -rrubygems scripts/review_apps/automated_cleanup.rb + - 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 danger-review: extends: diff --git a/.gitlab/ci/setup.gitlab-ci.yml b/.gitlab/ci/setup.gitlab-ci.yml index 129913a9f2d..861f3f1af5b 100644 --- a/.gitlab/ci/setup.gitlab-ci.yml +++ b/.gitlab/ci/setup.gitlab-ci.yml @@ -43,5 +43,6 @@ no_ee_check: - scripts/no-ee-check only: variables: - - $CI_SERVER_HOST == "gitlab.com" && $CI_PROJECT_NAME == "gitlab-foss" - - $CI_SERVER_HOST == "dev.gitlab.org" && $CI_PROJECT_NAME == "gitlabhq" + - $CI_PROJECT_NAME == "gitlab-foss" + - $CI_PROJECT_NAME == "gitlab-ce" # Support former project name for forks/mirrors + - $CI_PROJECT_NAME == "gitlabhq" # Support former project name for dev diff --git a/.gitlab/ci/test-metadata.gitlab-ci.yml b/.gitlab/ci/test-metadata.gitlab-ci.yml index 5e2523e8a9c..6a7f3157d59 100644 --- a/.gitlab/ci/test-metadata.gitlab-ci.yml +++ b/.gitlab/ci/test-metadata.gitlab-ci.yml @@ -1,10 +1,16 @@ .tests-metadata-state: extends: - .default-only + - .only-code-changes variables: TESTS_METADATA_S3_BUCKET: "gitlab-ce-cache" before_script: - source scripts/utils.sh + cache: + key: tests_metadata + paths: + - knapsack/ + - rspec_flaky/ artifacts: expire_in: 31d paths: @@ -13,55 +19,29 @@ - rspec_profiling/ retrieve-tests-metadata: - extends: - - .tests-metadata-state - - .only-code-changes + extends: .tests-metadata-state stage: prepare cache: - key: tests_metadata policy: pull script: - - mkdir -p knapsack/${CI_PROJECT_NAME}/ - - wget -O $KNAPSACK_RSPEC_SUITE_REPORT_PATH http://${TESTS_METADATA_S3_BUCKET}.s3.amazonaws.com/$KNAPSACK_RSPEC_SUITE_REPORT_PATH || rm $KNAPSACK_RSPEC_SUITE_REPORT_PATH - - '[[ -f $KNAPSACK_RSPEC_SUITE_REPORT_PATH ]] || echo "{}" > ${KNAPSACK_RSPEC_SUITE_REPORT_PATH}' - - mkdir -p rspec_flaky/ - - 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}' - - '[[ ! -d "ee/" ]] || wget -O $EE_KNAPSACK_RSPEC_SUITE_REPORT_PATH http://${TESTS_METADATA_S3_BUCKET}.s3.amazonaws.com/$EE_KNAPSACK_RSPEC_SUITE_REPORT_PATH || rm $EE_KNAPSACK_RSPEC_SUITE_REPORT_PATH' - - '[[ ! -d "ee/" ]] || [[ -f $EE_KNAPSACK_RSPEC_SUITE_REPORT_PATH ]] || echo "{}" > ${EE_KNAPSACK_RSPEC_SUITE_REPORT_PATH}' + - source scripts/rspec_helpers.sh + - retrieve_tests_metadata update-tests-metadata: - extends: - - .tests-metadata-state - - .only-code-changes + extends: .tests-metadata-state stage: post-test cache: - key: tests_metadata - paths: - - knapsack/ - - rspec_flaky/ 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' - - '[[ ! -d "ee/" ]] || echo "{}" > ${EE_KNAPSACK_RSPEC_SUITE_REPORT_PATH}' - - '[[ ! -d "ee/" ]] || scripts/merge-reports ${EE_KNAPSACK_RSPEC_SUITE_REPORT_PATH} knapsack/${CI_PROJECT_NAME}/rspec_*_pg_ee_*node_*.json' - - '[[ ! -d "ee/" ]] || [[ -z ${TESTS_METADATA_S3_BUCKET} ]] || scripts/sync-reports put $TESTS_METADATA_S3_BUCKET $EE_KNAPSACK_RSPEC_SUITE_REPORT_PATH' - - rm -f knapsack/${CI_PROJECT_NAME}/*_node_*.json - - scripts/merge-reports ${FLAKY_RSPEC_SUITE_REPORT_PATH} rspec_flaky/all_*_*.json - - FLAKY_RSPEC_GENERATE_REPORT=1 scripts/prune-old-flaky-specs ${FLAKY_RSPEC_SUITE_REPORT_PATH} - - '[[ -z ${TESTS_METADATA_S3_BUCKET} ]] || scripts/sync-reports put $TESTS_METADATA_S3_BUCKET $FLAKY_RSPEC_SUITE_REPORT_PATH' - - rm -f rspec_flaky/all_*.json rspec_flaky/new_*.json - - scripts/insert-rspec-profiling-data + - source scripts/rspec_helpers.sh + - update_tests_metadata only: refs: - - master + - schedules variables: - - $CI_SERVER_HOST == "gitlab.com" && $CI_PROJECT_NAMESPACE == "gitlab-org" - - $CI_SERVER_HOST == "dev.gitlab.org" + # Only update the Knapsack metadata on GitLab.com/gitlab-org/gitlab + - $CI_SERVER_HOST == "gitlab.com" && $CI_PROJECT_PATH == "gitlab-org/gitlab" flaky-examples-check: extends: diff --git a/.gitlab/issue_templates/Acceptance_Testing.md b/.gitlab/issue_templates/Acceptance_Testing.md index f1fbb96ce61..5a6c35f28ad 100644 --- a/.gitlab/issue_templates/Acceptance_Testing.md +++ b/.gitlab/issue_templates/Acceptance_Testing.md @@ -25,7 +25,7 @@ Then leave running while monitoring and performing some testing through web, api - [ ] [Monitor Using Grafana](https://dashboards.gitlab.net) - [ ] [Inspect logs in ELK](https://log.gitlab.net/app/kibana) -- [ ] [Check for errors in GitLab Dev Sentry](https://sentry.gitlap.com/gitlab/devgitlaborg/?query=is%3Aunresolved) +- [ ] [Check for errors in GitLab Dev Sentry](https://sentry.gitlab.net/gitlab/devgitlaborg/?query=is%3Aunresolved) ## 2. Staging Trial @@ -41,7 +41,7 @@ Then leave running while monitoring for at least **15 minutes** while performing - [ ] [Monitor Using Grafana](https://dashboards.gitlab.net) - [ ] [Inspect logs in ELK](https://log.gitlab.net/app/kibana) -- [ ] [Check for errors in GitLab Sentry](https://sentry.gitlap.com/gitlab/gitlabcom/?query=is%3Aunresolved) +- [ ] [Check for errors in GitLab Sentry](https://sentry.gitlab.net/gitlab/gitlabcom/?query=is%3Aunresolved) ## 4. Production Server Version Check @@ -57,7 +57,7 @@ Then leave running while monitoring for at least **15 minutes** while performing - [ ] [Monitor Using Grafana](https://dashboards.gitlab.net) - [ ] [Inspect logs in ELK](https://log.gitlab.net/app/kibana) -- [ ] [Check for errors in GitLab Sentry](https://sentry.gitlap.com/gitlab/gitlabcom/?query=is%3Aunresolved) +- [ ] [Check for errors in GitLab Sentry](https://sentry.gitlab.net/gitlab/gitlabcom/?query=is%3Aunresolved) ## 6. Low Impact Check @@ -69,7 +69,7 @@ Then leave running while monitoring for at least **30 minutes** while performing - [ ] [Monitor Using Grafana](https://dashboards.gitlab.net) - [ ] [Inspect logs in ELK](https://log.gitlab.net/app/kibana) -- [ ] [Check for errors in GitLab Sentry](https://sentry.gitlap.com/gitlab/gitlabcom/?query=is%3Aunresolved) +- [ ] [Check for errors in GitLab Sentry](https://sentry.gitlab.net/gitlab/gitlabcom/?query=is%3Aunresolved) ## 7. Mid Impact Trial @@ -81,7 +81,7 @@ Then leave running while monitoring for at least **12 hours** while performing s - [ ] [Monitor Using Grafana](https://dashboards.gitlab.net) - [ ] [Inspect logs in ELK](https://log.gitlab.net/app/kibana) -- [ ] [Check for errors in GitLab Sentry](https://sentry.gitlap.com/gitlab/gitlabcom/?query=is%3Aunresolved) +- [ ] [Check for errors in GitLab Sentry](https://sentry.gitlab.net/gitlab/gitlabcom/?query=is%3Aunresolved) ## 8. Full Impact Trial @@ -93,7 +93,7 @@ Then leave running while monitoring for at least **1 week**. - [ ] [Monitor Using Grafana](https://dashboards.gitlab.net) - [ ] [Inspect logs in ELK](https://log.gitlab.net/app/kibana) -- [ ] [Check for errors in GitLab Dev Sentry](https://sentry.gitlap.com/gitlab/devgitlaborg/?query=is%3Aunresolved) +- [ ] [Check for errors in GitLab Dev Sentry](https://sentry.gitlab.net/gitlab/devgitlaborg/?query=is%3Aunresolved) #### Success? diff --git a/.gitlab/issue_templates/Bug.md b/.gitlab/issue_templates/Bug.md index 3adea22b33a..0d9990657e4 100644 --- a/.gitlab/issue_templates/Bug.md +++ b/.gitlab/issue_templates/Bug.md @@ -2,17 +2,10 @@ Please read this! Before opening a new issue, make sure to search for keywords in the issues -filtered by the "regression" or "bug" label. +filtered by the "regression" or "bug" label: -For the Community Edition issue tracker: - -- https://gitlab.com/gitlab-org/gitlab-ce/issues?label_name%5B%5D=regression -- https://gitlab.com/gitlab-org/gitlab-ce/issues?label_name%5B%5D=bug - -For the Enterprise Edition issue tracker: - -- https://gitlab.com/gitlab-org/gitlab-ee/issues?label_name%5B%5D=regression -- https://gitlab.com/gitlab-org/gitlab-ee/issues?label_name%5B%5D=bug +- https://gitlab.com/gitlab-org/gitlab/issues?label_name%5B%5D=regression +- https://gitlab.com/gitlab-org/gitlab/issues?label_name%5B%5D=bug and verify the issue you're about to submit isn't a duplicate. ---> diff --git a/.gitlab/issue_templates/Coding style proposal.md b/.gitlab/issue_templates/Coding style proposal.md index 1a3be44bea0..a969c9b72ee 100644 --- a/.gitlab/issue_templates/Coding style proposal.md +++ b/.gitlab/issue_templates/Coding style proposal.md @@ -11,6 +11,6 @@ Please describe the proposal and add a link to the source (for example, http://w /label ~"development guidelines" /label ~"Style decision" -/label ~Documentation +/label ~documentation /cc @gitlab-org/maintainers/rails-backend diff --git a/.gitlab/issue_templates/Doc Review.md b/.gitlab/issue_templates/Doc Review.md index 14ab0c82d59..5b470ed7c75 100644 --- a/.gitlab/issue_templates/Doc Review.md +++ b/.gitlab/issue_templates/Doc Review.md @@ -8,13 +8,13 @@ ## References -Merged MR that introduced documentation requiring review: +Merged MR that introduced documentation requiring review: -Related issue(s): +Related issue(s): ## Further Details <!-- Any additional context, questions, or notes for the technical writer. --> -/label ~Documentation ~docs-review +/label ~documentation ~"Technical Writing" diff --git a/.gitlab/issue_templates/Documentation.md b/.gitlab/issue_templates/Documentation.md index f4070a44755..43ee7cd448b 100644 --- a/.gitlab/issue_templates/Documentation.md +++ b/.gitlab/issue_templates/Documentation.md @@ -2,23 +2,13 @@ * Use this issue template for suggesting new docs or updates to existing docs. 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-org/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/ --> -<!-- Type of issue --> - -<!-- Un-comment the line for the applicable doc issue type to add its label. - Note that all text on that line is deleted upon issue creation. --> -<!-- /label ~"docs:fix" - Correction or clarification needed. --> -<!-- /label ~"docs:new" - New doc needed to cover a new topic or use case. --> -<!-- /label ~"docs:improvement" - Improving an existing doc; e.g. adding a diagram, adding or rewording text, resolving redundancies, cross-linking, etc. --> -<!-- /label ~"docs:revamp" - Review a page or group of pages in order to plan and implement major improvements/rewrites. --> -<!-- /label ~"docs:other" - Anything else. --> - ### Problem to solve <!-- Include the following detail as necessary: @@ -50,4 +40,4 @@ <!-- E.g. related GitLab issues/MRs --> -/label ~Documentation +/label ~documentation diff --git a/.gitlab/issue_templates/Feature Flag Roll Out.md b/.gitlab/issue_templates/Feature Flag Roll Out.md index 0cac769bd55..e0de8fab4a7 100644 --- a/.gitlab/issue_templates/Feature Flag Roll Out.md +++ b/.gitlab/issue_templates/Feature Flag Roll Out.md @@ -24,7 +24,7 @@ Remove the `:feature_name` feature flag ... If applicable, any groups/projects that are happy to have this feature turned on early. Some organizations may wish to test big changes they are interested in with a small subset of users ahead of time for example. -- `gitlab-org/gitlab-ce`/`gitlab-org/gitlab-ee` projects +- `gitlab-org/gitlab` project - `gitlab-org`/`gitlab-com` groups - ... @@ -34,6 +34,7 @@ If applicable, any groups/projects that are happy to have this feature turned on - [ ] Test on staging - [ ] Ensure that documentation has been updated - [ ] Enable on GitLab.com for individual groups/projects listed above and verify behaviour +- [ ] Coordinate a time to enable the flag with `#production` and `#g_delivery` on slack. - [ ] Announce on the issue an estimated time this will be enabled on GitLab.com - [ ] Enable on GitLab.com by running chatops command in `#production` - [ ] Cross post chatops slack command to `#support_gitlab-com` and in your team channel diff --git a/.gitlab/issue_templates/Problem_Validation.md b/.gitlab/issue_templates/Problem_Validation.md index d2bab21eb06..bc1fd3374df 100644 --- a/.gitlab/issue_templates/Problem_Validation.md +++ b/.gitlab/issue_templates/Problem_Validation.md @@ -26,7 +26,7 @@ ## Confidence -<!-- How do we know this is a problem? Please provide and link to any supporting information (e.g. data, customer verbatims) and use this basis to provide a numerical assessment on our confidence level in this problem's severity: +<!-- How do we know this is a problem? Please provide and link to any supporting information (e.g. data, customer verbatims) and use this basis to provide a numerical assessment on our confidence level in this problem's severity: 100% = High confidence 80% = Medium confidence @@ -34,8 +34,8 @@ ## Effort -<!-- How much effort do we think it will be to solve this problem? Please include all counterparts (Product, UX, Engineering, etc) in your assessment and quantify the number of person-months needed to dedicate to the effort. +<!-- How much effort do we think it will be to solve this problem? Please include all counterparts (Product, UX, Engineering, etc) in your assessment and quantify the number of person-months needed to dedicate to the effort. For example, if the solution will take a product manager, designer, and engineer two weeks of effort - you may quantify this as 1.5 (based on 0.5 months x 3 people). --> -/label ~"workflow::problem backlog" +/label ~"workflow::validation backlog" ~devops:: ~category: ~group:: diff --git a/.gitlab/issue_templates/Security Release.md b/.gitlab/issue_templates/Security Release.md index 3e60274623e..e6e5d731d96 100644 --- a/.gitlab/issue_templates/Security Release.md +++ b/.gitlab/issue_templates/Security Release.md @@ -18,13 +18,7 @@ Set the title to: `Security Release: 12.2.X, 12.1.X, and 12.0.X` ## Security Issues: -### CE - -* {https://gitlab.com/gitlab-org/gitlab-ce/issues link} - -### EE - -* {https://gitlab.com/gitlab-org/gitlab-ee/issues link} +* {https://gitlab.com/gitlab-org/gitlab/issues link} ## Security Issues in dev.gitlab.org: diff --git a/.gitlab/issue_templates/Test plan.md b/.gitlab/issue_templates/Test plan.md index f194adebc87..a202c0bf546 100644 --- a/.gitlab/issue_templates/Test plan.md +++ b/.gitlab/issue_templates/Test plan.md @@ -2,7 +2,7 @@ <!-- This issue outlines testing activities related to a particular issue or epic. -[Here is an example test plan](https://gitlab.com/gitlab-org/gitlab-ce/issues/50353) +[Here is an example test plan](https://gitlab.com/gitlab-org/gitlab-foss/issues/50353) This and other comments should be removed as you write the plan --> @@ -63,7 +63,7 @@ intersection of Components and Attributes. Some features might be simple enough that they only involve one Component, while more complex features could involve multiple or even all. -Example (from https://gitlab.com/gitlab-org/gitlab-ce/issues/50353): +Example (from https://gitlab.com/gitlab-org/gitlab-foss/issues/50353): * Repository is * Intuitive * It's easy to select the desired file template diff --git a/.gitlab/merge_request_templates/Change documentation location.md b/.gitlab/merge_request_templates/Change documentation location.md index 7dc80a641c4..f18957fdaaa 100644 --- a/.gitlab/merge_request_templates/Change documentation location.md +++ b/.gitlab/merge_request_templates/Change documentation location.md @@ -10,12 +10,12 @@ <!-- Mention the issue(s) this MR closes or is related to --> -Closes +Closes ## Moving docs to a new location? Read the guidelines: -https://docs.gitlab.com/ce/development/documentation/index.html#changing-document-location +https://docs.gitlab.com/ee/development/documentation/index.html#changing-document-location - [ ] Make sure the old link is not removed and has its contents replaced with a link to the new location. @@ -29,4 +29,4 @@ https://docs.gitlab.com/ce/development/documentation/index.html#changing-documen with the changes as well (https://docs.gitlab.com/ce/development/documentation/index.html#cherry-picking-from-ce-to-ee). - [ ] Ping one of the technical writers for review. -/label ~Documentation +/label ~documentation diff --git a/.gitlab/merge_request_templates/Database changes.md b/.gitlab/merge_request_templates/Database changes.md index 2077997a0cb..89c8c7a5d07 100644 --- a/.gitlab/merge_request_templates/Database changes.md +++ b/.gitlab/merge_request_templates/Database changes.md @@ -24,6 +24,7 @@ When adding migrations: - [ ] Added a `down` method so the migration can be reverted - [ ] Added the output of the migration(s) to the MR body - [ ] Added tests for the migration in `spec/migrations` if necessary (e.g. when migrating data) +- [ ] Added rollback procedure. Include either a rollback procedure or description how to rollback changes When adding or modifying queries to improve performance: @@ -37,7 +38,7 @@ When adding foreign keys to existing tables: When adding tables: -- [ ] Ordered columns based on the [Ordering Table Columns](https://docs.gitlab.com/ee/development/ordering_table_columns.html#ordering-table-columns) guidelines +- [ ] Ordered columns based on the [Ordering Table Columns](https://docs.gitlab.com/ee/development/ordering_table_columns.html) guidelines - [ ] Added foreign keys to any columns pointing to data in other tables - [ ] Added indexes for fields that are used in statements such as `WHERE`, `ORDER BY`, `GROUP BY`, and `JOIN`s diff --git a/.gitlab/merge_request_templates/Documentation.md b/.gitlab/merge_request_templates/Documentation.md index e502614b5ca..a2dd79ed1ab 100644 --- a/.gitlab/merge_request_templates/Documentation.md +++ b/.gitlab/merge_request_templates/Documentation.md @@ -1,5 +1,5 @@ <!-- Follow the documentation workflow https://docs.gitlab.com/ee/development/documentation/workflow.html --> -<!-- Additional information is located at https://docs.gitlab.com/ee/development/documentation/ --> +<!-- Additional information is located at https://docs.gitlab.com/ee/development/documentation/ --> <!-- Mention "documentation" or "docs" in the MR title --> <!-- For changing documentation location use the "Change documentation location" template --> @@ -17,7 +17,7 @@ - [ ] Follow the [Documentation Guidelines](https://docs.gitlab.com/ee/development/documentation/) and [Style Guide](https://docs.gitlab.com/ee/development/documentation/styleguide.html). - [ ] If applicable, update the [permissions table](https://docs.gitlab.com/ee/user/permissions.html). - [ ] Link docs to and from the higher-level index page, plus other related docs where helpful. -- [ ] Apply the ~Documentation label. +- [ ] Apply the ~documentation label. ## Review checklist @@ -26,7 +26,7 @@ All reviewers can help ensure accuracy, clarity, completeness, and adherence to **1. Primary Reviewer** * [ ] Review by a code reviewer or other selected colleague to confirm accuracy, clarity, and completeness. This can be skipped for minor fixes without substantive content changes. - + **2. Technical Writer** * [ ] Optional: Technical writer review. If not requested for this MR, must be scheduled post-merge. To request for this MR, assign the writer listed for the applicable [DevOps stage](https://about.gitlab.com/handbook/product/categories/#devops-stages). @@ -35,6 +35,6 @@ All reviewers can help ensure accuracy, clarity, completeness, and adherence to 1. [ ] Review by assigned maintainer, who can always request/require the above reviews. Maintainer's review can occur before or after a technical writer review. 1. [ ] Ensure a release milestone is set and that you merge the equivalent EE MR before the CE MR if both exist. -1. [ ] If there has not been a technical writer review, [create an issue for one using the Doc Review template](https://gitlab.com/gitlab-org/gitlab-ce/issues/new?issuable_template=Doc%20Review). +1. [ ] If there has not been a technical writer review, [create an issue for one using the Doc Review template](https://gitlab.com/gitlab-org/gitlab/issues/new?issuable_template=Doc%20Review). -/label ~Documentation +/label ~documentation |