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

Add latest changes from gitlab-org/gitlab@master

parent bd860c22
image: "dev.gitlab.org:5005/gitlab/gitlab-build-images:ruby-2.6.3-golang-1.11-git-2.22-chrome-73.0-node-12.x-yarn-1.16-postgresql-9.6-graphicsmagick-1.3.33" 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: stages:
- build
- prepare - prepare
- quick-test - quick-test
- test - test
......
...@@ -11,5 +11,6 @@ cloud-native-image: ...@@ -11,5 +11,6 @@ cloud-native-image:
- CNG_PROJECT_PATH="gitlab-org/build/CNG" BUILD_TRIGGER_TOKEN=$CI_JOB_TOKEN ./scripts/trigger-build cng - CNG_PROJECT_PATH="gitlab-org/build/CNG" BUILD_TRIGGER_TOKEN=$CI_JOB_TOKEN ./scripts/trigger-build cng
only: only:
refs: refs:
- tags@gitlab-org/gitlab-foss - tags
- tags@gitlab-org/gitlab variables:
- $CI_SERVER_HOST == "gitlab.com" && $CI_PROJECT_NAMESPACE == "gitlab-org"
...@@ -2,6 +2,12 @@ ...@@ -2,6 +2,12 @@
extends: extends:
- .default-tags - .default-tags
- .default-retry - .default-retry
- .only-docs-changes
only:
refs:
- merge_requests
variables:
- $CI_SERVER_HOST == "gitlab.com" && $CI_PROJECT_NAMESPACE == "gitlab-org"
image: ruby:2.6-alpine image: ruby:2.6-alpine
stage: review stage: review
dependencies: [] dependencies: []
...@@ -19,55 +25,32 @@ ...@@ -19,55 +25,32 @@
- apk add --update openssl - apk add --update openssl
- wget $CI_PROJECT_URL/raw/$CI_COMMIT_SHA/scripts/trigger-build-docs - wget $CI_PROJECT_URL/raw/$CI_COMMIT_SHA/scripts/trigger-build-docs
- chmod 755 trigger-build-docs - chmod 755 trigger-build-docs
# Trigger a manual docs build in gitlab-docs only on non docs-only branches.
# Useful to preview the docs changes live.
review-docs-deploy-manual:
extends:
- .review-docs
- .except-docs-qa
script:
- gem install gitlab --no-document - gem install gitlab --no-document
- ./trigger-build-docs deploy
when: manual
only:
- branches@gitlab-org/gitlab-foss
- branches@gitlab-org/gitlab
# Always trigger a docs build in gitlab-docs only on docs-only branches. # Always trigger a docs build in gitlab-docs only on docs-only branches.
# Useful to preview the docs changes live. # Useful to preview the docs changes live.
review-docs-deploy: review-docs-deploy:
extends: extends: .review-docs
- .review-docs
- .except-qa
script: script:
- gem install gitlab --no-document
- ./trigger-build-docs deploy - ./trigger-build-docs deploy
only: when: manual
- /(^docs[\/-].+|.+-docs$)/@gitlab-org/gitlab-foss
- /(^docs[\/-].+|.+-docs$)/@gitlab-org/gitlab
# Cleanup remote environment of gitlab-docs # Cleanup remote environment of gitlab-docs
review-docs-cleanup: review-docs-cleanup:
extends: extends: .review-docs
- .review-docs
- .except-qa
environment: environment:
name: review-docs/$CI_COMMIT_REF_SLUG name: review-docs/$CI_COMMIT_REF_SLUG
action: stop action: stop
script: script:
- gem install gitlab --no-document
- ./trigger-build-docs cleanup - ./trigger-build-docs cleanup
when: manual when: manual
only:
- branches@gitlab-org/gitlab-foss
- branches@gitlab-org/gitlab
docs lint: docs lint:
extends: extends:
- .default-tags - .default-tags
- .default-retry - .default-retry
- .except-qa - .default-only
- .only-docs-changes
image: "registry.gitlab.com/gitlab-org/gitlab-build-images:gitlab-docs-lint" image: "registry.gitlab.com/gitlab-org/gitlab-build-images:gitlab-docs-lint"
stage: test stage: test
dependencies: [] dependencies: []
......
...@@ -9,9 +9,10 @@ ...@@ -9,9 +9,10 @@
extends: extends:
- .default-tags - .default-tags
- .default-retry - .default-retry
- .assets-compile-cache - .default-only
- .default-before_script - .default-before_script
- .except-docs - .assets-compile-cache
- .only-code-qa-changes
image: dev.gitlab.org:5005/gitlab/gitlab-build-images:ruby-2.6.3-git-2.22-chrome-73.0-node-12.x-yarn-1.16-graphicsmagick-1.3.33-docker-18.06.1 image: dev.gitlab.org:5005/gitlab/gitlab-build-images:ruby-2.6.3-git-2.22-chrome-73.0-node-12.x-yarn-1.16-graphicsmagick-1.3.33-docker-18.06.1
stage: test stage: test
dependencies: ["setup-test-env"] dependencies: ["setup-test-env"]
...@@ -45,10 +46,9 @@ ...@@ -45,10 +46,9 @@
- scripts/clean-old-cached-assets - scripts/clean-old-cached-assets
- rm -f /etc/apt/sources.list.d/google*.list # We don't need to update Chrome here - rm -f /etc/apt/sources.list.d/google*.list # We don't need to update Chrome here
only: only:
- /.+/@gitlab-org/gitlab-foss variables:
- /.+/@gitlab-org/gitlab - $CI_SERVER_HOST == "gitlab.com" && $CI_PROJECT_NAMESPACE == "gitlab-org"
- /.+/@gitlab/gitlabhq - $CI_SERVER_HOST == "dev.gitlab.org"
- /.+/@gitlab/gitlab-ee
tags: tags:
- gitlab-org - gitlab-org
- docker - docker
...@@ -57,8 +57,7 @@ gitlab:assets:compile: ...@@ -57,8 +57,7 @@ gitlab:assets:compile:
extends: .gitlab:assets:compile-metadata extends: .gitlab:assets:compile-metadata
only: only:
refs: refs:
- master@gitlab-org/gitlab-foss - master
- master@gitlab-org/gitlab
cache: cache:
policy: pull-push policy: pull-push
...@@ -66,9 +65,7 @@ gitlab:assets:compile pull-cache: ...@@ -66,9 +65,7 @@ gitlab:assets:compile pull-cache:
extends: .gitlab:assets:compile-metadata extends: .gitlab:assets:compile-metadata
except: except:
refs: refs:
- master@gitlab-org/gitlab-foss - master
- master@gitlab-org/gitlab
- /(^docs[\/-].+|.+-docs$)/
cache: cache:
policy: pull policy: pull
...@@ -76,8 +73,10 @@ gitlab:assets:compile pull-cache: ...@@ -76,8 +73,10 @@ gitlab:assets:compile pull-cache:
extends: extends:
- .default-tags - .default-tags
- .default-retry - .default-retry
- .assets-compile-cache - .default-only
- .default-before_script - .default-before_script
- .assets-compile-cache
- .only-code-qa-changes
- .use-pg - .use-pg
stage: prepare stage: prepare
script: script:
...@@ -98,12 +97,10 @@ gitlab:assets:compile pull-cache: ...@@ -98,12 +97,10 @@ gitlab:assets:compile pull-cache:
- public/assets - public/assets
compile-assets: compile-assets:
extends: extends: .compile-assets-metadata
- .compile-assets-metadata
only: only:
refs: refs:
- master@gitlab-org/gitlab-foss - master
- master@gitlab-org/gitlab
cache: cache:
policy: pull-push policy: pull-push
...@@ -111,21 +108,23 @@ compile-assets pull-cache: ...@@ -111,21 +108,23 @@ compile-assets pull-cache:
extends: .compile-assets-metadata extends: .compile-assets-metadata
except: except:
refs: refs:
- master@gitlab-org/gitlab-foss - master
- master@gitlab-org/gitlab
- /(^docs[\/-].+|.+-docs$)/
cache: cache:
policy: pull policy: pull
karma: .only-code-frontend-job-base:
extends: extends:
- .default-tags - .default-tags
- .default-retry - .default-retry
- .default-cache - .default-cache
- .default-only
- .default-before_script - .default-before_script
- .only-code-changes
- .use-pg - .use-pg
- .except-docs
dependencies: ["compile-assets", "compile-assets pull-cache", "setup-test-env"] dependencies: ["compile-assets", "compile-assets pull-cache", "setup-test-env"]
karma:
extends: .only-code-frontend-job-base
variables: variables:
# we override the max_old_space_size to prevent OOM errors # we override the max_old_space_size to prevent OOM errors
NODE_OPTIONS: --max_old_space_size=3584 NODE_OPTIONS: --max_old_space_size=3584
...@@ -148,14 +147,7 @@ karma: ...@@ -148,14 +147,7 @@ karma:
junit: junit_karma.xml junit: junit_karma.xml
jest: jest:
extends: extends: .only-code-frontend-job-base
- .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: script:
- scripts/gitaly-test-spawn - scripts/gitaly-test-spawn
- date - date
...@@ -178,27 +170,26 @@ jest: ...@@ -178,27 +170,26 @@ jest:
- tmp/jest/jest/ - tmp/jest/jest/
policy: pull-push policy: pull-push
.qa: .qa-job-base:
extends: extends:
- .default-tags - .default-tags
- .default-retry - .default-retry
- .default-cache - .default-cache
- .except-docs - .default-only
- .only-code-qa-changes
dependencies: [] dependencies: []
stage: test stage: test
variables:
SETUP_DB: "false"
before_script: before_script:
- cd qa/ - cd qa/
- bundle install - bundle install
qa:internal: qa:internal:
extends: .qa extends: .qa-job-base
script: script:
- bundle exec rspec - bundle exec rspec
qa:selectors: qa:selectors:
extends: .qa extends: .qa-job-base
script: script:
- bundle exec bin/qa Test::Sanity::Selectors - bundle exec bin/qa Test::Sanity::Selectors
...@@ -207,7 +198,8 @@ qa:selectors: ...@@ -207,7 +198,8 @@ qa:selectors:
- .default-tags - .default-tags
- .default-retry - .default-retry
- .default-cache - .default-cache
- .except-docs - .default-only
- .only-code-changes
dependencies: [] dependencies: []
cache: cache:
key: "$CI_JOB_NAME" key: "$CI_JOB_NAME"
...@@ -238,10 +230,9 @@ webpack-dev-server: ...@@ -238,10 +230,9 @@ webpack-dev-server:
- .default-tags - .default-tags
- .default-retry - .default-retry
- .default-cache - .default-cache
- .except-docs-qa - .only-code-changes
dependencies: ["compile-assets", "compile-assets pull-cache", "setup-test-env"] dependencies: ["setup-test-env", "compile-assets", "compile-assets pull-cache"]
variables: variables:
SETUP_DB: "false"
WEBPACK_MEMORY_TEST: "true" WEBPACK_MEMORY_TEST: "true"
script: script:
- node --version - node --version
......
...@@ -27,40 +27,83 @@ ...@@ -27,40 +27,83 @@
- vendor/gitaly-ruby - vendor/gitaly-ruby
policy: pull policy: pull
.except-docs: .default-only:
except: only:
refs: refs:
- /(^docs[\/-].+|.+-docs$)/ - master
- /^[\d-]+-stable(-ee)?$/
- /^\d+-\d+-auto-deploy-\d+$/
- merge_requests
- tags
.except-qa: .only-code-changes:
except: only:
refs: changes:
- /(^qa[\/-].*|.*-qa$)/ - ".gitlab/ci/**/*"
- ".{eslintignore,gitattributes,nvmrc,prettierrc,stylelintrc,yamllint}"
- ".{codeclimate,eslintrc,gitlab-ci,haml-lint,haml-lint_todo,rubocop,rubocop_todo,scss-lint}.yml"
- ".csscomb.json"
- "Dangerfile"
- "Dockerfile.assets"
- "*_VERSION"
- "Gemfile{,.lock}"
- "Rakefile"
- "{babel.config,jest.config}.js"
- "config.ru"
- "{package.json,yarn.lock}"
- "{app,bin,config,danger,db,ee,fixtures,haml_lint,lib,public,rubocop,scripts,spec,symbol,vendor}/**/*"
- "doc/README.md" # Some RSpec test rely on this file
.except-docs-qa: .only-qa-changes:
except: only:
refs: changes:
- /(^docs[\/-].+|.+-docs$)/ - ".dockerignore"
- /(^qa[\/-].*|.*-qa$)/ - "qa/**/*"
.except-docs-qa-geo: .only-docs-changes:
except: only:
refs: changes:
- /(^docs[\/-].+|.+-docs$)/ - ".gitlab/route-map.yml"
- /(^qa[\/-].*|.*-qa$)/ - "doc/**/*"
- /(^geo[\/-].*|.*-geo$)/ - ".markdownlint.json"
.review-only: .only-code-qa-changes:
only: only:
refs: changes:
- branches@gitlab-org/gitlab-foss - ".gitlab/ci/**/*"
- branches@gitlab-org/gitlab - ".{eslintignore,gitattributes,nvmrc,prettierrc,stylelintrc,yamllint}"
- ".{codeclimate,eslintrc,gitlab-ci,haml-lint,haml-lint_todo,rubocop,rubocop_todo,scss-lint}.yml"
- ".csscomb.json"
- "Dangerfile"
- "Dockerfile.assets"
- "*_VERSION"
- "Gemfile{,.lock}"
- "Rakefile"
- "{babel.config,jest.config}.js"
- "config.ru"
- "{package.json,yarn.lock}"
- "{app,bin,config,danger,db,ee,fixtures,haml_lint,lib,public,rubocop,scripts,spec,symbol,vendor}/**/*"
- "doc/README.md" # Some RSpec test rely on this file
- ".dockerignore"
- "qa/**/*"
.only-review:
only:
variables:
- $CI_SERVER_HOST == "gitlab.com" && $CI_PROJECT_NAMESPACE == "gitlab-org"
kubernetes: active kubernetes: active
except: except:
refs: refs:
- master - master
- /^\d+-\d+-auto-deploy-\d+$/ - /^\d+-\d+-auto-deploy-\d+$/
- /(^docs[\/-].+|.+-docs$)/
.only-review-schedules:
only:
refs:
- schedules
variables:
- $REVIEW_APP_CLEANUP && $CI_SERVER_HOST == "gitlab.com" && $CI_PROJECT_NAMESPACE == "gitlab-org"
kubernetes: active
.use-pg: .use-pg:
services: services:
...@@ -74,3 +117,9 @@ ...@@ -74,3 +117,9 @@
- name: postgres:10.9 - name: postgres:10.9
command: ["postgres", "-c", "fsync=off", "-c", "synchronous_commit=off", "-c", "full_page_writes=off"] command: ["postgres", "-c", "fsync=off", "-c", "synchronous_commit=off", "-c", "full_page_writes=off"]
- name: redis:alpine - name: redis:alpine
.only-ee:
only:
variables:
- $CI_PROJECT_NAME == "gitlab-ee"
- $CI_PROJECT_NAME == "gitlab" # New name of gitlab-ee after the single codebase migration
memory-static: .only-code-memory-job-base:
extends: extends:
- .default-tags - .default-tags
- .default-retry - .default-retry
- .default-cache - .default-cache
- .default-only
- .default-before_script - .default-before_script
- .except-docs - .only-code-changes
memory-static:
extends: .only-code-memory-job-base
variables: variables:
SETUP_DB: "false" SETUP_DB: "false"
script: script:
...@@ -31,12 +35,8 @@ memory-static: ...@@ -31,12 +35,8 @@ memory-static:
# All tests are run without a webserver (directly using Rack::Mock by default). # All tests are run without a webserver (directly using Rack::Mock by default).
memory-on-boot: memory-on-boot:
extends: extends:
- .default-tags - .only-code-memory-job-base
- .default-retry
- .default-cache
- .default-before_script
- .use-pg-10 - .use-pg-10
- .except-docs-qa
variables: variables:
NODE_ENV: "production" NODE_ENV: "production"
RAILS_ENV: "production" RAILS_ENV: "production"
......
...@@ -3,11 +3,12 @@ pages: ...@@ -3,11 +3,12 @@ pages:
- .default-tags - .default-tags
- .default-retry - .default-retry
- .default-cache - .default-cache
- .except-docs - .default-only
only: only:
refs: refs:
- master@gitlab-org/gitlab-foss - master
- master@gitlab-org/gitlab variables:
- $CI_SERVER_HOST == "gitlab.com" && $CI_PROJECT_NAMESPACE == "gitlab-org"
stage: pages stage: pages
dependencies: ["coverage", "karma", "gitlab:assets:compile"] dependencies: ["coverage", "karma", "gitlab:assets:compile"]
script: script:
......
.package-and-qa-base: .package-and-qa-base:
extends: .default-only
image: ruby:2.6-alpine image: ruby:2.6-alpine
stage: qa stage: qa
dependencies: [] dependencies: []
...@@ -10,17 +11,16 @@ ...@@ -10,17 +11,16 @@
- install_gitlab_gem - install_gitlab_gem
- ./scripts/trigger-build omnibus - ./scripts/trigger-build omnibus
only: only:
refs: variables:
- branches@gitlab-org/gitlab-foss - $CI_SERVER_HOST == "gitlab.com" && $CI_PROJECT_NAMESPACE == "gitlab-org"
- branches@gitlab-org/gitlab
package-and-qa-manual: package-and-qa-manual:
extends: .package-and-qa-base extends:
- .package-and-qa-base
- .only-code-changes
except: except:
refs: refs:
- master - master
- /(^docs[\/-].+|.+-docs$)/
- /(^qa[\/-].*|.*-qa$)/
when: manual when: manual
needs: ["build-qa-image", "gitlab:assets:compile pull-cache"] needs: ["build-qa-image", "gitlab:assets:compile pull-cache"]
...@@ -34,10 +34,11 @@ package-and-qa-manual:master: ...@@ -34,10 +34,11 @@ package-and-qa-manual:master:
needs: ["build-qa-image", "gitlab:assets:compile"] needs: ["build-qa-image", "gitlab:assets:compile"]
package-and-qa: package-and-qa:
extends: .package-and-qa-base extends:
only: - .package-and-qa-base
- .only-qa-changes
except:
refs: refs:
- /(^qa[\/-].*|.*-qa$)/@gitlab-org/gitlab-foss - master
- /(^qa[\/-].*|.*-qa$)/@gitlab-org/gitlab
needs: ["build-qa-image", "gitlab:assets:compile pull-cache"] needs: ["build-qa-image", "gitlab:assets:compile pull-cache"]
allow_failure: true allow_failure: true
.only-schedules-master: .only-master:
only: only:
refs: refs:
- schedules@gitlab-org/gitlab-foss - master
- schedules@gitlab-org/gitlab
- master@gitlab-org/gitlab-foss
- master@gitlab-org/gitlab
- master@gitlab/gitlabhq
- master@gitlab/gitlab-ee
.only-gitlab-ee:
only:
- branches@gitlab-org/gitlab
- tags@gitlab-org/gitlab
.rake-exec: .rake-exec:
extends: extends:
- .default-tags - .default-tags
- .default-retry - .default-retry
- .default-cache - .default-cache
- .default-only
- .default-before_script - .default-before_script
variables: variables:
SETUP_DB: "false" SETUP_DB: "false"
script: script:
- bundle exec rake $CI_JOB_NAME - bundle exec rake $CI_JOB_NAME
.rspec-base: .only-code-rails-job-base:
extends:
- .default-tags
- .default-retry
- .default-cache
- .default-only
- .default-before_script
- .only-code-changes
.only-code-qa-rails-job-base:
extends: extends:
- .default-tags - .default-tags
- .default-retry - .default-retry
- .default-cache - .default-cache
- .default-only
- .default-before_script - .default-before_script
- .except-docs-qa - .only-code-qa-changes
.rspec-base:
extends: .only-code-rails-job-base
stage: test stage: test
script: script:
- JOB_NAME=( $CI_JOB_NAME ) - JOB_NAME=( $CI_JOB_NAME )
...@@ -79,12 +83,8 @@ ...@@ -79,12 +83,8 @@
setup-test-env: setup-test-env:
extends: extends:
- .default-tags - .only-code-qa-rails-job-base
- .default-retry
- .default-cache
- .default-before_script
- .use-pg - .use-pg
- .except-docs
stage: prepare stage: prepare
script: script:
- bundle exec ruby -Ispec -e 'require "spec_helper" ; TestEnv.init' - bundle exec ruby -Ispec -e 'require "spec_helper" ; TestEnv.init'
...@@ -111,19 +111,19 @@ rspec system pg: ...@@ -111,19 +111,19 @@ rspec system pg:
rspec unit pg-10: rspec unit pg-10:
extends: extends:
- .rspec-base-pg-10 - .rspec-base-pg-10
- .only-schedules-master - .only-master
parallel: 20 parallel: 20
rspec integration pg-10: rspec integration pg-10:
extends: extends:
- .rspec-base-pg-10 - .rspec-base-pg-10
- .only-schedules-master - .only-master
parallel: 6 parallel: 6
rspec system pg-10: rspec system pg-10:
extends: extends:
- .rspec-base-pg-10 - .rspec-base-pg-10
- .only-schedules-master - .only-master
parallel: 24 parallel: 24
rspec-fast-spec-helper: rspec-fast-spec-helper:
...@@ -133,9 +133,8 @@ rspec-fast-spec-helper: ...@@ -133,9 +133,8 @@ rspec-fast-spec-helper:
rspec quarantine pg: rspec quarantine pg:
extends: extends:
- .default-before_script
- .rspec-base-pg - .rspec-base-pg
- .only-schedules-master - .only-master
script: script:
- export NO_KNAPSACK=1 CACHE_CLASSES=true - export NO_KNAPSACK=1 CACHE_CLASSES=true
- scripts/gitaly-test-spawn - scripts/gitaly-test-spawn
...@@ -143,12 +142,7 @@ rspec quarantine pg: ...@@ -143,12 +142,7 @@ rspec quarantine pg:
allow_failure: true allow_failure: true
static-analysis: static-analysis:
extends: extends: .only-code-qa-rails-job-base
- .default-tags
- .default-retry
- .default-cache
- .default-before_script
- .except-docs
dependencies: ["setup-test-env", "compile-assets", "compile-assets pull-cache"] dependencies: ["setup-test-env", "compile-assets", "compile-assets pull-cache"]
variables: variables:
SETUP_DB: "false" SETUP_DB: "false"
...@@ -162,81 +156,48 @@ static-analysis: ...@@ -162,81 +156,48 @@ static-analysis:
policy: pull-push policy: pull-push
downtime_check: downtime_check:
extends: .rake-exec extends:
- .rake-exec
- .only-code-changes
except: except:
refs: refs:
- master - master
- tags - tags
- /^[\d-]+-stable(-ee)?$/ variables:
- /(^docs[\/-].+|.+-docs$)/ - $CI_COMMIT_REF_NAME =~ /^[\d-]+-stable(-ee)?$/
- /(^qa[\/-].*|.*-qa$)/
stage: test stage: test
dependencies: ["setup-test-env"] dependencies: ["setup-test-env"]
needs: ["setup-test-env"] needs: ["setup-test-env"]
ee_compat_check: .db-job-base:
extends: .rake-exec
dependencies: []
except:
refs:
- master
- tags
- branches@gitlab-org/gitlab
- branches@gitlab/gitlab-ee
- /^[\d-]+-stable(-ee)?$/
- /(^docs[\/-].+|.+-docs$)/
- /^security-/
artifacts:
name: "${CI_JOB_NAME}_${CI_COMIT_REF_NAME}_${CI_COMMIT_SHA}"
when: always
expire_in: 10d
paths:
- ee_compat_check/patches/*.patch
# DB migration, rollback, and seed jobs
db:migrate:reset:
extends: extends:
- .default-tags - .only-code-rails-job-base
- .default-retry
- .default-cache
- .default-before_script
- .use-pg - .use-pg
- .except-docs-qa
stage: test stage: test
dependencies: ["setup-test-env"] dependencies: ["setup-test-env"]
needs: ["setup-test-env"] needs: ["setup-test-env"]
# DB migration, rollback, and seed jobs
db:migrate:reset:
extends: .db-job-base
script: script:
- bundle exec rake db:migrate:reset - bundle exec rake db:migrate:reset
db:check-schema: db:check-schema:
extends: extends: .db-job-base
- .default-tags
- .default-retry
- .default-cache
- .default-before_script
- .use-pg
- .except-docs-qa
stage: test
dependencies: ["setup-test-env"]
needs: ["setup-test-env"]
script: script:
- source scripts/schema_changed.sh - source scripts/schema_changed.sh
db:migrate-from-v11.11.0: db:migrate-from-v11.11.0:
extends: extends: .db-job-base
- .default-tags
- .default-retry
- .default-cache
- .default-before_script
- .use-pg
- .except-docs-qa
stage: test
dependencies: ["setup-test-env"]
needs: ["setup-test-env"]
variables: variables:
SETUP_DB: "false" SETUP_DB: "false"
script: script:
- git fetch https://gitlab.com/gitlab-org/gitlab.git v11.11.0-ee - export PROJECT_TO_CHECKOUT="gitlab-foss"
- export TAG_TO_CHECKOUT="v11.11.0"
- '[[ ! -d "ee/" ]] || export PROJECT_TO_CHECKOUT="gitlab"'
- '[[ ! -d "ee/" ]] || export TAG_TO_CHECKOUT="v11.11.0-ee"'
- git fetch https://gitlab.com/gitlab-org/$PROJECT_TO_CHECKOUT.git $TAG_TO_CHECKOUT
- git checkout -f FETCH_HEAD - git checkout -f FETCH_HEAD
- sed -i "s/gem 'oj', '~> 2.17.4'//" Gemfile - sed -i "s/gem 'oj', '~> 2.17.4'//" Gemfile
- sed -i "s/gem 'bootsnap', '~> 1.0.0'/gem 'bootsnap'/" Gemfile - sed -i "s/gem 'bootsnap', '~> 1.0.0'/gem 'bootsnap'/" Gemfile
...@@ -254,31 +215,13 @@ db:migrate-from-v11.11.0: ...@@ -254,31 +215,13 @@ db:migrate-from-v11.11.0:
- bundle exec rake db:migrate - bundle exec rake db:migrate
db:rollback: db:rollback:
extends: extends: .db-job-base
- .default-tags
- .default-retry
- .default-cache
- .default-before_script
- .use-pg
- .except-docs-qa
stage: test
dependencies: ["setup-test-env"]
needs: ["setup-test-env"]
script: script:
- bundle exec rake db:migrate VERSION=20180101160629 - bundle exec rake db:migrate VERSION=20180101160629
- bundle exec rake db:migrate SKIP_SCHEMA_VERSION_CHECK=true - bundle exec rake db:migrate SKIP_SCHEMA_VERSION_CHECK=true
gitlab:setup: gitlab:setup:
extends: extends: .db-job-base
- .default-tags
- .default-retry
- .default-cache
- .default-before_script
- .use-pg
- .except-docs-qa
stage: test
dependencies: ["setup-test-env"]
needs: ["setup-test-env"]
variables: variables:
SETUP_DB: "false" SETUP_DB: "false"
script: script:
...@@ -295,14 +238,7 @@ gitlab:setup: ...@@ -295,14 +238,7 @@ gitlab:setup:
- log/development.log - log/development.log
coverage: coverage:
# Don't include dedicated-no-docs-no-db-pull-cache-job here since we need to extends: .only-code-rails-job-base
# download artifacts from all the rspec jobs instead of from setup-test-env only
extends:
- .default-tags
- .default-retry
- .default-cache
- .default-before_script
- .except-docs-qa
cache: cache:
policy: pull policy: pull
variables: variables:
...@@ -324,7 +260,7 @@ coverage: ...@@ -324,7 +260,7 @@ coverage:
.rspec-base-ee: .rspec-base-ee:
extends: extends:
- .rspec-base - .rspec-base
- .only-gitlab-ee - .only-ee
script: script:
- JOB_NAME=( $CI_JOB_NAME ) - JOB_NAME=( $CI_JOB_NAME )
- TEST_TOOL=${JOB_NAME[0]} - TEST_TOOL=${JOB_NAME[0]}
...@@ -362,10 +298,9 @@ rspec system pg ee: ...@@ -362,10 +298,9 @@ rspec system pg ee:
extends: .rspec-base-pg-ee extends: .rspec-base-pg-ee
parallel: 5 parallel: 5
.rspec-base-pg-geo: .rspec-base-geo:
extends: extends: .rspec-base-ee
- .rspec-base parallel: 3
- .only-gitlab-ee
script: script:
- JOB_NAME=( $CI_JOB_NAME ) - JOB_NAME=( $CI_JOB_NAME )
- TEST_TOOL=${JOB_NAME[0]} - TEST_TOOL=${JOB_NAME[0]}
...@@ -382,33 +317,37 @@ rspec system pg ee: ...@@ -382,33 +317,37 @@ rspec system pg ee:
rspec geo pg ee: rspec geo pg ee:
extends: extends:
- .rspec-base-pg-geo - .rspec-base-geo
- .use-pg - .use-pg
- .except-docs-qa-geo except:
parallel: 3 variables:
- $CI_COMMIT_REF_NAME =~ /(^geo[\/-].*|.*-geo$)/
rspec geo pg-10 ee: rspec geo pg-10 ee:
extends: extends:
- .rspec-base-pg-geo - .rspec-base-geo
- .use-pg-10 - .use-pg-10
- .except-docs-qa-geo except:
parallel: 3 variables:
- $CI_COMMIT_REF_NAME =~ /(^geo[\/-].*|.*-geo$)/
quick-rspec geo pg ee: quick-rspec geo pg ee:
extends: extends:
- .rspec-base-pg-geo - .rspec-base-geo
- .use-pg - .use-pg
stage: quick-test stage: quick-test
only: only:
- /(^geo[\/-].*|.*-geo$)/ variables:
- $CI_COMMIT_REF_NAME =~ /(^geo[\/-].*|.*-geo$)/
quick-rspec geo pg-10 ee: quick-rspec geo pg-10 ee:
extends: extends:
- .rspec-base-pg-geo - .rspec-base-geo
- .use-pg-10 - .use-pg-10
stage: quick-test stage: quick-test
only: only:
- /(^geo[\/-].*|.*-geo$)/ variables:
- $CI_COMMIT_REF_NAME =~ /(^geo[\/-].*|.*-geo$)/
rspec quarantine pg ee: rspec quarantine pg ee:
extends: rspec quarantine pg extends: rspec quarantine pg
...@@ -417,35 +356,10 @@ rspec quarantine pg ee: ...@@ -417,35 +356,10 @@ rspec quarantine pg ee:
- scripts/gitaly-test-spawn - scripts/gitaly-test-spawn
- bin/rspec --color --format documentation --format RspecJunitFormatter --out junit_rspec.xml --tag quarantine -- ee/spec/ - bin/rspec --color --format documentation --format RspecJunitFormatter --out junit_rspec.xml --tag quarantine -- ee/spec/
migration:upgrade-pg-ce-to-ee:
extends:
- .default-tags
- .default-retry
- .default-cache
- .default-before_script
- .use-pg
- .except-docs-qa
dependencies: ["setup-test-env"]
variables:
SETUP_DB: "false"
script:
- ruby -r./scripts/ee_specific_check/ee_specific_check -e'EESpecificCheck.fetch_remote_ce_branch'
- git checkout -f FETCH_HEAD
- . scripts/utils.sh
- . scripts/prepare_build.sh
- date
- setup_db
- date
- git checkout -f $CI_COMMIT_SHA
- date
- . scripts/prepare_build.sh
- date
- bundle exec rake db:migrate
db:rollback geo: db:rollback geo:
extends: extends:
- db:rollback - db:rollback
- .only-gitlab-ee - .only-ee
script: script:
- bundle exec rake geo:db:migrate VERSION=20170627195211 - bundle exec rake geo:db:migrate VERSION=20170627195211
- bundle exec rake geo:db:migrate - bundle exec rake geo:db:migrate
......
include: # include:
- template: Code-Quality.gitlab-ci.yml # - template: Code-Quality.gitlab-ci.yml
- template: Security/SAST.gitlab-ci.yml # - template: Security/SAST.gitlab-ci.yml
- template: Security/Dependency-Scanning.gitlab-ci.yml # - template: Security/Dependency-Scanning.gitlab-ci.yml
- template: Security/DAST.gitlab-ci.yml # - template: Security/DAST.gitlab-ci.yml
.reports: # 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.
code_quality:
extends: extends:
- .default-retry - .default-retry
- .except-docs - .default-only
- .only-code-changes
code_quality: stage: test
extends: .reports image: docker:stable
allow_failure: true
services:
- docker:stable-dind
variables:
DOCKER_DRIVER: overlay2
DOCKER_TLS_CERTDIR: ""
script:
- |
if ! docker info &>/dev/null; then
if [ -z "$DOCKER_HOST" -a "$KUBERNETES_PORT" ]; then
export DOCKER_HOST='tcp://localhost:2375'
fi
fi
- docker run
--env SOURCE_CODE="$PWD"
--volume "$PWD":/code
--volume /var/run/docker.sock:/var/run/docker.sock
"registry.gitlab.com/gitlab-org/security-products/codequality:12-0-stable" /code
artifacts:
reports:
codequality: gl-code-quality-report.json
expire_in: 1 week
dependencies: []
except:
variables:
- $CODE_QUALITY_DISABLED
# 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.
sast: sast:
extends: .reports extends:
- .default-retry
- .default-only
- .only-code-changes
stage: test
image: docker:stable
variables: variables:
DOCKER_DRIVER: overlay2
DOCKER_TLS_CERTDIR: ""
SAST_BRAKEMAN_LEVEL: 2 SAST_BRAKEMAN_LEVEL: 2
SAST_EXCLUDED_PATHS: qa,spec,doc SAST_EXCLUDED_PATHS: qa,spec,doc,ee/spec
allow_failure: true
services:
- docker:stable-dind
script:
- export SAST_VERSION=${SP_VERSION:-$(echo "$CI_SERVER_VERSION" | sed 's/^\([0-9]*\)\.\([0-9]*\).*/\1-\2-stable/')}
- |
if ! docker info &>/dev/null; then
if [ -z "$DOCKER_HOST" -a "$KUBERNETES_PORT" ]; then
export DOCKER_HOST='tcp://localhost:2375'
fi
fi
- | # this is required to avoid undesirable reset of Docker image ENV variables being set on build stage
function propagate_env_vars() {
CURRENT_ENV=$(printenv)
for VAR_NAME; do
echo $CURRENT_ENV | grep "${VAR_NAME}=" > /dev/null && echo "--env $VAR_NAME "
done
}
- |
docker run \
$(propagate_env_vars \
SAST_BANDIT_EXCLUDED_PATHS \
SAST_ANALYZER_IMAGES \
SAST_ANALYZER_IMAGE_PREFIX \
SAST_ANALYZER_IMAGE_TAG \
SAST_DEFAULT_ANALYZERS \
SAST_PULL_ANALYZER_IMAGES \
SAST_BRAKEMAN_LEVEL \
SAST_FLAWFINDER_LEVEL \
SAST_GITLEAKS_ENTROPY_LEVEL \
SAST_GOSEC_LEVEL \
SAST_EXCLUDED_PATHS \
SAST_DOCKER_CLIENT_NEGOTIATION_TIMEOUT \
SAST_PULL_ANALYZER_IMAGE_TIMEOUT \
SAST_RUN_ANALYZER_TIMEOUT \
SAST_JAVA_VERSION \
ANT_HOME \
ANT_PATH \
GRADLE_PATH \
JAVA_OPTS \
JAVA_PATH \
JAVA_8_VERSION \
JAVA_11_VERSION \
MAVEN_CLI_OPTS \
MAVEN_PATH \
MAVEN_REPO_PATH \
SBT_PATH \
FAIL_NEVER \
) \
--volume "$PWD:/code" \
--volume /var/run/docker.sock:/var/run/docker.sock \
"registry.gitlab.com/gitlab-org/security-products/sast:$SAST_VERSION" /app/bin/run /code
artifacts: artifacts:
expire_in: 7 days expire_in: 7 days
paths: paths:
- gl-sast-report.json - gl-sast-report.json
reports:
sast: gl-sast-report.json
dependencies: []
only:
variables:
- $GITLAB_FEATURES =~ /\bsast\b/
except:
variables:
- $SAST_DISABLED
# 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.
dependency_scanning: dependency_scanning:
extends: .reports extends:
- .default-retry
- .default-only
- .only-code-changes
stage: test
image: docker:stable
variables:
DOCKER_DRIVER: overlay2
DOCKER_TLS_CERTDIR: ""
allow_failure: true
services:
- docker:stable-dind
script:
- export DS_VERSION=${SP_VERSION:-$(echo "$CI_SERVER_VERSION" | sed 's/^\([0-9]*\)\.\([0-9]*\).*/\1-\2-stable/')}
- |
if ! docker info &>/dev/null; then
if [ -z "$DOCKER_HOST" -a "$KUBERNETES_PORT" ]; then
export DOCKER_HOST='tcp://localhost:2375'
fi
fi
- | # this is required to avoid undesirable reset of Docker image ENV variables being set on build stage
function propagate_env_vars() {
CURRENT_ENV=$(printenv)
for VAR_NAME; do
echo $CURRENT_ENV | grep "${VAR_NAME}=" > /dev/null && echo "--env $VAR_NAME "
done
}
- |
docker run \
$(propagate_env_vars \
DS_ANALYZER_IMAGES \
DS_ANALYZER_IMAGE_PREFIX \
DS_ANALYZER_IMAGE_TAG \
DS_DEFAULT_ANALYZERS \
DS_EXCLUDED_PATHS \
DEP_SCAN_DISABLE_REMOTE_CHECKS \
DS_DOCKER_CLIENT_NEGOTIATION_TIMEOUT \
DS_PULL_ANALYZER_IMAGE_TIMEOUT \
DS_RUN_ANALYZER_TIMEOUT \
DS_PYTHON_VERSION \
DS_PIP_DEPENDENCY_PATH \
PIP_INDEX_URL \
PIP_EXTRA_INDEX_URL \
) \
--volume "$PWD:/code" \
--volume /var/run/docker.sock:/var/run/docker.sock \
"registry.gitlab.com/gitlab-org/security-products/dependency-scanning:$DS_VERSION" /code
artifacts:
reports:
dependency_scanning: gl-dependency-scanning-report.json
dependencies: []
only:
variables:
- $GITLAB_FEATURES =~ /\bdependency_scanning\b/
except:
variables:
- $DEPENDENCY_SCANNING_DISABLED
# 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.
dast: dast:
extends: extends:
- .reports - .default-retry
- .review-only - .default-only
- .only-code-qa-changes
- .only-review
stage: qa stage: qa
dependencies: ["review-deploy"] dependencies: ["review-deploy"]
before_script: before_script:
- export DAST_WEBSITE="$(cat review_app_url.txt)" - export DAST_WEBSITE="$(cat review_app_url.txt)"
image:
name: "registry.gitlab.com/gitlab-org/security-products/dast:$CI_SERVER_VERSION_MAJOR-$CI_SERVER_VERSION_MINOR-stable"
variables:
# URL to scan:
# DAST_WEBSITE: https://example.com/
#
# Time limit for target availability (scan is attempted even when timeout):
# DAST_TARGET_AVAILABILITY_TIMEOUT: 60
#
# Set these variables to scan with an authenticated user:
# DAST_AUTH_URL: https://example.com/sign-in
# DAST_USERNAME: john.doe@example.com
# DAST_PASSWORD: john-doe-password
# DAST_USERNAME_FIELD: session[user] # the name of username field at the sign-in HTML form
# DAST_PASSWORD_FIELD: session[password] # the name of password field at the sign-in HTML form
# DAST_AUTH_EXCLUDE_URLS: http://example.com/sign-out,http://example.com/sign-out-2 # optional: URLs to skip during the authenticated scan; comma-separated, no spaces in between
#
# Perform ZAP Full Scan, which includes both passive and active scanning:
# DAST_FULL_SCAN_ENABLED: "true"
allow_failure: true
script:
- export DAST_WEBSITE=${DAST_WEBSITE:-$(cat environment_url.txt)}
- /analyze -t $DAST_WEBSITE
artifacts: artifacts:
expire_in: 7 days expire_in: 7 days
paths: paths:
- gl-dast-report.json - gl-dast-report.json
reports:
dast: gl-dast-report.json
only:
variables:
- $GITLAB_FEATURES =~ /\bdast\b/
except:
variables:
- $DAST_DISABLED
.review-schedules-only:
only:
refs:
- schedules@gitlab-org/gitlab-foss
- schedules@gitlab-org/gitlab
kubernetes: active
variables:
- $REVIEW_APP_CLEANUP
except:
refs:
- tags
- /(^docs[\/-].+|.+-docs$)/
.review-base: .review-base:
extends: extends:
- .default-tags - .default-tags
- .default-retry - .default-retry
- .review-only - .default-only
- .only-review
- .only-code-qa-changes
image: registry.gitlab.com/gitlab-org/gitlab-build-images:gitlab-charts-build-base image: registry.gitlab.com/gitlab-org/gitlab-build-images:gitlab-charts-build-base
dependencies: [] dependencies: []
before_script: before_script:
...@@ -25,6 +14,7 @@ ...@@ -25,6 +14,7 @@
extends: extends:
- .default-tags - .default-tags
- .default-retry - .default-retry
- .default-only
image: registry.gitlab.com/gitlab-org/gitlab-build-images:gitlab-qa-alpine image: registry.gitlab.com/gitlab-org/gitlab-build-images:gitlab-qa-alpine
services: services:
- docker:19.03.0-dind - docker:19.03.0-dind
...@@ -39,12 +29,11 @@ ...@@ -39,12 +29,11 @@
build-qa-image: build-qa-image:
extends: extends:
- .review-docker - .review-docker
- .except-docs - .only-code-qa-changes
only: only:
refs: variables:
- branches@gitlab-org/gitlab-foss - $CI_SERVER_HOST == "gitlab.com" && $CI_PROJECT_NAMESPACE == "gitlab-org"
- branches@gitlab-org/gitlab stage: prepare
stage: test
script: script:
- '[[ ! -d "ee/" ]] || export GITLAB_EDITION="ee"' - '[[ ! -d "ee/" ]] || export GITLAB_EDITION="ee"'
- export QA_IMAGE="${CI_REGISTRY}/${CI_PROJECT_PATH}/gitlab/gitlab-${GITLAB_EDITION}-qa:${CI_COMMIT_REF_SLUG}" - export QA_IMAGE="${CI_REGISTRY}/${CI_PROJECT_PATH}/gitlab/gitlab-${GITLAB_EDITION}-qa:${CI_COMMIT_REF_SLUG}"
...@@ -53,6 +42,9 @@ build-qa-image: ...@@ -53,6 +42,9 @@ build-qa-image:
- time docker push ${QA_IMAGE} - time docker push ${QA_IMAGE}
.review-build-cng-base: .review-build-cng-base:
extends:
- .default-only
- .only-code-qa-changes
image: ruby:2.6-alpine image: ruby:2.6-alpine
stage: review-prepare stage: review-prepare
before_script: before_script:
...@@ -66,13 +58,13 @@ build-qa-image: ...@@ -66,13 +58,13 @@ build-qa-image:
review-build-cng: review-build-cng:
extends: extends:
- .review-build-cng-base - .review-build-cng-base
- .review-only - .only-review
needs: ["gitlab:assets:compile pull-cache"] needs: ["gitlab:assets:compile pull-cache"]
schedule:review-build-cng: schedule:review-build-cng:
extends: extends:
- .review-build-cng-base - .review-build-cng-base
- .review-schedules-only - .only-review-schedules
needs: ["gitlab:assets:compile"] needs: ["gitlab:assets:compile"]
.review-deploy-base: .review-deploy-base:
...@@ -118,7 +110,7 @@ review-deploy: ...@@ -118,7 +110,7 @@ review-deploy:
schedule:review-deploy: schedule:review-deploy:
extends: extends:
- .review-deploy-base - .review-deploy-base
- .review-schedules-only - .only-review-schedules
needs: ["schedule:review-build-cng"] needs: ["schedule:review-build-cng"]
review-stop: review-stop:
...@@ -153,7 +145,8 @@ review-cleanup-failed-deployment: ...@@ -153,7 +145,8 @@ review-cleanup-failed-deployment:
.review-qa-base: .review-qa-base:
extends: extends:
- .review-docker - .review-docker
- .review-only - .only-review
- .only-code-qa-changes
stage: qa stage: qa
variables: variables:
QA_ARTIFACTS_DIR: "${CI_PROJECT_DIR}/qa" QA_ARTIFACTS_DIR: "${CI_PROJECT_DIR}/qa"
...@@ -200,7 +193,9 @@ review-qa-all: ...@@ -200,7 +193,9 @@ review-qa-all:
parallel-spec-reports: parallel-spec-reports:
extends: extends:
- .default-tags - .default-tags
- .except-docs - .default-only
- .only-code-qa-changes
- .only-review
image: ruby:2.6-alpine image: ruby:2.6-alpine
stage: post-test stage: post-test
dependencies: ["review-qa-all"] dependencies: ["review-qa-all"]
...@@ -247,14 +242,14 @@ review-performance: ...@@ -247,14 +242,14 @@ review-performance:
schedule:review-performance: schedule:review-performance:
extends: extends:
- review-performance - review-performance
- .review-schedules-only - .only-review-schedules
dependencies: ["schedule:review-deploy"] dependencies: ["schedule:review-deploy"]
schedule:review-cleanup: schedule:review-cleanup:
extends: extends:
- .review-base - .review-base
- .review-schedules-only - .only-review-schedules
stage: build stage: prepare
allow_failure: true allow_failure: true
environment: environment:
name: review/auto-cleanup name: review/auto-cleanup
...@@ -270,6 +265,7 @@ danger-review: ...@@ -270,6 +265,7 @@ danger-review:
- .default-tags - .default-tags
- .default-retry - .default-retry
- .default-cache - .default-cache
- .default-only
image: registry.gitlab.com/gitlab-org/gitlab-build-images:danger image: registry.gitlab.com/gitlab-org/gitlab-build-images:danger
stage: test stage: test
dependencies: [] dependencies: []
...@@ -279,10 +275,9 @@ danger-review: ...@@ -279,10 +275,9 @@ danger-review:
except: except:
refs: refs:
- master - master
- /^\d+-\d+-auto-deploy-\d+$/ variables:
- /^[\d-]+-stable(-ee)?$/ - $CI_COMMIT_REF_NAME =~ /^\d+-\d+-auto-deploy-\d+$/
- /^ce-to-ee-.*/ - $CI_COMMIT_REF_NAME =~ /^[\d-]+-stable(-ee)?$/
- /.*-stable(-ee)?-prepare-.*/
script: script:
- git version - git version
- node --version - node --version
......
...@@ -6,7 +6,6 @@ cache gems: ...@@ -6,7 +6,6 @@ cache gems:
- .default-retry - .default-retry
- .default-cache - .default-cache
- .default-before_script - .default-before_script
- .except-docs
stage: test stage: test
dependencies: ["setup-test-env"] dependencies: ["setup-test-env"]
needs: ["setup-test-env"] needs: ["setup-test-env"]
...@@ -19,15 +18,17 @@ cache gems: ...@@ -19,15 +18,17 @@ cache gems:
- vendor/cache - vendor/cache
only: only:
refs: refs:
- master@gitlab-org/gitlab-foss - master
- master@gitlab-org/gitlab
- tags - tags
variables:
- $CI_SERVER_HOST == "gitlab.com" && $CI_PROJECT_NAMESPACE == "gitlab-org"
.minimal-job: .minimal-job:
extends: extends:
- .default-tags - .default-tags
- .default-retry - .default-retry
- .except-docs-qa - .default-only
- .only-code-changes
dependencies: [] dependencies: []
gitlab_git_test: gitlab_git_test:
...@@ -40,5 +41,6 @@ no_ee_check: ...@@ -40,5 +41,6 @@ no_ee_check:
script: script:
- scripts/no-ee-check - scripts/no-ee-check
only: only:
refs: variables:
- branches@gitlab-org/gitlab-foss - $CI_SERVER_HOST == "gitlab.com" && $CI_PROJECT_NAME == "gitlab-foss"
- $CI_SERVER_HOST == "dev.gitlab.org" && $CI_PROJECT_NAME == "gitlabhq"
.tests-metadata-state: .tests-metadata-state:
extends: .default-only
variables: variables:
TESTS_METADATA_S3_BUCKET: "gitlab-ce-cache" TESTS_METADATA_S3_BUCKET: "gitlab-ce-cache"
before_script: before_script:
...@@ -13,7 +14,7 @@ ...@@ -13,7 +14,7 @@
retrieve-tests-metadata: retrieve-tests-metadata:
extends: extends:
- .tests-metadata-state - .tests-metadata-state
- .except-docs-qa - .only-code-changes
stage: prepare stage: prepare
cache: cache:
key: tests_metadata key: tests_metadata
...@@ -26,8 +27,8 @@ retrieve-tests-metadata: ...@@ -26,8 +27,8 @@ retrieve-tests-metadata:
- mkdir -p rspec_profiling/ - 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 - 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}' - '[[ -f $FLAKY_RSPEC_SUITE_REPORT_PATH ]] || echo "{}" > ${FLAKY_RSPEC_SUITE_REPORT_PATH}'
- 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/" ]] || 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'
- '[[ -f $EE_KNAPSACK_RSPEC_SUITE_REPORT_PATH ]] || echo "{}" > ${EE_KNAPSACK_RSPEC_SUITE_REPORT_PATH}' - '[[ ! -d "ee/" ]] || [[ -f $EE_KNAPSACK_RSPEC_SUITE_REPORT_PATH ]] || echo "{}" > ${EE_KNAPSACK_RSPEC_SUITE_REPORT_PATH}'
update-tests-metadata: update-tests-metadata:
extends: .tests-metadata-state extends: .tests-metadata-state
...@@ -43,9 +44,9 @@ update-tests-metadata: ...@@ -43,9 +44,9 @@ update-tests-metadata:
- echo "{}" > ${KNAPSACK_RSPEC_SUITE_REPORT_PATH} - echo "{}" > ${KNAPSACK_RSPEC_SUITE_REPORT_PATH}
- scripts/merge-reports ${KNAPSACK_RSPEC_SUITE_REPORT_PATH} knapsack/${CI_PROJECT_NAME}/rspec_*_pg_node_*.json - 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' - '[[ -z ${TESTS_METADATA_S3_BUCKET} ]] || scripts/sync-reports put $TESTS_METADATA_S3_BUCKET $KNAPSACK_RSPEC_SUITE_REPORT_PATH'
- echo "{}" > ${EE_KNAPSACK_RSPEC_SUITE_REPORT_PATH} - '[[ ! -d "ee/" ]] || echo "{}" > ${EE_KNAPSACK_RSPEC_SUITE_REPORT_PATH}'
- scripts/merge-reports ${EE_KNAPSACK_RSPEC_SUITE_REPORT_PATH} knapsack/${CI_PROJECT_NAME}/rspec_*_pg_ee_*node_*.json - '[[ ! -d "ee/" ]] || scripts/merge-reports ${EE_KNAPSACK_RSPEC_SUITE_REPORT_PATH} knapsack/${CI_PROJECT_NAME}/rspec_*_pg_ee_*node_*.json'
- '[[ -z ${TESTS_METADATA_S3_BUCKET} ]] || scripts/sync-reports put $TESTS_METADATA_S3_BUCKET $EE_KNAPSACK_RSPEC_SUITE_REPORT_PATH' - '[[ ! -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 - rm -f knapsack/${CI_PROJECT_NAME}/*_node_*.json
- scripts/merge-reports ${FLAKY_RSPEC_SUITE_REPORT_PATH} rspec_flaky/all_*_*.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} - FLAKY_RSPEC_GENERATE_REPORT=1 scripts/prune-old-flaky-specs ${FLAKY_RSPEC_SUITE_REPORT_PATH}
...@@ -54,15 +55,17 @@ update-tests-metadata: ...@@ -54,15 +55,17 @@ update-tests-metadata:
- scripts/insert-rspec-profiling-data - scripts/insert-rspec-profiling-data
only: only:
refs: refs:
- master@gitlab-org/gitlab-foss - master
- master@gitlab-org/gitlab variables:
- master@gitlab/gitlabhq - $CI_SERVER_HOST == "gitlab.com" && $CI_PROJECT_NAMESPACE == "gitlab-org"
- master@gitlab/gitlab-ee - $CI_SERVER_HOST == "dev.gitlab.org"
flaky-examples-check: flaky-examples-check:
extends: extends:
- .default-tags - .default-tags
- .default-retry - .default-retry
- .default-only
- .only-code-changes
image: ruby:2.6-alpine image: ruby:2.6-alpine
stage: post-test stage: post-test
variables: variables:
...@@ -70,12 +73,7 @@ flaky-examples-check: ...@@ -70,12 +73,7 @@ flaky-examples-check:
allow_failure: true allow_failure: true
only: only:
refs: refs:
- branches - merge_requests
except:
refs:
- master
- /(^docs[\/-].+|.+-docs$)/
- /(^qa[\/-].*|.*-qa$)/
artifacts: artifacts:
expire_in: 30d expire_in: 30d
paths: paths:
......
...@@ -4,7 +4,10 @@ lint-ci-gitlab: ...@@ -4,7 +4,10 @@ lint-ci-gitlab:
extends: extends:
- .default-tags - .default-tags
- .default-retry - .default-retry
- .except-docs - .default-only
only:
changes:
- "**/*.yml"
image: sdesbure/yamllint:latest image: sdesbure/yamllint:latest
dependencies: [] dependencies: []
script: script:
......
<script>
export default {
props: {
duration: {
type: String,
required: true,
},
},
};
</script>
<template>
<div class="duration rounded align-self-start px-2 ml-2 flex-shrink-0">{{ duration }}</div>
</template>
...@@ -21,7 +21,7 @@ export default { ...@@ -21,7 +21,7 @@ export default {
<template> <template>
<div class="line"> <div class="line">
<line-number :line-number="line.lineNumber" :path="path" /> <line-number :line-number="line.lineNumber" :path="path" />
<span v-for="(content, i) in line.content" :key="i" class="line-text" :class="content.style">{{ <span v-for="(content, i) in line.content" :key="i" :class="content.style">{{
content.text content.text
}}</span> }}</span>
</div> </div>
......
<script> <script>
import Icon from '~/vue_shared/components/icon.vue'; import Icon from '~/vue_shared/components/icon.vue';
import LineNumber from './line_number.vue'; import LineNumber from './line_number.vue';
import DurationBadge from './duration_badge.vue';
export default { export default {
components: { components: {
Icon, Icon,
LineNumber, LineNumber,
DurationBadge,
}, },
props: { props: {
line: { line: {
...@@ -20,6 +22,11 @@ export default { ...@@ -20,6 +22,11 @@ export default {
type: String, type: String,
required: true, required: true,
}, },
duration: {
type: String,
required: false,
default: '',
},
}, },
computed: { computed: {
iconName() { iconName() {
...@@ -35,11 +42,16 @@ export default { ...@@ -35,11 +42,16 @@ export default {
</script> </script>
<template> <template>
<div class="line collapsible-line" role="button" @click="handleOnClick"> <div
<icon :name="iconName" class="arrow" /> class="line collapsible-line d-flex justify-content-between"
role="button"
@click="handleOnClick"
>
<icon :name="iconName" class="arrow position-absolute" />
<line-number :line-number="line.lineNumber" :path="path" /> <line-number :line-number="line.lineNumber" :path="path" />
<span v-for="(content, i) in line.content" :key="i" class="line-text" :class="content.style">{{ <span v-for="(content, i) in line.content" :key="i" class="line-text" :class="content.style">{{
content.text content.text
}}</span> }}</span>
<duration-badge v-if="duration" :duration="duration" />
</div> </div>
</template> </template>
...@@ -46,7 +46,10 @@ export default { ...@@ -46,7 +46,10 @@ export default {
}; };
</script> </script>
<template> <template>
<gl-link :id="lineNumberId" class="line-number" :href="buildLineNumber">{{ <gl-link
parsedLineNumber :id="lineNumberId"
}}</gl-link> class="d-inline-block text-right position-absolute line-number"
:href="buildLineNumber"
>{{ parsedLineNumber }}</gl-link
>
</template> </template>
...@@ -9,7 +9,7 @@ export default { ...@@ -9,7 +9,7 @@ export default {
LogLineHeader, LogLineHeader,
}, },
computed: { computed: {
...mapState(['traceEndpoint', 'trace']), ...mapState(['traceEndpoint', 'trace', 'isTraceComplete']),
}, },
methods: { methods: {
...mapActions(['toggleCollapsibleLine']), ...mapActions(['toggleCollapsibleLine']),
...@@ -20,12 +20,13 @@ export default { ...@@ -20,12 +20,13 @@ export default {
}; };
</script> </script>
<template> <template>
<code class="job-log"> <code class="job-log d-block">
<template v-for="(section, index) in trace"> <template v-for="(section, index) in trace">
<template v-if="section.isHeader"> <template v-if="section.isHeader">
<log-line-header <log-line-header
:key="`collapsible-${index}`" :key="`collapsible-${index}`"
:line="section.line" :line="section.line"
:duration="section.section_duration"
:path="traceEndpoint" :path="traceEndpoint"
:is-closed="section.isClosed" :is-closed="section.isClosed"
@toggleLine="handleOnClickCollapsibleLine(section)" @toggleLine="handleOnClickCollapsibleLine(section)"
...@@ -41,5 +42,11 @@ export default { ...@@ -41,5 +42,11 @@ export default {
</template> </template>
<log-line v-else :key="section.offset" :line="section" :path="traceEndpoint" /> <log-line v-else :key="section.offset" :line="section" :path="traceEndpoint" />
</template> </template>
<div v-if="!isTraceComplete" class="js-log-animation loader-animation pt-3 pl-3">
<div class="dot"></div>
<div class="dot"></div>
<div class="dot"></div>
</div>
</code> </code>
</template> </template>
/**
* Adds the line number property
* @param Object line
* @param Number lineNumber
*/
export const parseLine = (line = {}, lineNumber) => ({
...line,
lineNumber,
});
/** /**
* Parses the job log content into a structure usable by the template * Parses the job log content into a structure usable by the template
* *
...@@ -5,6 +15,7 @@ ...@@ -5,6 +15,7 @@
* - creates a new array to hold the lines that are collpasible, * - creates a new array to hold the lines that are collpasible,
* - adds a isClosed property to handle toggle * - adds a isClosed property to handle toggle
* - adds a isHeader property to handle template logic * - adds a isHeader property to handle template logic
* - adds the section_duration
* For each line: * For each line:
* - adds the index as lineNumber * - adds the index as lineNumber
* *
...@@ -14,27 +25,21 @@ ...@@ -14,27 +25,21 @@
export const logLinesParser = (lines = [], lineNumberStart) => export const logLinesParser = (lines = [], lineNumberStart) =>
lines.reduce((acc, line, index) => { lines.reduce((acc, line, index) => {
const lineNumber = lineNumberStart ? lineNumberStart + index : index; const lineNumber = lineNumberStart ? lineNumberStart + index : index;
const last = acc[acc.length - 1];
if (line.section_header) { if (line.section_header) {
acc.push({ acc.push({
isClosed: true, isClosed: true,
isHeader: true, isHeader: true,
line: { line: parseLine(line, lineNumber),
...line,
lineNumber,
},
lines: [], lines: [],
}); });
} else if (acc.length && acc[acc.length - 1].isHeader) { } else if (acc.length && last.isHeader && !line.section_duration && line.content.length) {
acc[acc.length - 1].lines.push({ last.lines.push(parseLine(line, lineNumber));
...line, } else if (acc.length && last.isHeader && line.section_duration) {
lineNumber, last.section_duration = line.section_duration;
}); } else if (line.content.length) {
} else { acc.push(parseLine(line, lineNumber));
acc.push({
...line,
lineNumber,
});
} }
return acc; return acc;
......
...@@ -2,8 +2,8 @@ function simulateEvent(el, type, options = {}) { ...@@ -2,8 +2,8 @@ function simulateEvent(el, type, options = {}) {
let event; let event;
if (!el) return null; if (!el) return null;
if (/^mouse/.test(type)) { if (/^(pointer|mouse)/.test(type)) {
event = el.ownerDocument.createEvent('MouseEvents'); event = el.ownerDocument.createEvent('MouseEvent');
event.initMouseEvent( event.initMouseEvent(
type, type,
true, true,
...@@ -125,7 +125,7 @@ export default function simulateDrag(options) { ...@@ -125,7 +125,7 @@ export default function simulateDrag(options) {
const startTime = new Date().getTime(); const startTime = new Date().getTime();
const duration = options.duration || 1000; const duration = options.duration || 1000;
simulateEvent(fromEl, 'mousedown', { simulateEvent(fromEl, 'pointerdown', {
button: 0, button: 0,
clientX: fromRect.cx, clientX: fromRect.cx,
clientY: fromRect.cy, clientY: fromRect.cy,
...@@ -146,7 +146,7 @@ export default function simulateDrag(options) { ...@@ -146,7 +146,7 @@ export default function simulateDrag(options) {
const y = fromRect.cy + (toRect.cy - fromRect.cy) * progress; const y = fromRect.cy + (toRect.cy - fromRect.cy) * progress;
const overEl = fromEl.ownerDocument.elementFromPoint(x, y); const overEl = fromEl.ownerDocument.elementFromPoint(x, y);
simulateEvent(overEl, 'mousemove', { simulateEvent(overEl, 'pointermove', {
clientX: x, clientX: x,
clientY: y, clientY: y,
}); });
......
.job-log {
font-family: $monospace-font;
padding: $gl-padding-8 $input-horizontal-padding;
margin: 0 0 $gl-padding-8;
font-size: 13px;
word-break: break-all;
word-wrap: break-word;
color: $gl-text-color-inverted;
border-radius: $border-radius-small;
min-height: 42px;
background-color: $builds-trace-bg;
}
.line {
padding: 1px $gl-padding 1px $job-log-line-padding;
}
.line-number {
color: $gl-text-color-inverted;
padding: 0 $gl-padding-8;
min-width: $job-line-number-width;
margin-left: -$job-line-number-width;
padding-right: 1em;
&:hover,
&:active,
&:visited {
text-decoration: underline;
color: $gl-text-color-inverted;
}
}
.collapsible-line {
&:hover {
background-color: rgba($white-light, 0.2);
}
.arrow {
margin-left: -$job-arrow-margin;
}
}
.duration {
background: $gl-gray-400;
}
.loader-animation {
@include build-loader-animation;
}
...@@ -90,3 +90,21 @@ ...@@ -90,3 +90,21 @@
padding: 0; padding: 0;
} }
} }
.is-dragging {
// Important because plugin sets inline CSS
opacity: 1 !important;
* {
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
// !important to make sure no style can override this when dragging
cursor: grabbing !important;
}
&.no-drop * {
cursor: no-drop !important;
}
}
...@@ -606,6 +606,9 @@ $blame-blue: #254e77; ...@@ -606,6 +606,9 @@ $blame-blue: #254e77;
*/ */
$builds-trace-bg: #111; $builds-trace-bg: #111;
$job-log-highlight-height: 18px; $job-log-highlight-height: 18px;
$job-log-line-padding: 62px;
$job-line-number-width: 40px;
$job-arrow-margin: 50px;
/* /*
* Commit Page * Commit Page
......
...@@ -2,20 +2,6 @@ ...@@ -2,20 +2,6 @@
cursor: grab; cursor: grab;
} }
.is-dragging {
// Important because plugin sets inline CSS
opacity: 1 !important;
* {
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
// !important to make sure no style can override this when dragging
cursor: grabbing !important;
}
}
.is-ghost { .is-ghost {
opacity: 0.3; opacity: 0.3;
pointer-events: none; pointer-events: none;
......
...@@ -889,11 +889,7 @@ pre.light-well { ...@@ -889,11 +889,7 @@ pre.light-well {
@include basic-list-stats; @include basic-list-stats;
display: flex; display: flex;
align-items: center; align-items: center;
padding: $gl-padding 0; padding: $gl-padding-12 0;
@include media-breakpoint-up(lg) {
padding: $gl-padding 0;
}
&.no-description { &.no-description {
@include media-breakpoint-up(sm) { @include media-breakpoint-up(sm) {
...@@ -909,7 +905,7 @@ pre.light-well { ...@@ -909,7 +905,7 @@ pre.light-well {
} }
h2 { h2 {
font-size: $gl-font-size-large; font-size: $gl-font-size;
font-weight: $gl-font-weight-bold; font-weight: $gl-font-weight-bold;
margin-bottom: 0; margin-bottom: 0;
...@@ -951,6 +947,7 @@ pre.light-well { ...@@ -951,6 +947,7 @@ pre.light-well {
.description { .description {
line-height: 1.5; line-height: 1.5;
color: $gl-text-color-secondary;
} }
@include media-breakpoint-down(md) { @include media-breakpoint-down(md) {
...@@ -1096,7 +1093,6 @@ pre.light-well { ...@@ -1096,7 +1093,6 @@ pre.light-well {
&:not(.explore) { &:not(.explore) {
.forks { .forks {
display: none; display: none;
} }
} }
......
...@@ -19,7 +19,7 @@ module VersionCheckHelper ...@@ -19,7 +19,7 @@ module VersionCheckHelper
end end
def source_code_project def source_code_project
'gitlab-ce' 'gitlab-foss'
end end
end end
......
...@@ -88,7 +88,11 @@ module Ci ...@@ -88,7 +88,11 @@ module Ci
validates :coverage, numericality: true, allow_blank: true validates :coverage, numericality: true, allow_blank: true
validates :ref, presence: true validates :ref, presence: true
scope :not_interruptible, -> { joins(:metadata).where(ci_builds_metadata: { interruptible: false }) } scope :not_interruptible, -> do
joins(:metadata).where('ci_builds_metadata.id NOT IN (?)',
Ci::BuildMetadata.scoped_build.with_interruptible.select(:id))
end
scope :unstarted, ->() { where(runner_id: nil) } scope :unstarted, ->() { where(runner_id: nil) }
scope :ignore_failures, ->() { where(allow_failure: false) } scope :ignore_failures, ->() { where(allow_failure: false) }
scope :with_artifacts_archive, ->() do scope :with_artifacts_archive, ->() do
......
...@@ -25,6 +25,9 @@ module Ci ...@@ -25,6 +25,9 @@ module Ci
chronic_duration_attr_reader :timeout_human_readable, :timeout chronic_duration_attr_reader :timeout_human_readable, :timeout
scope :scoped_build, -> { where('ci_builds_metadata.build_id = ci_builds.id') }
scope :with_interruptible, -> { where(interruptible: true) }
enum timeout_source: { enum timeout_source: {
unknown_timeout_source: 1, unknown_timeout_source: 1,
project_timeout_source: 2, project_timeout_source: 2,
......
...@@ -95,7 +95,7 @@ module Ci ...@@ -95,7 +95,7 @@ module Ci
# rubocop: disable CodeReuse/ActiveRecord # rubocop: disable CodeReuse/ActiveRecord
def auto_cancelable_pipelines def auto_cancelable_pipelines
# TODO: Introduced by https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/23464 # TODO: Introduced by https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/23464
if Feature.enabled?(:ci_support_interruptible_pipelines, project, default_enabled: false) if Feature.enabled?(:ci_support_interruptible_pipelines, project, default_enabled: true)
project.ci_pipelines project.ci_pipelines
.where(ref: pipeline.ref) .where(ref: pipeline.ref)
.where.not(id: pipeline.id) .where.not(id: pipeline.id)
......
...@@ -60,6 +60,11 @@ ...@@ -60,6 +60,11 @@
.controls.d-flex.flex-sm-column.align-items-center.align-items-sm-end.flex-wrap.flex-shrink-0.text-secondary{ class: css_controls_class } .controls.d-flex.flex-sm-column.align-items-center.align-items-sm-end.flex-wrap.flex-shrink-0.text-secondary{ class: css_controls_class }
.icon-container.d-flex.align-items-center .icon-container.d-flex.align-items-center
- if pipeline_status && can?(current_user, :read_cross_project) && project.pipeline_status.has_status? && can?(current_user, :read_build, project)
- pipeline_path = pipelines_project_commit_path(project.pipeline_status.project, project.pipeline_status.sha, ref: project.pipeline_status.ref)
%span.icon-wrapper.pipeline-status
= render 'ci/status/icon', status: project.commit.last_pipeline.detailed_status(current_user), tooltip_placement: 'top', path: pipeline_path
- if project.archived - if project.archived
%span.d-flex.icon-wrapper.badge.badge-warning archived %span.d-flex.icon-wrapper.badge.badge-warning archived
- if stars - if stars
...@@ -86,10 +91,6 @@ ...@@ -86,10 +91,6 @@
title: _('Issues'), data: { container: 'body', placement: 'top' } do title: _('Issues'), data: { container: 'body', placement: 'top' } do
= sprite_icon('issues', size: 14, css_class: 'append-right-4') = sprite_icon('issues', size: 14, css_class: 'append-right-4')
= number_with_delimiter(project.open_issues_count) = number_with_delimiter(project.open_issues_count)
- if pipeline_status && can?(current_user, :read_cross_project) && project.pipeline_status.has_status? && can?(current_user, :read_build, project)
- pipeline_path = pipelines_project_commit_path(project.pipeline_status.project, project.pipeline_status.sha, ref: project.pipeline_status.ref)
%span.icon-wrapper.pipeline-status
= render 'ci/status/icon', status: project.commit.last_pipeline.detailed_status(current_user), tooltip_placement: 'top', path: pipeline_path
.updated-note .updated-note
%span %span
= _('Updated') = _('Updated')
......
...@@ -15,7 +15,8 @@ Options = Struct.new( ...@@ -15,7 +15,8 @@ Options = Struct.new(
:force, :force,
:merge_request, :merge_request,
:title, :title,
:type :type,
:ee
) )
INVALID_TYPE = -1 INVALID_TYPE = -1
...@@ -85,6 +86,10 @@ class ChangelogOptionParser ...@@ -85,6 +86,10 @@ class ChangelogOptionParser
options.type = parse_type(value) options.type = parse_type(value)
end end
opts.on('-e', '--ee', 'Generate a changelog entry for GitLab EE') do |value|
options.ee = value
end
opts.on('-h', '--help', 'Print help message') do opts.on('-h', '--help', 'Print help message') do
$stdout.puts opts $stdout.puts opts
raise Done.new raise Done.new
...@@ -249,7 +254,7 @@ class ChangelogEntry ...@@ -249,7 +254,7 @@ class ChangelogEntry
end end
def ee? def ee?
@ee ||= File.exist?(File.expand_path('../CHANGELOG-EE.md', __dir__)) options.ee
end end
def branch_name def branch_name
......
...@@ -12,6 +12,12 @@ You can create one with: ...@@ -12,6 +12,12 @@ You can create one with:
bin/changelog -m %<mr_iid>s "%<mr_title>s" bin/changelog -m %<mr_iid>s "%<mr_title>s"
``` ```
If you want to create a changelog entry for GitLab EE, run the following instead:
```
bin/changelog --ee -m %<mr_iid>s "%<mr_title>s"
```
Note: Merge requests with %<labels>s do not trigger this check. Note: Merge requests with %<labels>s do not trigger this check.
MSG MSG
......
# rubocop:disable Style/SignalException
# frozen_string_literal: true
has_only_docs_changes = helper.all_changed_files.all? { |file| file.start_with?('doc/', '.gitlab/ci/docs.gitlab-ci.yml', '.markdownlint.json') || file.end_with?('.md') }
is_docs_only_branch = gitlab.branch_for_head =~ /(^docs[\/-].*|.*-docs$)/
if is_docs_only_branch && !has_only_docs_changes
fail "It seems like your branch name has a `docs` prefix or suffix. "\
"The CI won't run the full pipeline, but you also have changed non-docs files. "\
"Please recreate this MR with a new branch name."
end
if has_only_docs_changes && !is_docs_only_branch
markdown(<<~MARKDOWN)
## Documentation only changes
Hey! Seems your merge request contains only docs changes.
Tired of waiting 2 hours for the pipeline to finish?
Next time, prepend `docs-` to [your branch name](https://docs.gitlab.com/ee/development/documentation/#branch-naming)
and the pipeline will finish before you say GitLab (x300)!
MARKDOWN
end
# frozen_string_literal: true
class ModifyConcurrentIndexToBuildsMetadata < ActiveRecord::Migration[5.0]
include Gitlab::Database::MigrationHelpers
DOWNTIME = false
disable_ddl_transaction!
def up
add_concurrent_index :ci_builds_metadata, [:build_id],
where: "interruptible = true",
name: "index_ci_builds_metadata_on_build_id_and_interruptible"
remove_concurrent_index_by_name(:ci_builds_metadata, 'index_ci_builds_metadata_on_build_id_and_interruptible_false')
end
def down
remove_concurrent_index_by_name(:ci_builds_metadata, 'index_ci_builds_metadata_on_build_id_and_interruptible')
add_concurrent_index :ci_builds_metadata, [:build_id],
where: "interruptible = false",
name: "index_ci_builds_metadata_on_build_id_and_interruptible_false"
end
end
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
# #
# It's strongly recommended that you check this file into your version control system. # It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema.define(version: 2019_09_12_061145) do ActiveRecord::Schema.define(version: 2019_09_14_223900) do
# These are extensions that must be enabled in order to support this database # These are extensions that must be enabled in order to support this database
enable_extension "pg_trgm" enable_extension "pg_trgm"
...@@ -648,7 +648,7 @@ ActiveRecord::Schema.define(version: 2019_09_12_061145) do ...@@ -648,7 +648,7 @@ ActiveRecord::Schema.define(version: 2019_09_12_061145) do
t.jsonb "config_options" t.jsonb "config_options"
t.jsonb "config_variables" t.jsonb "config_variables"
t.index ["build_id"], name: "index_ci_builds_metadata_on_build_id", unique: true t.index ["build_id"], name: "index_ci_builds_metadata_on_build_id", unique: true
t.index ["build_id"], name: "index_ci_builds_metadata_on_build_id_and_interruptible_false", where: "(interruptible = false)" t.index ["build_id"], name: "index_ci_builds_metadata_on_build_id_and_interruptible", where: "(interruptible = true)"
t.index ["project_id"], name: "index_ci_builds_metadata_on_project_id" t.index ["project_id"], name: "index_ci_builds_metadata_on_project_id"
end end
......
...@@ -63,6 +63,11 @@ We need to make Docker Registry send notification events to the ...@@ -63,6 +63,11 @@ We need to make Docker Registry send notification events to the
notification secret in `registry.notification_secret` section of notification secret in `registry.notification_secret` section of
`/etc/gitlab/gitlab.rb` file. `/etc/gitlab/gitlab.rb` file.
NOTE: **Note:**
If you use GitLab HA, you will also have to specify
the notification secret in `registry.notification_secret` section of
`/etc/gitlab/gitlab.rb` file for every web node.
1. Reconfigure the **primary** node for the change to take effect: 1. Reconfigure the **primary** node for the change to take effect:
```sh ```sh
...@@ -94,10 +99,8 @@ generate a short-lived JWT that is pull-only-capable to access the ...@@ -94,10 +99,8 @@ generate a short-lived JWT that is pull-only-capable to access the
1. Edit `/etc/gitlab/gitlab.rb`: 1. Edit `/etc/gitlab/gitlab.rb`:
```ruby ```ruby
gitlab_rails['registry_replication'] = { gitlab_rails['geo_registry_replication_enabled'] = true
enabled: true, gitlab_rails['geo_registry_replication_primary_api_url'] = 'http://primary.example.com:5000/' # internal address to the primary registry, will be used by GitLab to directly communicate with primary registry API
primary_api_url: 'http://primary.example.com:5000/' # internal address to the primary registry, will be used by GitLab to directly communicate with primary registry API
}
``` ```
1. Reconfigure the **secondary** node for the change to take effect: 1. Reconfigure the **secondary** node for the change to take effect:
......
...@@ -2104,7 +2104,7 @@ staging: ...@@ -2104,7 +2104,7 @@ staging:
> [Introduced](https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/23464) in GitLab 12.3. > [Introduced](https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/23464) in GitLab 12.3.
`interruptible` is used to indicate that a job should be canceled if made redundant by a newer run of the same job. Defaults to `true`. `interruptible` is used to indicate that a job should be canceled if made redundant by a newer run of the same job. Defaults to `false`.
This value will only be used if the [automatic cancellation of redundant pipelines feature](../../user/project/pipelines/settings.md#auto-cancel-pending-pipelines) This value will only be used if the [automatic cancellation of redundant pipelines feature](../../user/project/pipelines/settings.md#auto-cancel-pending-pipelines)
is enabled. is enabled.
......
...@@ -18,6 +18,7 @@ description: 'Learn how to contribute to GitLab.' ...@@ -18,6 +18,7 @@ description: 'Learn how to contribute to GitLab.'
- [Generate a changelog entry with `bin/changelog`](changelog.md) - [Generate a changelog entry with `bin/changelog`](changelog.md)
- [Code review guidelines](code_review.md) for reviewing code and having code reviewed - [Code review guidelines](code_review.md) for reviewing code and having code reviewed
- [Database review guidelines](database_review.md) for reviewing database-related changes and complex SQL queries - [Database review guidelines](database_review.md) for reviewing database-related changes and complex SQL queries
- [Pipelines for the GitLab project](pipelines.md)
- [Automatic CE->EE merge](automatic_ce_ee_merge.md) - [Automatic CE->EE merge](automatic_ce_ee_merge.md)
- [Guidelines for implementing Enterprise Edition features](ee_features.md) - [Guidelines for implementing Enterprise Edition features](ee_features.md)
- [Security process for developers](https://gitlab.com/gitlab-org/release/docs/blob/master/general/security/developer.md#security-releases-critical-non-critical-as-a-developer) - [Security process for developers](https://gitlab.com/gitlab-org/release/docs/blob/master/general/security/developer.md#security-releases-critical-non-critical-as-a-developer)
......
...@@ -102,6 +102,13 @@ Its simplest usage is to provide the value for `title`: ...@@ -102,6 +102,13 @@ Its simplest usage is to provide the value for `title`:
bin/changelog 'Hey DZ, I added a feature to GitLab!' bin/changelog 'Hey DZ, I added a feature to GitLab!'
``` ```
If you want to generate a changelog entry for GitLab EE, you will need to pass
the `--ee` option:
```text
bin/changelog --ee 'Hey DZ, I added a feature to GitLab!'
```
At this point the script would ask you to select the category of the change (mapped to the `type` field in the entry): At this point the script would ask you to select the category of the change (mapped to the `type` field in the entry):
```text ```text
...@@ -131,9 +138,6 @@ author: ...@@ -131,9 +138,6 @@ author:
type: type:
``` ```
If you're working on the GitLab EE repository, the entry will be added to
`ee/changelogs/unreleased/` instead.
### Arguments ### Arguments
| Argument | Shorthand | Purpose | | Argument | Shorthand | Purpose |
......
...@@ -152,20 +152,6 @@ disqus_identifier: 'https://docs.gitlab.com/my-old-location/README.html' ...@@ -152,20 +152,6 @@ disqus_identifier: 'https://docs.gitlab.com/my-old-location/README.html'
Note: it is necessary to include the file name in the `disqus_identifier` URL, Note: it is necessary to include the file name in the `disqus_identifier` URL,
even if it's `index.html` or `README.html`. even if it's `index.html` or `README.html`.
## Branch naming
If your contribution contains **only** documentation changes, you can speed up
the CI process by following these branch naming conventions:
| Branch name | Valid example |
|:----------------------|:-----------------------------|
| Starting with `docs/` | `docs/update-api-issues` |
| Starting with `docs-` | `docs-update-api-issues` |
| Ending in `-docs` | `123-update-api-issues-docs` |
If your branch name matches any of the above, it will run only the docs
tests. If not, the whole application test suite will run (including docs tests).
## Merge requests for GitLab documentation ## Merge requests for GitLab documentation
Before getting started, make sure you read the introductory section Before getting started, make sure you read the introductory section
...@@ -173,7 +159,6 @@ Before getting started, make sure you read the introductory section ...@@ -173,7 +159,6 @@ Before getting started, make sure you read the introductory section
[documentation workflow](workflow.md). [documentation workflow](workflow.md).
- Use the current [merge request description template](https://gitlab.com/gitlab-org/gitlab/blob/master/.gitlab/merge_request_templates/Documentation.md) - Use the current [merge request description template](https://gitlab.com/gitlab-org/gitlab/blob/master/.gitlab/merge_request_templates/Documentation.md)
- Use the correct [branch name](#branch-naming)
- Label the MR `Documentation` - Label the MR `Documentation`
- Assign the correct milestone (see note below) - Assign the correct milestone (see note below)
...@@ -283,10 +268,6 @@ Several [rspec tests](https://gitlab.com/gitlab-org/gitlab/blob/master/spec/feat ...@@ -283,10 +268,6 @@ Several [rspec tests](https://gitlab.com/gitlab-org/gitlab/blob/master/spec/feat
are run to ensure GitLab documentation renders and works correctly. In particular, that [main docs landing page](../../README.md) will work correctly from `/help`. are run to ensure GitLab documentation renders and works correctly. In particular, that [main docs landing page](../../README.md) will work correctly from `/help`.
For example, [GitLab.com's `/help`](https://gitlab.com/help). For example, [GitLab.com's `/help`](https://gitlab.com/help).
CAUTION: **Caution:**
Because the rspec tests only run in a full pipeline, and not a special [docs-only pipeline](#branch-naming), it is possible
to merge changes that will break `master` from a merge request with a successful docs-only pipeline run.
## Docs site architecture ## Docs site architecture
See the [Docs site architecture](site_architecture/index.md) page to learn See the [Docs site architecture](site_architecture/index.md) page to learn
...@@ -309,14 +290,9 @@ The live preview is currently enabled for the following projects: ...@@ -309,14 +290,9 @@ The live preview is currently enabled for the following projects:
- <https://gitlab.com/gitlab-org/gitlab> - <https://gitlab.com/gitlab-org/gitlab>
- <https://gitlab.com/gitlab-org/gitlab-runner> - <https://gitlab.com/gitlab-org/gitlab-runner>
If your branch contains only documentation changes, you can use If your merge request has docs changes, you can use the manual `review-docs-deploy` job
[special branch names](#branch-naming) to avoid long-running pipelines. to deploy the docs review app for your merge request.
You will need at least Maintainer permissions to be able to run it.
For [docs-only changes](#branch-naming), the review app is run automatically.
For all other branches, you can use the manual `review-docs-deploy-manual` job
in your merge request. You will need at least Maintainer permissions to be able
to run it. In the mini pipeline graph, you should see a `>>` icon. Clicking it will
reveal the `review-docs-deploy-manual` job. Click the play button to start the job.
![Manual trigger a docs build](img/manual_build_docs.png) ![Manual trigger a docs build](img/manual_build_docs.png)
......
# Pipelines for the GitLab project
Pipelines for `gitlab-org/gitlab` and `gitlab-org/gitlab-foss` (as well as the
`dev` instance's mirrors) are configured in the usual
[`.gitlab-ci.yml`](https://gitlab.com/gitlab-org/gitlab/blob/master/.gitlab-ci.yml)
which itself includes files under
[`.gitlab/ci/`](https://gitlab.com/gitlab-org/gitlab/tree/master/.gitlab/ci)
for easier maintenance.
We're striving to [dogfood](https://about.gitlab.com/handbook/engineering/#dogfooding)
GitLab [CI/CD features and best-practices](../ci/yaml/README.md)
as much as possible.
## Stages
The current stages are:
- `prepare`: This stage includes jobs that prepare artifacts that are needed by
jobs in subsequent stages.
- `quick-test`: This stage includes test jobs that should run first and fail the
pipeline early (currently used to run Geo tests when the branch name starts
with `geo-`, `geo/`, or ends with `-geo`).
- `test`: This stage includes most of the tests, DB/migration jobs, and static analysis jobs.
- `review-prepare`: This stage includes a job that build the CNG images that are
later used by the (Helm) Review App deployment (see
[Review Apps](testing_guide/review_apps.md) for details).
- `review`: This stage includes jobs that deploy the GitLab and Docs Review Apps.
- `qa`: This stage includes jobs that perform QA tasks against the Review App
that is deployed in the previous stage.
- `post-test`: This stage includes jobs that build reports or gather data from
the previous stages' jobs (e.g. coverage, Knapsack metadata etc.).
- `pages`: This stage includes a job that deploys the various reports as
GitLab pages (e.g. <https://gitlab-org.gitlab.io/gitlab/coverage-ruby/>,
<https://gitlab-org.gitlab.io/gitlab/coverage-javascript/>,
<https://gitlab-org.gitlab.io/gitlab/webpack-report/>).
## Default image
The default image is currently
`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`.
It includes Ruby 2.6.3, Go 1.11, Git 2.22, Chrome 73, Node 12, Yarn 1.16,
PostgreSQL 9.6, and Graphics Magick 1.3.33.
The images used in our pipelines are configured in the
[`gitlab-org/gitlab-build-images`](https://gitlab.com/gitlab-org/gitlab-build-images)
project, which is push-mirrored to <https://dev.gitlab.org/gitlab/gitlab-build-images>
for redundancy.
The current version of the build images can be found in the
["Used by GitLab CE/EE section"](https://gitlab.com/gitlab-org/gitlab-build-images/blob/master/.gitlab-ci.yml).
## Default variables
In addition to the [predefined variables](../ci/variables/predefined_variables.md),
each pipeline includes the following [variables](../ci/variables/README.md):
- `RAILS_ENV: "test"`
- `NODE_ENV: "test"`
- `SIMPLECOV: "true"`
- `GIT_DEPTH: "20"`
- `GIT_SUBMODULE_STRATEGY: "none"`
- `GET_SOURCES_ATTEMPTS: "3"`
- `KNAPSACK_RSPEC_SUITE_REPORT_PATH: knapsack/${CI_PROJECT_NAME}/rspec_report-master.json`
- `EE_KNAPSACK_RSPEC_SUITE_REPORT_PATH: knapsack/${CI_PROJECT_NAME}/rspec_report-master-ee.json`
- `FLAKY_RSPEC_SUITE_REPORT_PATH: rspec_flaky/report-suite.json`
- `BUILD_ASSETS_IMAGE: "false"`
- `ES_JAVA_OPTS: "-Xms256m -Xmx256m"`
- `ELASTIC_URL: "http://elastic:changeme@docker.elastic.co-elasticsearch-elasticsearch:9200"`
## Common job definitions
Most of the jobs [extend from a few CI definitions](../ci/yaml/README.md#extends)
that are scoped to a single
[configuration parameter](../ci/yaml/README.md#configuration-parameters).
These common definitions are:
- `.default-tags`: Ensures a job has the `gitlab-org` tag to ensure it's using
our dedicated runners.
- `.default-retry`: Allows a job to retry upon `unknown_failure`, `api_failure`,
`runner_system_failure`.
- `.default-before_script`: Allows a job to use a default `before_script` definition
suitable for Ruby/Rails tasks that may need a database running (e.g. tests).
- `.default-cache`: Allows a job to use a default `cache` definition suitable for
Ruby/Rails and frontend tasks.
- `.default-only`: Restricts the cases where a job is created. This currently
includes `master`, `/^[\d-]+-stable(-ee)?$/` (stable branches),
`/^\d+-\d+-auto-deploy-\d+$/` (security branches), `merge_requests`, `tags`.
Note that jobs won't be created for branches with this default configuration.
- `.only-review`: Only creates a job for the `gitlab-org` namespace and if
Kubernetes integration is available. Also, prevents a job from being created
for `master` and auto-deploy branches.
- `.only-review-schedules`: Same as `.only-review` but also restrict a job to
only run for [schedules](../user/project/pipelines/schedules.md).
- `.use-pg`: Allows a job to use the `postgres:9.6.14` and `redis:alpine` services.
- `.use-pg-10`: Allows a job to use the `postgres:10.9` and `redis:alpine` services.
- `.only-ee`: Only creates a job for the `gitlab` project.
## Changes detection
If a job extends from `.default-only` (and most of the jobs should), it can restrict
the cases where it should be created
[based on the changes](../ci/yaml/README.md#onlychangesexceptchanges)
from a commit or MR by extending from the following CI definitions:
- `.only-code-changes`: Allows a job to only be created upon code-related changes.
- `.only-qa-changes`: Allows a job to only be created upon QA-related changes.
- `.only-docs-changes`: Allows a job to only be created upon docs-related changes.
- `.only-code-qa-changes`: Allows a job to only be created upon code-related or QA-related changes.
**See <https://gitlab.com/gitlab-org/gitlab/blob/master/.gitlab/ci/global.gitlab-ci.yml>
for the list of exact patterns.**
## Directed acyclic graph
We're using the [`needs:`](../ci/yaml/README.md#needs) keyword to
execute jobs out of order for the following jobs:
```mermaid
graph RL;
A[setup-test-env];
B["gitlab:assets:compile<br/>(master only)"];
C[gitlab:assets:compile pull-cache];
D["cache gems<br/>(master and tags only)"];
E[review-build-cng];
F[build-qa-image];
G[review-deploy];
G2["schedule:review-deploy<br/>(master only)"];
H[karma];
I[jest];
J["compile-assets<br/>(master only)"];
K[compile-assets pull-cache];
L[webpack-dev-server];
M[coverage];
N[pages];
O[static-analysis];
P["package-and-qa-manual:master<br/>(master schedule only)"];
Q[package-and-qa];
R[package-and-qa-manual];
subgraph "`prepare` stage"
A
F
J
K
end
subgraph "`test` stage"
B --> |needs| A;
C --> |needs| A;
D --> |needs| A;
H -.-> |depends on| A;
H -.-> |depends on| J;
H -.-> |depends on| K;
I -.-> |depends on| A;
I -.-> |depends on| J;
I -.-> |depends on| K;
L -.-> |depends on| A;
L -.-> |depends on| J;
L -.-> |depends on| K;
downtime_check --> |needs and depends on| A;
db:* --> |needs| A;
gitlab:setup --> |needs| A;
O -.-> |depends on| A;
O -.-> |depends on| B;
O -.-> |depends on| C;
downtime_check --> |needs and depends on| A;
end
subgraph "`review-prepare` stage"
E --> |needs| C;
X["schedule:review-build-cng<br/>(master schedule only)"] --> |needs| B;
end
subgraph "`review` stage"
G --> |needs| E;
G2 --> |needs| E;
end
subgraph "`qa` stage"
Q --> |needs| C;
Q --> |needs| F;
R --> |needs| C;
R --> |needs| F;
P --> |needs| B;
P --> |needs| F;
review-qa-smoke -.-> |depends on| G;
review-qa-all -.-> |depends on| G;
review-qa-performance -.-> |depends on| G;
X2["schedule:review-performance<br/>(master only)"] -.-> |depends on| G2;
dast -.-> |depends on| G;
end
subgraph "`post-test` stage"
M
end
subgraph "`pages` stage"
N -.-> |depends on| B;
N -.-> |depends on| H;
N -.-> |depends on| M;
end
```
## Test jobs
Consult [GitLab tests in the Continuous Integration (CI) context](testing_guide/ci.md)
for more information.
## Review app jobs
Consult the [Review Apps](testing_guide/review_apps.md) dedicated page for more information.
---
[Return to Development documentation](README.md)
...@@ -7,24 +7,6 @@ as expected across the entire software stack and architecture, including ...@@ -7,24 +7,6 @@ as expected across the entire software stack and architecture, including
integration of all micro-services and components that are supposed to work integration of all micro-services and components that are supposed to work
together. together.
## Branch naming
If your contribution contains **only** changes under the
[`qa/` folder](https://gitlab.com/gitlab-org/gitlab-ce/tree/master/qa), you can
speed up the CI process by following some branch naming conventions. You have
three choices:
| Branch name | Valid example |
|:----------------------|:-----------------------------|
| Starting with `qa/` | `qa/new-oauth-login-test` |
| Starting with `qa-` | `qa-new-oauth-login-test` |
| Ending in `-qa` | `123-new-oauth-login-test-qa` |
If your branch name matches any of the above, it will run only the QA-related
jobs.
If it does not, the whole application test suite will run (including QA-related
jobs).
## How do we test GitLab? ## How do we test GitLab?
We use [Omnibus GitLab][omnibus-gitlab] to build GitLab packages and then we We use [Omnibus GitLab][omnibus-gitlab] to build GitLab packages and then we
......
...@@ -21,7 +21,6 @@ class GitlabDanger ...@@ -21,7 +21,6 @@ class GitlabDanger
single_codebase single_codebase
gitlab_ui_wg gitlab_ui_wg
ce_ee_vue_templates ce_ee_vue_templates
only_documentation
].freeze ].freeze
MESSAGE_PREFIX = '==>'.freeze MESSAGE_PREFIX = '==>'.freeze
......
...@@ -4656,9 +4656,6 @@ msgstr "" ...@@ -4656,9 +4656,6 @@ msgstr ""
msgid "Days" msgid "Days"
msgstr "" msgstr ""
msgid "Days to merge"
msgstr ""
msgid "Debug" msgid "Debug"
msgstr "" msgstr ""
...@@ -5845,6 +5842,9 @@ msgstr "" ...@@ -5845,6 +5842,9 @@ msgstr ""
msgid "Epics Roadmap" msgid "Epics Roadmap"
msgstr "" msgstr ""
msgid "Epics and Issues"
msgstr ""
msgid "Epics let you manage your portfolio of projects more efficiently and with less effort" msgid "Epics let you manage your portfolio of projects more efficiently and with less effort"
msgstr "" msgstr ""
...@@ -5896,6 +5896,9 @@ msgstr "" ...@@ -5896,6 +5896,9 @@ msgstr ""
msgid "Epics|Something went wrong while fetching group epics." msgid "Epics|Something went wrong while fetching group epics."
msgstr "" msgstr ""
msgid "Epics|Something went wrong while ordering item."
msgstr ""
msgid "Epics|Something went wrong while removing issue from epic." msgid "Epics|Something went wrong while removing issue from epic."
msgstr "" msgstr ""
...@@ -11461,6 +11464,9 @@ msgstr "" ...@@ -11461,6 +11464,9 @@ msgstr ""
msgid "ProductivityAnalytics|Ascending" msgid "ProductivityAnalytics|Ascending"
msgstr "" msgstr ""
msgid "ProductivityAnalytics|Days to merge"
msgstr ""
msgid "ProductivityAnalytics|Descending" msgid "ProductivityAnalytics|Descending"
msgstr "" msgstr ""
...@@ -16376,9 +16382,6 @@ msgstr "" ...@@ -16376,9 +16382,6 @@ msgstr ""
msgid "TransferProject|Transfer failed, please contact an admin." msgid "TransferProject|Transfer failed, please contact an admin."
msgstr "" msgstr ""
msgid "Tree"
msgstr ""
msgid "Tree view" msgid "Tree view"
msgstr "" msgstr ""
......
...@@ -69,6 +69,14 @@ describe 'bin/changelog' do ...@@ -69,6 +69,14 @@ describe 'bin/changelog' do
end end
end end
it 'parses --ee and -e' do
%w[--ee -e].each do |flag|
options = described_class.parse(%W[foo #{flag} security])
expect(options.ee).to eq true
end
end
it 'parses -h' do it 'parses -h' do
expect do expect do
expect { described_class.parse(%w[foo -h bar]) }.to output.to_stdout expect { described_class.parse(%w[foo -h bar]) }.to output.to_stdout
......
...@@ -28,6 +28,12 @@ describe('Jobs Store Utils', () => { ...@@ -28,6 +28,12 @@ describe('Jobs Store Utils', () => {
content: [{ text: 'Pulling docker image postgres:9.6.14 ...', style: 'term-fg-l-green' }], content: [{ text: 'Pulling docker image postgres:9.6.14 ...', style: 'term-fg-l-green' }],
sections: ['prepare-executor'], sections: ['prepare-executor'],
}, },
{
offset: 1005,
content: [],
sections: ['prepare-executor'],
section_duration: '10:00',
},
]; ];
let result; let result;
...@@ -58,6 +64,16 @@ describe('Jobs Store Utils', () => { ...@@ -58,6 +64,16 @@ describe('Jobs Store Utils', () => {
expect(result[1].lines[1].content).toEqual(mockData[3].content); expect(result[1].lines[1].content).toEqual(mockData[3].content);
}); });
}); });
describe('section duration', () => {
it('adds the section information to the header section', () => {
expect(result[1].section_duration).toEqual(mockData[4].section_duration);
});
it('does not add section duration as a line', () => {
expect(result[1].lines.includes(mockData[4])).toEqual(false);
});
});
}); });
describe('updateIncrementalTrace', () => { describe('updateIncrementalTrace', () => {
......
import { shallowMount } from '@vue/test-utils';
import DurationBadge from '~/jobs/components/log/duration_badge.vue';
describe('Job Log Duration Badge', () => {
let wrapper;
const data = {
duration: '00:30:01',
};
const createComponent = (props = {}) => {
wrapper = shallowMount(DurationBadge, {
sync: false,
propsData: {
...props,
},
});
};
beforeEach(() => {
createComponent(data);
});
afterEach(() => {
wrapper.destroy();
});
it('renders provided duration', () => {
expect(wrapper.text()).toBe(data.duration);
});
});
import { mount } from '@vue/test-utils'; import { mount } from '@vue/test-utils';
import LineHeader from '~/jobs/components/log/line_header.vue'; import LineHeader from '~/jobs/components/log/line_header.vue';
import LineNumber from '~/jobs/components/log/line_number.vue'; import LineNumber from '~/jobs/components/log/line_number.vue';
import DurationBadge from '~/jobs/components/log/duration_badge.vue';
describe('Job Log Header Line', () => { describe('Job Log Header Line', () => {
let wrapper; let wrapper;
...@@ -81,4 +82,14 @@ describe('Job Log Header Line', () => { ...@@ -81,4 +82,14 @@ describe('Job Log Header Line', () => {
expect(wrapper.emitted().toggleLine.length).toBe(1); expect(wrapper.emitted().toggleLine.length).toBe(1);
}); });
}); });
describe('with duration', () => {
beforeEach(() => {
createComponent(Object.assign({}, data, { duration: '00:10' }));
});
it('renders the duration badge', () => {
expect(wrapper.contains(DurationBadge)).toBe(true);
});
});
}); });
...@@ -287,51 +287,21 @@ describe Ci::CreatePipelineService do ...@@ -287,51 +287,21 @@ describe Ci::CreatePipelineService do
expect(pipeline.builds.find_by(name: 'rspec').interruptible).to be_falsy expect(pipeline.builds.find_by(name: 'rspec').interruptible).to be_falsy
end end
end end
context 'not defined, but an environment is' do
before do
config = YAML.dump(rspec: { script: 'echo', environment: { name: "review/$CI_COMMIT_REF_NAME" } })
stub_ci_pipeline_yaml_file(config)
end
it 'is not cancelable' do
pipeline = execute_service
expect(pipeline.builds.find_by(name: 'rspec').interruptible).to be_nil
end
end
context 'overriding the environment definition' do
before do
config = YAML.dump(rspec: { script: 'echo', environment: { name: "review/$CI_COMMIT_REF_NAME" }, interruptible: true })
stub_ci_pipeline_yaml_file(config)
end
it 'is cancelable' do
pipeline = execute_service
expect(pipeline.builds.find_by(name: 'rspec').interruptible).to be_truthy
end
end
end end
context 'interruptible builds' do context 'interruptible builds' do
before do before do
Feature.enable(:ci_support_interruptible_pipelines)
stub_ci_pipeline_yaml_file(YAML.dump(config)) stub_ci_pipeline_yaml_file(YAML.dump(config))
end end
after do
Feature.disable(:ci_support_interruptible_pipelines)
end
let(:config) do let(:config) do
{ {
stages: %w[stage1 stage2 stage3 stage4], stages: %w[stage1 stage2 stage3 stage4],
build_1_1: { build_1_1: {
stage: 'stage1', stage: 'stage1',
script: 'echo' script: 'echo',
interruptible: true
}, },
build_1_2: { build_1_2: {
stage: 'stage1', stage: 'stage1',
...@@ -342,7 +312,8 @@ describe Ci::CreatePipelineService do ...@@ -342,7 +312,8 @@ describe Ci::CreatePipelineService do
stage: 'stage2', stage: 'stage2',
script: 'echo', script: 'echo',
when: 'delayed', when: 'delayed',
start_in: '10 minutes' start_in: '10 minutes',
interruptible: true
}, },
build_3_1: { build_3_1: {
stage: 'stage3', stage: 'stage3',
...@@ -364,9 +335,9 @@ describe Ci::CreatePipelineService do ...@@ -364,9 +335,9 @@ describe Ci::CreatePipelineService do
.pluck(:name, 'ci_builds_metadata.interruptible') .pluck(:name, 'ci_builds_metadata.interruptible')
expect(interruptible_status).to contain_exactly( expect(interruptible_status).to contain_exactly(
['build_1_1', nil], ['build_1_1', true],
['build_1_2', true], ['build_1_2', true],
['build_2_1', nil], ['build_2_1', true],
['build_3_1', false], ['build_3_1', false],
['build_4_1', nil] ['build_4_1', nil]
) )
......
...@@ -31,7 +31,7 @@ describe 'help/index' do ...@@ -31,7 +31,7 @@ describe 'help/index' do
render render
expect(rendered).to match '8.0.2' expect(rendered).to match '8.0.2'
expect(rendered).to have_link('8.0.2', href: %r{https://gitlab.com/gitlab-org/gitlab-(ce|ee)/-/tags/v8.0.2}) expect(rendered).to have_link('8.0.2', href: %r{https://gitlab.com/gitlab-org/(gitlab|gitlab-foss)/-/tags/v8.0.2})
end end
it 'shows a link to the commit for pre-releases' do it 'shows a link to the commit for pre-releases' do
...@@ -40,7 +40,7 @@ describe 'help/index' do ...@@ -40,7 +40,7 @@ describe 'help/index' do
render render
expect(rendered).to match '8.0.2' expect(rendered).to match '8.0.2'
expect(rendered).to have_link('abcdefg', href: %r{https://gitlab.com/gitlab-org/gitlab-(ce|ee)/commits/abcdefg}) expect(rendered).to have_link('abcdefg', href: %r{https://gitlab.com/gitlab-org/(gitlab|gitlab-foss)/commits/abcdefg})
end end
end end
end end
......
...@@ -11122,10 +11122,15 @@ sort-keys@^2.0.0: ...@@ -11122,10 +11122,15 @@ sort-keys@^2.0.0:
dependencies: dependencies:
is-plain-obj "^1.0.0" is-plain-obj "^1.0.0"
sortablejs@^1.7.0: sortablejs@^1.10.0:
version "1.7.0" version "1.10.0"
resolved "https://registry.yarnpkg.com/sortablejs/-/sortablejs-1.7.0.tgz#80a2b2370abd568e1cec8c271131ef30a904fa28" resolved "https://registry.yarnpkg.com/sortablejs/-/sortablejs-1.10.0.tgz#0ebc054acff2486569194a2f975b2b145dd5e7d6"
integrity sha1-gKKyNwq9Vo4c7IwnETHvMKkE+ig= integrity sha512-+e0YakK1BxgEZpf9l9UiFaiQ8ZOBn1p/4qkkXr8QDVmYyCrUDTyDRRGm0AgW4E4cD0wtgxJ6yzIRkSPUwqhuhg==
sortablejs@^1.9.0:
version "1.9.0"
resolved "https://registry.yarnpkg.com/sortablejs/-/sortablejs-1.9.0.tgz#2d1e74ae6bac2cb4ad0622908f340848969eb88d"
integrity sha512-Ot6bYJ6PoqPmpsqQYXjn1+RKrY2NWQvQt/o4jfd/UYwVWndyO5EPO8YHbnm5HIykf8ENsm4JUrdAvolPT86yYA==
source-list-map@^2.0.0: source-list-map@^2.0.0:
version "2.0.0" version "2.0.0"
...@@ -12793,6 +12798,13 @@ vue@^2.6.10: ...@@ -12793,6 +12798,13 @@ vue@^2.6.10:
resolved "https://registry.yarnpkg.com/vue/-/vue-2.6.10.tgz#a72b1a42a4d82a721ea438d1b6bf55e66195c637" resolved "https://registry.yarnpkg.com/vue/-/vue-2.6.10.tgz#a72b1a42a4d82a721ea438d1b6bf55e66195c637"
integrity sha512-ImThpeNU9HbdZL3utgMCq0oiMzAkt1mcgy3/E6zWC/G6AaQoeuFdsl9nDhTDU3X1R6FK7nsIUuRACVcjI+A2GQ== integrity sha512-ImThpeNU9HbdZL3utgMCq0oiMzAkt1mcgy3/E6zWC/G6AaQoeuFdsl9nDhTDU3X1R6FK7nsIUuRACVcjI+A2GQ==
vuedraggable@^2.23.0:
version "2.23.0"
resolved "https://registry.yarnpkg.com/vuedraggable/-/vuedraggable-2.23.0.tgz#1f4a5a601675a5dbf0d96ee61aebfffa43445262"
integrity sha512-RgdH16k43WNoxyRcv/OarB/DZh9SY5TYthk9TS4YiHXpelD1DytEG0phLAXiXx5EhsmdH8ltSWxklGa4g1WTCw==
dependencies:
sortablejs "^1.9.0"
vuex@^3.1.0: vuex@^3.1.0:
version "3.1.0" version "3.1.0"
resolved "https://registry.yarnpkg.com/vuex/-/vuex-3.1.0.tgz#634b81515cf0cfe976bd1ffe9601755e51f843b9" resolved "https://registry.yarnpkg.com/vuex/-/vuex-3.1.0.tgz#634b81515cf0cfe976bd1ffe9601755e51f843b9"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment