diff --git a/.eslintrc.yml b/.eslintrc.yml index a8cbd9731a..8d34efc9a6 100644 --- a/.eslintrc.yml +++ b/.eslintrc.yml @@ -10,9 +10,6 @@ globals: localStorage: false IS_EE: false plugins: - - import - - "@gitlab/i18n" - - "@gitlab/vue-i18n" - no-jquery settings: import/resolver: @@ -42,21 +39,19 @@ rules: lines-between-class-members: off # Disabled for now, to make the plugin-vue 4.5 -> 5.0 update smoother vue/no-confusing-v-for-v-if: error - vue/no-unused-components: off vue/no-use-v-if-with-v-for: off vue/no-v-html: off vue/use-v-on-exact: off - no-jquery/no-animate: off # all offenses of no-jquery/no-animate-toggle are false positives ( $toast.show() ) no-jquery/no-animate-toggle: off no-jquery/no-event-shorthand: off - no-jquery/no-fade: off no-jquery/no-serialize: error - no-jquery/no-sizzle: off promise/always-return: off promise/no-callback-in-promise: off + # Make update to eslint@6 smoother: + prefer-object-spread: off overrides: - files: - - '**/spec/**/*' - rules: - "@gitlab/i18n/no-non-i18n-strings": off + - files: + - '**/spec/**/*' + rules: + "@gitlab/i18n/no-non-i18n-strings": off diff --git a/.gitignore b/.gitignore index d43b1908dd..b3e6cbae96 100644 --- a/.gitignore +++ b/.gitignore @@ -7,6 +7,7 @@ .bundle .chef .directory +.eslintcache /.envrc eslint-report.html /.gitlab_shell_secret @@ -82,6 +83,9 @@ package-lock.json jsdoc/ **/tmp/rubocop_cache/** .overcommit.yml +.overcommit.yml.backup .projections.json /qa/.rakeTasks webpack-dev-server.json +/.nvimrc +.solargraph.yml diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 388f3f4b3e..19dca0b2fc 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,16 +1,14 @@ -image: "registry.gitlab.com/gitlab-org/gitlab-build-images:ruby-2.6.3-golang-1.12-git-2.24-lfs-2.9-chrome-73.0-node-12.x-yarn-1.16-postgresql-9.6-graphicsmagick-1.3.33" +image: "registry.gitlab.com/gitlab-org/gitlab-build-images:ruby-2.6.5-golang-1.12-git-2.24-lfs-2.9-chrome-73.0-node-12.x-yarn-1.21-postgresql-9.6-graphicsmagick-1.3.34" stages: - sync - prepare - - quick-test - test - post-test - review-prepare - review - qa - post-qa - - notification - pages variables: @@ -26,9 +24,6 @@ variables: ES_JAVA_OPTS: "-Xms256m -Xmx256m" ELASTIC_URL: "http://elastic:changeme@elasticsearch:9200" -after_script: - - date - include: - local: .gitlab/ci/cache-repo.gitlab-ci.yml - local: .gitlab/ci/cng.gitlab-ci.yml @@ -36,13 +31,14 @@ include: - local: .gitlab/ci/frontend.gitlab-ci.yml - local: .gitlab/ci/global.gitlab-ci.yml - local: .gitlab/ci/memory.gitlab-ci.yml - - local: .gitlab/ci/notifications.gitlab-ci.yml - local: .gitlab/ci/pages.gitlab-ci.yml - local: .gitlab/ci/qa.gitlab-ci.yml - local: .gitlab/ci/reports.gitlab-ci.yml - local: .gitlab/ci/rails.gitlab-ci.yml - local: .gitlab/ci/review.gitlab-ci.yml + - local: .gitlab/ci/rules.gitlab-ci.yml - local: .gitlab/ci/setup.gitlab-ci.yml + - local: .gitlab/ci/dev-fixtures.gitlab-ci.yml - local: .gitlab/ci/test-metadata.gitlab-ci.yml - local: .gitlab/ci/yaml.gitlab-ci.yml - local: .gitlab/ci/releases.gitlab-ci.yml diff --git a/.gitlab/CODEOWNERS b/.gitlab/CODEOWNERS index c828332653..0b817fe14b 100644 --- a/.gitlab/CODEOWNERS +++ b/.gitlab/CODEOWNERS @@ -1,9 +1,13 @@ +# When adding a group as a code owner, make sure to invite the group to the +# project here: https://gitlab.com/gitlab-org/gitlab/-/project_members +# As described in https://docs.gitlab.com/ee/user/project/code_owners.html + # Backend Maintainers are the default for all ruby files *.rb @gitlab-org/maintainers/rails-backend *.rake @gitlab-org/maintainers/rails-backend -# Technical writing team are the default reviewers for everything in `doc/` -/doc/ @gl-docsteam +# Technical writing team are the default reviewers for all markdown docs +*.md @gl-docsteam # Frontend maintainers should see everything in `app/assets/` app/assets/ @gitlab-org/maintainers/frontend @@ -28,10 +32,17 @@ lib/gitlab/github_import/ @gitlab-org/maintainers/database /ee/app/models/project_alias.rb @patrickbajao /ee/lib/api/project_aliases.rb @patrickbajao +# Quality owned files +/qa/ @gl-quality + # Engineering Productivity owned files /.gitlab-ci.yml @gl-quality/eng-prod /.gitlab/ci/ @gl-quality/eng-prod +/.gitlab/CODEOWNERS @gl-quality/eng-prod Dangerfile @gl-quality/eng-prod /danger/ @gl-quality/eng-prod /lib/gitlab/danger/ @gl-quality/eng-prod /scripts/ @gl-quality/eng-prod + +# Delivery owner files +/.gitlab/ci/releases.gitlab-ci.yml @gitlab-org/delivery diff --git a/.gitlab/ci/cache-repo.gitlab-ci.yml b/.gitlab/ci/cache-repo.gitlab-ci.yml index f856afd3a0..ecbed0ed6c 100644 --- a/.gitlab/ci/cache-repo.gitlab-ci.yml +++ b/.gitlab/ci/cache-repo.gitlab-ci.yml @@ -18,16 +18,20 @@ # runner, or network egress charges will apply: # https://cloud.google.com/storage/pricing cache-repo: - extends: - - .only:variables_refs-canonical-dot-com-schedules + extends: .cache-repo:rules image: gcr.io/google.com/cloudsdktool/cloud-sdk:alpine stage: sync allow_failure: true variables: - GIT_DEPTH: 0 + GIT_STRATEGY: none TAR_FILENAME: /tmp/gitlab-master.tar script: + - cd .. + - rm -rf $CI_PROJECT_NAME + - git clone --progress $CI_REPOSITORY_URL $CI_PROJECT_NAME + - cd $CI_PROJECT_NAME - gcloud auth activate-service-account --key-file=$CI_REPO_CACHE_CREDENTIALS + - git remote rm origin - tar cf $TAR_FILENAME . - gzip $TAR_FILENAME - gsutil cp $TAR_FILENAME.gz gs://gitlab-ci-git-repo-cache/project-$CI_PROJECT_ID/gitlab-master.tar.gz diff --git a/.gitlab/ci/cng.gitlab-ci.yml b/.gitlab/ci/cng.gitlab-ci.yml index bd11042eb1..2450e34656 100644 --- a/.gitlab/ci/cng.gitlab-ci.yml +++ b/.gitlab/ci/cng.gitlab-ci.yml @@ -1,15 +1,11 @@ cloud-native-image: - extends: .only:variables-canonical-dot-com + extends: .cng:rules image: ruby:2.6-alpine dependencies: [] stage: post-test allow_failure: true variables: GIT_DEPTH: "1" - when: manual script: - install_gitlab_gem - CNG_PROJECT_PATH="gitlab-org/build/CNG" BUILD_TRIGGER_TOKEN=$CI_JOB_TOKEN ./scripts/trigger-build cng - only: - refs: - - tags diff --git a/.gitlab/ci/dev-fixtures.gitlab-ci.yml b/.gitlab/ci/dev-fixtures.gitlab-ci.yml new file mode 100644 index 0000000000..e08f7e969c --- /dev/null +++ b/.gitlab/ci/dev-fixtures.gitlab-ci.yml @@ -0,0 +1,35 @@ +.run-dev-fixtures: + extends: + - .default-tags + - .default-retry + - .default-cache + - .default-before_script + - .use-pg9 + stage: test + needs: ["setup-test-env"] + dependencies: ["setup-test-env"] + variables: + FIXTURE_PATH: "db/fixtures/development" + SEED_CYCLE_ANALYTICS: "true" + SEED_PRODUCTIVITY_ANALYTICS: "true" + CYCLE_ANALYTICS_ISSUE_COUNT: 1 + SIZE: 0 # number of external projects to fork, requires network connection + # SEED_NESTED_GROUPS: "false" # requires network connection + +run-dev-fixtures: + extends: + - .run-dev-fixtures + - .dev-fixtures:rules:ee-and-foss + script: + - scripts/gitaly-test-spawn + - RAILS_ENV=test bundle exec rake db:seed_fu + +run-dev-fixtures-ee: + extends: + - .run-dev-fixtures + - .dev-fixtures:rules:ee-only + - .use-pg9-ee + script: + - scripts/gitaly-test-spawn + - cp ee/db/fixtures/development/* $FIXTURE_PATH + - RAILS_ENV=test bundle exec rake db:seed_fu diff --git a/.gitlab/ci/docs.gitlab-ci.yml b/.gitlab/ci/docs.gitlab-ci.yml index cd0e4085e1..59f1773da2 100644 --- a/.gitlab/ci/docs.gitlab-ci.yml +++ b/.gitlab/ci/docs.gitlab-ci.yml @@ -2,16 +2,16 @@ extends: - .default-tags - .default-retry - - .only:variables-canonical-dot-com - - .only:changes-docs - only: - refs: - - merge_requests + - .docs:rules:review-docs + allow_failure: true image: ruby:2.6-alpine stage: review dependencies: [] variables: - GIT_STRATEGY: none + # We're cloning the repo instead of downloading the script for now + # because some repos are private and CI_JOB_TOKEN cannot access files. + # See https://gitlab.com/gitlab-org/gitlab/issues/191273 + GIT_DEPTH: 1 environment: name: review-docs/$DOCS_GITLAB_REPO_SUFFIX-$CI_MERGE_REQUEST_IID # DOCS_REVIEW_APPS_DOMAIN and DOCS_GITLAB_REPO_SUFFIX are CI variables @@ -19,11 +19,7 @@ url: http://docs-preview-$DOCS_GITLAB_REPO_SUFFIX-$CI_MERGE_REQUEST_IID.$DOCS_REVIEW_APPS_DOMAIN/$DOCS_GITLAB_REPO_SUFFIX on_stop: review-docs-cleanup before_script: - # We don't clone the repo by using GIT_STRATEGY: none and only download the - # single script we need here so it's much faster than cloning. - apk add --update openssl - - wget $CI_PROJECT_URL/raw/$CI_COMMIT_SHA/scripts/trigger-build-docs - - chmod 755 trigger-build-docs - gem install httparty --no-document --version 0.17.3 - gem install gitlab --no-document --version 4.13.0 @@ -32,8 +28,7 @@ review-docs-deploy: extends: .review-docs script: - - ./trigger-build-docs deploy - when: manual + - ./scripts/trigger-build-docs deploy # Cleanup remote environment of gitlab-docs review-docs-cleanup: @@ -42,16 +37,14 @@ review-docs-cleanup: name: review-docs/$DOCS_GITLAB_REPO_SUFFIX-$CI_MERGE_REQUEST_IID action: stop script: - - ./trigger-build-docs cleanup - when: manual + - ./scripts/trigger-build-docs cleanup docs lint: extends: - .default-tags - .default-retry - - .default-only - - .only:changes-docs - image: "registry.gitlab.com/gitlab-org/gitlab-build-images:gitlab-docs-lint" + - .docs:rules:docs-lint + image: "registry.gitlab.com/gitlab-org/gitlab-docs:docs-lint" stage: test dependencies: [] script: @@ -70,13 +63,11 @@ docs lint: graphql-reference-verify: extends: - - .only-ee - .default-tags - .default-retry - .default-cache - - .default-only - .default-before_script - - .only:changes-code-backstage-qa + - .docs:rules:graphql-reference-verify - .use-pg9 stage: test needs: ["setup-test-env"] diff --git a/.gitlab/ci/frontend.gitlab-ci.yml b/.gitlab/ci/frontend.gitlab-ci.yml index 6578eec823..3a72c941b8 100644 --- a/.gitlab/ci/frontend.gitlab-ci.yml +++ b/.gitlab/ci/frontend.gitlab-ci.yml @@ -4,19 +4,17 @@ - vendor/ruby/ - .yarn-cache/ - tmp/cache/assets/sprockets + - tmp/cache/babel-loader + - tmp/cache/vue-loader .gitlab:assets:compile-metadata: extends: - .default-tags - .default-retry - - .default-only - .default-before_script - .assets-compile-cache - - .only:changes-code-backstage-qa - image: registry.gitlab.com/gitlab-org/gitlab-build-images:ruby-2.6.3-git-2.24-lfs-2.9-chrome-73.0-node-12.x-yarn-1.16-graphicsmagick-1.3.33-docker-19.03.1 - stage: test - dependencies: ["setup-test-env"] - needs: ["setup-test-env"] + image: registry.gitlab.com/gitlab-org/gitlab-build-images:ruby-2.6.5-git-2.24-lfs-2.9-chrome-73.0-node-12.x-yarn-1.21-graphicsmagick-1.3.34-docker-19.03.1 + stage: prepare services: - docker:19.03.0-dind variables: @@ -30,7 +28,7 @@ DOCKER_DRIVER: overlay2 DOCKER_HOST: tcp://docker:2375 cache: - key: "assets-compile:production:vendor_ruby:.yarn-cache:tmp_cache_assets_sprockets:v6" + key: "assets-compile:production:vendor_ruby:.yarn-cache:tmp_cache_assets_sprockets:tmp_cache_webpack:v9" artifacts: name: webpack-report expire_in: 31d @@ -45,24 +43,21 @@ - time scripts/build_assets_image - scripts/clean-old-cached-assets - rm -f /etc/apt/sources.list.d/google*.list # We don't need to update Chrome here - only: - variables: - - $CI_SERVER_HOST == "gitlab.com" && $CI_PROJECT_NAMESPACE =~ /^gitlab-org($|\/)/ # Matches the gitlab-org group and its subgroups - - $CI_SERVER_HOST == "dev.gitlab.org" tags: - gitlab-org - docker gitlab:assets:compile pull-push-cache: - extends: .gitlab:assets:compile-metadata - only: - refs: - - master + extends: + - .gitlab:assets:compile-metadata + - .frontend:rules:gitlab-assets-compile-pull-push-cache cache: policy: pull-push gitlab:assets:compile pull-cache: - extends: .gitlab:assets:compile-metadata + extends: + - .gitlab:assets:compile-metadata + - .frontend:rules:gitlab-assets-compile-pull-cache cache: policy: pull @@ -70,10 +65,8 @@ gitlab:assets:compile pull-cache: extends: - .default-tags - .default-retry - - .default-only - .default-before_script - .assets-compile-cache - - .only:changes-code-backstage-qa stage: prepare script: - node --version @@ -86,7 +79,7 @@ gitlab:assets:compile pull-cache: # we override the max_old_space_size to prevent OOM errors NODE_OPTIONS: --max_old_space_size=3584 cache: - key: "assets-compile:v7" + key: "assets-compile:v9" artifacts: expire_in: 7d paths: @@ -94,48 +87,49 @@ gitlab:assets:compile pull-cache: - public/assets compile-assets pull-push-cache: - extends: .compile-assets-metadata - only: - refs: - - master + extends: + - .compile-assets-metadata + - .frontend:rules:compile-assets-pull-push-cache cache: policy: pull-push -compile-assets pull-push-cache foss: - extends: [".compile-assets-metadata", ".only-ee-as-if-foss"] - only: - refs: - - master +compile-assets pull-push-cache as-if-foss: + extends: + - .compile-assets-metadata + - .frontend:rules:compile-assets-pull-push-cache-as-if-foss + - .as-if-foss cache: policy: pull-push - key: "assets-compile:v7:foss" + key: "assets-compile:v9:foss" compile-assets pull-cache: - extends: .compile-assets-metadata + extends: + - .compile-assets-metadata + - .frontend:rules:compile-assets-pull-cache cache: policy: pull -compile-assets pull-cache foss: - extends: [".compile-assets-metadata", ".only-ee-as-if-foss"] +compile-assets pull-cache as-if-foss: + extends: + - .compile-assets-metadata + - .frontend:rules:compile-assets-pull-cache-as-if-foss + - .as-if-foss cache: policy: pull - key: "assets-compile:v7:foss" + key: "assets-compile:v9:foss" -.only-code-frontend-job-base: +.frontend-job-base: extends: - .default-tags - .default-retry - .default-cache - - .default-only - .default-before_script - - .only:changes-code-backstage - .use-pg9 stage: test needs: ["setup-test-env", "compile-assets pull-cache"] - dependencies: ["setup-test-env", "compile-assets pull-cache"] .karma-base: - extends: .only-code-frontend-job-base + extends: .frontend-job-base variables: # we override the max_old_space_size to prevent OOM errors NODE_OPTIONS: --max_old_space_size=3584 @@ -147,7 +141,9 @@ compile-assets pull-cache foss: - bundle exec rake karma karma: - extends: .karma-base + extends: + - .karma-base + - .frontend:rules:default-frontend-jobs coverage: '/^Statements *: (\d+\.\d+%)/' artifacts: name: coverage-javascript @@ -160,13 +156,14 @@ karma: reports: junit: junit_karma.xml -karma-foss: +karma-as-if-foss: extends: - .karma-base - - .only-ee-as-if-foss + - .frontend:rules:default-frontend-jobs-as-if-foss + - .as-if-foss .jest-base: - extends: .only-code-frontend-job-base + extends: .frontend-job-base script: - scripts/gitaly-test-spawn - date @@ -180,7 +177,9 @@ karma-foss: policy: pull-push jest: - extends: .jest-base + extends: + - .jest-base + - .frontend:rules:default-frontend-jobs artifacts: name: coverage-frontend expire_in: 31d @@ -192,10 +191,11 @@ jest: reports: junit: junit_jest.xml -jest-foss: +jest-as-if-foss: extends: - .jest-base - - .only-ee-as-if-foss + - .frontend:rules:default-frontend-jobs-as-if-foss + - .as-if-foss cache: policy: pull @@ -204,8 +204,7 @@ jest-foss: - .default-tags - .default-retry - .default-cache - - .default-only - - .only:changes-code-backstage + - .frontend:rules:qa-frontend-node stage: test dependencies: [] cache: @@ -237,11 +236,9 @@ webpack-dev-server: - .default-tags - .default-retry - .default-cache - - .default-only - - .only:changes-code-backstage + - .frontend:rules:default-frontend-jobs stage: test needs: ["setup-test-env", "compile-assets pull-cache"] - dependencies: ["setup-test-env", "compile-assets pull-cache"] variables: WEBPACK_MEMORY_TEST: "true" WEBPACK_VENDOR_DLL: "true" diff --git a/.gitlab/ci/global.gitlab-ci.yml b/.gitlab/ci/global.gitlab-ci.yml index a3fdfea8e3..ffdc115cff 100644 --- a/.gitlab/ci/global.gitlab-ci.yml +++ b/.gitlab/ci/global.gitlab-ci.yml @@ -9,10 +9,13 @@ - unknown_failure - api_failure - runner_system_failure + - job_execution_timeout + - stuck_or_timeout_failure .default-before_script: before_script: - date + - '[ "$FOSS_ONLY" = "1" ] && rm -rf ee/ qa/spec/ee/ qa/qa/specs/features/ee/ qa/qa/ee/ qa/qa/ee.rb' - export GOPATH=$CI_PROJECT_DIR/.go - mkdir -p $GOPATH - source scripts/utils.sh @@ -22,7 +25,7 @@ # Jobs that only need to pull cache .default-cache: cache: - key: "debian-stretch-ruby-2.6.3-node-12.x" + key: "debian-stretch-ruby-2.6.5-pg9.6-node-12.x" paths: - .go/pkg/mod - vendor/ruby @@ -30,183 +33,18 @@ - vendor/gitaly-ruby policy: pull -.default-only: - only: - refs: - - master - - /^[\d-]+-stable(-ee)?$/ - - /^\d+-\d+-auto-deploy-\d+$/ - - /^security\// - - merge_requests - - tags - -.only:variables-canonical-dot-com: - only: - variables: - - $CI_SERVER_HOST == "gitlab.com" && $CI_PROJECT_NAMESPACE =~ /^gitlab-org($|\/)/ # Matches the gitlab-org group or its subgroups - -.only:variables_refs-canonical-dot-com-schedules: - extends: .only:variables-canonical-dot-com - only: - refs: - - schedules - -.except:refs-deploy: - except: - refs: - - /^\d+-\d+-auto-deploy-\d+$/ - -.except:refs-master-tags-stable-deploy: - except: - refs: - - master - - tags - - /^[\d-]+-stable(-ee)?$/ - - /^\d+-\d+-auto-deploy-\d+$/ - -.only:kubernetes: - only: - kubernetes: active - -.only-review: - extends: - - .only:variables-canonical-dot-com - - .only:kubernetes - - .except:refs-master-tags-stable-deploy - -.only-review-schedules: - extends: - - .only:variables_refs-canonical-dot-com-schedules - - .only:kubernetes - - .except:refs-deploy - -.code-patterns: &code-patterns - - ".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" - - "Dockerfile.assets" - - "*_VERSION" - - "Gemfile{,.lock}" - - "Rakefile" - - "{babel.config,jest.config}.js" - - "config.ru" - - "{package.json,yarn.lock}" - - "{,ee/}{app,bin,config,db,haml_lint,lib,locale,public,scripts,symbol,vendor}/**/*" - - "doc/api/graphql/reference/*" # Files in this folder are auto-generated - -.backstage-patterns: &backstage-patterns - - "Dangerfile" - - "danger/**/*" - - "{,ee/}fixtures/**/*" - - "{,ee/}rubocop/**/*" - - "{,ee/}spec/**/*" - - "doc/README.md" # Some RSpec test rely on this file - -.qa-patterns: &qa-patterns - - ".dockerignore" - - "qa/**/*" - -.docs-patterns: &docs-patterns - - ".gitlab/route-map.yml" - - "doc/**/*" - - ".markdownlint.json" - -.only:changes-code: - only: - changes: *code-patterns - -.only:changes-qa: - only: - changes: *qa-patterns - -.only:changes-docs: - only: - changes: *docs-patterns - -.only:changes-code-backstage: - only: - changes: - - ".gitlab/ci/**/*" - - ".{eslintignore,gitattributes,nvmrc,prettierrc,stylelintrc,yamllint}" - - ".{codeclimate,eslintrc,gitlab-ci,haml-lint,haml-lint_todo,rubocop,rubocop_todo,scss-lint}.yml" - - ".csscomb.json" - - "Dockerfile.assets" - - "*_VERSION" - - "Gemfile{,.lock}" - - "Rakefile" - - "{babel.config,jest.config}.js" - - "config.ru" - - "{package.json,yarn.lock}" - - "{,ee/}{app,bin,config,db,haml_lint,lib,locale,public,scripts,symbol,vendor}/**/*" - - "doc/api/graphql/reference/*" # Files in this folder are auto-generated - # Backstage changes - - "Dangerfile" - - "danger/**/*" - - "{,ee/}fixtures/**/*" - - "{,ee/}rubocop/**/*" - - "{,ee/}spec/**/*" - - "doc/README.md" # Some RSpec test rely on this file - -.only:changes-code-qa: - only: - changes: - - ".gitlab/ci/**/*" - - ".{eslintignore,gitattributes,nvmrc,prettierrc,stylelintrc,yamllint}" - - ".{codeclimate,eslintrc,gitlab-ci,haml-lint,haml-lint_todo,rubocop,rubocop_todo,scss-lint}.yml" - - ".csscomb.json" - - "Dockerfile.assets" - - "*_VERSION" - - "Gemfile{,.lock}" - - "Rakefile" - - "{babel.config,jest.config}.js" - - "config.ru" - - "{package.json,yarn.lock}" - - "{,ee/}{app,bin,config,db,haml_lint,lib,locale,public,scripts,symbol,vendor}/**/*" - - "doc/api/graphql/reference/*" # Files in this folder are auto-generated - # QA changes - - ".dockerignore" - - "qa/**/*" - -.only:changes-code-backstage-qa: - only: - changes: - - ".gitlab/ci/**/*" - - ".{eslintignore,gitattributes,nvmrc,prettierrc,stylelintrc,yamllint}" - - ".{codeclimate,eslintrc,gitlab-ci,haml-lint,haml-lint_todo,rubocop,rubocop_todo,scss-lint}.yml" - - ".csscomb.json" - - "Dockerfile.assets" - - "*_VERSION" - - "Gemfile{,.lock}" - - "Rakefile" - - "{babel.config,jest.config}.js" - - "config.ru" - - "{package.json,yarn.lock}" - - "{,ee/}{app,bin,config,db,haml_lint,lib,locale,public,scripts,symbol,vendor}/**/*" - - "doc/api/graphql/reference/*" # Files in this folder are auto-generated - # Backstage changes - - "Dangerfile" - - "danger/**/*" - - "{,ee/}fixtures/**/*" - - "{,ee/}rubocop/**/*" - - "{,ee/}spec/**/*" - - "doc/README.md" # Some RSpec test rely on this file - # QA changes - - ".dockerignore" - - "qa/**/*" - .use-pg9: services: - - name: postgres:9.6 + - name: postgres:9.6.17 command: ["postgres", "-c", "fsync=off", "-c", "synchronous_commit=off", "-c", "full_page_writes=off"] - name: redis:alpine variables: POSTGRES_HOST_AUTH_METHOD: trust .use-pg10: - image: "registry.gitlab.com/gitlab-org/gitlab-build-images:ruby-2.6.3-golang-1.12-git-2.24-lfs-2.9-chrome-73.0-node-12.x-yarn-1.16-postgresql-10-graphicsmagick-1.3.33" + image: "registry.gitlab.com/gitlab-org/gitlab-build-images:ruby-2.6.5-golang-1.12-git-2.24-lfs-2.9-chrome-73.0-node-12.x-yarn-1.21-postgresql-10-graphicsmagick-1.3.34" services: - - name: postgres:10.9 + - name: postgres:10.12 command: ["postgres", "-c", "fsync=off", "-c", "synchronous_commit=off", "-c", "full_page_writes=off"] - name: redis:alpine variables: @@ -214,30 +52,23 @@ .use-pg9-ee: services: - - name: postgres:9.6 + - name: postgres:9.6.17 command: ["postgres", "-c", "fsync=off", "-c", "synchronous_commit=off", "-c", "full_page_writes=off"] - name: redis:alpine - - name: elasticsearch:5.6.12 + - name: elasticsearch:6.4.2 variables: POSTGRES_HOST_AUTH_METHOD: trust .use-pg10-ee: - image: "registry.gitlab.com/gitlab-org/gitlab-build-images:ruby-2.6.3-golang-1.12-git-2.24-lfs-2.9-chrome-73.0-node-12.x-yarn-1.16-postgresql-10-graphicsmagick-1.3.33" + image: "registry.gitlab.com/gitlab-org/gitlab-build-images:ruby-2.6.5-golang-1.12-git-2.24-lfs-2.9-chrome-73.0-node-12.x-yarn-1.21-postgresql-10-graphicsmagick-1.3.34" services: - - name: postgres:10.9 + - name: postgres:10.12 command: ["postgres", "-c", "fsync=off", "-c", "synchronous_commit=off", "-c", "full_page_writes=off"] - name: redis:alpine - - name: elasticsearch:5.6.12 + - name: elasticsearch:6.4.2 variables: POSTGRES_HOST_AUTH_METHOD: trust -.only-ee: - only: - variables: - - $CI_PROJECT_NAME == "gitlab" - - $CI_PROJECT_NAME == "gitlab-ee" # Support former project name for forks/mirrors - -.only-ee-as-if-foss: - extends: .only-ee +.as-if-foss: variables: FOSS_ONLY: '1' diff --git a/.gitlab/ci/memory.gitlab-ci.yml b/.gitlab/ci/memory.gitlab-ci.yml index ba14024df3..a8e2d90a4e 100644 --- a/.gitlab/ci/memory.gitlab-ci.yml +++ b/.gitlab/ci/memory.gitlab-ci.yml @@ -3,9 +3,8 @@ - .default-tags - .default-retry - .default-cache - - .default-only - .default-before_script - - .only:changes-code + - .memory:rules memory-static: extends: .only-code-memory-job-base diff --git a/.gitlab/ci/notifications.gitlab-ci.yml b/.gitlab/ci/notifications.gitlab-ci.yml deleted file mode 100644 index 4271e709f4..0000000000 --- a/.gitlab/ci/notifications.gitlab-ci.yml +++ /dev/null @@ -1,23 +0,0 @@ -.notify: - image: ruby:2.6-alpine - stage: notification - dependencies: [] - cache: {} - before_script: - - apk update && apk add git curl bash - - source scripts/utils.sh - - source scripts/notifications.sh - - install_gitlab_gem - variables: - COMMIT_NOTES_URL: "https://${CI_SERVER_HOST}/${CI_PROJECT_PATH}/commit/${CI_COMMIT_SHA}#notes-list" - -schedule:package-and-qa:notify-failure: - extends: - - .only:variables_refs-canonical-dot-com-schedules - - .notify - script: - - 'export NOTIFICATION_MESSAGE=":skull_and_crossbones: Scheduled QA against master failed! :skull_and_crossbones: See ${CI_PIPELINE_URL}. For downstream pipelines, see ${COMMIT_NOTES_URL}"' - - 'notify_on_job_failure schedule:package-and-qa qa-master "${NOTIFICATION_MESSAGE}" ci_failing' - needs: ["schedule:package-and-qa"] - allow_failure: true - when: always diff --git a/.gitlab/ci/pages.gitlab-ci.yml b/.gitlab/ci/pages.gitlab-ci.yml index 6a2d3702bd..993ed21e39 100644 --- a/.gitlab/ci/pages.gitlab-ci.yml +++ b/.gitlab/ci/pages.gitlab-ci.yml @@ -3,12 +3,7 @@ pages: - .default-tags - .default-retry - .default-cache - - .default-only - - .only:variables-canonical-dot-com - - .only:changes-code-backstage-qa - only: - refs: - - master + - .pages:rules stage: pages dependencies: ["coverage", "karma", "gitlab:assets:compile pull-cache"] script: diff --git a/.gitlab/ci/qa.gitlab-ci.yml b/.gitlab/ci/qa.gitlab-ci.yml index 3cb5a40a8b..0e9d7abb3a 100644 --- a/.gitlab/ci/qa.gitlab-ci.yml +++ b/.gitlab/ci/qa.gitlab-ci.yml @@ -2,8 +2,6 @@ extends: - .default-tags - .default-retry - - .default-only - - .only:changes-code-qa stage: test dependencies: [] cache: @@ -11,24 +9,38 @@ paths: - vendor/ruby before_script: + - '[ "$FOSS_ONLY" = "1" ] && rm -rf ee/ qa/spec/ee/ qa/qa/specs/features/ee/ qa/qa/ee/ qa/qa/ee.rb' - cd qa/ - bundle install --clean --jobs=$(nproc) --path=vendor --retry=3 --quiet - bundle check qa:internal: - extends: .qa-job-base + extends: + - .qa-job-base + - .qa:rules:ee-and-foss + script: + - bundle exec rspec + +qa:internal-as-if-foss: + extends: + - .qa-job-base + - .qa:rules:ee-only + - .as-if-foss script: - bundle exec rspec qa:selectors: - extends: .qa-job-base + extends: + - .qa-job-base + - .qa:rules:ee-and-foss script: - bundle exec bin/qa Test::Sanity::Selectors -qa:selectors-foss: +qa:selectors-as-if-foss: extends: - qa:selectors - - .only-ee-as-if-foss + - .qa:rules:ee-only + - .as-if-foss .package-and-qa-base: image: ruby:2.6-alpine @@ -40,30 +52,9 @@ qa:selectors-foss: - install_gitlab_gem - ./scripts/trigger-build omnibus -package-and-qa-manual: - extends: - - .package-and-qa-base - - .default-only - - .only:variables-canonical-dot-com - - .except:refs-deploy - - .only:changes-code - when: manual - needs: ["build-qa-image", "gitlab:assets:compile pull-cache"] - package-and-qa: extends: - .package-and-qa-base - - .default-only - - .only:variables-canonical-dot-com - - .except:refs-master-tags-stable-deploy - - .only:changes-qa - needs: ["build-qa-image", "gitlab:assets:compile pull-cache"] - allow_failure: true - -schedule:package-and-qa: - extends: - - .package-and-qa-base - - .default-only - - .only:variables_refs-canonical-dot-com-schedules + - .qa:rules:package-and-qa needs: ["build-qa-image", "gitlab:assets:compile pull-cache"] allow_failure: true diff --git a/.gitlab/ci/rails.gitlab-ci.yml b/.gitlab/ci/rails.gitlab-ci.yml index 4ac187e167..58c4ef0e02 100644 --- a/.gitlab/ci/rails.gitlab-ci.yml +++ b/.gitlab/ci/rails.gitlab-ci.yml @@ -1,41 +1,23 @@ -.only-master: - only: - refs: - - master +.rails:needs:setup-and-assets: + needs: + - job: setup-test-env + artifacts: true + - job: compile-assets pull-cache + artifacts: true -.rake-exec: +.rails-job-base: extends: - .default-tags - .default-retry - .default-cache - - .default-only - .default-before_script - variables: - SETUP_DB: "false" - script: - - bundle exec rake $CI_JOB_NAME - -.only-code-rails-job-base: - extends: - - .default-tags - - .default-retry - - .default-cache - - .default-only - - .default-before_script - - .only:changes-code-backstage - -.only-code-qa-rails-job-base: - extends: - - .default-tags - - .default-retry - - .default-cache - - .default-only - - .default-before_script - - .only:changes-code-backstage-qa +#################### +# ee and foss jobs # setup-test-env: extends: - - .only-code-qa-rails-job-base + - .rails-job-base + - .rails:rules:default-refs-code-backstage-qa - .use-pg9 stage: prepare script: @@ -50,14 +32,48 @@ setup-test-env: cache: policy: pull-push -.rspec-base: - extends: .only-code-rails-job-base +static-analysis: + extends: + - .rails-job-base + - .rails:rules:default-refs-code-backstage-qa + - .rails:needs:setup-and-assets stage: test - needs: ["setup-test-env", "retrieve-tests-metadata", "compile-assets pull-cache"] - dependencies: ["setup-test-env", "retrieve-tests-metadata", "compile-assets pull-cache"] + variables: + SETUP_DB: "false" + parallel: 2 + script: + - scripts/static-analysis + cache: + key: "debian-stretch-ruby-2.6-pg9.6-rubocop" + paths: + - vendor/ruby + - tmp/rubocop_cache + policy: pull-push + +downtime_check: + extends: + - .rails-job-base + - .rails:needs:setup-and-assets + - .rails:rules:downtime_check + stage: test + variables: + SETUP_DB: "false" + script: + - bundle exec rake downtime_check + +.rspec-base: + extends: .rails-job-base + stage: test + needs: + - job: setup-test-env + artifacts: true + - job: retrieve-tests-metadata + artifacts: true + - job: compile-assets pull-cache + artifacts: true script: - source scripts/rspec_helpers.sh - - rspec_paralellized_job "--tag ~quarantine --tag ~geo" + - rspec_paralellized_job "--tag ~quarantine --tag ~geo --tag ~level:migration" artifacts: expire_in: 31d when: always @@ -68,169 +84,14 @@ setup-test-env: - rspec_profiling/ - tmp/capybara/ - tmp/memory_test/ + - junit_rspec.xml reports: junit: junit_rspec.xml -.rspec-base-foss: - extends: [".rspec-base", ".only-ee-as-if-foss"] - needs: ["setup-test-env", "retrieve-tests-metadata", "compile-assets pull-cache foss"] - dependencies: ["setup-test-env", "retrieve-tests-metadata", "compile-assets pull-cache foss"] - -.rspec-base-pg9: +.rspec-base-quarantine: extends: - .rspec-base - .use-pg9 - -.rspec-base-pg9-foss: - extends: - - .rspec-base-foss - - .use-pg9 - -.rspec-base-pg10: - extends: - - .rspec-base - - .use-pg10 - - .only-master - -rspec migration pg9: - extends: .rspec-base-pg9 - parallel: 4 - -rspec migration pg9-foss: - extends: .rspec-base-pg9-foss - parallel: 4 - -rspec unit pg9: - extends: .rspec-base-pg9 - parallel: 20 - -rspec unit pg9-foss: - extends: .rspec-base-pg9-foss - parallel: 20 - -rspec integration pg9: - extends: .rspec-base-pg9 - parallel: 6 - -rspec integration pg9-foss: - extends: .rspec-base-pg9-foss - parallel: 6 - -rspec system pg9: - extends: .rspec-base-pg9 - parallel: 24 - -rspec system pg9-foss: - extends: .rspec-base-pg9-foss - parallel: 24 - -rspec unit pg10: - extends: .rspec-base-pg10 - parallel: 20 - -rspec integration pg10: - extends: .rspec-base-pg10 - parallel: 6 - -rspec system pg10: - extends: .rspec-base-pg10 - parallel: 24 - -.rspec-ee-base-pg9: - extends: - - .rspec-base - - .only-ee - - .use-pg9-ee - -.rspec-ee-base-pg10: - extends: - - .rspec-base - - .only-ee - - .use-pg10-ee - -rspec-ee migration pg9: - extends: .rspec-ee-base-pg9 - parallel: 2 - -rspec-ee unit pg9: - extends: .rspec-ee-base-pg9 - parallel: 5 - -rspec-ee integration pg9: - extends: .rspec-ee-base-pg9 - parallel: 3 - -rspec-ee system pg9: - extends: .rspec-ee-base-pg9 - parallel: 5 - -rspec-ee migration pg10: - extends: - - .rspec-ee-base-pg10 - - .only-master - parallel: 2 - -rspec-ee unit pg10: - extends: - - .rspec-ee-base-pg10 - - .only-master - parallel: 5 - -rspec-ee integration pg10: - extends: - - .rspec-ee-base-pg10 - - .only-master - parallel: 3 - -rspec-ee system pg10: - extends: - - .rspec-ee-base-pg10 - - .only-master - parallel: 5 - -.rspec-ee-base-geo: - extends: - - .rspec-base - - .only-ee - script: - - source scripts/rspec_helpers.sh - - scripts/prepare_postgres_fdw.sh - - rspec_paralellized_job "--tag ~quarantine --tag geo" - -.rspec-ee-base-geo-pg9: - extends: - - .rspec-ee-base-geo - - .use-pg9-ee - -.rspec-ee-base-geo-pg10: - extends: - - .rspec-ee-base-geo - - .use-pg10-ee - -rspec-ee unit pg9 geo: - extends: .rspec-ee-base-geo-pg9 - parallel: 2 - -rspec-ee integration pg9 geo: - extends: .rspec-ee-base-geo-pg9 - -rspec-ee system pg9 geo: - extends: .rspec-ee-base-geo-pg9 - -rspec-ee unit pg10 geo: - extends: .rspec-ee-base-geo-pg10 - parallel: 2 - -rspec-ee integration pg10 geo: - extends: .rspec-ee-base-geo-pg10 - -rspec-ee system pg10 geo: - extends: .rspec-ee-base-geo-pg10 - -rspec quarantine pg9: - extends: - - .rspec-base-pg9 - - .only-master variables: RSPEC_OPTS: "--tag quarantine -- spec/" script: @@ -238,53 +99,50 @@ rspec quarantine pg9: - rspec_simple_job "${RSPEC_OPTS}" allow_failure: true -rspec-ee quarantine pg9: +.rspec-base-pg9: extends: - - rspec quarantine pg9 - - .only-ee - variables: - RSPEC_OPTS: "--tag quarantine -- ee/spec/" + - .rspec-base + - .rails:rules:ee-and-foss + - .use-pg9 + +.rspec-base-migration: + script: + - source scripts/rspec_helpers.sh + - rspec_paralellized_job "--tag ~quarantine --tag ~geo --tag level:migration" + +rspec migration pg9: + extends: + - .rspec-base-pg9 + - .rspec-base-migration + parallel: 5 + +rspec unit pg9: + extends: .rspec-base-pg9 + parallel: 20 + +rspec integration pg9: + extends: .rspec-base-pg9 + parallel: 8 + +rspec system pg9: + extends: .rspec-base-pg9 + parallel: 24 rspec fast_spec_helper: extends: .rspec-base-pg9 script: - bin/rspec spec/fast_spec_helper.rb -static-analysis: - extends: .only-code-qa-rails-job-base - stage: test - needs: ["setup-test-env", "compile-assets pull-cache"] - dependencies: ["setup-test-env", "compile-assets pull-cache"] - variables: - SETUP_DB: "false" - parallel: 2 - script: - - scripts/static-analysis - cache: - key: "debian-stretch-ruby-2.6.3-and-rubocop" - paths: - - vendor/ruby - - tmp/rubocop_cache - policy: pull-push - -downtime_check: - extends: - - .rake-exec - - .only:changes-code-backstage - - .except:refs-master-tags-stable-deploy - stage: test - needs: ["setup-test-env"] - dependencies: ["setup-test-env"] - .db-job-base: extends: - - .only-code-rails-job-base + - .rails-job-base + - .rails:rules:ee-and-foss - .use-pg9 stage: test - needs: ["setup-test-env"] - dependencies: ["setup-test-env"] + needs: + - job: setup-test-env + artifacts: true -# DB migration, rollback, and seed jobs db:migrate:reset: extends: .db-job-base script: @@ -345,12 +203,14 @@ gitlab:setup: - log/development.log coverage: - extends: .only-code-rails-job-base - cache: - policy: pull + extends: + - .rails-job-base + - .rails:rules:ee-and-foss + stage: post-test variables: SETUP_DB: "false" - stage: post-test + cache: + policy: pull script: - bundle exec scripts/merge-simplecov - bundle exec scripts/gather-test-memory-data @@ -362,11 +222,181 @@ coverage: - coverage/index.html - coverage/assets/ - tmp/memory_test/ +# ee and foss jobs # +#################### + +#################### +# master-only jobs # +rspec quarantine pg9: + extends: + - .rspec-base-quarantine + - .rails:rules:master-refs-code-backstage + +.rspec-base-pg10: + extends: + - .rspec-base + - .rails:rules:master-refs-code-backstage + - .use-pg10 + +rspec unit pg10: + extends: .rspec-base-pg10 + parallel: 20 + +rspec integration pg10: + extends: .rspec-base-pg10 + parallel: 8 + +rspec system pg10: + extends: .rspec-base-pg10 + parallel: 24 +# master-only jobs # +#################### + +######################### +# ee + master-only jobs # +rspec-ee quarantine pg9: + extends: + - .rspec-base-quarantine + - .rails:rules:master-refs-code-backstage-ee-only + variables: + RSPEC_OPTS: "--tag quarantine -- ee/spec/" + +rspec-ee migration pg10: + extends: + - .rspec-ee-base-pg10 + - .rspec-base-migration + - .rails:rules:master-refs-code-backstage + parallel: 2 + +rspec-ee unit pg10: + extends: + - .rspec-ee-base-pg10 + - .rails:rules:master-refs-code-backstage + parallel: 10 + +rspec-ee integration pg10: + extends: + - .rspec-ee-base-pg10 + - .rails:rules:master-refs-code-backstage + parallel: 4 + +rspec-ee system pg10: + extends: + - .rspec-ee-base-pg10 + - .rails:rules:master-refs-code-backstage + parallel: 6 +# ee + master-only jobs # +######################### + +################# +# ee-only jobs # +.rspec-base-ee: + extends: + - .rspec-base + - .rails:rules:ee-only + +.rspec-base-pg9-as-if-foss: + extends: + - .rspec-base-ee + - .as-if-foss + - .use-pg9 + needs: + - job: setup-test-env + artifacts: true + - job: retrieve-tests-metadata + artifacts: true + - job: compile-assets pull-cache as-if-foss + artifacts: true + +.rspec-ee-base-pg9: + extends: + - .rspec-base-ee + - .use-pg9-ee + +.rspec-ee-base-pg10: + extends: + - .rspec-base-ee + - .use-pg10-ee + +rspec migration pg9-as-if-foss: + extends: + - .rspec-base-pg9-as-if-foss + - .rspec-base-migration + parallel: 5 + +rspec unit pg9-as-if-foss: + extends: .rspec-base-pg9-as-if-foss + parallel: 20 + +rspec integration pg9-as-if-foss: + extends: .rspec-base-pg9-as-if-foss + parallel: 8 + +rspec system pg9-as-if-foss: + extends: .rspec-base-pg9-as-if-foss + parallel: 24 + +rspec-ee migration pg9: + extends: + - .rspec-ee-base-pg9 + - .rspec-base-migration + parallel: 2 + +rspec-ee unit pg9: + extends: .rspec-ee-base-pg9 + parallel: 10 + +rspec-ee integration pg9: + extends: .rspec-ee-base-pg9 + parallel: 4 + +rspec-ee system pg9: + extends: .rspec-ee-base-pg9 + parallel: 6 + +.rspec-ee-base-geo: + extends: .rspec-base-ee + script: + - source scripts/rspec_helpers.sh + - scripts/prepare_postgres_fdw.sh + - rspec_paralellized_job "--tag ~quarantine --tag geo" + +.rspec-ee-base-geo-pg9: + extends: + - .rspec-ee-base-geo + - .use-pg9-ee + +.rspec-ee-base-geo-pg10: + extends: + - .rspec-ee-base-geo + - .use-pg10-ee + +rspec-ee unit pg9 geo: + extends: .rspec-ee-base-geo-pg9 + parallel: 2 + +rspec-ee integration pg9 geo: + extends: .rspec-ee-base-geo-pg9 + +rspec-ee system pg9 geo: + extends: .rspec-ee-base-geo-pg9 + +rspec-ee unit pg10 geo: + extends: .rspec-ee-base-geo-pg10 + parallel: 2 + +rspec-ee integration pg10 geo: + extends: .rspec-ee-base-geo-pg10 + +rspec-ee system pg10 geo: + extends: .rspec-ee-base-geo-pg10 db:rollback geo: extends: - db:rollback - - .only-ee + - .rails:rules:ee-only script: - bundle exec rake geo:db:migrate VERSION=20170627195211 - bundle exec rake geo:db:migrate +# ee-only jobs # +################ diff --git a/.gitlab/ci/releases.gitlab-ci.yml b/.gitlab/ci/releases.gitlab-ci.yml index d4e0236f3a..b3f961afe6 100644 --- a/.gitlab/ci/releases.gitlab-ci.yml +++ b/.gitlab/ci/releases.gitlab-ci.yml @@ -1,5 +1,3 @@ ---- - # Syncs any changes pushed to a stable branch to the corresponding # gitlab-foss/CE stable branch. We run this prior to any tests so that random # failures don't prevent a sync. @@ -9,28 +7,22 @@ image: alpine:edge stage: sync before_script: - - apk add --no-cache --update curl bash - after_script: [] + - apk add --no-cache --update curl bash jq script: - bash scripts/sync-stable-branch.sh - only: - variables: - - $CI_SERVER_HOST == "gitlab.com" sync-stable-branch: - extends: .merge-train-sync + extends: + - .releases:rules:canonical-dot-com-gitlab-stable-branch-only + - .merge-train-sync variables: SOURCE_PROJECT: gitlab-org/gitlab TARGET_PROJECT: gitlab-org/gitlab-foss - only: - refs: - - /^[\d-]+-stable-ee$/@gitlab-org/gitlab sync-security-branch: - extends: .merge-train-sync + extends: + - .releases:rules:canonical-dot-com-security-gitlab-stable-branch-only + - .merge-train-sync variables: SOURCE_PROJECT: gitlab-org/security/gitlab TARGET_PROJECT: gitlab-org/security/gitlab-foss - only: - refs: - - /^[\d-]+-stable-ee$/@gitlab-org/security/gitlab diff --git a/.gitlab/ci/reports.gitlab-ci.yml b/.gitlab/ci/reports.gitlab-ci.yml index 4ff14b660b..e7ee47fbe0 100644 --- a/.gitlab/ci/reports.gitlab-ci.yml +++ b/.gitlab/ci/reports.gitlab-ci.yml @@ -1,5 +1,5 @@ # include: -# - template: Code-Quality.gitlab-ci.yml +# - template: Jobs/Code-Quality.gitlab-ci.yml # - template: Security/SAST.gitlab-ci.yml # - template: Security/Dependency-Scanning.gitlab-ci.yml # - template: Security/DAST.gitlab-ci.yml @@ -10,8 +10,7 @@ code_quality: extends: - .default-retry - - .default-only - - .only:changes-code-backstage + - .reports:rules:code_quality stage: test image: docker:stable allow_failure: true @@ -20,7 +19,7 @@ code_quality: variables: DOCKER_DRIVER: overlay2 DOCKER_TLS_CERTDIR: "" - CODE_QUALITY_IMAGE: "registry.gitlab.com/gitlab-org/security-products/codequality:12-5-stable" + CODE_QUALITY_IMAGE: "registry.gitlab.com/gitlab-org/security-products/codequality:0.85.6" script: - | if ! docker info &>/dev/null; then @@ -38,12 +37,9 @@ code_quality: reports: codequality: gl-code-quality-report.json paths: - - gl-code-quality-report.json - expire_in: 1 week + - gl-code-quality-report.json # GitLab-specific + expire_in: 1 week # GitLab-specific 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`. @@ -53,16 +49,22 @@ code_quality: sast: extends: - .default-retry - - .default-only - - .only:changes-code-backstage-qa + - .reports:rules:sast stage: test + allow_failure: true + dependencies: [] # GitLab-specific + artifacts: + paths: + - gl-sast-report.json # GitLab-specific + reports: + sast: gl-sast-report.json + expire_in: 1 week # GitLab-specific image: docker:stable variables: DOCKER_DRIVER: overlay2 DOCKER_TLS_CERTDIR: "" - SAST_BRAKEMAN_LEVEL: 2 - SAST_EXCLUDED_PATHS: qa,spec,doc,ee/spec - allow_failure: true + SAST_BRAKEMAN_LEVEL: 2 # GitLab-specific + SAST_EXCLUDED_PATHS: qa,spec,doc,ee/spec # GitLab-specific services: - docker:stable-dind script: @@ -73,61 +75,12 @@ sast: 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 \ - ) \ + ENVS=`printenv | grep -vE '^(DOCKER_|CI|GITLAB_|FF_|HOME|PWD|OLDPWD|PATH|SHLVL|HOSTNAME)' | sed -n '/^[^\t]/s/=.*//p' | sed '/^$/d' | sed 's/^/-e /g' | tr '\n' ' '` + docker run "$ENVS" \ --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: - expire_in: 7 days - paths: - - 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`. @@ -135,13 +88,13 @@ sast: dependency_scanning: extends: - .default-retry - - .default-only - - .only:changes-code-backstage-qa + - .reports:rules:dependency_scanning stage: test image: docker:stable variables: DOCKER_DRIVER: overlay2 DOCKER_TLS_CERTDIR: "" + DS_EXCLUDED_PATHS: "qa/qa/ee/fixtures/secure_premade_reports,spec,ee/spec" # GitLab-specific allow_failure: true services: - docker:stable-dind @@ -173,23 +126,29 @@ dependency_scanning: DS_PULL_ANALYZER_IMAGE_TIMEOUT \ DS_RUN_ANALYZER_TIMEOUT \ DS_PYTHON_VERSION \ + DS_PIP_VERSION \ DS_PIP_DEPENDENCY_PATH \ + GEMNASIUM_DB_LOCAL_PATH \ + GEMNASIUM_DB_REMOTE_URL \ + GEMNASIUM_DB_REF_NAME \ PIP_INDEX_URL \ PIP_EXTRA_INDEX_URL \ + PIP_REQUIREMENTS_FILE \ + MAVEN_CLI_OPTS \ + BUNDLER_AUDIT_UPDATE_DISABLED \ + BUNDLER_AUDIT_ADVISORY_DB_URL \ + BUNDLER_AUDIT_ADVISORY_DB_REF_NAME \ ) \ --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: + paths: + - gl-dependency-scanning-report.json # GitLab-specific reports: dependency_scanning: gl-dependency-scanning-report.json + expire_in: 1 week # GitLab-specific 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`. @@ -197,40 +156,36 @@ dependency_scanning: dast: extends: - .default-retry - - .default-only - - .only:changes-code-qa - - .only-review - stage: qa - needs: ["review-deploy"] - dependencies: ["review-deploy"] - before_script: - - export DAST_WEBSITE="$(cat review_app_url.txt)" + - .reports:rules:dast + needs: + - job: review-deploy + artifacts: true + stage: qa # GitLab-specific image: - name: "registry.gitlab.com/gitlab-org/security-products/dast:$CI_SERVER_VERSION_MAJOR-$CI_SERVER_VERSION_MINOR-stable" + name: "registry.gitlab.com/gitlab-org/security-products/dast:$DAST_VERSION" 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" + # To be done in a later iteration + # DAST_USERNAME: "root" + # DAST_USERNAME_FIELD: "user[login]" + # DAST_PASSWORD_FIELD: "user[passowrd]" allow_failure: true script: - - export DAST_WEBSITE=${DAST_WEBSITE:-$(cat environment_url.txt)} + - 'export DAST_WEBSITE="${DAST_WEBSITE:-$(cat environment_url.txt)}"' + # To be done in a later iteration + # - 'export DAST_AUTH_URL="${DAST_WEBSITE}/users/sign_in"' + # - 'export DAST_PASSWORD="${REVIEW_APPS_ROOT_PASSWORD}"' - /analyze -t $DAST_WEBSITE artifacts: - expire_in: 7 days paths: - - gl-dast-report.json + - gl-dast-report.json # GitLab-specific reports: dast: gl-dast-report.json + expire_in: 1 week # GitLab-specific + +# To be done in a later iteration: https://gitlab.com/gitlab-org/gitlab/issues/31160#note_278188255 +# schedule:dast: +# extends: +# - dast +# - .reports:schedule-dast +# variables: +# DAST_FULL_SCAN_ENABLED: "true" diff --git a/.gitlab/ci/review.gitlab-ci.yml b/.gitlab/ci/review.gitlab-ci.yml index 1062f6b03a..e23708337a 100644 --- a/.gitlab/ci/review.gitlab-ci.yml +++ b/.gitlab/ci/review.gitlab-ci.yml @@ -2,8 +2,7 @@ extends: - .default-tags - .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-ruby-2.6 services: - docker:19.03.0-dind tags: @@ -17,9 +16,7 @@ build-qa-image: extends: - .review-docker - - .only:variables-canonical-dot-com - - .except:refs-deploy - - .only:changes-code-qa + - .review:rules:mr-and-schedule stage: prepare script: - '[[ ! -d "ee/" ]] || export GITLAB_EDITION="ee"' @@ -30,11 +27,11 @@ build-qa-image: - time docker build --cache-from "${QA_MASTER_IMAGE}" --tag ${QA_IMAGE} --file ./qa/Dockerfile ./ - time docker push ${QA_IMAGE} -.base-review-cleanup: +review-cleanup: extends: - .default-tags - .default-retry - - .default-only + - .review:rules:review-cleanup stage: prepare image: registry.gitlab.com/gitlab-org/gitlab-build-images:gitlab-charts-build-base allow_failure: true @@ -47,52 +44,28 @@ build-qa-image: script: - ruby -rrubygems scripts/review_apps/automated_cleanup.rb -schedule:review-cleanup: - extends: - - .base-review-cleanup - - .only-review-schedules - -manual:review-cleanup: - extends: - - .base-review-cleanup - - .only:changes-code-qa - when: manual - -.review-build-cng-base: +review-build-cng: extends: - .default-tags - .default-retry - - .default-only + - .review:rules:mr-and-schedule image: ruby:2.6-alpine stage: review-prepare before_script: - source scripts/utils.sh - install_api_client_dependencies_with_apk - install_gitlab_gem - dependencies: [] + needs: + - job: gitlab:assets:compile pull-cache + artifacts: false script: - BUILD_TRIGGER_TOKEN=$REVIEW_APPS_BUILD_TRIGGER_TOKEN ./scripts/trigger-build cng -review-build-cng: - extends: - - .review-build-cng-base - - .only-review - - .only:changes-code-qa - needs: ["gitlab:assets:compile pull-cache"] - -schedule:review-build-cng: - extends: - - .review-build-cng-base - - .only-review-schedules - needs: ["gitlab:assets:compile pull-cache"] - .review-workflow-base: extends: - .default-tags - .default-retry - - .default-only image: registry.gitlab.com/gitlab-org/gitlab-build-images:gitlab-charts-build-base - dependencies: [] variables: HOST_SUFFIX: "${CI_ENVIRONMENT_SLUG}" DOMAIN: "-${CI_ENVIRONMENT_SLUG}.${REVIEW_APPS_DOMAIN}" @@ -103,17 +76,22 @@ schedule:review-build-cng: url: https://gitlab-${CI_ENVIRONMENT_SLUG}.${REVIEW_APPS_DOMAIN} on_stop: review-stop -.review-deploy-base: - extends: .review-workflow-base +review-deploy: + extends: + - .review-workflow-base + - .review:rules:mr-and-schedule stage: review + needs: + - job: review-build-cng + artifacts: false allow_failure: true before_script: - '[[ ! -d "ee/" ]] || export GITLAB_EDITION="ee"' - export GITLAB_SHELL_VERSION=$( review_app_url.txt - - source scripts/utils.sh + - echo "${CI_ENVIRONMENT_URL}" > environment_url.txt + - source ./scripts/utils.sh - install_api_client_dependencies_with_apk - source scripts/review_apps/review-apps.sh script: @@ -125,59 +103,48 @@ schedule:review-build-cng: - date - deploy || (display_deployment_debug && exit 1) artifacts: - paths: [review_app_url.txt] + paths: [environment_url.txt] expire_in: 2 days when: always -review-deploy: - extends: - - .review-deploy-base - - .only-review - - .only:changes-code-qa - -schedule:review-deploy: - extends: - - .review-deploy-base - - .only-review-schedules - -.base-review-stop: - extends: - - .review-workflow-base - - .only-review - - .only:changes-code-qa +.review-stop-base: + extends: .review-workflow-base environment: action: stop + dependencies: [] variables: - GIT_STRATEGY: none + # We're cloning the repo instead of downloading the script for now + # because some repos are private and CI_JOB_TOKEN cannot access files. + # See https://gitlab.com/gitlab-org/gitlab/issues/191273 + GIT_DEPTH: 1 before_script: - # We don't clone the repo by using GIT_STRATEGY: none and only download the - # single script we need here so it's much faster than cloning. - apk add --update openssl - - wget $CI_PROJECT_URL/raw/$CI_COMMIT_SHA/scripts/review_apps/review-apps.sh - - wget $CI_PROJECT_URL/raw/$CI_COMMIT_SHA/scripts/utils.sh - - source utils.sh - - source review-apps.sh + - source ./scripts/utils.sh + - source ./scripts/review_apps/review-apps.sh review-stop-failed-deployment: - extends: .base-review-stop + extends: + - .review-stop-base + - .review:rules:mr-only-auto stage: prepare script: - delete_failed_release review-stop: - extends: .base-review-stop + extends: + - .review-stop-base + - .review:rules:mr-only-manual stage: review - when: manual allow_failure: true script: - delete_release .review-qa-base: - extends: - - .review-docker - - .only-review - - .only:changes-code-qa + extends: .review-docker stage: qa + needs: + - job: review-deploy + artifacts: true allow_failure: true variables: QA_ARTIFACTS_DIR: "${CI_PROJECT_DIR}/qa" @@ -189,66 +156,49 @@ review-stop: GITLAB_ADMIN_PASSWORD: "${REVIEW_APPS_ROOT_PASSWORD}" GITHUB_ACCESS_TOKEN: "${REVIEW_APPS_QA_GITHUB_ACCESS_TOKEN}" EE_LICENSE: "${REVIEW_APPS_EE_LICENSE}" - needs: ["review-deploy"] - dependencies: ["review-deploy"] - artifacts: - paths: - - ./qa/gitlab-qa-run-* - expire_in: 7 days - when: always before_script: - '[[ ! -d "ee/" ]] || export GITLAB_EDITION="ee"' - export QA_IMAGE="${CI_REGISTRY}/${CI_PROJECT_PATH}/gitlab/gitlab-${GITLAB_EDITION}-qa:${CI_COMMIT_REF_SLUG}" - - export CI_ENVIRONMENT_URL="$(cat review_app_url.txt)" + - export CI_ENVIRONMENT_URL="$(cat environment_url.txt)" - echo "${CI_ENVIRONMENT_URL}" - echo "${QA_IMAGE}" - source scripts/utils.sh - install_api_client_dependencies_with_apk - gem install gitlab-qa --no-document ${GITLAB_QA_VERSION:+ --version ${GITLAB_QA_VERSION}} + artifacts: + paths: + - ./qa/gitlab-qa-run-* + expire_in: 7 days + when: always review-qa-smoke: - extends: .review-qa-base + extends: + - .review-qa-base + - .review:rules:mr-only-auto script: - gitlab-qa Test::Instance::Smoke "${QA_IMAGE}" "${CI_ENVIRONMENT_URL}" review-qa-all: - extends: .review-qa-base - when: manual + extends: + - .review-qa-base + - .review:rules:mr-only-manual parallel: 5 script: - export KNAPSACK_REPORT_PATH=knapsack/master_report.json - export KNAPSACK_TEST_FILE_PATTERN=qa/specs/features/**/*_spec.rb - gitlab-qa Test::Instance::Any "${QA_IMAGE}" "${CI_ENVIRONMENT_URL}" -- --format RspecJunitFormatter --out tmp/rspec-${CI_JOB_ID}.xml --format html --out tmp/rspec.htm --color --format documentation -.review-performance-base: - extends: .review-docker - stage: qa - allow_failure: true - before_script: - - export CI_ENVIRONMENT_URL="$(cat review_app_url.txt)" - - echo "${CI_ENVIRONMENT_URL}" - - mkdir -p gitlab-exporter - - wget -O ./gitlab-exporter/index.js https://gitlab.com/gitlab-org/gl-performance/raw/master/index.js - - mkdir -p sitespeed-results - script: - - docker run --shm-size=1g --rm -v "$(pwd)":/sitespeed.io sitespeedio/sitespeed.io:6.3.1 --plugins.add ./gitlab-exporter --outputFolder sitespeed-results "${CI_ENVIRONMENT_URL}" - after_script: - - mv sitespeed-results/data/performance.json performance.json - artifacts: - paths: - - sitespeed-results/ - reports: - performance: performance.json - review-performance: extends: - - .review-performance-base - - .only-review - - .only:changes-code-qa - needs: ["review-deploy"] - dependencies: ["review-deploy"] + - .review-docker + - .review:rules:mr-and-schedule + stage: qa + needs: + - job: review-deploy + artifacts: true + allow_failure: true before_script: - - export CI_ENVIRONMENT_URL="$(cat review_app_url.txt)" + - export CI_ENVIRONMENT_URL="$(cat environment_url.txt)" - echo "${CI_ENVIRONMENT_URL}" - mkdir -p gitlab-exporter - wget -O ./gitlab-exporter/index.js https://gitlab.com/gitlab-org/gl-performance/raw/master/index.js @@ -263,34 +213,17 @@ review-performance: reports: performance: performance.json -schedule:review-performance: - extends: - - .review-performance-base - - .only-review-schedules - needs: ["schedule:review-deploy"] - dependencies: ["schedule:review-deploy"] - parallel-spec-reports: extends: - .default-tags - - .default-only - - .only-review - - .only:changes-code-qa + - .review:rules:mr-only-manual image: ruby:2.6-alpine stage: post-qa dependencies: ["review-qa-all"] + allow_failure: true variables: NEW_PARALLEL_SPECS_REPORT: qa/report-new.html BASE_ARTIFACT_URL: "${CI_PROJECT_URL}/-/jobs/${CI_JOB_ID}/artifacts/file/qa/" - allow_failure: true - when: manual - artifacts: - when: always - paths: - - qa/report-new.html - - qa/gitlab-qa-run-* - reports: - junit: qa/gitlab-qa-run-*/**/rspec-*.xml script: - apk add --update build-base libxml2-dev libxslt-dev && rm -rf /var/cache/apk/* - gem install nokogiri --no-document @@ -299,20 +232,23 @@ parallel-spec-reports: - cd - - '[[ -f $NEW_PARALLEL_SPECS_REPORT ]] || echo "{}" > ${NEW_PARALLEL_SPECS_REPORT}' - scripts/merge-html-reports ${NEW_PARALLEL_SPECS_REPORT} ${BASE_ARTIFACT_URL}${ARTIFACT_DIRS} qa/gitlab-qa-run-*/**/rspec.htm + artifacts: + when: always + paths: + - qa/report-new.html + - qa/gitlab-qa-run-* + reports: + junit: qa/gitlab-qa-run-*/**/rspec-*.xml danger-review: extends: - .default-tags - .default-retry - .default-cache - - .default-only - - .except:refs-master-tags-stable-deploy + - .review:rules:danger image: registry.gitlab.com/gitlab-org/gitlab-build-images:danger stage: test dependencies: [] - only: - variables: - - $DANGER_GITLAB_API_TOKEN script: - git version - node --version diff --git a/.gitlab/ci/rules.gitlab-ci.yml b/.gitlab/ci/rules.gitlab-ci.yml new file mode 100644 index 0000000000..8cf652d51e --- /dev/null +++ b/.gitlab/ci/rules.gitlab-ci.yml @@ -0,0 +1,500 @@ +############## +# Conditions # +############## +.if-not-canonical-namespace: &if-not-canonical-namespace + if: '$CI_PROJECT_NAMESPACE !~ /^gitlab(-org)?($|\/)/' + +.if-not-ee: &if-not-ee + if: '$CI_PROJECT_NAME !~ /^gitlab(-ee)?$/' + +.if-not-foss: &if-not-foss + if: '$CI_PROJECT_NAME != "gitlab-foss" && $CI_PROJECT_NAME != "gitlab-ce" && $CI_PROJECT_NAME != "gitlabhq"' + +.if-default-refs: &if-default-refs + if: '$CI_COMMIT_REF_NAME == "master" || $CI_COMMIT_REF_NAME =~ /^[\d-]+-stable(-ee)?$/ || $CI_COMMIT_REF_NAME =~ /^\d+-\d+-auto-deploy-\d+$/ || $CI_COMMIT_REF_NAME =~ /^security\// || $CI_MERGE_REQUEST_IID || $CI_COMMIT_TAG' + +.if-master-refs: &if-master-refs + if: '$CI_COMMIT_REF_NAME == "master"' + +.if-master-or-tag: &if-master-or-tag + if: '$CI_COMMIT_REF_NAME == "master" || $CI_COMMIT_TAG' + +.if-merge-request: &if-merge-request + if: '$CI_MERGE_REQUEST_IID' + +.if-dot-com-gitlab-org-schedule: &if-dot-com-gitlab-org-schedule + if: '$CI_SERVER_HOST == "gitlab.com" && $CI_PROJECT_NAMESPACE == "gitlab-org" && $CI_PIPELINE_SOURCE == "schedule"' + +.if-dot-com-gitlab-org-master: &if-dot-com-gitlab-org-master + if: '$CI_SERVER_HOST == "gitlab.com" && $CI_PROJECT_NAMESPACE == "gitlab-org" && $CI_COMMIT_REF_NAME == "master"' + +.if-dot-com-gitlab-org-merge-request: &if-dot-com-gitlab-org-merge-request + if: '$CI_SERVER_HOST == "gitlab.com" && $CI_PROJECT_NAMESPACE == "gitlab-org" && $CI_MERGE_REQUEST_IID' + +.if-dot-com-gitlab-org-and-security-merge-request: &if-dot-com-gitlab-org-and-security-merge-request + if: '$CI_SERVER_HOST == "gitlab.com" && $CI_PROJECT_NAMESPACE =~ /^gitlab-org($|\/security$)/ && $CI_MERGE_REQUEST_IID' + +.if-dot-com-gitlab-org-and-security-tag: &if-dot-com-gitlab-org-and-security-tag + if: '$CI_SERVER_HOST == "gitlab.com" && $CI_PROJECT_NAMESPACE =~ /^gitlab-org($|\/security$)/ && $CI_COMMIT_TAG' + +.if-dot-com-ee-schedule: &if-dot-com-ee-schedule + if: '$CI_SERVER_HOST == "gitlab.com" && $CI_PROJECT_PATH == "gitlab-org/gitlab" && $CI_PIPELINE_SOURCE == "schedule"' + +.if-cache-credentials-schedule: &if-cache-credentials-schedule + if: '$CI_REPO_CACHE_CREDENTIALS && $CI_PIPELINE_SOURCE == "schedule"' + +#################### +# Changes patterns # +#################### +.yaml-patterns: &yaml-patterns + - "**/*.yml" + +.docs-patterns: &docs-patterns + - ".gitlab/route-map.yml" + - "doc/**/*" + - ".markdownlint.json" + +.backstage-patterns: &backstage-patterns + - "Dangerfile" + - "danger/**/*" + - "{,ee/}fixtures/**/*" + - "{,ee/}rubocop/**/*" + - "{,ee/}spec/**/*" + - "doc/README.md" # Some RSpec test rely on this file + +.code-patterns: &code-patterns + - ".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" + - "Dockerfile.assets" + - "*_VERSION" + - "Gemfile{,.lock}" + - "Rakefile" + - "{babel.config,jest.config}.js" + - "config.ru" + - "{package.json,yarn.lock}" + - "{,ee/}{app,bin,config,db,haml_lint,lib,locale,public,scripts,symbol,vendor}/**/*" + - "doc/api/graphql/reference/*" # Files in this folder are auto-generated + +.qa-patterns: &qa-patterns + - ".dockerignore" + - "qa/**/*" + +.code-backstage-patterns: &code-backstage-patterns + - ".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" + - "Dockerfile.assets" + - "*_VERSION" + - "Gemfile{,.lock}" + - "Rakefile" + - "{babel.config,jest.config}.js" + - "config.ru" + - "{package.json,yarn.lock}" + - "{,ee/}{app,bin,config,db,haml_lint,lib,locale,public,scripts,symbol,vendor}/**/*" + - "doc/api/graphql/reference/*" # Files in this folder are auto-generated + # Backstage changes + - "Dangerfile" + - "danger/**/*" + - "{,ee/}fixtures/**/*" + - "{,ee/}rubocop/**/*" + - "{,ee/}spec/**/*" + - "doc/README.md" # Some RSpec test rely on this file + +.code-qa-patterns: &code-qa-patterns + - ".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" + - "Dockerfile.assets" + - "*_VERSION" + - "Gemfile{,.lock}" + - "Rakefile" + - "{babel.config,jest.config}.js" + - "config.ru" + - "{package.json,yarn.lock}" + - "{,ee/}{app,bin,config,db,haml_lint,lib,locale,public,scripts,symbol,vendor}/**/*" + - "doc/api/graphql/reference/*" # Files in this folder are auto-generated + # QA changes + - ".dockerignore" + - "qa/**/*" + +.code-backstage-qa-patterns: &code-backstage-qa-patterns + - ".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" + - "Dockerfile.assets" + - "*_VERSION" + - "Gemfile{,.lock}" + - "Rakefile" + - "{babel.config,jest.config}.js" + - "config.ru" + - "{package.json,yarn.lock}" + - "{,ee/}{app,bin,config,db,haml_lint,lib,locale,public,scripts,symbol,vendor}/**/*" + - "doc/api/graphql/reference/*" # Files in this folder are auto-generated + # Backstage changes + - "Dangerfile" + - "danger/**/*" + - "{,ee/}fixtures/**/*" + - "{,ee/}rubocop/**/*" + - "{,ee/}spec/**/*" + - "doc/README.md" # Some RSpec test rely on this file + # QA changes + - ".dockerignore" + - "qa/**/*" + +#################### +# Cache repo rules # +#################### +.cache-repo:rules: + rules: + - <<: *if-cache-credentials-schedule + when: on_success + +############# +# CNG rules # +############# +.cng:rules: + rules: + - <<: *if-dot-com-gitlab-org-and-security-tag + when: manual + +###################### +# Dev fixtures rules # +###################### +.dev-fixtures:rules:ee-and-foss: + rules: + - <<: *if-default-refs + changes: *code-backstage-patterns + when: on_success + +.dev-fixtures:rules:ee-only: + rules: + - <<: *if-not-ee + when: never + - <<: *if-default-refs + changes: *code-backstage-patterns + when: on_success + +############## +# Docs rules # +############## +.docs:rules:review-docs: + rules: + - <<: *if-dot-com-gitlab-org-merge-request + changes: *docs-patterns + when: manual + +.docs:rules:docs-lint: + rules: + - <<: *if-default-refs + changes: *docs-patterns + when: on_success + +.docs:rules:graphql-reference-verify: + rules: + - <<: *if-not-ee + when: never + - <<: *if-default-refs + changes: *code-backstage-qa-patterns + when: on_success + +################## +# Frontend rules # +################## +.frontend:rules:gitlab-assets-compile-pull-push-cache: + rules: + - <<: *if-not-canonical-namespace + when: never + - <<: *if-master-refs + changes: *code-backstage-qa-patterns + when: on_success + +.frontend:rules:gitlab-assets-compile-pull-cache: + rules: + - <<: *if-not-canonical-namespace + when: never + - <<: *if-default-refs + changes: *code-backstage-qa-patterns + when: on_success + +.frontend:rules:compile-assets-pull-push-cache: + rules: + - <<: *if-master-refs + changes: *code-backstage-qa-patterns + when: on_success + +.frontend:rules:compile-assets-pull-push-cache-as-if-foss: + rules: + - <<: *if-not-ee + when: never + - <<: *if-master-refs + changes: *code-backstage-qa-patterns + when: on_success + +.frontend:rules:compile-assets-pull-cache: + rules: + - <<: *if-default-refs + changes: *code-backstage-qa-patterns + when: on_success + +.frontend:rules:compile-assets-pull-cache-as-if-foss: + rules: + - <<: *if-not-ee + when: never + - <<: *if-default-refs + changes: *code-backstage-qa-patterns + when: on_success + +.frontend:rules:default-frontend-jobs: + rules: + - <<: *if-default-refs + changes: *code-backstage-patterns + when: on_success + +.frontend:rules:default-frontend-jobs-as-if-foss: + rules: + - <<: *if-not-ee + when: never + - <<: *if-default-refs + changes: *code-backstage-patterns + when: on_success + +.frontend:rules:qa-frontend-node: + rules: + - <<: *if-master-refs + when: on_success + +################ +# Memory rules # +################ +.memory:rules: + rules: + - <<: *if-default-refs + changes: *code-patterns + when: on_success + +############### +# Pages rules # +############### +.pages:rules: + rules: + - <<: *if-dot-com-gitlab-org-master + changes: *code-backstage-qa-patterns + when: on_success + +############ +# QA rules # +############ +.qa:rules:ee-and-foss: + rules: + - <<: *if-default-refs + changes: *code-qa-patterns + when: on_success + +.qa:rules:ee-only: + rules: + - <<: *if-not-ee + when: never + - <<: *if-default-refs + changes: *code-qa-patterns + when: on_success + +.qa:rules:package-and-qa: + rules: + - <<: *if-dot-com-gitlab-org-merge-request + changes: *qa-patterns + when: on_success + - <<: *if-dot-com-gitlab-org-merge-request + changes: *code-patterns + when: manual + - <<: *if-dot-com-gitlab-org-schedule + when: on_success + +############### +# Rails rules # +############### +.rails:rules:ee-and-foss: + rules: + - <<: *if-default-refs + changes: *code-backstage-patterns + when: on_success + +.rails:rules:default-refs-code-backstage-qa: + rules: + - <<: *if-default-refs + changes: *code-backstage-qa-patterns + when: on_success + +.rails:rules:master-refs-code-backstage: + rules: + - <<: *if-master-refs + changes: *code-backstage-patterns + when: on_success + +.rails:rules:master-refs-code-backstage-ee-only: + rules: + - <<: *if-not-ee + when: never + - <<: *if-master-refs + changes: *code-backstage-patterns + when: on_success + +.rails:rules:ee-only: + rules: + - <<: *if-not-ee + when: never + - <<: *if-default-refs + changes: *code-backstage-patterns + when: on_success + +.rails:rules:downtime_check: + rules: + - <<: *if-merge-request + changes: *code-backstage-patterns + when: on_success + +################## +# Releases rules # +################## +.releases:rules:canonical-dot-com-gitlab-stable-branch-only: + rules: + - if: '$CI_SERVER_HOST == "gitlab.com" && $CI_PROJECT_PATH == "gitlab-org/gitlab" && $CI_COMMIT_REF_NAME =~ /^[\d-]+-stable-ee$/' + +.releases:rules:canonical-dot-com-security-gitlab-stable-branch-only: + rules: + - if: '$CI_SERVER_HOST == "gitlab.com" && $CI_PROJECT_PATH == "gitlab-org/security/gitlab" && $CI_COMMIT_REF_NAME =~ /^[\d-]+-stable-ee$/' + +################# +# Reports rules # +################# +.reports:rules:code_quality: + rules: + - if: '$CODE_QUALITY_DISABLED' + when: never + # - <<: *if-master-refs # To be done in a later iteration: https://gitlab.com/gitlab-org/gitlab/issues/31160#note_278188255 + - <<: *if-default-refs + changes: *code-backstage-patterns + +.reports:rules:sast: + rules: + - if: '$SAST_DISABLED || $GITLAB_FEATURES !~ /\bsast\b/' + when: never + # - <<: *if-master-refs # To be done in a later iteration: https://gitlab.com/gitlab-org/gitlab/issues/31160#note_278188255 + - <<: *if-default-refs + changes: *code-backstage-qa-patterns + +.reports:rules:dependency_scanning: + rules: + - if: '$DEPENDENCY_SCANNING_DISABLED || $GITLAB_FEATURES !~ /\bdependency_scanning\b/' + when: never + # - <<: *if-master-refs # To be done in a later iteration: https://gitlab.com/gitlab-org/gitlab/issues/31160#note_278188255 + - <<: *if-default-refs + changes: *code-backstage-qa-patterns + +.reports:rules:dast: + rules: + - if: '$DAST_DISABLED || $GITLAB_FEATURES !~ /\bdast\b/' + when: never + - <<: *if-dot-com-gitlab-org-merge-request + changes: *code-qa-patterns + +.reports:schedule-dast: + rules: + - if: '$DAST_DISABLED || $GITLAB_FEATURES !~ /\bdast\b/' + when: never + - <<: *if-dot-com-gitlab-org-schedule + +################ +# Review rules # +################ +.review:rules:mr-and-schedule: + rules: + - <<: *if-dot-com-gitlab-org-merge-request + changes: *code-qa-patterns + when: on_success + - <<: *if-dot-com-gitlab-org-schedule + when: on_success + +.review:rules:mr-only-auto: + rules: + - <<: *if-dot-com-gitlab-org-merge-request + changes: *code-qa-patterns + when: on_success + +.review:rules:mr-only-manual: + rules: + - <<: *if-dot-com-gitlab-org-merge-request + changes: *code-qa-patterns + when: manual + +.review:rules:review-cleanup: + rules: + - <<: *if-dot-com-gitlab-org-merge-request + changes: *code-qa-patterns + when: manual + - <<: *if-dot-com-gitlab-org-schedule + when: on_success + +.review:rules:danger: + rules: + - if: '$DANGER_GITLAB_API_TOKEN && $CI_MERGE_REQUEST_IID' + when: on_success + +############### +# Setup rules # +############### +.setup:rules:cache-gems: + rules: + - <<: *if-not-canonical-namespace + when: never + - <<: *if-master-or-tag + changes: *code-backstage-qa-patterns + when: on_success + +.setup:rules:gitlab_git_test: + rules: + - <<: *if-default-refs + changes: *code-backstage-patterns + when: on_success + +.setup:rules:no_ee_check: + rules: + - <<: *if-not-foss + when: never + - <<: *if-default-refs + changes: *code-backstage-patterns + when: on_success + +####################### +# Test metadata rules # +####################### +.test-metadata:rules:retrieve-tests-metadata: + rules: + - <<: *if-default-refs + changes: *code-backstage-patterns + when: on_success + +.test-metadata:rules:update-tests-metadata: + rules: + - <<: *if-dot-com-ee-schedule + changes: *code-backstage-patterns + when: on_success + +.test-metadata:rules:flaky-examples-check: + rules: + - <<: *if-merge-request + changes: *code-backstage-patterns + when: on_success + + +############## +# YAML rules # +############## +.yaml:rules: + rules: + - <<: *if-default-refs + changes: *yaml-patterns diff --git a/.gitlab/ci/setup.gitlab-ci.yml b/.gitlab/ci/setup.gitlab-ci.yml index 2426758439..fb203db147 100644 --- a/.gitlab/ci/setup.gitlab-ci.yml +++ b/.gitlab/ci/setup.gitlab-ci.yml @@ -6,11 +6,11 @@ cache gems: - .default-retry - .default-cache - .default-before_script - - .only:variables-canonical-dot-com - - .only:changes-code-backstage-qa + - .setup:rules:cache-gems stage: test - dependencies: ["setup-test-env"] - needs: ["setup-test-env"] + needs: + - job: setup-test-env + artifacts: true variables: SETUP_DB: "false" script: @@ -18,30 +18,23 @@ cache gems: artifacts: paths: - vendor/cache - only: - refs: - - master - - tags .minimal-job: extends: - .default-tags - .default-retry - - .default-only - - .only:changes-code-backstage dependencies: [] gitlab_git_test: - extends: .minimal-job + extends: + - .minimal-job + - .setup:rules:gitlab_git_test script: - spec/support/prepare-gitlab-git-test-for-commit --check-for-changes no_ee_check: - extends: .minimal-job + extends: + - .minimal-job + - .setup:rules:no_ee_check script: - scripts/no-ee-check - only: - variables: - - $CI_PROJECT_NAME == "gitlab-foss" - - $CI_PROJECT_NAME == "gitlab-ce" # Support former project name for forks/mirrors - - $CI_PROJECT_NAME == "gitlabhq" # Support former project name for dev diff --git a/.gitlab/ci/test-metadata.gitlab-ci.yml b/.gitlab/ci/test-metadata.gitlab-ci.yml index 21af0d373b..719e4e821c 100644 --- a/.gitlab/ci/test-metadata.gitlab-ci.yml +++ b/.gitlab/ci/test-metadata.gitlab-ci.yml @@ -1,7 +1,4 @@ .tests-metadata-state: - extends: - - .default-only - - .only:changes-code-backstage variables: TESTS_METADATA_S3_BUCKET: "gitlab-ce-cache" before_script: @@ -19,7 +16,9 @@ - rspec_profiling/ retrieve-tests-metadata: - extends: .tests-metadata-state + extends: + - .tests-metadata-state + - .test-metadata:rules:retrieve-tests-metadata stage: prepare cache: policy: pull @@ -28,7 +27,9 @@ retrieve-tests-metadata: - retrieve_tests_metadata update-tests-metadata: - extends: .tests-metadata-state + extends: + - .tests-metadata-state + - .test-metadata:rules:update-tests-metadata stage: post-test cache: policy: push @@ -36,27 +37,17 @@ update-tests-metadata: - retry gem install fog-aws mime-types activesupport rspec_profiling postgres-copy --no-document - source scripts/rspec_helpers.sh - update_tests_metadata - only: - refs: - - schedules - variables: - # Only update the Knapsack metadata on GitLab.com/gitlab-org/gitlab - - $CI_SERVER_HOST == "gitlab.com" && $CI_PROJECT_PATH == "gitlab-org/gitlab" flaky-examples-check: extends: - .default-tags - .default-retry - - .default-only - - .only:changes-code-backstage + - .test-metadata:rules:flaky-examples-check image: ruby:2.6-alpine stage: post-test variables: NEW_FLAKY_SPECS_REPORT: rspec_flaky/report-new.json allow_failure: true - only: - refs: - - merge_requests artifacts: expire_in: 30d paths: @@ -64,4 +55,4 @@ flaky-examples-check: script: - '[[ -f $NEW_FLAKY_SPECS_REPORT ]] || echo "{}" > ${NEW_FLAKY_SPECS_REPORT}' - scripts/merge-reports ${NEW_FLAKY_SPECS_REPORT} rspec_flaky/new_*_*.json - - scripts/detect-new-flaky-examples $NEW_FLAKY_SPECS_REPORT + - scripts/flaky_examples/detect-new-flaky-examples $NEW_FLAKY_SPECS_REPORT diff --git a/.gitlab/ci/yaml.gitlab-ci.yml b/.gitlab/ci/yaml.gitlab-ci.yml index 323f94b6d0..cdc3aa6e57 100644 --- a/.gitlab/ci/yaml.gitlab-ci.yml +++ b/.gitlab/ci/yaml.gitlab-ci.yml @@ -4,11 +4,11 @@ lint-ci-gitlab: extends: - .default-tags - .default-retry - - .default-only - only: - changes: - - "**/*.yml" + - .yaml:rules image: sdesbure/yamllint:latest dependencies: [] + variables: + LINT_PATHS: .gitlab-ci.yml .gitlab/ci lib/gitlab/ci/templates changelogs script: - - yamllint .gitlab-ci.yml .gitlab/ci lib/gitlab/ci/templates changelogs + - '[[ ! -d "ee/" ]] || export LINT_PATHS="$LINT_PATHS ee/changelogs"' + - yamllint $LINT_PATHS diff --git a/.gitlab/issue_templates/Coding style proposal.md b/.gitlab/issue_templates/Coding style proposal.md deleted file mode 100644 index a969c9b72e..0000000000 --- a/.gitlab/issue_templates/Coding style proposal.md +++ /dev/null @@ -1,16 +0,0 @@ -## Description of the proposal - - - -- [ ] Mention the proposal in the next backend weekly call and the #backend channel to encourage contribution -- [ ] Proceed with the proposal once 50% of the maintainers have weighed in, and 80% of the votes are :+1: -- [ ] Once approved, mention it again in the next backend weekly call and the #backend channel - - -/label ~"development guidelines" -/label ~"Style decision" -/label ~documentation - -/cc @gitlab-org/maintainers/rails-backend diff --git a/.gitlab/issue_templates/Feature proposal.md b/.gitlab/issue_templates/Feature proposal.md index 2d6d03c313..fa989e4528 100644 --- a/.gitlab/issue_templates/Feature proposal.md +++ b/.gitlab/issue_templates/Feature proposal.md @@ -6,6 +6,7 @@ -### Testing +### Availability & Testing - + ### What does success look like, and how can we measure that? -### What is the type of buyer? +### What is the type of buyer? diff --git a/.gitlab/issue_templates/QA failure.md b/.gitlab/issue_templates/QA failure.md new file mode 100644 index 0000000000..13b5d7bf92 --- /dev/null +++ b/.gitlab/issue_templates/QA failure.md @@ -0,0 +1,65 @@ + + +### Summary + + + +### Stack trace + +``` +PUT STACK TRACE HERE +``` + +### Screenshot / HTML page + + + +### Possible fixes + + + +/due in 2 weeks + + +/label ~Quality ~QA ~bug ~S1 + + +/label ~devops:: + + +/label ~found: + + +/label ~P + + +/milestone % diff --git a/.gitlab/issue_templates/Security Release.md b/.gitlab/issue_templates/Security Release.md index e6e5d731d9..e5b26bc6fc 100644 --- a/.gitlab/issue_templates/Security Release.md +++ b/.gitlab/issue_templates/Security Release.md @@ -16,37 +16,27 @@ Set the title to: `Security Release: 12.2.X, 12.1.X, and 12.0.X` * 12.1.X: {release task link} * 12.0.X: {release task link} -## Security Issues: +## Issues in GitLab Security -* {https://gitlab.com/gitlab-org/gitlab/issues link} - -## Security Issues in dev.gitlab.org: - -### CE - -- {https://dev.gitlab.org/gitlab/gitlabhq/issues link} +* {https://gitlab.com/gitlab-org/security/gitlab/issues/ link} | Version | MR | |---------|----| -| 12.2 | {https://dev.gitlab.org/gitlab/gitlabhq/merge_requests/ link} | -| 12.1 | {https://dev.gitlab.org/gitlab/gitlabhq/merge_requests/ link} | -| 12.0 | {https://dev.gitlab.org/gitlab/gitlabhq/merge_requests/ link} | -| master | {https://dev.gitlab.org/gitlab/gitlabhq/merge_requests/ link} | +| 12.2 | {https://gitlab.com/gitlab-org/security/gitlab/-/merge_requests link} | +| 12.1 | {https://gitlab.com/gitlab-org/security/gitlab/-/merge_requests link} | +| 12.0 | {https://gitlab.com/gitlab-org/security/gitlab/-/merge_requests link} | +| master | {https://gitlab.com/gitlab-org/security/gitlab/-/merge_requests link} | +## Issues in Omnibus-GitLab - -### EE - -* {https://dev.gitlab.org/gitlab/gitlabhq/issues/ link} - +* {https://gitlab.com/gitlab-org/security/gitlab/issues/ link} | Version | MR | |---------|----| -| 12.2 | {https://dev.gitlab.org/gitlab/gitlab-ee/merge_requests/ link} | -| 12.1 | {https://dev.gitlab.org/gitlab/gitlab-ee/merge_requests/ link} | -| 12.0 | {https://dev.gitlab.org/gitlab/gitlab-ee/merge_requests/ link} | -| master | {https://dev.gitlab.org/gitlab/gitlab-ee/merge_requests/ link} | - +| 12.2 | {https://dev.gitlab.org/gitlab/omnibus-gitlab/merge_requests/ link} | +| 12.1 | {https://dev.gitlab.org/gitlab/omnibus-gitlab/merge_requests/ link} | +| 12.0 | {https://dev.gitlab.org/gitlab/omnibus-gitlab/merge_requests/ link} | +| master | {https://dev.gitlab.org/gitlab/omnibus-gitlab/merge_requests/ link} | ## QA {QA issue link} @@ -54,7 +44,7 @@ Set the title to: `Security Release: 12.2.X, 12.1.X, and 12.0.X` ## Blog post Dev: {https://dev.gitlab.org/gitlab/www-gitlab-com/merge_requests/ link}
-gitlab.com: {https://gitlab.com/gitlab-com/www-gitlab-com/merge_requests/ link} +GitLab.com: {https://gitlab.com/gitlab-com/www-gitlab-com/merge_requests/ link} ## Email notification {https://gitlab.com/gitlab-com/marketing/general/issues/ link} diff --git a/.gitlab/issue_templates/Technical Evaluation.md b/.gitlab/issue_templates/Technical Evaluation.md new file mode 100644 index 0000000000..f703f72711 --- /dev/null +++ b/.gitlab/issue_templates/Technical Evaluation.md @@ -0,0 +1,23 @@ + + +### Topic to Evaluate + + +* [Link to other Issue](link) + +### Tasks to Evaluate + + + +- [ ] Add task +- [ ] Add task +- [ ] Add task + +### Risks and Implementation Considerations + + + +### Team + +- [ ] Add ~"workflow::planning breakdown" ~feature and the corresponding `~devops::` and `~group::` labels. +- [ ] Ping the PM and EM. diff --git a/.gitlab/merge_request_templates/Database changes.md b/.gitlab/merge_request_templates/Database changes.md deleted file mode 100644 index 89c8c7a5d0..0000000000 --- a/.gitlab/merge_request_templates/Database changes.md +++ /dev/null @@ -1,50 +0,0 @@ -## What does this MR do? - - - -Add a description of your merge request here. - -## Database checklist - -- [ ] Conforms to the [database guides](https://docs.gitlab.com/ee/development/README.html#database-guides) - -When adding migrations: - -- [ ] Updated `db/schema.rb` -- [ ] Added a `down` method so the migration can be reverted -- [ ] Added the output of the migration(s) to the MR body -- [ ] Added tests for the migration in `spec/migrations` if necessary (e.g. when migrating data) -- [ ] Added rollback procedure. Include either a rollback procedure or description how to rollback changes - -When adding or modifying queries to improve performance: - -- [ ] Included data that shows the performance improvement, preferably in the form of a benchmark -- [ ] Included the output of `EXPLAIN (ANALYZE, BUFFERS)` of the relevant queries - -When adding foreign keys to existing tables: - -- [ ] Included a migration to remove orphaned rows in the source table before adding the foreign key -- [ ] Removed any instances of `dependent: ...` that may no longer be necessary - -When adding tables: - -- [ ] Ordered columns based on the [Ordering Table Columns](https://docs.gitlab.com/ee/development/ordering_table_columns.html) guidelines -- [ ] Added foreign keys to any columns pointing to data in other tables -- [ ] Added indexes for fields that are used in statements such as `WHERE`, `ORDER BY`, `GROUP BY`, and `JOIN`s - -When removing columns, tables, indexes or other structures: - -- [ ] Removed these in a post-deployment migration -- [ ] Made sure the application no longer uses (or ignores) these structures - -/label ~database ~"database::review pending" diff --git a/.gitlab/merge_request_templates/New static analysis check.md b/.gitlab/merge_request_templates/New static analysis check.md new file mode 100644 index 0000000000..b89b6f7dbc --- /dev/null +++ b/.gitlab/merge_request_templates/New static analysis check.md @@ -0,0 +1,27 @@ +## Description of the proposal + + + +### Check-list + +- [ ] Make sure this MR enables a static analysis check rule for new usage but + ignores current offenses +- [ ] Create a follow-up issue to fix the current offenses as a separate iteration: ISSUE_LINK +- [ ] Mention this proposal in the relevant Slack channels (e.g. `#development`, `#backend`, `#frontend`) +- [ ] If there is a choice to make between two potential styles, set up an emoji vote in the MR: + - CHOICE_A: :a: + - CHOICE_B: :b: + - Vote yourself for both choices so that people know these are the choices +- [ ] The MR doesn't have significant objections, and is getting a majority of :+1: vs :-1: (remember that [we don't need to reach a consensus](https://about.gitlab.com/handbook/values/#collaboration-is-not-consensus)) +- [ ] (If applicable) One style is getting a majority of vote (compared to the other choice) +- [ ] (If applicable) Update the MR with the chosen style +- [ ] Follow the [review process](https://docs.gitlab.com/ee/development/code_review.html) as usual +- [ ] Once approved and merged by a maintainer, mention it again: + - [ ] In the relevant Slack channels (e.g. `#development`, `#backend`, `#frontend`) + - [ ] (Optional depending on the impact of the change) In the Engineering Week in Review + +/label ~"Engineering Productivity" ~"Style decision" ~"development guidelines" ~"static analysis" + +/cc @gitlab-org/maintainers/rails-backend diff --git a/.overcommit.yml.example b/.overcommit.yml.example index 9cd04825bc..b957a8bbd2 100644 --- a/.overcommit.yml.example +++ b/.overcommit.yml.example @@ -15,6 +15,13 @@ # # Uncomment the following lines to make the configuration take effect. +# Make sure to run `cd tooling/overcommit && make && cd -` +gemfile: 'tooling/overcommit/gems.rb' + +PostCheckout: + BundleInstall: + enabled: true + PreCommit: AuthorName: enabled: false @@ -35,6 +42,19 @@ PreCommit: # on_warn: fail # Treat all warnings as failures ScssLint: enabled: true + +CommitMsg: + TextWidth: + enabled: true + min_subject_width: 8 # three 2-letter words with 2 spaces + max_subject_width: 72 + quiet: false + + EmptyMessage: + enabled: true + required: true + description: 'Checking for empty commit message' + #PostCheckout: # ALL: # Special hook name that customizes all hooks of this type # quiet: true # Change all post-checkout hooks to only display output on failure diff --git a/.rubocop.yml b/.rubocop.yml index 27dce2239d..514e427127 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -155,11 +155,10 @@ Rails/ApplicationRecord: # as they need to be as decoupled from application code as possible - db/**/*.rb - lib/gitlab/background_migration/**/*.rb + - ee/lib/ee/gitlab/background_migration/**/*.rb - lib/gitlab/database/**/*.rb - spec/**/*.rb - ee/db/**/*.rb - - ee/lib/gitlab/background_migration/**/*.rb - - ee/lib/ee/gitlab/background_migration/**/*.rb - ee/spec/**/*.rb # GitLab ################################################################### @@ -233,13 +232,8 @@ RSpec/FactoriesInMigrationSpecs: - 'spec/migrations/**/*.rb' - 'ee/spec/migrations/**/*.rb' - 'spec/lib/gitlab/background_migration/**/*.rb' - - 'ee/spec/lib/gitlab/background_migration/**/*.rb' - -Cop/IncludeActionViewContext: - Enabled: true - Exclude: - - 'spec/**/*' - - 'ee/spec/**/*' + - 'spec/lib/ee/gitlab/background_migration/**/*.rb' + - 'ee/spec/lib/ee/gitlab/background_migration/**/*.rb' Cop/IncludeSidekiqWorker: Enabled: true @@ -299,3 +293,63 @@ Graphql/Descriptions: RSpec/AnyInstanceOf: Enabled: false + +# Cops for upgrade to gitlab-styles 3.1.0 +RSpec/ImplicitSubject: + Enabled: false + +RSpec/LeakyConstantDeclaration: + Enabled: false + +RSpec/EmptyLineAfterHook: + Enabled: false + +RSpec/HooksBeforeExamples: + Enabled: false + +RSpec/EmptyLineAfterExample: + Enabled: false + +RSpec/Be: + Enabled: false + +RSpec/DescribedClass: + Enabled: false + +RSpec/SharedExamples: + Enabled: false + +RSpec/EmptyLineAfterExampleGroup: + Enabled: false + +RSpec/ReceiveNever: + Enabled: false + +RSpec/MissingExampleGroupArgument: + Enabled: false + +RSpec/UnspecifiedException: + Enabled: false + +# Work in progress. See https://gitlab.com/gitlab-org/gitlab/issues/196163 +RSpec/HaveGitlabHttpStatus: + Enabled: true + Exclude: + - 'spec/support/matchers/have_gitlab_http_status.rb' + Include: + - 'spec/support/**/*' + - 'ee/spec/support/**/*' + - 'spec/features/**/*' + - 'ee/spec/features/**/*' + - 'spec/controllers/**/*' + - 'ee/spec/controllers/**/*' + - 'spec/requests/*.rb' + - 'ee/spec/requests/*.rb' + - 'spec/requests/api/*/**/*.rb' + - 'ee/spec/requests/api/*/**/*.rb' + +Style/MultilineWhenThen: + Enabled: false + +Style/FloatDivision: + Enabled: false diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index f0388ab79d..f6aa0e7700 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -1,25 +1,26 @@ # This configuration was generated by # `rubocop --auto-gen-config` -# on 2019-05-04 16:01:00 +0000 using RuboCop version 0.68.1. +# on 2020-01-16 11:53:06 -0800 using RuboCop version 0.74.0. # The point is for the user to remove these configuration records # one by one as the offenses are removed from the code base. # Note that changes in the inspected code, or installation of new # versions of RuboCop, may require this file to be generated again. -# Offense count: 264 +# Offense count: 299 +# Cop supports --auto-correct. Capybara/CurrentPathExpectation: Enabled: false -# Offense count: 1097 +# Offense count: 1432 # Cop supports --auto-correct. # Configuration parameters: EnforcedStyle, IndentationWidth. # SupportedStyles: with_first_argument, with_fixed_indentation Layout/AlignArguments: Enabled: false -# Offense count: 824 +# Offense count: 1630 # Cop supports --auto-correct. -# Configuration parameters: EnforcedHashRocketStyle, EnforcedColonStyle, EnforcedLastArgumentHashStyle. +# Configuration parameters: AllowMultipleStyles, EnforcedHashRocketStyle, EnforcedColonStyle, EnforcedLastArgumentHashStyle. # SupportedHashRocketStyles: key, separator, table # SupportedColonStyles: key, separator, table # SupportedLastArgumentHashStyles: always_inspect, always_ignore, ignore_implicit, ignore_explicit @@ -32,40 +33,25 @@ Layout/ClosingHeredocIndentation: Exclude: - 'app/graphql/mutations/merge_requests/set_wip.rb' - 'ee/db/geo/migrate/20180322062741_migrate_ci_job_artifacts_to_separate_registry.rb' - - 'ee/db/migrate/20160204190809_update_jenkins_service_category.rb' - - 'ee/lib/gitlab/background_migration/prune_orphaned_geo_events.rb' - 'ee/lib/gitlab/geo/health_check.rb' - 'lib/gitlab/background_migration/populate_untracked_uploads.rb' - - 'qa/qa/service/kubernetes_cluster.rb' - 'spec/features/merge_request/user_sees_diff_spec.rb' - 'spec/lib/gitlab/asciidoc_spec.rb' - 'spec/lib/gitlab/checks/project_moved_spec.rb' - 'spec/rubocop/cop/active_record_association_reload_spec.rb' - 'spec/services/task_list_toggle_service_spec.rb' -# Offense count: 14 +# Offense count: 9 # Cop supports --auto-correct. Layout/ClosingParenthesisIndentation: Exclude: - 'db/post_migrate/20180704145007_update_project_indexes.rb' - 'ee/db/geo/migrate/20180405074130_add_partial_index_project_repository_verification.rb' - - 'ee/db/migrate/20180308234102_add_partial_index_to_project_repository_states_checksum_columns.rb' - - 'ee/db/post_migrate/20180605213516_fix_partial_index_to_project_repository_states_checksum_columns.rb' - - 'ee/lib/ee/gitlab/usage_data.rb' - 'spec/services/issues/resolve_discussions_spec.rb' - 'spec/services/projects/update_service_spec.rb' - 'spec/support/helpers/stub_object_storage.rb' - 'spec/workers/remove_unreferenced_lfs_objects_worker_spec.rb' -# Offense count: 2 -# Cop supports --auto-correct. -# Configuration parameters: EnforcedStyle. -# SupportedStyles: leading, trailing -Layout/DotPosition: - Exclude: - - 'app/models/concerns/relative_positioning.rb' - - 'app/models/group.rb' - # Offense count: 69 # Cop supports --auto-correct. Layout/EmptyLinesAroundArguments: @@ -81,74 +67,61 @@ Layout/EmptyLinesAroundArguments: - 'lib/banzai/pipeline/single_line_pipeline.rb' - 'spec/features/markdown/copy_as_gfm_spec.rb' -# Offense count: 160 +# Offense count: 305 # Cop supports --auto-correct. # Configuration parameters: EnforcedStyle, IndentationWidth. # SupportedStyles: special_inside_parentheses, consistent, align_brackets Layout/IndentFirstArrayElement: Enabled: false -# Offense count: 631 +# Offense count: 1005 # Cop supports --auto-correct. # Configuration parameters: EnforcedStyle, IndentationWidth. # SupportedStyles: special_inside_parentheses, consistent, align_braces Layout/IndentFirstHashElement: Enabled: false -# Offense count: 5 +# Offense count: 4 # Cop supports --auto-correct. # Configuration parameters: EnforcedStyle, IndentationWidth. # SupportedStyles: consistent, align_parentheses Layout/IndentFirstParameter: Exclude: - - 'app/models/ci/pipeline_schedule.rb' - 'lib/gitlab/cross_project_access.rb' - 'lib/gitlab/data_builder/push.rb' - 'spec/support/helpers/repo_helpers.rb' - 'spec/support/helpers/stub_object_storage.rb' -# Offense count: 5 -# Cop supports --auto-correct. -Layout/LeadingBlankLines: - Exclude: - - 'app/workers/update_project_statistics_worker.rb' - - 'db/migrate/20161007073613_create_user_activities.rb' - - 'ee/spec/helpers/boards_helper_spec.rb' - - 'lib/tasks/yarn.rake' - - 'spec/javascripts/fixtures/merge_requests_diffs.rb' - -# Offense count: 30 +# Offense count: 54 # Cop supports --auto-correct. # Configuration parameters: EnforcedStyle, IndentationWidth. # SupportedStyles: aligned, indented Layout/MultilineOperationIndentation: Enabled: false -# Offense count: 13 +# Offense count: 10 # Cop supports --auto-correct. Layout/RescueEnsureAlignment: Exclude: - 'app/models/blob_viewer/dependency_manager.rb' - - 'app/models/ci/pipeline.rb' - 'app/models/project.rb' - 'app/services/prometheus/proxy_service.rb' - 'app/workers/delete_stored_files_worker.rb' - 'app/workers/reactive_caching_worker.rb' - 'config/initializers/1_settings.rb' - 'config/initializers/trusted_proxies.rb' - - 'ee/db/migrate/20151113115819_canonicalize_kerberos_identities.rb' - 'lib/gitlab/background_migration/archive_legacy_traces.rb' - 'lib/gitlab/highlight.rb' - 'lib/tasks/gitlab/lfs/migrate.rake' -# Offense count: 344 +# Offense count: 522 # Cop supports --auto-correct. # Configuration parameters: EnforcedStyle. # SupportedStyles: require_no_space, require_space Layout/SpaceInLambdaLiteral: Enabled: false -# Offense count: 583 +# Offense count: 796 # Cop supports --auto-correct. # Configuration parameters: EnforcedStyle, EnforcedStyleForEmptyBraces, SpaceBeforeBlockParameters. # SupportedStyles: space, no_space @@ -156,18 +129,13 @@ Layout/SpaceInLambdaLiteral: Layout/SpaceInsideBlockBraces: Enabled: false -# Offense count: 255 +# Offense count: 315 # Cop supports --auto-correct. # Configuration parameters: EnforcedStyle. # SupportedStyles: space, no_space Layout/SpaceInsideParens: Enabled: false -# Offense count: 1 -Lint/DisjunctiveAssignmentInConstructor: - Exclude: - - 'app/models/uploads/base.rb' - # Offense count: 19 Lint/DuplicateMethods: Exclude: @@ -185,55 +153,27 @@ Lint/DuplicateMethods: - 'lib/gitlab/git/tree.rb' - 'lib/gitlab/git/wiki_page.rb' -# Offense count: 2 -Lint/InterpolationCheck: - Exclude: - - 'spec/features/issues/filtered_search/filter_issues_spec.rb' - - 'spec/services/quick_actions/interpret_service_spec.rb' - -# Offense count: 326 +# Offense count: 122 # Configuration parameters: MaximumRangeSize. Lint/MissingCopEnableDirective: Enabled: false -# Offense count: 2 -# Cop supports --auto-correct. -# Configuration parameters: Whitelist. -# Whitelist: present?, blank?, presence, try, try! -Lint/SafeNavigationConsistency: - Exclude: - - 'lib/gitlab/gpg/commit.rb' - -# Offense count: 2 -# Cop supports --auto-correct. -Lint/ToJSON: - Exclude: - - 'lib/gitlab/cycle_analytics/usage_data.rb' - - 'lib/gitlab/template/base_template.rb' - -# Offense count: 7 +# Offense count: 6 Lint/UriEscapeUnescape: Exclude: - 'app/controllers/application_controller.rb' - 'app/models/project_services/drone_ci_service.rb' - 'spec/lib/google_api/auth_spec.rb' - 'spec/requests/api/files_spec.rb' - - 'spec/requests/api/internal/base_spec.rb' -# Offense count: 1 -# Configuration parameters: CheckForMethodsWithNoSideEffects. -Lint/Void: - Exclude: - - 'lib/gitlab/git/diff_collection.rb' - -# Offense count: 158 +# Offense count: 165 # Cop supports --auto-correct. # Configuration parameters: AutoCorrect, AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns. # URISchemes: http, https Metrics/LineLength: Max: 176 -# Offense count: 94 +# Offense count: 143 # Configuration parameters: ExpectMatchingDefinition, Regex, IgnoreExecutableScripts, AllowedAcronyms. # AllowedAcronyms: CLI, DSL, ACL, API, ASCII, CPU, CSS, DNS, EOF, GUID, HTML, HTTP, HTTPS, ID, IP, JSON, LHS, QPS, RAM, RHS, RPC, SLA, SMTP, SQL, SSH, TCP, TLS, TTL, UDP, UI, UID, UUID, URI, URL, UTF8, VM, XML, XMPP, XSRF, XSS Naming/FileName: @@ -250,37 +190,32 @@ Naming/HeredocDelimiterCase: - 'spec/support/helpers/repo_helpers.rb' - 'spec/support/helpers/seed_repo.rb' -# Offense count: 197 +# Offense count: 211 # Configuration parameters: Blacklist. # Blacklist: (?-mix:(^|\s)(EO[A-Z]{1}|END)(\s|$)) Naming/HeredocDelimiterNaming: Enabled: false -# Offense count: 125 +# Offense count: 139 # Cop supports --auto-correct. # Configuration parameters: PreferredName. Naming/RescuedExceptionsVariableName: Enabled: false -# Offense count: 7081 +# Offense count: 9913 # Configuration parameters: Prefixes. # Prefixes: when, with, without RSpec/ContextWording: Enabled: false -# Offense count: 407 -# Cop supports --auto-correct. -RSpec/EmptyLineAfterFinalLet: - Enabled: false - -# Offense count: 719 +# Offense count: 879 # Cop supports --auto-correct. # Configuration parameters: EnforcedStyle. # SupportedStyles: method_call, block RSpec/ExpectChange: Enabled: false -# Offense count: 512 +# Offense count: 660 RSpec/ExpectInHook: Enabled: false @@ -294,13 +229,6 @@ RSpec/ItBehavesLike: - 'spec/lib/gitlab/git/repository_spec.rb' - 'spec/services/notification_service_spec.rb' -# Offense count: 3 -RSpec/IteratedExpectation: - Exclude: - - 'spec/features/admin/admin_settings_spec.rb' - - 'spec/lib/gitlab/gitlab_import/client_spec.rb' - - 'spec/lib/gitlab/legacy_github_import/client_spec.rb' - # Offense count: 68 # Cop supports --auto-correct. RSpec/LetBeforeExamples: @@ -316,56 +244,35 @@ RSpec/LetBeforeExamples: - 'spec/rubocop/cop/migration/update_column_in_batches_spec.rb' - 'spec/serializers/pipeline_details_entity_spec.rb' -# Offense count: 1 +# Offense count: 2018 # Cop supports --auto-correct. -RSpec/MultipleSubjects: - Exclude: - - 'spec/services/merge_requests/create_from_issue_service_spec.rb' - -# Offense count: 4 -RSpec/OverwritingSetup: - Exclude: - - 'spec/lib/gitlab/background_migration/migrate_events_to_push_event_payloads_spec.rb' - - 'spec/models/email_spec.rb' - - 'spec/services/merge_requests/add_todo_when_build_fails_service_spec.rb' - - 'spec/services/notes/quick_actions_service_spec.rb' - -# Offense count: 1828 -# Cop supports --auto-correct. -# Configuration parameters: Strict, EnforcedStyle. +# Configuration parameters: Strict, EnforcedStyle, AllowedExplicitMatchers. # SupportedStyles: inflected, explicit RSpec/PredicateMatcher: Enabled: false -# Offense count: 57 +# Offense count: 69 RSpec/RepeatedExample: Enabled: false -# Offense count: 474 +# Offense count: 584 # Cop supports --auto-correct. # Configuration parameters: EnforcedStyle. # SupportedStyles: and_return, block RSpec/ReturnFromStub: Enabled: false -# Offense count: 188 +# Offense count: 380 RSpec/ScatteredLet: Enabled: false -# Offense count: 10 +# Offense count: 8 RSpec/ScatteredSetup: Exclude: - - 'spec/controllers/projects/templates_controller_spec.rb' - 'spec/lib/gitlab/bitbucket_import/importer_spec.rb' - 'spec/requests/api/jobs_spec.rb' - 'spec/services/projects/create_service_spec.rb' -# Offense count: 1 -# Cop supports --auto-correct. -RSpec/SharedContext: - Exclude: - - 'spec/features/admin/admin_groups_spec.rb' - # Offense count: 4 RSpec/VoidExpect: Exclude: @@ -374,6 +281,21 @@ RSpec/VoidExpect: - 'spec/models/ci/runner_spec.rb' - 'spec/services/users/destroy_service_spec.rb' +# Offense count: 10 +# Cop supports --auto-correct. +Rails/ApplicationController: + Exclude: + - 'app/controllers/acme_challenges_controller.rb' + - 'app/controllers/chaos_controller.rb' + - 'app/controllers/health_controller.rb' + - 'app/controllers/metrics_controller.rb' + - 'ee/app/controllers/oauth/geo_auth_controller.rb' + - 'ee/spec/helpers/ee/services_helper_spec.rb' + - 'lib/gitlab/base_doorkeeper_controller.rb' + - 'lib/gitlab/request_forgery_protection.rb' + - 'spec/controllers/concerns/continue_params_spec.rb' + - 'spec/lib/marginalia_spec.rb' + # Offense count: 8 # Cop supports --auto-correct. Rails/BelongsTo: @@ -383,39 +305,37 @@ Rails/BelongsTo: - 'ee/app/models/prometheus_alert.rb' - 'ee/app/models/prometheus_alert_event.rb' -# Offense count: 80 +# Offense count: 151 # Configuration parameters: Include. # Include: db/migrate/*.rb Rails/CreateTableWithTimestamps: Enabled: false -# Offense count: 222 +# Offense count: 266 # Configuration parameters: EnforcedStyle. # SupportedStyles: slashes, arguments Rails/FilePath: Enabled: false -# Offense count: 167 +# Offense count: 211 # Configuration parameters: Include. # Include: app/models/**/*.rb Rails/HasManyOrHasOneDependent: Enabled: false -# Offense count: 2 +# Offense count: 431 # Configuration parameters: Include. -# Include: app/controllers/**/*.rb -Rails/IgnoredSkipActionFilterOption: - Exclude: - - 'app/controllers/projects/snippets_controller.rb' - - 'app/controllers/snippets_controller.rb' +# Include: app/helpers/**/*.rb +Rails/HelperInstanceVariable: + Enabled: false -# Offense count: 87 +# Offense count: 103 # Configuration parameters: Include. # Include: app/models/**/*.rb Rails/InverseOf: Enabled: false -# Offense count: 46 +# Offense count: 51 # Configuration parameters: Include. # Include: app/controllers/**/*.rb Rails/LexicallyScopedActionFilter: @@ -430,39 +350,22 @@ Rails/LinkToBlank: - 'ee/app/helpers/ee/user_callouts_helper.rb' - 'ee/app/helpers/license_helper.rb' -# Offense count: 1 -# Cop supports --auto-correct. +# Offense count: 35 # Configuration parameters: Include. -# Include: app/models/**/*.rb -Rails/RedundantAllowNil: - Exclude: - - 'app/models/application_setting.rb' +# Include: **/Rakefile, **/*.rake +Rails/RakeEnvironment: + Enabled: false -# Offense count: 2 -# Configuration parameters: Include. -# Include: db/migrate/*.rb -Rails/ReversibleMigration: - Exclude: - - 'db/migrate/20160824103857_drop_unused_ci_tables.rb' - -# Offense count: 860 +# Offense count: 868 # Configuration parameters: Blacklist, Whitelist. # Blacklist: decrement!, decrement_counter, increment!, increment_counter, toggle!, touch, update_all, update_attribute, update_column, update_columns, update_counters Rails/SkipsModelValidations: Enabled: false -# Offense count: 1 -# Configuration parameters: Environments. -# Environments: development, test, production -Rails/UnknownEnv: - Exclude: - - 'db/migrate/20171124125748_populate_missing_merge_request_statuses.rb' - -# Offense count: 11 +# Offense count: 8 # Cop supports --auto-correct. Security/YAMLLoad: Exclude: - - 'lib/gitlab/background_migration/deserialize_merge_request_diffs_and_commits.rb' - 'lib/gitlab/redis/wrapper.rb' - 'lib/system_check/incoming_email/imap_authentication_check.rb' - 'spec/config/mail_room_spec.rb' @@ -475,7 +378,7 @@ Security/YAMLLoad: Style/AccessModifierDeclarations: Enabled: false -# Offense count: 121 +# Offense count: 127 # Cop supports --auto-correct. # Configuration parameters: EnforcedStyle. # SupportedStyles: percent_q, bare_percent @@ -488,25 +391,18 @@ Style/CommentedKeyword: - 'lib/tasks/gitlab/backup.rake' - 'spec/tasks/gitlab/backup_rake_spec.rb' -# Offense count: 1 -# Cop supports --auto-correct. -Style/Dir: - Exclude: - - 'qa/qa.rb' - -# Offense count: 7 +# Offense count: 6 # Cop supports --auto-correct. Style/EachWithObject: Exclude: - 'lib/expand_variables.rb' - 'lib/gitlab/ci/ansi2html.rb' - - 'lib/gitlab/ee_compat_check.rb' - 'lib/gitlab/hook_data/issuable_builder.rb' - 'lib/gitlab/i18n/po_linter.rb' - 'lib/gitlab/import_export/members_mapper.rb' - 'lib/gitlab/import_export/relation_factory.rb' -# Offense count: 34 +# Offense count: 41 # Cop supports --auto-correct. # Configuration parameters: EnforcedStyle. # SupportedStyles: empty, nil, both @@ -520,7 +416,7 @@ Style/EmptyLambdaParameter: - 'app/models/ci/build.rb' - 'app/models/ci/runner.rb' -# Offense count: 9 +# Offense count: 8 # Cop supports --auto-correct. Style/EmptyLiteral: Exclude: @@ -528,58 +424,51 @@ Style/EmptyLiteral: - 'lib/gitlab/git/diff_collection.rb' - 'lib/gitlab/gitaly_client.rb' - 'spec/helpers/merge_requests_helper_spec.rb' - - 'spec/lib/gitlab/request_context_spec.rb' - 'spec/lib/gitlab/workhorse_spec.rb' - 'spec/requests/api/jobs_spec.rb' - 'spec/support/shared_examples/chat_slash_commands_shared_examples.rb' -# Offense count: 180 +# Offense count: 148 # Cop supports --auto-correct. # Configuration parameters: EnforcedStyle. # SupportedStyles: compact, expanded Style/EmptyMethod: Enabled: false -# Offense count: 203 +# Offense count: 346 # Cop supports --auto-correct. # Configuration parameters: EnforcedStyle. # SupportedStyles: format, sprintf, percent Style/FormatString: Enabled: false -# Offense count: 669 +# Offense count: 692 # Configuration parameters: MinBodyLength. Style/GuardClause: Enabled: false # Offense count: 27 +# Configuration parameters: AllowIfModifier. Style/IfInsideElse: Enabled: false -# Offense count: 1346 +# Offense count: 1474 # Cop supports --auto-correct. Style/IfUnlessModifier: Enabled: false -# Offense count: 186 +# Offense count: 314 # Cop supports --auto-correct. # Configuration parameters: EnforcedStyle. # SupportedStyles: line_count_dependent, lambda, literal Style/Lambda: Enabled: false -# Offense count: 3 -# Cop supports --auto-correct. -Style/LineEndConcatenation: - Exclude: - - 'spec/lib/gitlab/gfm/reference_rewriter_spec.rb' - - 'spec/lib/gitlab/incoming_email_spec.rb' - -# Offense count: 18 +# Offense count: 17 Style/MethodMissingSuper: Enabled: false -# Offense count: 18 +# Offense count: 17 Style/MissingRespondToMissing: Enabled: false @@ -602,54 +491,40 @@ Style/MultilineIfModifier: - 'app/services/ci/process_pipeline_service.rb' - 'lib/api/commit_statuses.rb' -# Offense count: 72 -# Cop supports --auto-correct. -# Configuration parameters: EnforcedStyle. -# SupportedStyles: literals, strict -Style/MutableConstant: - Enabled: false - -# Offense count: 28 +# Offense count: 34 # Cop supports --auto-correct. # Configuration parameters: Whitelist. # Whitelist: be, be_a, be_an, be_between, be_falsey, be_kind_of, be_instance_of, be_truthy, be_within, eq, eql, end_with, include, match, raise_error, respond_to, start_with Style/NestedParenthesizedCalls: Enabled: false -# Offense count: 31 +# Offense count: 25 # Cop supports --auto-correct. # Configuration parameters: EnforcedStyle, MinBodyLength. # SupportedStyles: skip_modifier_ifs, always Style/Next: Enabled: false -# Offense count: 67 +# Offense count: 71 # Cop supports --auto-correct. # Configuration parameters: EnforcedOctalStyle. # SupportedOctalStyles: zero_with_o, zero_only Style/NumericLiteralPrefix: Enabled: false -# Offense count: 186 +# Offense count: 234 # Cop supports --auto-correct. # Configuration parameters: AutoCorrect, EnforcedStyle, IgnoredMethods. # SupportedStyles: predicate, comparison Style/NumericPredicate: Enabled: false -# Offense count: 2 -# Cop supports --auto-correct. -Style/OrAssignment: - Exclude: - - 'lib/api/commit_statuses.rb' - - 'lib/gitlab/project_transfer.rb' - -# Offense count: 79 +# Offense count: 106 # Cop supports --auto-correct. Style/ParallelAssignment: Enabled: false -# Offense count: 1390 +# Offense count: 1692 # Cop supports --auto-correct. # Configuration parameters: PreferredDelimiters. Style/PercentLiteralDelimiters: @@ -671,28 +546,14 @@ Style/PerlBackrefs: - 'lib/gitlab/search_results.rb' - 'lib/gitlab/sherlock/query.rb' -# Offense count: 129 +# Offense count: 165 # Cop supports --auto-correct. # Configuration parameters: EnforcedStyle. # SupportedStyles: compact, exploded Style/RaiseArgs: Enabled: false -# Offense count: 3 -# Cop supports --auto-correct. -Style/RedundantBegin: - Exclude: - - 'app/models/merge_request.rb' - - 'app/services/projects/import_service.rb' - - 'lib/gitlab/health_checks/base_abstract_check.rb' - -# Offense count: 1 -# Cop supports --auto-correct. -Style/RedundantConditional: - Exclude: - - 'lib/system_check/helpers.rb' - -# Offense count: 360 +# Offense count: 221 # Cop supports --auto-correct. Style/RedundantFreeze: Enabled: false @@ -712,31 +573,31 @@ Style/RedundantReturn: - 'lib/gitlab/utils.rb' - 'lib/google_api/auth.rb' -# Offense count: 700 +# Offense count: 739 # Cop supports --auto-correct. Style/RedundantSelf: Enabled: false -# Offense count: 28 +# Offense count: 80 # Cop supports --auto-correct. # Configuration parameters: EnforcedStyle, AllowInnerSlashes. # SupportedStyles: slashes, percent_r, mixed Style/RegexpLiteral: Enabled: false -# Offense count: 41 +# Offense count: 42 # Cop supports --auto-correct. Style/RescueModifier: Enabled: false -# Offense count: 197 +# Offense count: 237 # Cop supports --auto-correct. # Configuration parameters: EnforcedStyle. # SupportedStyles: implicit, explicit Style/RescueStandardError: Enabled: false -# Offense count: 5 +# Offense count: 4 # Cop supports --auto-correct. Style/SelfAssignment: Exclude: @@ -751,27 +612,21 @@ Style/SingleLineMethods: Exclude: - 'lib/gitlab/ci/ansi2html.rb' -# Offense count: 91 +# Offense count: 94 # Cop supports --auto-correct. # Configuration parameters: . # SupportedStyles: use_perl_names, use_english_names Style/SpecialGlobalVars: EnforcedStyle: use_perl_names -# Offense count: 1 -# Cop supports --auto-correct. -Style/StderrPuts: - Exclude: - - 'config/initializers/rspec_profiling.rb' - -# Offense count: 65 +# Offense count: 75 # Cop supports --auto-correct. # Configuration parameters: EnforcedStyle. # SupportedStyles: single_quotes, double_quotes Style/StringLiteralsInInterpolation: Enabled: false -# Offense count: 187 +# Offense count: 216 # Cop supports --auto-correct. # Configuration parameters: IgnoredMethods. # IgnoredMethods: respond_to, define_method @@ -790,41 +645,7 @@ Style/TernaryParentheses: - 'spec/requests/api/pipeline_schedules_spec.rb' - 'spec/support/capybara.rb' -# Offense count: 3 -# Cop supports --auto-correct. -# Configuration parameters: EnforcedStyleForMultiline. -# SupportedStylesForMultiline: comma, consistent_comma, no_comma -Style/TrailingCommaInArguments: - Exclude: - - 'spec/features/markdown/copy_as_gfm_spec.rb' - -# Offense count: 10 -# Cop supports --auto-correct. -# Configuration parameters: EnforcedStyleForMultiline. -# SupportedStylesForMultiline: comma, consistent_comma, no_comma -Style/TrailingCommaInArrayLiteral: - Exclude: - - 'ee/spec/models/project_spec.rb' - - 'spec/lib/gitlab/diff/position_tracer_spec.rb' - - 'spec/lib/gitlab/metrics/dashboard/processor_spec.rb' - -# Offense count: 2 -# Cop supports --auto-correct. -# Configuration parameters: EnforcedStyleForMultiline. -# SupportedStylesForMultiline: comma, consistent_comma, no_comma -Style/TrailingCommaInHashLiteral: - Exclude: - - 'lib/gitlab/ci/ansi2html.rb' - - 'lib/gitlab/kubernetes.rb' - -# Offense count: 2 -# Cop supports --auto-correct. -Style/UnlessElse: - Exclude: - - 'lib/backup/manager.rb' - - 'lib/gitlab/project_search_results.rb' - -# Offense count: 10 +# Offense count: 8 # Cop supports --auto-correct. Style/UnneededCondition: Exclude: @@ -832,19 +653,10 @@ Style/UnneededCondition: - 'app/helpers/environment_helper.rb' - 'app/models/project.rb' - 'app/services/issuable/clone/base_service.rb' - - 'app/services/prometheus/adapter_service.rb' - 'lib/gitlab/email/message/repository_push.rb' - - 'lib/gitlab/prometheus_client.rb' - 'spec/lib/rspec_flaky/flaky_example_spec.rb' -# Offense count: 73 +# Offense count: 99 # Cop supports --auto-correct. Style/UnneededInterpolation: Enabled: false - -# Offense count: 2 -# Cop supports --auto-correct. -Style/UnneededSort: - Exclude: - - 'app/models/concerns/resolvable_discussion.rb' - - 'lib/gitlab/highlight.rb' diff --git a/.ruby-version b/.ruby-version index ec1cf33c3f..57cf282ebb 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -2.6.3 +2.6.5 diff --git a/.vale.ini b/.vale.ini new file mode 100644 index 0000000000..89a669ec7f --- /dev/null +++ b/.vale.ini @@ -0,0 +1,40 @@ +# Vale configuration file, taken from https://errata-ai.github.io/vale/config/ + +# The relative path to the folder containing linting rules (styles) +# ----------------------------------------------------------------- +StylesPath = doc/.linting/vale/styles + +# Minimum alert level +# ------------------- +# The minimum alert level to display (suggestion, warning, or error). +# If integrated into CI, builds fail by default on error-level alerts, +# unless you execute Vale with the --no-exit flag +MinAlertLevel = suggestion + +# Should Vale parse any file formats other than .md files as Markdown? +# -------------------------------------------------------------------- +[formats] +mdx = md + +# What file types should Vale test? +# ---------------------------------- +[*.md] + +# Styles to load +# -------------- +# What styles, located in the StylesPath folder, should Vale load? +# Vale also currently includes write-good, proselint, joblint, and vale +BasedOnStyles = gitlab + +# Enabling or disabling specific rules in a style +# ----------------------------------------------- +# To disable a rule in an enabled style, use the following format: +# {style}.{filename} = NO +# To enable a single rule in a disabled style, use the following format: +# vale.Editorializing = YES + +# Altering the severity of a rule in a style +# ------------------------------------------ +# To change the reporting level (suggestion, warning, error) of a rule, +# use the following format: {style}.{filename} = {level} +# vale.Hedging = error diff --git a/CHANGELOG-EE.md b/CHANGELOG-EE.md index fa1375930a..e72168bfc2 100644 --- a/CHANGELOG-EE.md +++ b/CHANGELOG-EE.md @@ -1,5 +1,253 @@ Please view this file on the master branch, on stable branches it's out of date. +## 12.8.5 + +- No changes. + +## 12.8.4 + +- Unreleased due to tagging failure. + +## 12.8.3 + +- Unreleased due to tagging failure. + +## 12.8.2 + +### Security (5 changes) + +- Don't show Contribution Analytics to users who are not group members. +- Update epic tree when group is transfered. +- Fix Service Side Request Forgery in JenkinsDeprecatedService. +- Enforce vulnerability feedback pipeline is in the same project. +- Enforce existing vulnerability feedback pipeline is in the same project. + + +## 12.8.1 + +### Performance (1 change) + +- Geo - Fix query to retrieve Job Artifacts when selective sync is disabled. !25388 + + +## 12.8.0 + +### Removed (1 change) + +- Remove confidence labels from security report. !24033 + +### Fixed (33 changes, 1 of them is from the community) + +- Fix UI on Project Audit Events when the feature not available. !16032 (Takuya Noguchi) +- Group SSO handles locked users gracefully instead of showing 500 error. !20329 +- Fix incorrect security status counts. !22650 +- Fix include subgroups in security status. !22653 +- Make sure type is set properly in Elasticsearch query when doing global search. !22821 +- Include users from all sub-projects and shared groups when counting billing seats currently in use. !22967 +- Fix vulnerability finding list endpoint query timeout on instance security dashboard. !23232 +- Add app validation for any-approver rule uniqueness. !23241 +- Fix 500 error in global search for blob, wiki_blob and commit search. !23326 +- Fix group hook triggering from subgroup project. !23333 +- Change conditions when user uses license seat. !23522 +- Accept group path as ID when fetching notes from API. !23535 +- Fixes a bug that prevented auto-remediation on the pipeline security dashboard. !23677 +- Fix nav link in security submenu. !23775 +- Order epic related issues by relative_position. !23776 +- Correctly display the number of approvals for a merge request. !23827 +- Fix orphan issues that were promoted to epics. !23916 +- Fix rendering of design management references. !24001 +- Fix 500 error when browsing the roadmap page for a group the user is not authorized to view. !24002 +- Use project slug instead of name for Error Tracking Settings Display. !24176 +- Display error message in MR License Report if it fails to load. !24201 +- Fix display logic of Securty Report MR widget. !24204 +- Set SSL certificates path env when calling ES indexer. !24213 +- Allow submit to event to trigger a new search. !24262 +- Fix npm package uploads when bundleDependencies is set to false. !24355 +- Resolve 500 error after Web IDE terminal use. !24443 +- Added commas to current active user count when appropriate. !24549 +- Hide duplicate company/individual question on trial selection. !24567 +- Update invalid SPDX identifiers in software licenses table. !24829 +- Cleanup deprecated package dependency links. !24868 +- Fix to display a link to the logs in both embed and dashboard. !25288 +- Disable self-approval at the Instance level - Fix approvals filtering. !25385 +- Allow user to close sidebar while editing boardlist and save wip limit. + +### Changed (13 changes) + +- Display generic error in codeclimate MR widget when base_path is null. !21666 +- Adjust skip trial copy in trial sign up flow for SaaS users who are logged in. !22923 +- Use export icon instead of download for the export button in the Dependencies List. !23094 +- Apply darker color to column headers and scan names in secure features configuration. !23104 +- Redacts quick actions used by support bot. !23353 +- Remove Code Review Analytics feature flag. !23418 +- Delete description change history - Frontend. !23568 +- Support moving the design repository of a project when the project is transferred to a new namespace. !23573 +- Display proper error messages on vulnerabilities fetch failure. !23812 +- Add date range validation for Cycle Analytics at the backend side. !24254 +- Exclude GitLab generated bot users from using a license seat. !24275 +- Changes the standalone vulnerabilty endpoint. !24777 +- Move Productivity Analytics page to the group level. !25329 + +### Performance (1 change) + +- Geo - Fix query to retrieve Job Artifacts when selective sync is disabled. !25388 + +### Added (42 changes, 1 of them is from the community) + +- Create DesignAtVersion model, exposing it with GraphQL. !15260 +- Add Group-level compliance dashboard MVC. !20844 +- Adds sorting to package api. !20963 +- Allow to soft delete issuables description history. !21439 +- Display warning flash if design upload is skipped. !21615 +- Ask if a user is trying GitLab for his company or for his individual usage. !22280 +- Support design tab link references for issues. !22330 +- Allow using custom user name for service desk emails. !22478 +- Raise exception if any namespaces runner minutes were not reset. !22636 +- Adds vulnerability management state dropdown. !22823 +- Add additional license information to admin dashboard. !22866 +- Add sort by date to audit logs and events. !22887 +- Add Group WebHooks API. !22994 (Rajendra Kadam) +- Add API route to confirm a vulnerability. !23099 +- Creates the standalone vulnerability list page. !23438 +- Show license badge for Gitlab.com member overview. !23521 +- Create audit log when username changes. !23576 +- Resolve Disable self-approval at the Instance level. !23731 +- Add time picker to logs page. !23837 +- Introduce Credentials Inventory for Groups that enforce Group Managed Accounts. !23944 +- Add API for protected environments. !23964 +- Prompt users to check their account settings. !23994 +- Allow to pick a subgroup to hold the Insights config. !24053 +- Add health_status column to issues and epics tables. !24202 +- Add a link in dashboard to allow users to go to the logs page. !24240 +- Record audit event when user is deleted. !24257 +- Time Series chart filtered time range (datazoom) becomes reflected in the View logs link. !24343 +- Scope merge request approval rules to protected branches using API search. !24344 +- Add application limit for ES indexed field length. !24345 +- Add affected projects feature to instance security dashboard. !24644 +- Add trial field to namespaces API. !24666 +- Make elasticsearch bulk parameters configurable. !24688 +- Add feature filter for users. !24765 +- Design view: moveable `new comment` pin. !24769 +- Record audit event when user is added. !24855 +- Add group identification headers to epic emails. !24878 +- Record audit event when user is blocked. !24930 +- Moveable design note pins. !24934 +- Add NuGet Repository. !25157 +- Add single-level Epics to EE Premium. !25184 +- Show View logs link in embed metrics. !25217 +- Add usage ping counter for events. !199874 + +### Other (1 change) + +- Prepare DB structure for GMA forking changes. !22002 + + +## 12.7.5 + +### Fixed (1 change) + +- Fix DB connection pool size for Geo database. !24021 + + +## 12.7.3 + +- No changes. + +## 12.7.1 + +### Fixed (1 change) + +- Fix create/delete API calls for approval rules. !23107 + + +## 12.7.0 + +### Removed (2 changes) + +- Remove `project_ci_cd_settings.merge_trains_enabled` column. !19701 +- Remove old pipeline security report view in favor of the Security Dashboard. !22152 + +### Fixed (20 changes, 1 of them is from the community) + +- Add error flashes to Design view. !20889 +- Pending (unsubmitted) review comments with multiple lines now display whitespace before being submitted. !21435 +- Fixed GitLab admin not seeing merge requests in Jira Development Panel Integration. !21467 +- fix CSS shadowbox on focus. !21785 (allenlai18) +- Fix GraphQL access to groups with SAML SSO Enforcement. !21922 +- Remove spinner when approval require input is changed. !22186 +- Add billing plans box to profiles. !22270 +- Use full reference in Epic Issue GraphQL query. !22292 +- Support new Azure SCIM pre-setup check. !22348 +- Show expiry details in Audit events when changing acesss levels. !22412 +- Fix PruneOrphanedGeoEvents to pass in demodulized name to BackgroundMigrationWorker. !22451 +- Update widget on click dropdown item when creating epic from epic. !22511 +- Ensure When userWithId Is Picked User IDs are Sent. !22528 +- Fix initial sorting of non-persisted Cycle Analytics stages. !22541 +- The Active tab on the Admin Users page should include bots. !22543 +- Fix reply emails with attachments for epics. !22547 +- Fix child epics depth validation. !22729 +- Users without a license do not use a seat. !23146 +- Fix access to horizontal scrollbar when zooming in on a design. +- fix positioning of design overlay pins when viewing design. + +### Changed (13 changes) + +- Rename "Production" stage in Cycle Analytics to "Total". !21450 +- Update copy for start a free gold trial screen. !21820 +- Show Geo node's name in admin page. !21876 +- Improve validation message when a design extension is unsupported. !21888 +- Prevent spiders indexing contribution analytics. !21896 +- Replace depricatedModal (Geo) with GlModal. !22125 +- Allow namespaces in a trial to upgrade to any plan. !22273 +- DAST vendored template pins DAST to latest major version. !22371 +- Rename productivity analytics date parameters. !22377 +- Rename Contribution Analytics endpoint URL. !22877 +- Move 'Allow admins to disable users ability to change profile name' feature to Premium tier. !23034 +- Change security dashboard's filters bar background. !23094 +- Add First & last name on the trial form. !33742 + +### Performance (3 changes) + +- Cache vulnerability summary per project/group. !21373 +- Fix N+1 SQL queries with protected environments. !22101 +- Optimize Group#for_epics scope. !22375 + +### Added (26 changes) + +- GitLab Pages - Storage size Limitations by Project or Group. !17725 +- Add Instance Security Dashboard feature. !18008 +- Add NPM dist-tag support. !20636 +- Track resource weight changes. !21515 +- Add support for custom email templates for service desk. !21745 +- members list to group sso page. !21852 +- Alow to filter by saml identity linked for group members API. !21931 +- Added submit_review quick action. !22061 +- Adds project_id and project_path to package group api. !22089 +- Add trial_ends_on to Namespaces API. !22121 +- Uniquifies path slug creation from trial new group name. !22147 +- Capture Release actions in the audit log page. !22167 +- Add ability to cancel a design discussion. !22241 +- Enable License compliance feature for all instances. !22250 +- Add support for license_scanning artifact report. !22277 +- Add trial counters to usage ping. !22279 +- Support gl-license-scanning-report.json file. !22312 +- Includes _link object in packages list api. !22503 +- Geo - Replicate project designs repositories. !22544 +- Add information about epic to Issue list csv export. !22662 +- Scope approval rules by protected branches via API. !22673 +- Prevent a child pipeline to create further child pipelines. !22675 +- Adds pipeline object to package API. !22854 +- Add zooming functionality to designs in Design view. !22863 +- Introduce Code Review Analytics page. !23031 +- Add support for work in progress limits - Max issue count only. + +### Other (3 changes, 1 of them is from the community) + +- Generate appropriate Vue key for licenses list table. !21566 (allenlai18) +- Limit size of search query for non ES searches. !22208 +- Remove "creations" in gitlab_subscription_histories on gitlab.com. !22278 + + ## 12.6.7 - No changes. @@ -16,10 +264,6 @@ Please view this file on the master branch, on stable branches it's out of date. - No changes. -## 12.6.3 - -- No changes. - ## 12.6.2 ### Security (2 changes) @@ -128,6 +372,10 @@ Please view this file on the master branch, on stable branches it's out of date. - Update the alerts used in the Dependency List to follow GitLab design guidelines. !21760 +## 12.5.8 + +- No changes. + ## 12.5.5 - No changes. @@ -248,6 +496,10 @@ Please view this file on the master branch, on stable branches it's out of date. - Remove IIFEs from jira_connect.js file. !19248 (nuwe1) +## 12.4.8 + +- No changes. + ## 12.4.5 - No changes. diff --git a/CHANGELOG.md b/CHANGELOG.md index 52ede9e8d4..e95c28605b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,18 +2,57 @@ documentation](doc/development/changelog.md) for instructions on adding your own entry. -## 12.6.8 +## 12.8.6 (2020-03-11) -### Security (16 changes) +### Security (1 change) -- Respect member access level for group shares. +- Do not enable soft email confirmation by default. + + +## 12.8.5 + +### Fixed (8 changes) + +- Fix Group Import API file upload when object storage is disabled. !25715 +- Fix Web IDE fork modal showing no text. !25842 +- Fixed regression when URL was encoded in a loop. !25849 +- Fixed repository browsing for folders with non-ascii characters. !25877 +- Fix search for Sentry error list. !26129 +- Send credentials with GraphQL fetch requests. !26386 +- Show CI status in project dashboards. !26403 +- Rescue invalid URLs during badge retrieval in asset proxy. !26524 + +### Performance (2 changes) + +- Disable Marginalia line backtrace in production. !26199 +- Remove unnecessary Redis deletes for broadcast messages. !26541 + +### Other (1 change, 1 of them is from the community) + +- Fix fixtures for Error Tracking Web UI. !26233 (Takuya Noguchi) + + +## 12.8.4 + +- Unreleased due to tagging failure. + +## 12.8.3 + +- Unreleased due to tagging failure. + +## 12.8.2 + +### Security (17 changes) + +- Update container registry authentication to account for login request when checking permissions. +- Update ProjectAuthorization when deleting or updating GroupGroupLink. - Prevent an endless checking loop for two merge requests targeting each other. - Update user 2fa when accepting a group invite. - Fix for XSS in branch names. - Prevent directory traversal through FileUploader. - Run project badge images through the asset proxy. - Check merge requests read permissions before showing them in the pipeline widget. -- Update container registry authentication to account for login request when checking permissions. +- Respect member access level for group shares. - Remove OID filtering during LFS imports. - Protect against denial of service using pipeline webhook recursion. - Expire account confirmation token. @@ -23,6 +62,857 @@ entry. - Recalculate ProjectAuthorizations for all users. - Escape special chars in Sentry error header. +### Other (1 change, 1 of them is from the community) + +- Fix fixtures for Error Tracking Web UI. !26233 (Takuya Noguchi) + + +## 12.8.1 + +### Fixed (5 changes) + +- Fix markdown layout of incident issues. !25352 +- Time series extends axis options correctly. !25399 +- Fix "Edit Release" page. !25469 +- Fix upgrade failure in EE displaying license. !25788 +- Fixed last commit widget when Gravatar is disabled. + + +## 12.8.0 + +### Security (6 changes, 2 of them are from the community) + +- Upgrade Doorkeeper to 4.4.3 to address CVE-2018-1000211. !20953 +- Upgrade Doorkeeper to 5.0.2. !21173 +- Update webpack related packages. !22456 (Takuya Noguchi) +- Update rubyzip gem in qa tests to 1.3.0 to fix CVE-2019-16892. !24119 +- Update GraphicsMagick from 1.3.33 to 1.3.34. !24225 (Takuya Noguchi) +- Update handlebars to remove issues from dependency dashboard. + +### Removed (2 changes, 1 of them is from the community) + +- Remove temporary index at services on project_id. !24263 +- Remove CI status from Projects Dashboard. !25225 (George Thomas @thegeorgeous) + +### Fixed (136 changes, 21 of them are from the community) + +- When a namespace GitLab Subscription expires, disable SSO enforcement. !21135 +- Fix bug with snippet counts not being scoped to current authorisation. !21705 +- Log user last activity on REST API. !21725 +- Create LfsObjectsProject record for forks as well. !22418 +- Limit size of diffs returned by /projects/:id/repository/compare API endpoint. !22658 +- Fix spacing and UI on Recent Deliveries section of Project Services. !22666 +- Improve error messages when adding a child epic. !22688 +- Fixes a new line issue with suggestions in the last line of a file. !22732 +- Use POSTGRES_VERSION variable in Auto DevOps Test stage. !22884 (Serban Marti) +- Include milestones from subgroups in the list of Group Milestones. !22922 +- Authenticate user when scope is passed to events api. !22956 (briankabiro) +- Limit productivity analytics graph y-axis scale to whole numbers. !23140 +- Fix GraphiQL when GitLab is installed under a relative URL. !23143 (Mathieu Parent) +- Stop NoMethodError happening for 1.16+ Kubernetes clusters. !23149 +- Fix advanced global search permissions for guest users. !23177 +- Fix JIRA DVCS retrieving repositories. !23180 +- Fix logs api etag issues with elasticsearch. !23249 +- Add border radius and remove blue outline on recent searches filter. !23266 +- Fix premailer and S/MIME emailer hooks order. !23293 (Diego Louzán) +- Fix Web IDE alert message look and feel. !23300 (Sean Nichols) +- Ensure that error tracking frontend only polls when required. !23305 +- Fixes spacing issue in modal footers. !23327 +- Fix POST method in dashboard link for disabling admin mode. !23363 (Diego Louzán) +- Fix Markdown not rendering on releases page. !23370 +- Fix pipeline status loading errors on project dashboard page caused by Gitaly connection failures. !23378 +- Improve message UI on Microsoft Teams notification. !23385 (Takuya Noguchi) +- Use state machine in Merge Train to avoid race conditions. !23395 +- Prevent DAG builds to run after skipped need build. !23405 +- Fixes AutoMergeProcessWorker failing when merge train service is not available for a merge request. !23407 +- Fix error when assigning an existing asignee. !23416 +- Fix outdated MR security warning message. !23496 +- Fix missing API notification argument for Microsoft Teams. !23571 (Seiji Suenaga) +- Support the bypass 2FA function with ADFS SAML. !23615 +- Require other stages than .pre and .post. !23629 +- Remove the OpenSSL include within SMIME email signing. !23642 (Roger Meier) +- Fix custom charts in monitoring dashboard shrinking. !23649 +- Correctly render mermaid digrams inside details blocks. !23662 +- Fix Pipeline failed notification email not being delivered if the failed job is a bridge job. !23668 +- Call DetectRepositoryLanguagesWorker only for project repositories. !23696 +- Fix emails on push integrations created before 12.7. !23699 +- Fix hash parameter of Permalink and Blame button. !23713 +- Task lists work correctly again on closed MRs. !23714 +- Fix broken link to documentation. !23715 +- Trim extra period when merge error displayed. !23737 +- Skip squashing with only one commit in a merge request. !23744 +- Fix 500 error when trying to unsubscribe from an already deleted entity. !23747 +- Fix some of the file encoding issues when uploading in the Web IDE. !23761 +- Remove keep button for non archive artifacts. !23762 +- Ensure all Project records have a corresponding ProjectFeature record. !23766 +- Fix design of snippet search results page. !23780 +- Fix Merge Request comments when some notes are corrupt. !23786 +- Add optional angle brackets in address_regex. !23797 (Max Winterstein) +- Eliminate statement timeouts when namespace is blank. !23839 +- Remove unstaged and staged modification tooltip. !23847 +- Allow Owner access level for sharing groups with groups. !23868 +- Allow running child pipelines as merge request pipelines. !23884 +- Fix user popover glitch. !23904 +- Return 404 when repository archive cannot be retrieved. !23926 +- Fix 503 errors caused by Gitaly failures during project_icon lookup. !23930 +- Fix showing 'NaN files' when a MR diff does not have any changes. !24002 +- Label MR test modal execution time as seconds. !24019 +- Fix copy markdown with elements with no text content. !24020 +- Disable pull mirror importing for archived projects. !24029 +- Remove gray color from diff buttons. !24041 +- Prevent project path namespace overflow during import. !24042 (George Tsiolis) +- Fix JIRA::HTTPError initialize parameter. !24060 +- Fix multiline issue when loading env vars from DinD in SAST. !24108 +- Clean backgroud_migration queue from ActivatePrometheusServicesForSharedCluster jobs. !24135 +- Fix quoted-printable encoding for unicode and newlines in mails. !24153 (Diego Louzán) +- Replace artifacts via Runner API if already exist. !24165 +- Port `trigger` keyword in CI config to Core. !24191 +- Fix race condition bug in Prometheus managed app update process. !24228 +- Hide label tooltips when dragging board cards. !24239 +- Fix dropdown caret not being positioned correctly. !24273 +- Enable recaptcha check on sign up. !24274 +- Avoid loading user activity calendar on mobile. !24277 (Takuya Noguchi) +- Resolve Design discussion note preview is broken. !24288 +- Query projects of subgroups in productivity analytics. !24335 +- Query projects of subgroups in Cycle Analytics. !24392 +- Fix backup restoration with pre-existing wiki. !24394 +- Fix duplicated user popovers. !24405 +- Fix inconditionally setting user profile to public when updating via API and private_profile parameter is not present in the request. !24456 (Diego Louzán) +- Enable Web IDE on projects without Merge Requests. !24508 +- Avoid double encoding of credential while importing a Project by URL. !24514 +- Redact push options from error logs. !24540 +- Fix merge train unnecessarily retries pipeline by a race condition. !24566 +- Show selected template type when clicked. !24596 +- Don't leak entire objects into the error log when rendering markup fails. !24599 +- Fix blobs search API degradation. !24607 +- Sanitize request parameters in exceptions_json.log. !24625 +- Add styles for board list labels when text is too long. !24627 +- Show blocked status for all blocked issues on issue boards. !24631 +- Ensure board lists are sorted consistently. !24637 +- Geo: Fix GeoNode name in geo:update_primary_node_url rake task. !24649 +- Fix link to base domain help in clusters view. !24658 +- Fix false matches of substitution-based quick actions in text. !24699 +- Fix pipeline icon background in Web IDE. !24707 +- Fix job page not loading because kuberenetes/prometheus URL is blocked. !24743 +- Fix signature badge popover on Firefox. !24756 +- Avoid autolinking YouTrack issue numbers followed by letters. !24770 (Konrad Borowski) +- Fix 500 error while accessing Oauth::ApplicationsController without a valid session. !24775 +- Ensure a valid mount_point is used by the AvatarUploader. !24800 +- Fix k8s logs alert display state. !24802 +- Squelch Snowplow tracker log messages. !24809 +- Fix code line and line number alignment in Safari. !24820 +- Fixed default-branch link under Pipeline Subscription settings. !24834 (James Johnson) +- Do not remove space from project name in Slack. !24851 +- Drop etag cache on logs API. !24864 +- Revert rename services template to instance migration. !24885 +- Geo: Don't clean up files in object storage when Geo is responsible of syncing them. !24901 +- Add missing colors on the monitoring dashboards. !24921 +- Upgrade omniauth-github gem to fix GitHub API deprecation notice. !24928 +- dragoon20. !24958 (Jordan Fernando) +- Fix bug rendering BlobType markdown data. !24960 +- Use closest allowed visibility level on group creation when importing groups using Group Import/Export. !25026 +- Extend the list of excluded_attributes for group on Group Import. !25031 +- Update broken links to Cloud Run for Anthos documentation. !25159 +- Fix autocomplete limitation bug. !25167 +- Fix Group Import existing objects lookup when description attribute is an empty string. !25187 +- Fix N+1 queries caused by loading job artifacts archive in pipeline details entity. !25250 +- Fix sidekiq jobs not always getting a database connection when running with low concurrency. !25261 +- Fix overriding the image pull policy from a values file for Auto Deploy. !25271 (robcalcroft) +- Pin Auto DevOps Docker-in-Docker service image to work around pull timeouts. !25286 +- Remove name & path from list of excluded attributes during Group Import. !25342 +- Time series extends axis options correctly. !25399 +- Fix "Edit Release" page. !25469 +- Ensure New Snippet button is displayed based on the :create_snippet permission in Project Snippets page and User profile > Snippets tab. !55240 +- Fix wrong MR link is shown on pipeline failure email. +- Fix issue count wrapping on board list. +- Allow long milestone titles on board lists to be truncated. +- Update styles for pipeline status badge to be correctly vertically centered in project pipeline card. (Oregand) +- MVC for assignees avatar dissapearing when opening issue sidebar in board. (Oregand) +- Fix application settings not working with pending migrations. +- Rename too long migration filename to address gem packaging limitations. +- Add more accurate way of counting remaining background migrations before upgrading. +- update main javascript file to only apply right sidebar class when an aside is present. (Oregand) + +### Deprecated (2 changes) + +- Move repository routes under - scope. !20455 +- Move merge request routes under /-/ scope. !21126 + +### Changed (82 changes, 13 of them are from the community) + +- Move the clone button to the tree controls area. !17752 (Ablay Keldibek) +- Add experimental --queue-selector option to sidekiq-cluster. !18877 +- Truncate related merge requests list in pipeline view. !19404 +- Increase pipeline email notification from 10 to 30 lines. !21728 (Philipp Hasper) +- Sets size limits on data loaded async, like deploy boards and merge request reports. !21871 +- Deprecate /admin/application_settings in favor of /admin/application_settings/general. The former path is to be removed in 13.0. !22252 (Alexander Oleynikov) +- Migrate epic, epic notes mentions to respective DB table. !22333 +- Restyle changes header & file tree. !22364 +- Let tie breaker order follow primary sort direction (API). !22795 +- Allow SSH keys API endpoint to be requested for a given username. !22899 (Rajendra Kadam) +- Allow to deploy only forward deployments. !22959 +- Add blob and blob_viewer fields to graphql snippet type. !22960 +- Activate new project integrations by default. !23009 +- Rename Custom hooks to Server hooks. !23064 +- Reorder signup omniauth options. !23082 +- Cycle unresolved threads. !23123 +- Rename 'GitLab Instance Administration' project to 'GitLab self monitoring' project. !23182 +- Update pipeline status copy in deploy footer. !23199 +- Allow users to read broadcast messages via API. !23298 (Rajendra Kadam) +- Default the `creation of a Mattermost team` checkbox to false. !23329 (briankabiro) +- Makes the generic alerts endpoint available with the free tier. !23339 +- Allow to switch between cloud providers in cluster creation screen. !23362 +- Rename cycle analytics interfaces to value stream analytics. !23427 +- Upgrade to Gitaly v1.83.0. !23431 +- Groups::ImportExport::ExportService to require admin_group permission. !23434 +- Bump ingress managed app chart to 1.29.3. !23461 +- Add support for stacked column charts. !23474 +- Remove kibana_hostname column from clusters_applications_elastic_stacks table. !23503 +- Update rebasing to use the new two-phase Gitaly Rebase RPC. !23546 +- Fetch merge request widget data asynchronous. !23594 +- Include issues created in GitLab on error tracking details page. !23605 +- Add Epics Activity information to Group Export. !23613 +- Copy issues routing under - scope. !23779 +- Make Explore Projects default to All. !23811 +- Migrate CI CD statistics + duration chart to VueJS. !23840 +- Use NodeUpdateService for updating Geo node. !23894 (Rajendra Kadam) +- Add support for column charts. !23903 +- Update PagesDomains data model for serverless domains. !23943 +- Upgrade to Gitaly v1.85.0. !23945 +- Change vague copy to clipboard icon to a clearer icon. !23983 +- Add award emoji information of Epics and Epic Notes to Group Import/Export. !24003 +- Make name, email, and location attributes readonly for LDAP enabled instances. !24049 +- Migrate CI CD pipelines charts to ECharts. !24057 +- Include license_scanning to index_ci_builds_on_name_for_security_products_values. !24090 +- Add mode field to snippet blob in GraphQL. !24157 +- Switch order of tabs in Web IDE nav dropdown. !24199 +- Hide comment button if on diff HEAD. !24207 +- Move commit routes under - scope. !24279 +- Move security routes under - scope. !24287 +- Restyle Merge Request diffs file tree. !24342 +- Limit length of wiki file/directory names. !24364 +- Admin mode support in sidekiq jobs. !24388 (Diego Louzán) +- Expose theme and color scheme user preferences in API. !24409 +- Remove username lookup when mapping users when importing projects using Project Import/Export and rely on email only. !24464 +- Extend logs retention to period from 15 to 30 days. !24466 +- Move analytics pages under the sidebar for projects and groups. !24470 +- Rename 'Kubernetes configured' button. !24487 +- Test reports in the pipeline details page will now load when clicking the tests tab. !24577 +- Move Settings->Operations->Incidents to the Core. !24600 +- Upgrade to Gitaly v1.86.0. !24610 +- Conan packages are validated based on full recipe instead of name/version alone. !24692 +- WebIDE: Support # in branch names. !24717 +- Move Merge Request from right sidebar of Web IDE to bottom bar. !24746 +- Updated cluster-applications to v0.7.0. !24754 +- Add migration to save Instance Administrators group ID in application_settings table. !24796 +- Add percentile value support to single stat panel types. !24813 +- Parse filebeat modsec logs as JSON. !24836 +- Add plain_highlighted_data field to SnippetBlobType. !24856 +- Add Board Lists to Group Export. !24863 +- Replace underscore with lodash for ./app/assets/javascripts/mirrors. !24967 (Jacopo Beschi @jacopo-beschi) +- Replace underscore with lodash in /app/assets/javascripts/helpers. !25014 (rkpattnaik780) +- Migrate from class .fa-spinner to .spinner in app/assets/javascripts/gfm_auto_complete.js. !25039 (rk4bir) +- Update cluster-applications to v0.8.0. !25138 +- Limit size of params array in JSON logs to 10 KiB. !25158 +- Omit error details from previous attempt in Sidekiq JSON logs. !25161 +- Remove unnecessary milestone join tables. !25198 +- Upgrade to Gitaly v1.87.0. !25370 +- Drop signatures in email replies. !25389 (Diego Louzán) +- update service desk project to use GlLoadingIcon over font awesome spinner. (Oregand) +- Search group-level objects among all ancestors during project import. +- Add broadcast type to API. +- Changed color of allowed to fail badge from danger to warning. + +### Performance (22 changes, 1 of them is from the community) + +- Check mergeability of MR asynchronously. !21026 +- Fix query performance in PipelinesFinder. !21092 +- Fix usage ping timeouts with batch counters. !22705 +- Remove N+1 query for profile notifications. !22845 (Ohad Dahan) +- Limit page number on explore/projects. !22876 +- Prevent unnecessary Gitaly calls when rendering comment excerpts in todos and activity feed. !23100 +- Eliminate Gitaly N+1 queries loading submodules. !23292 +- Optimize page loading of Admin::RunnersController#show. !23309 +- Improve performance of the Container Registry delete tags API. !23325 +- Don't allow Gitaly calls to exceed the worker timeout set for unicorn or puma. !23510 +- Use CTE optimization fence for loading projects in dashboard. !23754 +- Optimize ref name lookups in archive downloads. !23890 +- Change broadcast message index. !23986 +- Add index to audit_events (entity_id, entity_type, id). !23998 +- Remove unneeded indexes on projects table. !24086 +- Load maximum 1mb blob data for a diff file. !24160 +- Optimize issue search when sorting by weight. !24208 +- Optimize issue search when sorting by due date and position. !24217 +- Refactored repository browser to use Vue and GraphQL. !24450 +- Improvement to merged_branch_names cache. !24504 +- Destroy user associations in batches like we do with projects. !24641 +- Cache repository merged branch names by default. !24986 + +### Added (137 changes, 46 of them are from the community) + +- x509 signed commits using openssl. !17773 (Roger Meier) +- Allow keyboard shortcuts to be disabled. !18782 +- Add API endpoints for 'soft-delete for groups' feature. !19430 +- Add UI for 'soft-delete for groups' feature. !19483 +- Introduce project_settings table. !19761 +- Expose current and last IPs to /users endpoint. !19781 +- Add Group Import API endpoint & update Group Import/Export documentation. !20353 +- Show Kubernetes namespace on job show page. !20983 +- Add admin settings panel for instance-level serverless domain (behind feature flag). !21222 +- Filter merge requests by approvals (API). !21379 +- Expose is_using_seat attribute for Member in API. !21496 +- Add querying of Sentry errors to Graphql. !21802 +- Extends 'Duplicate dashboard' feature, by including custom metrics added to GitLab-defined dashboards. !21923 +- Add tab width option to user preferences. !22063 (Alexander Oleynikov) +- Add iid to operations_feature_flags and backfill. !22175 +- Support retrieval of disk statistics from Gitaly. !22226 (Nels Nelson) +- Implement allowing empty needs for jobs in DAG pipelines. !22246 +- Create snippet repository when it's created. !22269 +- When switching to a file permalink, just change the URL instead of triggering a useless page reload. !22340 +- Packages published to the package registry via CI/CD with a CI_JOB_TOKEN will display pipeline information on the details page. !22485 +- Add users memberships endpoints for admins. !22518 +- Add cilium to the managed cluster apps template. !22557 +- Add WAF Anomaly Summary service. !22736 +- Introduce license_scanning CI template. !22773 +- Add extra fields to the application context. !22792 +- Add selective sync support to Geo Nodes API update endpoint. !22828 (Rajendra Kadam) +- Add validation for custom PrometheusDashboard. !22893 +- Sync GitLab issue back to Sentry when created in GitLab. !23007 +- Add new Elastic Stack cluster application for pod log aggregation. !23058 +- NPM dist tags will now be displayed on the package details page. !23061 +- Add show routes for group and project repositories_controllers and add pagination to the index responses. !23151 +- Add pages_access_level to projects API. !23176 (Mathieu Parent) +- Document CI job activity limit for pipeline creation. !23246 +- Update Praefect docs for subcommand. !23255 +- Add CI variables to provide GitLab port and protocol. !23296 (Aidin Abedi) +- Seprate 5 classes in separate files from entities. !23299 (Rajendra Kadam) +- Upgrade pages to 1.14.0. !23317 +- Indicate Sentry error severity in GitLab. !23346 +- Sync GitLab issues with Sentry plugin integration. !23355 +- Backfill missing GraphQL API Group type properties. !23389 (Fabio Huser) +- Allow setting minimum concurrency for sidekiq-cluster processes. !23408 +- Geo: Add tables to prepare to replicate package files. !23447 +- Update deploy token architecture to introduce group-level deploy tokens. !23460 +- Add tags, external_base_url, gitlab_issue to Sentry Detailed Error graphql. !23483 +- Reverse actions for resolve/ignore Sentry issue. !23516 +- Add deploy_token_type column to deploy_tokens table. !23530 +- Add ability to hide GraphQL fields using GitLab Feature flags. !23563 +- Add can_create_merge_request_in to /project/:id API response. !23577 +- Close related GitLab issue on Sentry error resolve. !23610 +- Add emails_disabled to projects API. !23616 (Mathieu Parent) +- Expose group milestones on GraphQL. !23635 +- Add support for lsif artifact report. !23672 +- Displays package tags next to the name on the new package list page. !23675 +- Collect release evidence at release timestamp. !23697 +- Create conditional Enable Review App button. !23703 +- Add CI variables to configure bundler-audit advisory database (Dependency Scanning). !23717 +- Add API to "Play" a scheduled pipeline immediately. !23718 +- Add selective sync support to Geo Nodes API create endpoint. !23729 (Rajendra Kadam) +- Refactor user entities into own class files. !23730 (Rajendra Kadam) +- Replace Net::HTTP with Gitlab::HTTP in rake gitlab:geo:check. !23741 (Rajendra Kadam) +- Add separate classes for user related entities for email, membership, status. !23748 (Rajendra Kadam) +- Add Sentry error stack trace to GraphQL API. !23750 +- Allow for relative time ranges in metrics dashboard URLs. !23765 +- Add non_archived param to issues API endpoint to filter issues from archived projects. !23785 +- Add separate classes for project hook, identity, export status. !23789 (Rajendra Kadam) +- Create snippet repository model. !23796 +- Add non_archived param to group merge requests API endpoint to filter MRs from non archived projects. !23809 +- Change `Rename` to `Rename/Move` in Web IDE Dropdown. !23877 +- Add separate classes for project related classes. !23887 (Rajendra Kadam) +- Added search box to dashboards dropdown in monitoring dashboard. !23906 +- Display operations feature flag internal ids. !23914 +- Enable search and filter in environments dropdown in monitoring dashboard. !23942 +- Add GraphQL mutation to restore multiple todos. !23950 +- Add migration to create resource milestone events table. !23965 +- Add cycle analytics duration chart with median line. !23971 +- Support require_password_to_approve in project merge request approvals API. !24016 +- Add updateImageDiffNote mutation. !24027 +- Upgrade Pages to 1.15.0. !24043 +- Updated package details page header to begin updating the page design. !24055 +- Added migration which adds project_key column to service_desk_settings. !24063 +- Separate project and group entities into own class files. !24070 (Rajendra Kadam) +- Separate commit entities into own class files. !24085 (Rajendra Kadam) +- Add delete identity endpoint on the users API. !24122 +- Add search support for protected branches API. !24137 +- Dark syntax highlighting theme for Web IDE. !24158 +- Added NuGet package installation instructions to package details page. !24162 +- Expose issue link type in REST API. !24175 +- Separate snippet entities into own class files. !24183 (Rajendra Kadam) +- Support for table of contents tag in GitLab Flavored Markdown. !24196 +- Add GET endpoint to LDAP group link API. !24216 +- Add API to enable and disable error tracking settings. !24220 (Rajendra Kadam) +- Separate protected and issuable entities into own class files. !24221 (Rajendra Kadam) +- Separate issue entities into own class files. !24226 (Rajendra Kadam) +- Make smarter user suggestions for assign slash commands. !24294 +- Add loading icon to clusters being created. !24370 +- Allow a grace period for new users to confirm their email. !24371 +- Separate merge request entities into own class files. !24373 (Rajendra Kadam) +- Create an environment for self monitoring project. !24403 +- Add blocked icon on issue board card. !24420 +- Add blocking issues feature. !24460 +- Wait for elasticsearch to be green on install. !24489 +- Separate key and other entities into own class files. !24495 (Rajendra Kadam) +- Implement support of allow_failure keyword for CI rules. !24605 +- Adds path to edit custom metrics in dashboard response. !24645 +- Add tooltip when dates in date picker are too long. !24664 +- API: Ability to list commits in order (--topo-order). !24702 +- Separate note entities into own class files. !24732 (Rajendra Kadam) +- Separate 5 classes into own entities files. !24745 (Rajendra Kadam) +- Set default dashboard for self monitoring project. !24814 +- Create operations strategies and scopes tables. !24819 +- Separate access entities into own class files. !24845 (Rajendra Kadam) +- Refactor error tracking specs and add validation to enabled field in error tracking model. !24892 (Rajendra Kadam) +- Separate service entities into own class files. !24936 (Rajendra Kadam) +- Separate label entities into own class files. !24938 (Rajendra Kadam) +- Separate board, list and other entities into own class files. !24939 (Rajendra Kadam) +- Separate entities into own class files. !24941 (Rajendra Kadam) +- Separate tag and release entities into own class files. !24943 (Rajendra Kadam) +- Separate job entities into own class files. !24948 (Rajendra Kadam) +- Separate entities into own class files. !24950 (Rajendra Kadam) +- Separate environment entities into own class files. !24951 (Rajendra Kadam) +- Display the y-axis on the range of data value in the chart. !24953 +- Separate token and template entities into own class files. !24955 (Rajendra Kadam) +- Separate token entities into own class files. !24974 (Rajendra Kadam) +- Separate JobRequest entities into own class files. !24977 (Rajendra Kadam) +- Separate entities into own class files. !24985 (Rajendra Kadam) +- Separate page domain entities into own class files. !24987 (Rajendra Kadam) +- add avatar_url in job webhook, and email in pipeline webhook. !24992 (Guillaume Micouin) +- Separate Application and Blob entities into own class files. !24997 (Rajendra Kadam) +- Separate badge entities into own class files. !25116 (Rajendra Kadam) +- Separate provider, platform and post receive entities into own class files. !25119 (Rajendra Kadam) +- Separate cluster entities into own class files. !25121 (Rajendra Kadam) +- Container Registry tag expiration policy settings. !25123 +- Upgrade pages to 1.16.0. !25238 +- Added "Prohibit outer fork" setting for Group SAML. !25246 +- Separate project entity into own class file. !25297 (Rajendra Kadam) +- Add license FAQ link to license expired message. +- Add broadcast types to broadcast messages. + +### Other (55 changes, 15 of them are from the community) + +- Upgrade to Rails 6. !19891 +- refactoring gl_dropdown.js to use ES6 classes instead of constructor functions. !20488 (nuwe1) +- Creates a standalone vulnerability page. !20734 +- Auto generated wiki commit message containing HTML encoded entities. !21371 (2knal) +- removes store logic from issue board models. !21391 (nuwe1) +- removes store logic from issue board models. !21404 (nuwe1) +- Reducing whitespace in group list to show more on screen and reduce vertical scrolling. !21584 +- Geo: Include host when logging. !22203 +- Add rate limiter to Project Imports. !22644 +- Use consistent layout in cluster advanced settings. !22656 +- Replace custom action array in CI header bar with . !22839 (Fabio Huser) +- Fix visibility levels of subgroups to be not higher than their parents' level. !22889 +- Update pg gem to v1.2.2. !23237 +- Remove milestone_id from epics. !23282 (Lee Tickett) +- Remove button group for edit and web ide in file header. !23291 +- Update GitLab Runner Helm Chart to 0.13.0/12.7.0. !23308 +- Remove storage_version column from snippets. !23315 +- Upgrade acme-client to v2.0.5. !23498 +- Make rake -T output more consistent. !23550 +- Show security report outdated message for only Active MRs. !23575 +- Update Kaminari templates to match gl-pagination's markup. !23582 +- Update GitLab Runner Helm Chart to 0.13.1 (GitLab Runner 12.7.1). !23588 +- Remove unused Code Hotspots database tables. !23590 +- Remove self monitoring feature flag. !23631 +- Store security scans run in CI jobs. !23669 +- More verbose JiraService error logs. !23688 +- Rename Cloud Run on GKE to Cloud Run for Anthos. !23694 +- Update links related to MR approvals in UI. !23948 +- Migrate issue tracker data to data field tables. !24076 +- Updated icon for copy-to-clipboard button. !24146 +- Add specialized index to packages_packages database table. !24182 +- Bump auto-deploy-image for Auto DevOps deploy to 0.9.1. !24231 +- Bump DAST deploy auto-deploy-image to 0.9.1. !24232 +- Move contribution analytics chart to echarts. !24272 +- Minor text update to IDE commit to branch disabled tooltip. !24521 +- Promote stackprof into a production gem. !24564 +- Replace unstructured application logs with structured (JSON) application logs in the admin interface. !24614 +- Move insights charts to echarts. !24661 +- Improve UX of optional fields in Snippets form. !24762 +- Update snippets empty state and remove explore snippets button. !24764 +- Backfill LfsObjectsProject records of forks. !24767 +- Update button margin of various empty states. !24806 +- Update loading icon in Value Stream Analytics view. !24861 +- Replace underscore with lodash for ./app/assets/javascripts/serverless. !25011 (Tobias Spagert) +- Replaced underscore with lodash for spec/javascripts/vue_shared/components. !25018 (Shubham Pandey) +- Replaced underscore with lodash for spec/javascripts/badges. !25135 (Shubham Pandey) +- Replace underscore with lodash for ./app/assets/javascripts/error_tracking. !25143 (Tobias Spagert) +- Destroy the OAuth application when Geo secondary becomes a primary. !25154 (briankabiro) +- Refactored snippets view to Vue. !25188 +- Updated ui elements in wiki page creation. !25197 (Marc Schwede) +- Internationalize messages for group audit events. !25233 (Takuya Noguchi) +- Add a link to the variable priority override section from triggers page. !25264 (DFredell) +- Track usage of merge request file header buttons. (Oregand) +- Switch dropdown operators to lowercase. +- Add clarifying content to account fields. + + +## 12.7.5 + +### Fixed (4 changes, 1 of them is from the community) + +- Add accidentally deleted project config for custom apply suggestions. !23687 (Fabio Huser) +- Fix database permission check for triggers on Amazon RDS. !24035 +- Fix applying the suggestions with an empty custom message. !24144 +- Remove invalid data from issue_tracker_data table. + + +## 12.7.3 + +### Security (17 changes, 1 of them is from the community) + +- Fix xss on frequent groups dropdown. !50 +- Bump rubyzip to 2.0.0. (Utkarsh Gupta) +- Disable access to last_pipeline in commits API for users without read permissions. +- Add constraint to group dependency proxy endpoint param. +- Limit number of AsciiDoc includes per document. +- Prevent API access for unconfirmed users. +- Enforce permission check when counting activity events. +- Prevent gafana integration token from being displayed as a plain text to other project maintainers, by only displaying a masked version of it. GraphQL api deprecate token field in GrafanaIntegration type. +- Cleanup todos for users from a removed linked group. +- Fix XSS vulnerability on custom project templates form. +- Protect internal CI builds from external overrides. +- ImportExport::ExportService to require admin_project permission. +- Make sure that only system notes where all references are visible to user are exposed in GraphQL API. +- Disable caching of repository/files/:file_path/raw API endpoint. +- Make cross-repository comparisons happen in the source repository. +- Update excon to 0.71.1 to fix CVE-2019-16779. +- Add workhorse request verification to package upload endpoints. + + +## 12.7.1 + +### Fixed (6 changes) + +- Fix loading of sub-epics caused by wrong subscription check. !23184 +- Fix Bitbucket Server importer error handler. !23310 +- Fixes random passwords generated not conforming to minimum_password_length setting. !23387 +- Reverts MR diff redesign which fixes Web IDE visual bugs including file dropdown not showing up. !23428 +- Allow users to sign out on a read-only instance. !23545 +- Remove invalid data from jira_tracker_data table. !23621 + +### Added (1 change) + +- Close Issue when resolving corresponding Sentry error. !22744 + + +## 12.7.0 + +### Security (6 changes, 2 of them are from the community) + +- Ensure content matches extension on image uploads. !20697 +- Update set-value from 2.0.0 to 2.0.1. !22366 (Takuya Noguchi) +- Update rdoc to 6.1.2. !22434 +- Upgrade json-jwt to v1.11.0. !22440 +- Update webpack from 4.40.2 to 4.41.5. !22452 (Takuya Noguchi) +- Update rack-cors to 1.0.6. !22809 + +### Removed (2 changes) + +- Remove feature flag 'use_legacy_pipeline_triggers' and remove legacy tokens. !21732 +- Add deprecation warning to Rake tasks in sidekiq namespace. + +### Fixed (91 changes, 7 of them are from the community) + +- Remove extra whitespace in user popover. !19938 +- Migrate the database to activate projects prometheus service integration for projects with prometheus installed on shared k8s cluster. !19956 +- Fix pages size limit setting in database if it is above the hard limit. !20154 +- Support dashes in LDAP group CN for sync on users first log in. !20402 +- Users without projects use a license seat in a non-premium license. !20664 +- Add fallbacks and proper errors for diff file creation. !21034 +- Authenticate API requests with job tokens for Rack::Attack. !21412 +- Tasks in HTML comments are no longer incorrectly detected. !21434 +- Hide mirror admin actions from developers. !21569 +- !21542 Part 3: Handle edge cases in stage and unstage mutations. !21676 +- Web IDE: Fix Incorrect diff of deletion and addition of the same file. !21680 +- Fix bug when clicking on same note twice in Firefox. !21699 (Jan Beckmann) +- Fix "No changes" empty state showing up in changes tab, despite there being changes. !21713 +- Require group owner to have linked SAML before enabling Group Managed Accounts. !21721 +- Fix README.txt not showing up on a project page. !21763 (Alexander Oleynikov) +- Fix MR diffs file count increments while batch loading. !21764 +- When sidekiq-cluster is asked to shutdown, actively terminate any sidekiq processes that don't finish cleanly in short order. !21796 +- Prevent MergeRequestsController#ci_environment_status.json from making HTTP requests. !21812 +- Fix issue: Discard button in Web IDE does nothing. !21902 +- Fix "Discard" for newly-created and renamed files. !21905 +- Add epic milestone sourcing foreign key. !21907 +- Fix transferring groups to root when EE features are enabled. !21915 +- Show regular rules without approvers. !21918 +- Resolve "Merge request discussions API doesn't reject an error input in some case". !21936 +- fix CSS when board issue is collapsed. !21940 (allenlai18) +- Properly check a task embedded in a list with no text. !21947 +- Process quick actions when using Service Desk templates. !21948 +- Sidebar getting partially hidden behind the content block. !21978 (allenlai18) +- Fix bug in Container Scanning report remediations. !21980 +- Return empty body for 204 responses in API. !22086 +- Limit the amount of time ChatNotificationWorker waits for the build trace. !22132 +- Return 503 error when metrics dashboard has no connectivity. !22140 +- Cancel running pipelines when merge request is dropped from merge train. !22146 +- Fix: undefined background migration classes for EE-CE downgrades. !22160 +- Check both SAST_DISABLE and SAST_DISABLE_DIND when executing SAST job template. !22166 +- Check both DEPENDENCY_SCANNING_DISABLED and DS_DISABLE_DIND when executing Dependency Scanning job template. !22172 +- Stop exposing MR refs in favor of persistent pipeline refs. !22198 +- Display login or register widget only if user is not logged in. !22211 +- Fix milestone quick action to handle ancestor group milestones. !22231 +- Fix RefreshMergeRequestsService raises an exception and unnecessary sidekiq retry. !22262 +- Make BackgroundMigrationWorker backward compatible. !22271 +- Update foreign key constraint for personal access tokens. !22305 +- Fix markdown table border colors. !22314 +- Retry obtaining Let's Encrypt certificates every 2 hours if it wasn't successful. !22336 +- Disable Prometheus metrics if initialization fails. !22355 +- Make jobs with resource group cancellable. !22356 +- Fix bug when trying to expose artifacts and no artifacts are produced by the job. !22378 +- Gracefully error handle CI lint errors in artifacts section. !22388 +- Fix GitLab plugins not working without hooks configured. !22409 +- Prevent omniauth signup redirect loop. !22432 (Balazs Nagy) +- Fix deploy tokens erroneously triggering unique IP limits. !22445 +- Add support to export and import award emojis for issues, issue notes, MR, MR notes and snippet notes. !22493 +- Fix Delete Selected button being active after uploading designs after a deletion. !22516 +- Fix releases page when tag contains a slash. !22527 +- Reverts Add RBAC permissions for getting knative version. !22560 +- Fix error in Wiki when rendering the AsciiDoc include directive. !22565 +- Fix Error 500 in parsing invalid CI needs and dependencies. !22567 +- Fix discard all to behave like discard single file in Web IDE. !22572 +- Update IDE discard of renamed entry to also discard file changes. !22573 +- Avoid pre-populating form for MR resolve issues. !22593 +- Fix relative links in Slack message. !22608 +- Hide merge request tab popover for anonymous users. !22613 +- Remove unused keyword from EKS provision service. !22633 +- Prevent job log line numbers from being selected. !22691 +- Fix CAS users being signed out repeatedly. !22704 +- Make Sidekiq timestamps consistently ISO 8601. !22750 +- Merge a merge request immediately when passing merge when pipeline succeeds to the merge API when the head pipeline already succeeded. !22777 +- Fix Issue API: creating with manual IID returns conflict when IID already in use. !22788 (Mara Sophie Grosch) +- Project issue board names now sorted correctly in FOSS. !22807 +- Fix upload redirections when project has moved. !22822 +- Update Mermaid to v8.4.5. !22830 +- Prevent builds from halting unnecessarily when completing prerequisites. !22938 +- Fix discarding renamed directories in Web IDE. !22943 +- Gracefully handle marking a project deletion multiple times. !22949 +- Fix: WebIDE doesn't work on empty repositories again. !22950 +- Fix rebase error message translation in merge requests. !22952 (briankabiro) +- Geo: Fix Docker repository synchronization for local storage. !22981 +- Include subgroups when searching inside a group. !22991 +- Geo: Handle repositories in Docker Registry with no tags gracefully. !23022 +- Fix group issue list and group issue board filters not showing ancestor group milestones. !23038 +- Add returning relation from GroupMembersFinder if called on root group with only inherited param. !23161 +- Fix extracting Sentry external URL when URL is nil. !23162 +- Fix issue CSV export failing for some projects. !23223 +- Fix unexpected behaviour of the commit form after committing in Web IDE. !23238 +- Fix analytics tracking for new merge request notes. !23273 +- Identify correct sentry id in error tracking detail. !23280 +- Fix for 500 when error stack trace is empty. !119205 +- Removes incorrect help text from EKS Kubernetes version field. +- Exclude snippets from external caching handling. +- Validate deployment SHAs and refs. +- Increase size of issue boards sidebar collapse button. + +### Changed (42 changes, 4 of them are from the community) + +- Restores user's ability to revoke sessions from the active sessions page. !17462 (Jesse Hall @jessehall3) +- Add documentation & helper text information regarding securing a GitLab instance. !18987 +- Add activity across all projects to /events endpoint. !19816 (briankabiro) +- Don't run Auto DevOps when no dockerfile or matching buildpack exists. !20267 +- Expose full reference path for issuables in API. !20354 +- Add measurement details for programming languages graph. !20592 +- Move instance statistics into analytics namespace. !21112 +- Improve warning for Promote issue to epic. !21158 +- Added Conan recipe in place of the package name on the package details page. !21247 +- Expose description_html for labels. !21413 +- Add audit events to the adding members to project or group API endpoint. !21633 +- Include commit message instead of entire page content in Wiki chat notifications. !21722 (Ville Skyttä) +- Add fetching of Grafana Auth via the GraphQL API. !21756 +- Update prometheus chart version to 9.5.2. !21935 +- Turns on backend MR reports for DAST by default. !22001 +- Changes to template dropdown location. !22049 +- Copy merge request routes to the - scope. !22082 +- Copy repository route under - scope. !22092 +- Add back feature flag for cache invalidator. !22106 +- Update jupyterhub chart. !22127 +- Enable ability to install Crossplane app by default. !22141 +- Apply word-diff highlighting to Suggestions. !22182 +- Update auto-deploy-image to v0.8.3 for DAST default branch deploy. !22227 +- Restyle changes header & file tree. !22364 +- Upgrade to Gitaly v1.79.0. !22515 +- Save Instance Administrators group ID in DB. !22600 +- Resolve Create new project: Auto-populate project slug string to project name if name is empty. !22627 +- Bump cluster-applications image to v0.4.0, adding support to install cert-manager. !22657 +- Pass log source to the frontend. !22694 +- Allow Unicode 11 emojis in project names. !22776 (Harm Berntsen) +- Update name max length. !22840 +- Update button label in MR widget pipeline footer. !22900 +- Exposes tiller.log as artifact in Managed-Cluster-Applications GitLab CI template. !22940 +- Rename GitLab Plugins feature to GitLab File Hooks. !22979 +- Allow to share groups with other groups. !23185 +- Upgrade to Gitaly v1.81.0. !23198 +- Enable Code Review Analytics by default. !23285 +- Add JSON error context to extends error in CI lint. !30066 +- Fix embedded snippets UI polish issues. +- Align embedded snippet mono space font with GitLab mono space font. +- Updates AWS EKS service role name help text to clarify it is distinct from provision role. +- Adds quickstart doc link to ADO CICD settings. + +### Performance (27 changes) + +- Reduce redis key size for the Prometheus proxy and the amount of queries by half. !20006 +- Implement Atomic Processing that updates status of builds, stages and pipelines in one go. !20229 +- Request less frequent updates from Runner when job log is not being watched. !20841 +- Don't let Gitaly calls exceed a request time of 55 seconds. !21492 +- Reduce CommitIsAncestor RPCs with environments. !21778 +- LRU object caching for GroupProjectObjectBuilder. !21823 +- Preload project, user and group to reuse objects during project import. !21853 +- Fix slow query on blob search when doing path filtering. !21996 +- Add index to optimize loading pipeline charts. !22052 +- Avoid Gitaly RPCs in rate-limited raw blob requests. !22123 +- Remove after_initialize and before_validation for Note. !22128 +- Execute Gitaly LFS call once when Vue file enabled. !22168 +- Speed up path generation with build artifacts. !22257 +- Performance improvements on milestone burndown chart. !22380 +- Added smart virtual list component to test reports to enhance rendering performance. !22381 +- Add Index to help Hashed Storage migration on big instances. !22391 +- Use GraphQL to load error tracking detail page content. !22422 +- Improve link generation performance. !22426 +- Create optimal indexes for created_at order (Projects API). !22623 +- Avoid making Gitaly calls when some Markdown text links to an uploaded file. !22631 +- Remove unused index on project_mirror_data. !22647 +- Add more indexes for other order_by options (Projects API). !22784 +- Add indexes for authenticated Project API calls. !22886 +- Enable redis HSET diff caching by default. !23105 +- Add `importing?` to disable some callbacks. +- Remove N+1 query issue when checking group root ancestor. +- Reduce Gitaly calls needed for issue discussions. + +### Added (95 changes, 18 of them are from the community) + +- Add previous revision link to blame. !17088 (Hiroyuki Sato) +- Render whitespaces in code. !17244 (Mathieu Parent) +- Add an option to configure forking restriction. !17988 +- Add support for operator in filter bar. !19011 +- Add epics to project import/export. !19883 +- Load MR diff types lazily to reduce initial diff payload size. !19930 +- Metrics and network referee artifact types added to job artifact types. !20181 +- Auto stop environments after a certain period. !20372 +- Implement application appearance API endpoint. !20674 (Fabio Huser) +- Add build metadata to package API. !20682 +- Add support for Liquid format in Prometheus queries. !20793 +- Adds created_at object to package api response. !20816 +- Stage all changes by default in Web IDE. !21067 +- 25968-activity-filter-to-notes-api. !21159 (jhenkens) +- Improve error list UI on mobile viewports. !21192 +- New API endpoint GET /projects/:id/services. !21330 +- Add child and parent labels to pipelines. !21332 +- Add release count to project homepage. !21350 +- Add pipeline deletion button to pipeline details page. !21365 (Fabio Huser) +- Add support for Rust Cargo.toml dependency vizualisation and linking. !21374 (Fabio Huser) +- Expose issue link type in REST API. !21375 +- Implement customizable commit messages for applied suggested changes. !21411 (Fabio Huser) +- Add stacktrace to issue created from the sentry error detail page. !21438 +- add background migration for sha256 fingerprints of ssh keys. !21579 (Roger Meier) +- Add a cron job and worker to run the Container Expiration Policies. !21593 +- Add feature flag override toggle. !21598 +- Add 'resource_group' keyword to .gitlab-ci.yml for pipeline job concurrency limitation. !21617 +- Add full text search to pod logs. !21656 +- Add capability to disable issue auto-close feature per project. !21704 (Fabio Huser) +- Add API for getting sentry error tracking settings of a project. !21788 (raju249) +- Allow a pipeline (parent) to create a child pipeline as downstream pipeline within the same project. !21830 +- Add API support for retrieving merge requests deployed in a deployment. !21837 +- Add remaining project services to usage ping. !21843 +- Add ability to duplicate the common metrics dashboard. !21929 +- Custom snowplow events for monitoring alerts. !21963 +- Add enable_modsecurity setting to managed ingress. !21966 +- Add modsecurity_enabled setting to managed ingress. !21968 +- Allow admins to disable users ability to change profile name. !21987 +- Allow administrators to enforce access control for all pages web-sites. !22003 +- Setup storage for multiple milestones. !22043 +- Generate Prometheus sample metrics over pre-set intervals. !22066 +- Add tags to sentry detailed error response. !22068 +- Extend Design view sidebar with issue link and a list of participants. !22103 +- Add Gitlab version and revision to export. !22108 +- Add language and error urgency level for Sentry issue details page. !22122 +- Document MAVEN_CLI_OPTS defaults for maven project dependency scanning and update when the variable is used. !22126 +- Show sample metrics for an environment without prometheus configured. !22133 +- Download cross-project artifacts by using needs keyword in the CI file. !22161 +- Add GitLab commit to error detail endpoint. !22174 +- Container expiration policies can be updated with the project api. !22180 +- Allow CI_JOB_TOKENS for Conan package registry authentication. !22184 +- Add option to configure branches for which to send emails on push. !22196 +- Add a config for disabling CSS and jQuery animations. !22217 +- Add API for rollout Elasticsearch per plan level. !22240 +- Add retry logic for failures during import. !22265 +- Add migrations for version control snippets. !22275 +- Update tooltip content for deployment instances. !22289 (Rajendra Kadam) +- Cut and paste Markdown table from a spreadsheet. !22290 +- Add CI variable to provide GitLab base URL. !22327 (Aidin Abedi) +- Bump kubeclient version from 4.4.0 to 4.6.0. !22347 +- Accept `Envelope-To` as possible location for Service Desk key. !22354 (Max Winterstein) +- Added Conan installation instructions to Conan package details page. !22390 +- Add API endpoint for creating a Geo node. !22392 (Rajendra Kadam) +- Link to GitLab commit in Sentry error details page. !22431 +- Geo: Check current node in gitlab:geo:check Rake task. !22436 +- Add internal API to update Sentry error status. !22454 +- Add ability to ignore/resolve errors from error tracking detail page. !22475 +- Add informational message about page limits to environments dashboard. !22489 +- Add slug to services API response. !22518 +- Allow an upstream pipeline to create a downstream pipeline in the same project. !22663 +- Display SHA fingerprint for Deploy Keys and extend api to query those. !22665 (Roger Meier ) +- Add getDateInFuture util method. !22671 +- Detect go when doing dependency scanning. !22712 +- Fix aligment for icons on alerts. !22760 (Rajendra Kadam) +- Allow "skip_ci" flag to be passed to rebase operation. !22800 +- Add gitlab_commit_path to Sentry Error Details Response. !22803 +- Document go support for dependency scanning. !22806 +- Implement ability to ignore Sentry errrors from the list view. !22819 +- Add ability to create an issue in an epic. !22833 +- Drop support for ES5 add support for ES7. !22859 +- Add View Issue button to error tracking details page. !22862 +- Resolve Design View: Left/Right keyboard arrows through Designs. !22870 +- Add Org to the list of available markups for project wikis. !22898 (Alexander Oleynikov) +- Backend for allowing sample metrics to be toggled from ui. !22901 +- Display fn, line num and column in stacktrace entry caption. !22905 +- Get Project's environment names via GraphQL. !22932 +- Filter deployments using the environment & status. !22996 +- Assign labels to the GMA and project k8s namespaces. !23027 +- Expose mentions_disabled value via group API. !23070 (Fabio Huser) +- Bump cluster-applications image to v0.5.0 (Adds GitLab Runner support). !23110 +- Resolve Sentry errors from error tracking list. !23135 +- Expose `active` field in the Error Tracking API. !23150 +- Track deployed merge requests using GitLab environments and deployments. +- Enable the linking of merge requests to all non review app deployments. +- Add comment_on_event_enabled to services API. + +### Other (31 changes, 7 of them are from the community) + +- Migrate issue trackers data. !18639 +- refactor javascript to remove Immediately Invoked Function Expression from project file search. !19192 (Brian Luckenbill) +- Remove IIFEs from users_select.js. !19290 (minghuan lei) +- Remove milestone_id from epics. !20539 (Lee Tickett) +- Update d3 to 5.12. !20627 (Praveen Arimbrathodiyil) +- Add Ci Resource Group models. !20950 +- Display in MR if security report is outdated. !20954 +- Fix CI job's scroll down icon and update animation. !21442 +- Implement saving config content for pipelines in a new table 'ci_pipelines_config'. !21827 +- Display SSL limitations warning for project's pages under namespace that contains dot. !21874 +- Updated monaco-editor dependency. !21938 +- fix: EKS credentials form does not reset after error. !21958 +- Fix regex matching for gemnasium dependency scanning jobs. !22025 (Maximilian Stendler) +- User signout and admin mode disable use now POST instead of GET. !22113 (Diego Louzán) +- Update to clarify slightly misleading tool tip. !22222 +- Replace Font Awesome cog icon with GitLab settings icon. !22259 +- Drop redundant index on ci_pipelines.project_id. !22325 +- Display location in the Security Project Dashboard. !22376 +- Add structured logging for application logs. !22379 +- Remove ActiveRecord patch to ignore limit on text columns. !22406 +- Update Ruby to 2.6.5. !22417 +- Log database time in Sidekiq JSON logs. !22548 +- Update GitLab Runner Helm Chart to 0.12.0. !22566 +- Update project hooks limits to 100 for all plans. !22604 +- Update Gitaly to v1.80.0. !22654 +- Update GitLab's codeclimate to 0.85.6. !22659 (Takuya Noguchi) +- Updated no commit verbiage. !22765 +- Use IS08601.3 format for app level logging of timestamps. !22793 +- Upgrade octokit and its dependencies. !22946 +- Remove feature flag for import graceful failures. +- Update the Net-LDAP gem to 0.16.2. + ## 12.6.7 @@ -70,25 +960,6 @@ entry. - Fix private objects exposure when using Project Import functionality. -## 12.6.3 - -### Security (1 change) - -- Upgrade json-jwt to v1.11.0. !22440 - -### Fixed (9 changes) - -- Fix RefreshMergeRequestsService raises an exception and unnecessary sidekiq retry. !22262 -- Disable Prometheus metrics if initialization fails. !22355 -- Fix bug when trying to expose artifacts and no artifacts are produced by the job. !22378 -- Gracefully error handle CI lint errors in artifacts section. !22388 -- Fix GitLab plugins not working without hooks configured. !22409 -- Fix releases page when tag contains a slash. !22527 -- Reverts Add RBAC permissions for getting knative version. !22560 -- Remove unused keyword from EKS provision service. !22633 -- Fix CAS users being signed out repeatedly. !22704 - - ## 12.6.2 ### Security (6 changes) @@ -325,7 +1196,7 @@ entry. - Skip updating LFS objects in mirror updates if repository has not changed. !21744 - Add indexes on deployments to improve environments search. !21789 -### Added (117 changes, 16 of them are from the community) +### Added (119 changes, 18 of them are from the community) - Add upvote/downvotes attributes to GraphQL Epic query. !14311 - Delete kubernetes cluster association and resources. !16954 @@ -444,6 +1315,8 @@ entry. - Added migration which adds service desk username column. !21733 - Add SentryIssue table to store a link between issue and sentry issue. !37026 - Add path based targeting to broadcast messages. +- Add allow failure in pipeline webhook event. !20978 (Gaetan Semet) +- Add runner information in build web hook event. !20709 (Gaetan Semet) ### Other (51 changes, 28 of them are from the community) @@ -500,6 +1373,35 @@ entry. - Replace Font Awesome bullhorn icon with GitLab bullhorn icon. +## 12.5.8 + +### Security (19 changes, 1 of them is from the community) + +- Prevent gafana integration token from being displayed as a plain text to other project maintainers, by only displaying a masked version of it. +- Update rdoc to 6.1.2. +- Bump rubyzip to 2.0.0. (Utkarsh Gupta) +- Cleanup todos for users from a removed linked group. +- Disable access to last_pipeline in commits API for users without read permissions. +- Add constraint to group dependency proxy endpoint param. +- Limit number of AsciiDoc includes per document. +- Prevent API access for unconfirmed users. +- Enforce permission check when counting activity events. +- Update rack-cors to 1.0.6. +- Fix xss on frequent groups dropdown. +- Fix XSS vulnerability on custom project templates form. +- Protect internal CI builds from external overrides. +- ImportExport::ExportService to require admin_project permission. +- Make sure that only system notes where all references are visible to user are exposed in GraphQL API. +- Disable caching of repository/files/:file_path/raw API endpoint. +- Make cross-repository comparisons happen in the source repository. +- Update excon to 0.71.1 to fix CVE-2019-16779. +- Add workhorse request verification to package upload endpoints. + +### Changed (1 change, 1 of them is from the community) + +- Add template repository usage to the usage ping. !20126 (minghuan lei) + + ## 12.5.5 ### Security (1 change) @@ -570,7 +1472,7 @@ entry. - Do not display project labels that are not visible for user accessing group labels. - Standardize error response when route is missing. -### Fixed (99 changes, 14 of them are from the community) +### Fixed (100 changes, 15 of them are from the community) - Fix incorrect selection of custom templates. !17205 - Smaller width for design comments layout, truncate image title. !17547 @@ -671,6 +1573,7 @@ entry. - Only allow confirmed users to run pipelines. - Fix scroll to bottom with new job log. - Fixed protected branches flash styling. +- Show tag link whenever it's a tag in chat message integration for push events and pipeline events. !18126 (Mats Estensen) ### Deprecated (2 changes) @@ -901,6 +1804,13 @@ entry. - Change selects from default browser style to custom style. +## 12.4.8 + +### Security (1 change) + +- Fix private objects exposure when using Project Import functionality. + + ## 12.4.5 - No changes. diff --git a/GITALY_SERVER_VERSION b/GITALY_SERVER_VERSION index edbef70c29..51fbd82b8c 100644 --- a/GITALY_SERVER_VERSION +++ b/GITALY_SERVER_VERSION @@ -1 +1 @@ -12.6.8 +12.8.6 diff --git a/GITLAB_ELASTICSEARCH_INDEXER_VERSION b/GITLAB_ELASTICSEARCH_INDEXER_VERSION index bc80560fad..7ec1d6db40 100644 --- a/GITLAB_ELASTICSEARCH_INDEXER_VERSION +++ b/GITLAB_ELASTICSEARCH_INDEXER_VERSION @@ -1 +1 @@ -1.5.0 +2.1.0 diff --git a/GITLAB_PAGES_VERSION b/GITLAB_PAGES_VERSION index 0eed1a29ef..15b989e398 100644 --- a/GITLAB_PAGES_VERSION +++ b/GITLAB_PAGES_VERSION @@ -1 +1 @@ -1.12.0 +1.16.0 diff --git a/GITLAB_SHELL_VERSION b/GITLAB_SHELL_VERSION index 0719d81025..275283a18f 100644 --- a/GITLAB_SHELL_VERSION +++ b/GITLAB_SHELL_VERSION @@ -1 +1 @@ -10.3.0 +11.0.0 diff --git a/GITLAB_WORKHORSE_VERSION b/GITLAB_WORKHORSE_VERSION index ba624dacf9..72963fb08c 100644 --- a/GITLAB_WORKHORSE_VERSION +++ b/GITLAB_WORKHORSE_VERSION @@ -1 +1 @@ -8.20.0 +8.21.0 diff --git a/Gemfile b/Gemfile index 53606ace03..20c713e8c3 100644 --- a/Gemfile +++ b/Gemfile @@ -1,6 +1,6 @@ source 'https://rubygems.org' -gem 'rails', '5.2.3' +gem 'rails', '6.0.2' gem 'bootsnap', '~> 1.4' @@ -19,21 +19,21 @@ gem 'default_value_for', '~> 3.3.0' gem 'pg', '~> 1.1' gem 'rugged', '~> 0.28' -gem 'grape-path-helpers', '~> 1.1' +gem 'grape-path-helpers', '~> 1.2' gem 'faraday', '~> 0.12' gem 'marginalia', '~> 1.8.0' # Authentication libraries gem 'devise', '~> 4.6' -gem 'doorkeeper', '~> 4.3' -gem 'doorkeeper-openid_connect', '~> 1.5' +gem 'doorkeeper', '~> 5.0.2' +gem 'doorkeeper-openid_connect', '~> 1.6.3' gem 'omniauth', '~> 1.8' gem 'omniauth-auth0', '~> 2.0.0' gem 'omniauth-azure-oauth2', '~> 0.0.9' gem 'omniauth-cas3', '~> 1.1.4' gem 'omniauth-facebook', '~> 4.0.0' -gem 'omniauth-github', '~> 1.3' +gem 'omniauth-github', '~> 1.4' gem 'omniauth-gitlab', '~> 1.0.2' gem 'omniauth-google-oauth2', '~> 0.6.0' gem 'omniauth-kerberos', '~> 0.3.0', group: :kerberos @@ -67,7 +67,7 @@ gem 'u2f', '~> 0.2.1' gem 'validates_hostname', '~> 1.0.6' gem 'rubyzip', '~> 2.0.0', require: 'zip' # GitLab Pages letsencrypt support -gem 'acme-client', '~> 2.0.2' +gem 'acme-client', '~> 2.0.5' # Browser detection gem 'browser', '~> 2.5' @@ -84,10 +84,10 @@ gem 'net-ldap' # API gem 'grape', '~> 1.1.0' gem 'grape-entity', '~> 0.7.1' -gem 'rack-cors', '~> 1.0.0', require: 'rack/cors' +gem 'rack-cors', '~> 1.0.6', require: 'rack/cors' # GraphQL API -gem 'graphql', '~> 1.9.11' +gem 'graphql', '~> 1.9.12' # NOTE: graphiql-rails v1.5+ doesn't work: https://gitlab.com/gitlab-org/gitlab/issues/31771 # TODO: remove app/views/graphiql/rails/editors/show.html.erb when https://github.com/rmosolgo/graphiql-rails/pull/71 is released: # https://gitlab.com/gitlab-org/gitlab/issues/31747 @@ -129,15 +129,15 @@ gem 'unf', '~> 0.1.4' gem 'seed-fu', '~> 2.3.7' # Search -gem 'elasticsearch-model', '~> 0.1.9' -gem 'elasticsearch-rails', '~> 0.1.9', require: 'elasticsearch/rails/instrumentation' -gem 'elasticsearch-api', '5.0.3' +gem 'elasticsearch-model', '~> 6.1' +gem 'elasticsearch-rails', '~> 6.1', require: 'elasticsearch/rails/instrumentation' +gem 'elasticsearch-api', '~> 6.8' gem 'aws-sdk' gem 'faraday_middleware-aws-signers-v4' # Markdown and HTML processing gem 'html-pipeline', '~> 2.12' -gem 'deckar01-task_list', '2.2.1' +gem 'deckar01-task_list', '2.3.1' gem 'gitlab-markup', '~> 1.7.0' gem 'github-markup', '~> 1.7.0', require: 'github/markup' gem 'commonmarker', '~> 0.20' @@ -148,8 +148,8 @@ gem 'creole', '~> 0.5.0' gem 'wikicloth', '0.8.1' gem 'asciidoctor', '~> 2.0.10' gem 'asciidoctor-include-ext', '~> 0.3.1', require: false -gem 'asciidoctor-plantuml', '0.0.9' -gem 'rouge', '~> 3.11.0' +gem 'asciidoctor-plantuml', '0.0.10' +gem 'rouge', '~> 3.15.0' gem 'truncato', '~> 0.7.11' gem 'bootstrap_form', '~> 4.2.0' gem 'nokogiri', '~> 1.10.5' @@ -249,7 +249,7 @@ gem 'asana', '~> 0.9' gem 'ruby-fogbugz', '~> 0.2.1' # Kubernetes integration -gem 'kubeclient', '~> 4.4.0' +gem 'kubeclient', '~> 4.6.0' # Sanitize user input gem 'sanitize', '~> 4.6' @@ -283,7 +283,7 @@ gem 'rack-proxy', '~> 0.6.0' gem 'sassc-rails', '~> 2.1.0' gem 'uglifier', '~> 2.7.2' -gem 'addressable', '~> 2.5.2' +gem 'addressable', '~> 2.7' gem 'font-awesome-rails', '~> 4.7' gem 'gemojione', '~> 3.3' gem 'gon', '~> 6.2' @@ -301,11 +301,11 @@ gem 'sentry-raven', '~> 2.9' gem 'premailer-rails', '~> 1.10.3' # LabKit: Tracing and Correlation -gem 'gitlab-labkit', '~> 0.5' +gem 'gitlab-labkit', '0.9.1' # I18n gem 'ruby_parser', '~> 3.8', require: false -gem 'rails-i18n', '~> 5.1' +gem 'rails-i18n', '~> 6.0' gem 'gettext_i18n_rails', '~> 1.8.0' gem 'gettext_i18n_rails_js', '~> 1.3' gem 'gettext', '~> 3.2.2', require: false, group: :development @@ -349,7 +349,7 @@ end group :development, :test do gem 'bullet', '~> 6.0.2', require: !!ENV['ENABLE_BULLET'] gem 'pry-byebug', '~> 3.5.1', platform: :mri - gem 'pry-rails', '~> 0.3.4' + gem 'pry-rails', '~> 0.3.9' gem 'awesome_print', require: false @@ -366,11 +366,11 @@ group :development, :test do gem 'spring', '~> 2.0.0' gem 'spring-commands-rspec', '~> 1.0.4' - gem 'gitlab-styles', '~> 2.7', require: false + gem 'gitlab-styles', '~> 3.1.0', require: false # Pin these dependencies, otherwise a new rule could break the CI pipelines - gem 'rubocop', '~> 0.69.0' - gem 'rubocop-performance', '~> 1.1.0' - gem 'rubocop-rspec', '~> 1.22.1' + gem 'rubocop', '~> 0.74.0' + gem 'rubocop-performance', '~> 1.4.1' + gem 'rubocop-rspec', '~> 1.37.0' gem 'scss_lint', '~> 0.56.0', require: false gem 'haml_lint', '~> 0.34.0', require: false @@ -381,11 +381,13 @@ group :development, :test do gem 'knapsack', '~> 1.17' - gem 'stackprof', '~> 0.2.13', require: false - gem 'simple_po_parser', '~> 1.1.2', require: false gem 'timecop', '~> 0.8.0' + + gem 'png_quantizator', '~> 0.2.1', require: false + + gem 'parallel', '~> 1.19', require: false end # Gems required in omnibus-gitlab pipeline @@ -415,7 +417,7 @@ group :test do gem 'guard-rspec' end -gem 'octokit', '~> 4.9' +gem 'octokit', '~> 4.15' gem 'mail_room', '~> 0.10.0' @@ -423,6 +425,7 @@ gem 'email_reply_trimmer', '~> 0.1' gem 'html2text' gem 'ruby-prof', '~> 1.0.0' +gem 'stackprof', '~> 0.2.15', require: false gem 'rbtrace', '~> 0.4', require: false gem 'memory_profiler', '~> 0.9', require: false gem 'benchmark-memory', '~> 0.1', require: false @@ -452,13 +455,13 @@ group :ed25519 do end # Gitaly GRPC protocol definitions -gem 'gitaly', '~> 1.73.0' +gem 'gitaly', '~> 1.86.0' gem 'grpc', '~> 1.24.0' gem 'google-protobuf', '~> 3.8.0' -gem 'toml-rb', '~> 1.0.0', require: false +gem 'toml-rb', '~> 1.0.0' # Feature toggles gem 'flipper', '~> 0.17.1' @@ -477,3 +480,15 @@ gem 'gitlab-net-dns', '~> 0.9.1' gem 'countries', '~> 3.0' gem 'retriable', '~> 3.1.2' + +gem 'liquid', '~> 4.0' + +# LRU cache +gem 'lru_redux' + +gem 'erubi', '~> 1.9.0' + +# Locked as long as quoted-printable encoding issues are not resolved +# Monkey-patched in `config/initializers/mail_encoding_patch.rb` +# See https://gitlab.com/gitlab-org/gitlab/issues/197386 +gem 'mail', '= 2.7.1' diff --git a/Gemfile.lock b/Gemfile.lock index f510788f1f..aa33bd4cd6 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -4,65 +4,78 @@ GEM RedCloth (4.3.2) abstract_type (0.0.7) ace-rails-ap (4.1.2) - acme-client (2.0.2) + acme-client (2.0.5) faraday (~> 0.9, >= 0.9.1) - actioncable (5.2.3) - actionpack (= 5.2.3) + actioncable (6.0.2) + actionpack (= 6.0.2) nio4r (~> 2.0) websocket-driver (>= 0.6.1) - actionmailer (5.2.3) - actionpack (= 5.2.3) - actionview (= 5.2.3) - activejob (= 5.2.3) + actionmailbox (6.0.2) + actionpack (= 6.0.2) + activejob (= 6.0.2) + activerecord (= 6.0.2) + activestorage (= 6.0.2) + activesupport (= 6.0.2) + mail (>= 2.7.1) + actionmailer (6.0.2) + actionpack (= 6.0.2) + actionview (= 6.0.2) + activejob (= 6.0.2) mail (~> 2.5, >= 2.5.4) rails-dom-testing (~> 2.0) - actionpack (5.2.3) - actionview (= 5.2.3) - activesupport (= 5.2.3) + actionpack (6.0.2) + actionview (= 6.0.2) + activesupport (= 6.0.2) rack (~> 2.0) rack-test (>= 0.6.3) rails-dom-testing (~> 2.0) - rails-html-sanitizer (~> 1.0, >= 1.0.2) - actionview (5.2.3) - activesupport (= 5.2.3) + rails-html-sanitizer (~> 1.0, >= 1.2.0) + actiontext (6.0.2) + actionpack (= 6.0.2) + activerecord (= 6.0.2) + activestorage (= 6.0.2) + activesupport (= 6.0.2) + nokogiri (>= 1.8.5) + actionview (6.0.2) + activesupport (= 6.0.2) builder (~> 3.1) erubi (~> 1.4) rails-dom-testing (~> 2.0) - rails-html-sanitizer (~> 1.0, >= 1.0.3) - activejob (5.2.3) - activesupport (= 5.2.3) + rails-html-sanitizer (~> 1.1, >= 1.2.0) + activejob (6.0.2) + activesupport (= 6.0.2) globalid (>= 0.3.6) - activemodel (5.2.3) - activesupport (= 5.2.3) - activerecord (5.2.3) - activemodel (= 5.2.3) - activesupport (= 5.2.3) - arel (>= 9.0) + activemodel (6.0.2) + activesupport (= 6.0.2) + activerecord (6.0.2) + activemodel (= 6.0.2) + activesupport (= 6.0.2) activerecord-explain-analyze (0.1.0) activerecord (>= 4) pg - activestorage (5.2.3) - actionpack (= 5.2.3) - activerecord (= 5.2.3) + activestorage (6.0.2) + actionpack (= 6.0.2) + activejob (= 6.0.2) + activerecord (= 6.0.2) marcel (~> 0.3.1) - activesupport (5.2.3) + activesupport (6.0.2) concurrent-ruby (~> 1.0, >= 1.0.2) i18n (>= 0.7, < 2) minitest (~> 5.1) tzinfo (~> 1.1) + zeitwerk (~> 2.2) acts-as-taggable-on (6.5.0) activerecord (>= 5.0, < 6.1) adamantium (0.2.0) ice_nine (~> 0.11.0) memoizable (~> 0.4.0) - addressable (2.5.2) - public_suffix (>= 2.0.2, < 4.0) + addressable (2.7.0) + public_suffix (>= 2.0.2, < 5.0) aes_key_wrap (1.0.1) akismet (3.0.0) apollo_upload_server (2.0.0.beta.3) graphql (>= 1.8) rails (>= 4.2) - arel (9.0.0) asana (0.9.3) faraday (~> 0.9) faraday_middleware (~> 0.9) @@ -71,7 +84,7 @@ GEM asciidoctor (2.0.10) asciidoctor-include-ext (0.3.1) asciidoctor (>= 1.5.6, < 3.0.0) - asciidoctor-plantuml (0.0.9) + asciidoctor-plantuml (0.0.10) asciidoctor (>= 1.5.6, < 3.0.0) ast (2.4.0) atlassian-jwt (0.2.0) @@ -117,7 +130,7 @@ GEM activemodel (>= 5.0) brakeman (4.2.1) browser (2.5.3) - builder (3.2.3) + builder (3.2.4) bullet (6.0.2) activesupport (>= 3.0.0) uniform_notifier (~> 1.11) @@ -171,7 +184,7 @@ GEM unicode_utils (~> 1.4) crack (0.4.3) safe_yaml (~> 1.0.0) - crass (1.0.5) + crass (1.0.6) creole (0.5.0) css_parser (1.7.0) addressable @@ -192,19 +205,20 @@ GEM database_cleaner (1.7.0) debug_inspector (0.0.3) debugger-ruby_core_source (1.3.8) - deckar01-task_list (2.2.1) + deckar01-task_list (2.3.1) html-pipeline declarative (0.0.10) declarative-option (0.1.0) default_value_for (3.3.0) activerecord (>= 3.2.0, < 6.1) - derailed_benchmarks (1.3.5) + derailed_benchmarks (1.4.2) benchmark-ips (~> 2) get_process_mem (~> 0) heapy (~> 0) memory_profiler (~> 0) rack (>= 1) - rake (> 10, < 13) + rake (> 10, < 14) + ruby-statistics (>= 2.1) thor (~> 0.19) descendants_tracker (0.0.4) thread_safe (~> 0.3, >= 0.3.1) @@ -229,23 +243,23 @@ GEM docile (1.3.1) domain_name (0.5.20180417) unf (>= 0.0.5, < 1.0.0) - doorkeeper (4.3.2) + doorkeeper (5.0.2) railties (>= 4.2) - doorkeeper-openid_connect (1.5.0) - doorkeeper (~> 4.3) + doorkeeper-openid_connect (1.6.3) + doorkeeper (>= 5.0, < 5.2) json-jwt (~> 1.6) ed25519 (1.2.4) - elasticsearch (5.0.3) - elasticsearch-api (= 5.0.3) - elasticsearch-transport (= 5.0.3) - elasticsearch-api (5.0.3) + elasticsearch (6.8.0) + elasticsearch-api (= 6.8.0) + elasticsearch-transport (= 6.8.0) + elasticsearch-api (6.8.0) multi_json - elasticsearch-model (0.1.9) + elasticsearch-model (6.1.0) activesupport (> 3) - elasticsearch (> 0.4) + elasticsearch (> 1) hashie - elasticsearch-rails (0.1.9) - elasticsearch-transport (5.0.3) + elasticsearch-rails (6.1.0) + elasticsearch-transport (6.8.0) faraday multi_json email_reply_trimmer (0.1.6) @@ -270,7 +284,7 @@ GEM factory_bot_rails (5.1.0) factory_bot (~> 5.1.0) railties (>= 4.2.0) - faraday (0.12.2) + faraday (0.15.4) multipart-post (>= 1.2, < 3) faraday-http-cache (2.0.0) faraday (~> 0.8) @@ -286,6 +300,9 @@ GEM fast_gettext (1.6.0) ffaker (2.10.0) ffi (1.11.3) + ffi-compiler (1.0.1) + ffi (>= 1.0.0) + rake flipper (0.17.1) flipper-active_record (0.17.1) activerecord (>= 4.2, < 7) @@ -345,7 +362,8 @@ GEM gemoji (3.0.1) gemojione (3.3.0) json - get_process_mem (0.2.3) + get_process_mem (0.2.5) + ffi (~> 1.0) gettext (3.2.9) locale (>= 2.0.5) text (>= 1.3.0) @@ -357,12 +375,12 @@ GEM po_to_json (>= 1.0.0) rails (>= 3.2.0) git (1.5.0) - gitaly (1.73.0) + gitaly (1.86.0) grpc (~> 1.0) github-markup (1.7.0) gitlab-chronic (0.10.5) numerizer (~> 0.2) - gitlab-labkit (0.7.0) + gitlab-labkit (0.9.1) actionpack (>= 5.0.0, < 6.1.0) activesupport (>= 5.0.0, < 6.1.0) grpc (~> 1.19) @@ -379,11 +397,12 @@ GEM gitlab-puma (>= 2.7, < 5) gitlab-sidekiq-fetcher (0.5.2) sidekiq (~> 5) - gitlab-styles (2.8.0) - rubocop (~> 0.69.0) + gitlab-styles (3.1.0) + rubocop (~> 0.74.0) rubocop-gitlab-security (~> 0.1.0) - rubocop-performance (~> 1.1.0) - rubocop-rspec (~> 1.19) + rubocop-performance (~> 1.4.1) + rubocop-rails (~> 2.0) + rubocop-rspec (~> 1.36) gitlab_chronic_duration (0.10.6.2) numerizer (~> 0.2) gitlab_omniauth-ldap (2.1.1) @@ -426,16 +445,17 @@ GEM grape-entity (0.7.1) activesupport (>= 4.0) multi_json (>= 1.3.2) - grape-path-helpers (1.1.0) + grape-path-helpers (1.2.0) activesupport grape (~> 1.0) rake (~> 12) - grape_logging (1.7.0) + grape_logging (1.8.3) grape + rack graphiql-rails (1.4.10) railties sprockets-rails - graphql (1.9.11) + graphql (1.9.12) graphql-docs (1.6.0) commonmarker (~> 0.16) escape_utils (~> 1.2) @@ -477,7 +497,7 @@ GEM tilt hangouts-chat (0.0.5) hashdiff (0.3.8) - hashie (3.5.7) + hashie (3.6.0) hashie-forbidden_attributes (0.1.1) hashie (>= 3.0) health_check (2.6.0) @@ -492,20 +512,21 @@ GEM html2text (0.2.0) nokogiri (~> 1.6) htmlentities (4.3.4) - http (3.3.0) + http (4.2.0) addressable (~> 2.3) http-cookie (~> 1.0) http-form_data (~> 2.0) - http_parser.rb (~> 0.6.0) + http-parser (~> 1.2.0) http-cookie (1.0.3) domain_name (~> 0.5) http-form_data (2.1.1) - http_parser.rb (0.6.0) + http-parser (1.2.1) + ffi-compiler (>= 1.0, < 2.0) httparty (0.16.4) mime-types (~> 3.0) multi_xml (>= 0.5.2) httpclient (2.8.3) - i18n (1.7.0) + i18n (1.8.2) concurrent-ruby (~> 1.0) i18n_data (0.8.0) icalendar (2.4.1) @@ -519,7 +540,7 @@ GEM jaeger-client (0.10.0) opentracing (~> 0.3) thrift - jaro_winkler (1.5.3) + jaro_winkler (1.5.4) jira-ruby (1.7.1) activesupport atlassian-jwt @@ -556,8 +577,8 @@ GEM kramdown (2.1.0) kramdown-parser-gfm (1.1.0) kramdown (~> 2.0) - kubeclient (4.4.0) - http (~> 3.0) + kubeclient (4.6.0) + http (>= 3.0, < 5.0) recursive-open-struct (~> 1.0, >= 1.0.4) rest-client (~> 2.0) launchy (2.4.3) @@ -577,6 +598,7 @@ GEM xml-simple licensee (8.9.2) rugged (~> 0.24) + liquid (4.0.3) listen (3.1.5) rb-fsevent (~> 0.9, >= 0.9.4) rb-inotify (~> 0.9, >= 0.9.7) @@ -587,9 +609,10 @@ GEM activesupport (>= 4) railties (>= 4) request_store (~> 1.0) - loofah (2.3.1) + loofah (2.4.0) crass (~> 1.0.2) nokogiri (>= 1.5.9) + lru_redux (1.1.0) lumberjack (1.0.13) mail (2.7.1) mini_mime (>= 0.1.1) @@ -602,20 +625,20 @@ GEM memoist (0.16.0) memoizable (0.4.2) thread_safe (~> 0.3, >= 0.3.1) - memory_profiler (0.9.13) + memory_profiler (0.9.14) method_source (0.9.2) mime-types (3.2.2) mime-types-data (~> 3.2015) mime-types-data (3.2019.0331) - mimemagic (0.3.2) + mimemagic (0.3.3) mini_magick (4.9.5) mini_mime (1.0.2) mini_portile2 (2.4.0) minitest (5.11.3) msgpack (1.3.1) - multi_json (1.13.1) + multi_json (1.14.1) multi_xml (0.6.0) - multipart-post (2.0.0) + multipart-post (2.1.1) murmurhash3 (0.1.6) mustermann (1.0.3) mustermann-grape (1.0.0) @@ -623,13 +646,13 @@ GEM nakayoshi_fork (0.0.4) nap (1.1.0) nenv (0.3.0) - net-ldap (0.16.0) + net-ldap (0.16.2) net-ntp (2.1.3) net-ssh (5.2.0) netrc (0.11.0) nio4r (2.5.2) no_proxy_fix (0.1.2) - nokogiri (1.10.5) + nokogiri (1.10.7) mini_portile2 (~> 2.4.0) nokogumbo (1.5.0) nokogiri @@ -644,7 +667,8 @@ GEM multi_json (~> 1.3) multi_xml (~> 0.5) rack (>= 1.2, < 3) - octokit (4.9.0) + octokit (4.15.0) + faraday (>= 0.9) sawyer (~> 0.8.0, >= 0.5.3) omniauth (1.9.0) hashie (>= 3.4.6, < 3.7.0) @@ -664,7 +688,7 @@ GEM omniauth (~> 1.2) omniauth-facebook (4.0.0) omniauth-oauth2 (~> 1.2) - omniauth-github (1.3.0) + omniauth-github (1.4.0) omniauth (~> 1.5) omniauth-oauth2 (>= 1.4.0, < 2.0) omniauth-gitlab (1.0.3) @@ -725,13 +749,14 @@ GEM rubypants (~> 0.2) orm_adapter (0.5.0) os (1.0.0) - parallel (1.17.0) - parser (2.6.3.0) + parallel (1.19.1) + parser (2.6.5.0) ast (~> 2.4.0) parslet (1.8.2) peek (1.1.0) railties (>= 4.0.0) - pg (1.1.4) + pg (1.2.2) + png_quantizator (0.2.1) po_to_json (1.0.1) json (>= 1.6.0) premailer (1.11.1) @@ -753,9 +778,9 @@ GEM pry-byebug (3.5.1) byebug (~> 9.1) pry (~> 0.10) - pry-rails (0.3.6) + pry-rails (0.3.9) pry (>= 0.10.4) - public_suffix (3.1.1) + public_suffix (4.0.3) pyu-ruby-sasl (0.0.3.3) raabro (1.1.6) rack (2.0.7) @@ -778,18 +803,20 @@ GEM rack-test (1.1.0) rack (>= 1.0, < 3) rack-timeout (0.5.1) - rails (5.2.3) - actioncable (= 5.2.3) - actionmailer (= 5.2.3) - actionpack (= 5.2.3) - actionview (= 5.2.3) - activejob (= 5.2.3) - activemodel (= 5.2.3) - activerecord (= 5.2.3) - activestorage (= 5.2.3) - activesupport (= 5.2.3) + rails (6.0.2) + actioncable (= 6.0.2) + actionmailbox (= 6.0.2) + actionmailer (= 6.0.2) + actionpack (= 6.0.2) + actiontext (= 6.0.2) + actionview (= 6.0.2) + activejob (= 6.0.2) + activemodel (= 6.0.2) + activerecord (= 6.0.2) + activestorage (= 6.0.2) + activesupport (= 6.0.2) bundler (>= 1.3.0) - railties (= 5.2.3) + railties (= 6.0.2) sprockets-rails (>= 2.0.0) rails-controller-testing (1.0.4) actionpack (>= 5.0.1.x) @@ -800,15 +827,15 @@ GEM nokogiri (>= 1.6) rails-html-sanitizer (1.3.0) loofah (~> 2.3) - rails-i18n (5.1.1) + rails-i18n (6.0.0) i18n (>= 0.7, < 2) - railties (>= 5.0, < 6) - railties (5.2.3) - actionpack (= 5.2.3) - activesupport (= 5.2.3) + railties (>= 6.0.0, < 7) + railties (6.0.2) + actionpack (= 6.0.2) + activesupport (= 6.0.2) method_source rake (>= 0.8.7) - thor (>= 0.19.0, < 2.0) + thor (>= 0.20.3, < 2.0) rainbow (3.0.0) raindrops (0.19.0) rake (12.3.3) @@ -862,7 +889,7 @@ GEM retriable (3.1.2) rinku (2.0.0) rotp (2.1.2) - rouge (3.11.0) + rouge (3.15.0) rqrcode (0.7.0) chunky_png rqrcode-rails3 (0.1.7) @@ -904,7 +931,7 @@ GEM pg rails sqlite3 - rubocop (0.69.0) + rubocop (0.74.0) jaro_winkler (~> 1.5.1) parallel (~> 1.10) parser (>= 2.6) @@ -913,10 +940,13 @@ GEM unicode-display_width (>= 1.4.0, < 1.7) rubocop-gitlab-security (0.1.1) rubocop (>= 0.51) - rubocop-performance (1.1.0) - rubocop (>= 0.67.0) - rubocop-rspec (1.22.2) - rubocop (>= 0.52.1) + rubocop-performance (1.4.1) + rubocop (>= 0.71.0) + rubocop-rails (2.4.0) + rack (>= 1.1) + rubocop (>= 0.72.0) + rubocop-rspec (1.37.0) + rubocop (>= 0.68.1) ruby-enum (0.7.2) i18n ruby-fogbugz (0.2.1) @@ -925,6 +955,7 @@ GEM ruby-progressbar (1.10.1) ruby-saml (1.7.2) nokogiri (>= 1.5.10) + ruby-statistics (2.1.1) ruby_dep (1.5.0) ruby_parser (3.13.1) sexp_processor (~> 4.9) @@ -951,9 +982,9 @@ GEM sprockets (> 3.0) sprockets-rails tilt - sawyer (0.8.1) - addressable (>= 2.3.5, < 2.6) - faraday (~> 0.8, < 1.0) + sawyer (0.8.2) + addressable (>= 2.3.5) + faraday (> 0.8, < 2.0) scss_lint (0.56.0) rake (>= 0.9, < 13) sass (~> 3.5.3) @@ -1006,7 +1037,7 @@ GEM sprockets (>= 3.0.0) sqlite3 (1.3.13) sshkey (2.0.0) - stackprof (0.2.13) + stackprof (0.2.15) state_machines (0.5.0) state_machines-activemodel (0.7.1) activemodel (>= 4.1) @@ -1043,7 +1074,7 @@ GEM truncato (0.7.11) htmlentities (~> 4.3.1) nokogiri (>= 1.7.0, <= 2.0) - tzinfo (1.2.5) + tzinfo (1.2.6) thread_safe (~> 0.1) u2f (0.2.1) uber (0.1.0) @@ -1099,9 +1130,9 @@ GEM hashdiff webpack-rails (0.9.11) railties (>= 3.2.0) - websocket-driver (0.7.0) + websocket-driver (0.7.1) websocket-extensions (>= 0.1.0) - websocket-extensions (0.1.3) + websocket-extensions (0.1.4) wikicloth (0.8.1) builder expression_parser @@ -1110,6 +1141,7 @@ GEM xml-simple (1.1.5) xpath (3.2.0) nokogiri (~> 1.8) + zeitwerk (2.2.2) PLATFORMS ruby @@ -1117,16 +1149,16 @@ PLATFORMS DEPENDENCIES RedCloth (~> 4.3.2) ace-rails-ap (~> 4.1.0) - acme-client (~> 2.0.2) + acme-client (~> 2.0.5) activerecord-explain-analyze (~> 0.1) acts-as-taggable-on (~> 6.0) - addressable (~> 2.5.2) + addressable (~> 2.7) akismet (~> 3.0) apollo_upload_server (~> 2.0.0.beta3) asana (~> 0.9) asciidoctor (~> 2.0.10) asciidoctor-include-ext (~> 0.3.1) - asciidoctor-plantuml (= 0.0.9) + asciidoctor-plantuml (= 0.0.10) atlassian-jwt (~> 0.2.0) attr_encrypted (~> 3.1.0) awesome_print @@ -1156,7 +1188,7 @@ DEPENDENCIES creole (~> 0.5.0) danger (~> 6.0) database_cleaner (~> 1.7.0) - deckar01-task_list (= 2.2.1) + deckar01-task_list (= 2.3.1) default_value_for (~> 3.3.0) derailed_benchmarks device_detector @@ -1165,14 +1197,15 @@ DEPENDENCIES diff_match_patch (~> 0.1.0) diffy (~> 3.1.0) discordrb-webhooks-blackst0ne (~> 3.3) - doorkeeper (~> 4.3) - doorkeeper-openid_connect (~> 1.5) + doorkeeper (~> 5.0.2) + doorkeeper-openid_connect (~> 1.6.3) ed25519 (~> 1.2) - elasticsearch-api (= 5.0.3) - elasticsearch-model (~> 0.1.9) - elasticsearch-rails (~> 0.1.9) + elasticsearch-api (~> 6.8) + elasticsearch-model (~> 6.1) + elasticsearch-rails (~> 6.1) email_reply_trimmer (~> 0.1) email_spec (~> 2.2.0) + erubi (~> 1.9.0) escape_utils (~> 1.1) factory_bot_rails (~> 5.1.0) faraday (~> 0.12) @@ -1197,17 +1230,17 @@ DEPENDENCIES gettext (~> 3.2.2) gettext_i18n_rails (~> 1.8.0) gettext_i18n_rails_js (~> 1.3) - gitaly (~> 1.73.0) + gitaly (~> 1.86.0) github-markup (~> 1.7.0) gitlab-chronic (~> 0.10.5) - gitlab-labkit (~> 0.5) + gitlab-labkit (= 0.9.1) gitlab-license (~> 1.0) gitlab-markup (~> 1.7.0) gitlab-net-dns (~> 0.9.1) gitlab-puma (~> 4.3.1.gitlab.2) gitlab-puma_worker_killer (~> 0.1.1.gitlab.1) gitlab-sidekiq-fetcher (= 0.5.2) - gitlab-styles (~> 2.7) + gitlab-styles (~> 3.1.0) gitlab_chronic_duration (~> 0.10.6.2) gitlab_omniauth-ldap (~> 2.1.1) gon (~> 6.2) @@ -1216,10 +1249,10 @@ DEPENDENCIES gpgme (~> 2.0.19) grape (~> 1.1.0) grape-entity (~> 0.7.1) - grape-path-helpers (~> 1.1) + grape-path-helpers (~> 1.2) grape_logging (~> 1.7) graphiql-rails (~> 1.4.10) - graphql (~> 1.9.11) + graphql (~> 1.9.12) graphql-docs (~> 1.6.0) grpc (~> 1.24.0) gssapi @@ -1242,12 +1275,15 @@ DEPENDENCIES jwt (~> 2.1.0) kaminari (~> 1.0) knapsack (~> 1.17) - kubeclient (~> 4.4.0) + kubeclient (~> 4.6.0) letter_opener_web (~> 1.3.4) license_finder (~> 5.4) licensee (~> 8.9) + liquid (~> 4.0) lograge (~> 0.5) loofah (~> 2.2) + lru_redux + mail (= 2.7.1) mail_room (~> 0.10.0) marginalia (~> 1.8.0) memory_profiler (~> 0.9) @@ -1261,14 +1297,14 @@ DEPENDENCIES net-ssh (~> 5.2) nokogiri (~> 1.10.5) oauth2 (~> 1.4) - octokit (~> 4.9) + octokit (~> 4.15) omniauth (~> 1.8) omniauth-auth0 (~> 2.0.0) omniauth-authentiq (~> 0.3.3) omniauth-azure-oauth2 (~> 0.0.9) omniauth-cas3 (~> 1.1.4) omniauth-facebook (~> 4.0.0) - omniauth-github (~> 1.3) + omniauth-github (~> 1.4) omniauth-gitlab (~> 1.0.2) omniauth-google-oauth2 (~> 0.6.0) omniauth-kerberos (~> 0.3.0) @@ -1281,21 +1317,23 @@ DEPENDENCIES omniauth_crowd (~> 2.2.0) omniauth_openid_connect (~> 0.3.3) org-ruby (~> 0.9.12) + parallel (~> 1.19) peek (~> 1.1) pg (~> 1.1) + png_quantizator (~> 0.2.1) premailer-rails (~> 1.10.3) prometheus-client-mmap (~> 0.10.0) pry-byebug (~> 3.5.1) - pry-rails (~> 0.3.4) + pry-rails (~> 0.3.9) rack (~> 2.0.7) rack-attack (~> 6.2.0) - rack-cors (~> 1.0.0) + rack-cors (~> 1.0.6) rack-oauth2 (~> 1.9.3) rack-proxy (~> 0.6.0) rack-timeout - rails (= 5.2.3) + rails (= 6.0.2) rails-controller-testing - rails-i18n (~> 5.1) + rails-i18n (~> 6.0) rainbow (~> 3.0) raindrops (~> 0.18) rblineprof (~> 0.3.6) @@ -1309,7 +1347,7 @@ DEPENDENCIES request_store (~> 1.3) responders (~> 3.0) retriable (~> 3.1.2) - rouge (~> 3.11.0) + rouge (~> 3.15.0) rqrcode-rails3 (~> 0.1.7) rspec-parameterized rspec-rails (~> 4.0.0.beta3) @@ -1317,9 +1355,9 @@ DEPENDENCIES rspec-set (~> 0.1.3) rspec_junit_formatter rspec_profiling (~> 0.0.5) - rubocop (~> 0.69.0) - rubocop-performance (~> 1.1.0) - rubocop-rspec (~> 1.22.1) + rubocop (~> 0.74.0) + rubocop-performance (~> 1.4.1) + rubocop-rspec (~> 1.37.0) ruby-fogbugz (~> 0.2.1) ruby-prof (~> 1.0.0) ruby-progressbar @@ -1344,7 +1382,7 @@ DEPENDENCIES spring-commands-rspec (~> 1.0.4) sprockets (~> 3.7.0) sshkey (~> 2.0) - stackprof (~> 0.2.13) + stackprof (~> 0.2.15) state_machines-activerecord (~> 0.6.0) sys-filesystem (~> 1.1.6) test-prof (~> 0.10.0) diff --git a/Guardfile b/Guardfile index 8a43f414ca..21ee2a9d61 100644 --- a/Guardfile +++ b/Guardfile @@ -2,7 +2,7 @@ # More info at https://github.com/guard/guard#readme -cmd = ENV['SPRING'] ? 'spring rspec' : 'bundle exec rspec' +cmd = ENV['GUARD_CMD'] || (ENV['SPRING'] ? 'spring rspec' : 'bundle exec rspec') guard :rspec, cmd: cmd do require "guard/rspec/dsl" diff --git a/README.md b/README.md index 95a2192a37..1372e47d52 100644 --- a/README.md +++ b/README.md @@ -79,12 +79,12 @@ Instructions on how to start GitLab and how to run the tests can be found in the GitLab is a Ruby on Rails application that runs on the following software: - Ubuntu/Debian/CentOS/RHEL/OpenSUSE -- Ruby (MRI) 2.6.3 +- Ruby (MRI) 2.6.5 - Git 2.8.4+ - Redis 2.8+ -- PostgreSQL (preferred) or MySQL +- PostgreSQL 9.6+ -For more information please see the [architecture documentation](https://docs.gitlab.com/ce/development/architecture.html). +For more information please see the [architecture](https://docs.gitlab.com/ee/development/architecture.html) and [requirements](https://docs.gitlab.com/ee/install/requirements.html) documentation. ## UX design diff --git a/VERSION b/VERSION index edbef70c29..51fbd82b8c 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -12.6.8 +12.8.6 diff --git a/app/assets/images/ext_snippet_icons/ext_snippet_icons.png b/app/assets/images/ext_snippet_icons/ext_snippet_icons.png index 20380adc4e..c864e558bf 100644 Binary files a/app/assets/images/ext_snippet_icons/ext_snippet_icons.png and b/app/assets/images/ext_snippet_icons/ext_snippet_icons.png differ diff --git a/app/assets/images/ext_snippet_icons/logo.png b/app/assets/images/ext_snippet_icons/logo.png deleted file mode 100644 index 794c9cc2db..0000000000 Binary files a/app/assets/images/ext_snippet_icons/logo.png and /dev/null differ diff --git a/app/assets/images/ext_snippet_icons/logo.svg b/app/assets/images/ext_snippet_icons/logo.svg new file mode 100644 index 0000000000..9cb3042213 --- /dev/null +++ b/app/assets/images/ext_snippet_icons/logo.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/app/assets/javascripts/alerts_service_settings/components/alerts_service_form.vue b/app/assets/javascripts/alerts_service_settings/components/alerts_service_form.vue new file mode 100644 index 0000000000..5e16f6f387 --- /dev/null +++ b/app/assets/javascripts/alerts_service_settings/components/alerts_service_form.vue @@ -0,0 +1,168 @@ + + + diff --git a/app/assets/javascripts/alerts_service_settings/index.js b/app/assets/javascripts/alerts_service_settings/index.js new file mode 100644 index 0000000000..d49725c6a4 --- /dev/null +++ b/app/assets/javascripts/alerts_service_settings/index.js @@ -0,0 +1,27 @@ +import Vue from 'vue'; +import { parseBoolean } from '~/lib/utils/common_utils'; +import AlertsServiceForm from './components/alerts_service_form.vue'; + +export default el => { + if (!el) { + return null; + } + + const { activated: activatedStr, formPath, authorizationKey, url, learnMoreUrl } = el.dataset; + const activated = parseBoolean(activatedStr); + + return new Vue({ + el, + render(createElement) { + return createElement(AlertsServiceForm, { + props: { + initialActivated: activated, + formPath, + learnMoreUrl, + initialAuthorizationKey: authorizationKey, + url, + }, + }); + }, + }); +}; diff --git a/app/assets/javascripts/api.js b/app/assets/javascripts/api.js index 071ae8ca8c..4dc4ce543e 100644 --- a/app/assets/javascripts/api.js +++ b/app/assets/javascripts/api.js @@ -24,6 +24,7 @@ const Api = { projectMergeRequestChangesPath: '/api/:version/projects/:id/merge_requests/:mrid/changes', projectMergeRequestVersionsPath: '/api/:version/projects/:id/merge_requests/:mrid/versions', projectRunnersPath: '/api/:version/projects/:id/runners', + projectProtectedBranchesPath: '/api/:version/projects/:id/protected_branches', mergeRequestsPath: '/api/:version/merge_requests', groupLabelsPath: '/groups/:namespace_path/-/labels', issuableTemplatePath: '/:namespace_path/:project_path/templates/:type/:key', @@ -44,6 +45,8 @@ const Api = { releasePath: '/api/:version/projects/:id/releases/:tag_name', mergeRequestsPipeline: '/api/:version/projects/:id/merge_requests/:merge_request_iid/pipelines', adminStatisticsPath: '/api/:version/application/statistics', + pipelineSinglePath: '/api/:version/projects/:id/pipelines/:pipeline_id', + lsifPath: '/api/:version/projects/:id/commits/:commit_id/lsif/info', group(groupId, callback) { const url = Api.buildUrl(Api.groupPath).replace(':id', groupId); @@ -54,10 +57,15 @@ const Api = { }); }, - groupMembers(id) { + groupMembers(id, options) { const url = Api.buildUrl(this.groupMembersPath).replace(':id', encodeURIComponent(id)); - return axios.get(url); + return axios.get(url, { + params: { + per_page: DEFAULT_PER_PAGE, + ...options, + }, + }); }, // Return groups list. Filtered by query @@ -142,6 +150,12 @@ const Api = { return axios.get(url); }, + // Update a single project + updateProject(projectPath, data) { + const url = Api.buildUrl(Api.projectPath).replace(':id', encodeURIComponent(projectPath)); + return axios.put(url, data); + }, + /** * Get all projects for a forked relationship to a specified project * @param {string} projectPath - Path or ID of a project @@ -207,6 +221,22 @@ const Api = { return axios.get(url, config); }, + projectProtectedBranches(id, query = '') { + const url = Api.buildUrl(Api.projectProtectedBranchesPath).replace( + ':id', + encodeURIComponent(id), + ); + + return axios + .get(url, { + params: { + search: query, + per_page: DEFAULT_PER_PAGE, + }, + }) + .then(({ data }) => data); + }, + mergeRequests(params = {}) { const url = Api.buildUrl(Api.mergeRequestsPath); @@ -437,6 +467,22 @@ const Api = { return axios.get(url); }, + pipelineSingle(id, pipelineId) { + const url = Api.buildUrl(this.pipelineSinglePath) + .replace(':id', encodeURIComponent(id)) + .replace(':pipeline_id', encodeURIComponent(pipelineId)); + + return axios.get(url); + }, + + lsifData(projectPath, commitId, path) { + const url = Api.buildUrl(this.lsifPath) + .replace(':id', encodeURIComponent(projectPath)) + .replace(':commit_id', commitId); + + return axios.get(url, { params: { path } }); + }, + buildUrl(url) { return joinPaths(gon.relative_url_root || '', url.replace(':version', gon.api_version)); }, diff --git a/app/assets/javascripts/awards_handler.js b/app/assets/javascripts/awards_handler.js index aaab217964..0e403d023d 100644 --- a/app/assets/javascripts/awards_handler.js +++ b/app/assets/javascripts/awards_handler.js @@ -2,13 +2,13 @@ import $ from 'jquery'; import _ from 'underscore'; +import { GlBreakpointInstance as bp } from '@gitlab/ui/dist/utils'; import Cookies from 'js-cookie'; import { __ } from './locale'; import { updateTooltipTitle } from './lib/utils/common_utils'; import { isInVueNoteablePage } from './lib/utils/dom_utils'; import flash from './flash'; import axios from './lib/utils/axios_utils'; -import bp from './breakpoints'; const animationEndEventString = 'animationend webkitAnimationEnd MSAnimationEnd oAnimationEnd'; const transitionEndEventString = 'transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd'; @@ -266,7 +266,7 @@ export class AwardsHandler { top: `${$addBtn.offset().top + $addBtn.outerHeight()}px`, }; // for xs screen we position the element on center - if (bp.getBreakpointSize() === 'xs') { + if (bp.getBreakpointSize() === 'xs' || bp.getBreakpointSize() === 'sm') { css.left = '5%'; } else if (position === 'right') { css.left = `${$addBtn.offset().left - $menu.outerWidth() + 20}px`; @@ -506,6 +506,8 @@ export class AwardsHandler { const options = { scrollTop: $('.awards').offset().top - 110, }; + + // eslint-disable-next-line no-jquery/no-animate return $('body, html').animate(options, 200); } diff --git a/app/assets/javascripts/behaviors/markdown/constants.js b/app/assets/javascripts/behaviors/markdown/constants.js new file mode 100644 index 0000000000..b4545d6c6c --- /dev/null +++ b/app/assets/javascripts/behaviors/markdown/constants.js @@ -0,0 +1,3 @@ +// https://prosemirror.net/docs/ref/#model.ParseRule.priority +export const DEFAULT_PARSE_RULE_PRIORITY = 50; +export const HIGHER_PARSE_RULE_PRIORITY = 1 + DEFAULT_PARSE_RULE_PRIORITY; diff --git a/app/assets/javascripts/behaviors/markdown/copy_as_gfm.js b/app/assets/javascripts/behaviors/markdown/copy_as_gfm.js index 318b7f77c7..03c1b5a016 100644 --- a/app/assets/javascripts/behaviors/markdown/copy_as_gfm.js +++ b/app/assets/javascripts/behaviors/markdown/copy_as_gfm.js @@ -183,7 +183,7 @@ export class CopyAsGFM { } // Export CopyAsGFM as a global for rspec to access -// see /spec/features/copy_as_gfm_spec.rb +// see /spec/features/markdown/copy_as_gfm_spec.rb if (process.env.NODE_ENV !== 'production') { window.CopyAsGFM = CopyAsGFM; } diff --git a/app/assets/javascripts/behaviors/markdown/editor_extensions.js b/app/assets/javascripts/behaviors/markdown/editor_extensions.js index 8bd2145db1..308e31e704 100644 --- a/app/assets/javascripts/behaviors/markdown/editor_extensions.js +++ b/app/assets/javascripts/behaviors/markdown/editor_extensions.js @@ -53,7 +53,7 @@ import InlineHTML from './marks/inline_html'; // The nodes and marks referenced here transform that same HTML to GFM to be copied to the clipboard. // Every filter in lib/banzai/pipeline/gfm_pipeline.rb that generates HTML // from GFM should have a node or mark here. -// The GFM-to-HTML-to-GFM cycle is tested in spec/features/copy_as_gfm_spec.rb. +// The GFM-to-HTML-to-GFM cycle is tested in spec/features/markdown/copy_as_gfm_spec.rb. export default [ new Doc(), diff --git a/app/assets/javascripts/behaviors/markdown/marks/inline_html.js b/app/assets/javascripts/behaviors/markdown/marks/inline_html.js index ebed8698e2..7e020139fe 100644 --- a/app/assets/javascripts/behaviors/markdown/marks/inline_html.js +++ b/app/assets/javascripts/behaviors/markdown/marks/inline_html.js @@ -1,7 +1,7 @@ /* eslint-disable class-methods-use-this */ import { Mark } from 'tiptap'; -import _ from 'underscore'; +import { escape as esc } from 'lodash'; // Transforms generated HTML back to GFM for Banzai::Filter::MarkdownFilter export default class InlineHTML extends Mark { @@ -35,7 +35,7 @@ export default class InlineHTML extends Mark { mixable: true, open(state, mark) { return `<${mark.attrs.tag}${ - mark.attrs.title ? ` title="${state.esc(_.escape(mark.attrs.title))}"` : '' + mark.attrs.title ? ` title="${state.esc(esc(mark.attrs.title))}"` : '' }>`; }, close(state, mark) { diff --git a/app/assets/javascripts/behaviors/markdown/marks/math.js b/app/assets/javascripts/behaviors/markdown/marks/math.js index e582fb18f1..04441d5d71 100644 --- a/app/assets/javascripts/behaviors/markdown/marks/math.js +++ b/app/assets/javascripts/behaviors/markdown/marks/math.js @@ -2,6 +2,7 @@ import { Mark } from 'tiptap'; import { defaultMarkdownSerializer } from 'prosemirror-markdown'; +import { HIGHER_PARSE_RULE_PRIORITY } from '../constants'; // Transforms generated HTML back to GFM for Banzai::Filter::MathFilter export default class MathMark extends Mark { @@ -15,7 +16,7 @@ export default class MathMark extends Mark { // Matches HTML generated by Banzai::Filter::MathFilter { tag: 'code.code.math[data-math-style=inline]', - priority: 51, + priority: HIGHER_PARSE_RULE_PRIORITY, }, // Matches HTML after being transformed by app/assets/javascripts/behaviors/markdown/render_math.js { diff --git a/app/assets/javascripts/behaviors/markdown/nodes/audio.js b/app/assets/javascripts/behaviors/markdown/nodes/audio.js index 48ac408cf2..146349b118 100644 --- a/app/assets/javascripts/behaviors/markdown/nodes/audio.js +++ b/app/assets/javascripts/behaviors/markdown/nodes/audio.js @@ -1,53 +1,9 @@ -/* eslint-disable class-methods-use-this */ - -import { Node } from 'tiptap'; -import { defaultMarkdownSerializer } from 'prosemirror-markdown'; +import Playable from './playable'; // Transforms generated HTML back to GFM for Banzai::Filter::AudioLinkFilter -export default class Audio extends Node { - get name() { - return 'audio'; - } - - get schema() { - return { - attrs: { - src: {}, - alt: { - default: null, - }, - }, - group: 'block', - draggable: true, - parseDOM: [ - { - tag: '.audio-container', - skip: true, - }, - { - tag: '.audio-container p', - priority: 51, - ignore: true, - }, - { - tag: 'audio[src]', - getAttrs: el => ({ src: el.getAttribute('src'), alt: el.dataset.title }), - }, - ], - toDOM: node => [ - 'audio', - { - src: node.attrs.src, - controls: true, - 'data-setup': '{}', - 'data-title': node.attrs.alt, - }, - ], - }; - } - - toMarkdown(state, node) { - defaultMarkdownSerializer.nodes.image(state, node); - state.closeBlock(node); +export default class Audio extends Playable { + constructor() { + super(); + this.mediaType = 'audio'; } } diff --git a/app/assets/javascripts/behaviors/markdown/nodes/image.js b/app/assets/javascripts/behaviors/markdown/nodes/image.js index e839396330..b1983eebe1 100644 --- a/app/assets/javascripts/behaviors/markdown/nodes/image.js +++ b/app/assets/javascripts/behaviors/markdown/nodes/image.js @@ -3,6 +3,7 @@ import { Image as BaseImage } from 'tiptap-extensions'; import { defaultMarkdownSerializer } from 'prosemirror-markdown'; import { placeholderImage } from '~/lazy_loader'; +import { HIGHER_PARSE_RULE_PRIORITY } from '../constants'; export default class Image extends BaseImage { get schema() { @@ -23,7 +24,7 @@ export default class Image extends BaseImage { // Matches HTML generated by Banzai::Filter::ImageLinkFilter { tag: 'a.no-attachment-icon', - priority: 51, + priority: HIGHER_PARSE_RULE_PRIORITY, skip: true, }, // Matches HTML generated by Banzai::Filter::ImageLazyLoadFilter diff --git a/app/assets/javascripts/behaviors/markdown/nodes/ordered_task_list.js b/app/assets/javascripts/behaviors/markdown/nodes/ordered_task_list.js index 25c4976a1b..a28d7be375 100644 --- a/app/assets/javascripts/behaviors/markdown/nodes/ordered_task_list.js +++ b/app/assets/javascripts/behaviors/markdown/nodes/ordered_task_list.js @@ -1,6 +1,7 @@ /* eslint-disable class-methods-use-this */ import { Node } from 'tiptap'; +import { HIGHER_PARSE_RULE_PRIORITY } from '../constants'; // Transforms generated HTML back to GFM for Banzai::Filter::TaskListFilter export default class OrderedTaskList extends Node { @@ -14,7 +15,7 @@ export default class OrderedTaskList extends Node { content: '(task_list_item|list_item)+', parseDOM: [ { - priority: 51, + priority: HIGHER_PARSE_RULE_PRIORITY, tag: 'ol.task-list', }, ], diff --git a/app/assets/javascripts/behaviors/markdown/nodes/playable.js b/app/assets/javascripts/behaviors/markdown/nodes/playable.js new file mode 100644 index 0000000000..9209c69d04 --- /dev/null +++ b/app/assets/javascripts/behaviors/markdown/nodes/playable.js @@ -0,0 +1,73 @@ +/* eslint-disable class-methods-use-this */ +/* eslint-disable @gitlab/i18n/no-non-i18n-strings */ + +import { Node } from 'tiptap'; +import { defaultMarkdownSerializer } from 'prosemirror-markdown'; +import { HIGHER_PARSE_RULE_PRIORITY } from '../constants'; + +/** + * Abstract base class for playable media, like video and audio. + * Must not be instantiated directly. Subclasses must set + * the `mediaType` property in their constructors. + * @abstract + */ +export default class Playable extends Node { + constructor() { + super(); + this.mediaType = ''; + this.extraElementAttrs = {}; + } + + get name() { + return this.mediaType; + } + + get schema() { + const attrs = { + src: {}, + alt: { + default: null, + }, + }; + + const parseDOM = [ + { + tag: `.${this.mediaType}-container`, + skip: true, + }, + { + tag: `.${this.mediaType}-container p`, + priority: HIGHER_PARSE_RULE_PRIORITY, + ignore: true, + }, + { + tag: `${this.mediaType}[src]`, + getAttrs: el => ({ src: el.src, alt: el.dataset.title }), + }, + ]; + + const toDOM = node => [ + this.mediaType, + { + src: node.attrs.src, + controls: true, + 'data-setup': '{}', + 'data-title': node.attrs.alt, + ...this.extraElementAttrs, + }, + ]; + + return { + attrs, + group: 'block', + draggable: true, + parseDOM, + toDOM, + }; + } + + toMarkdown(state, node) { + defaultMarkdownSerializer.nodes.image(state, node); + state.closeBlock(node); + } +} diff --git a/app/assets/javascripts/behaviors/markdown/nodes/reference.js b/app/assets/javascripts/behaviors/markdown/nodes/reference.js index 5d6bbeca83..aa724798da 100644 --- a/app/assets/javascripts/behaviors/markdown/nodes/reference.js +++ b/app/assets/javascripts/behaviors/markdown/nodes/reference.js @@ -1,6 +1,7 @@ /* eslint-disable class-methods-use-this */ import { Node } from 'tiptap'; +import { HIGHER_PARSE_RULE_PRIORITY } from '../constants'; // Transforms generated HTML back to GFM for Banzai::Filter::ReferenceFilter and subclasses export default class Reference extends Node { @@ -23,7 +24,7 @@ export default class Reference extends Node { parseDOM: [ { tag: 'a.gfm:not([data-link=true])', - priority: 51, + priority: HIGHER_PARSE_RULE_PRIORITY, getAttrs: el => ({ className: el.className, referenceType: el.dataset.referenceType, diff --git a/app/assets/javascripts/behaviors/markdown/nodes/table_header_row.js b/app/assets/javascripts/behaviors/markdown/nodes/table_header_row.js index e7eee63640..6e3c16f0a0 100644 --- a/app/assets/javascripts/behaviors/markdown/nodes/table_header_row.js +++ b/app/assets/javascripts/behaviors/markdown/nodes/table_header_row.js @@ -1,6 +1,7 @@ /* eslint-disable class-methods-use-this */ import TableRow from './table_row'; +import { HIGHER_PARSE_RULE_PRIORITY } from '../constants'; const CENTER_ALIGN = 'center'; @@ -16,7 +17,7 @@ export default class TableHeaderRow extends TableRow { parseDOM: [ { tag: 'thead tr', - priority: 51, + priority: HIGHER_PARSE_RULE_PRIORITY, }, ], toDOM: () => ['tr', 0], diff --git a/app/assets/javascripts/behaviors/markdown/nodes/table_of_contents.js b/app/assets/javascripts/behaviors/markdown/nodes/table_of_contents.js index 9a2e2c0321..db9072acc3 100644 --- a/app/assets/javascripts/behaviors/markdown/nodes/table_of_contents.js +++ b/app/assets/javascripts/behaviors/markdown/nodes/table_of_contents.js @@ -2,6 +2,7 @@ import { Node } from 'tiptap'; import { __ } from '~/locale'; +import { HIGHER_PARSE_RULE_PRIORITY } from '../constants'; // Transforms generated HTML back to GFM for Banzai::Filter::TableOfContentsFilter export default class TableOfContents extends Node { @@ -16,11 +17,11 @@ export default class TableOfContents extends Node { parseDOM: [ { tag: 'ul.section-nav', - priority: 51, + priority: HIGHER_PARSE_RULE_PRIORITY, }, { tag: 'p.table-of-contents', - priority: 51, + priority: HIGHER_PARSE_RULE_PRIORITY, }, ], toDOM: () => ['p', { class: 'table-of-contents' }, __('Table of Contents')], diff --git a/app/assets/javascripts/behaviors/markdown/nodes/task_list.js b/app/assets/javascripts/behaviors/markdown/nodes/task_list.js index ab33bc2150..35ba2eb067 100644 --- a/app/assets/javascripts/behaviors/markdown/nodes/task_list.js +++ b/app/assets/javascripts/behaviors/markdown/nodes/task_list.js @@ -1,6 +1,7 @@ /* eslint-disable class-methods-use-this */ import { Node } from 'tiptap'; +import { HIGHER_PARSE_RULE_PRIORITY } from '../constants'; // Transforms generated HTML back to GFM for Banzai::Filter::TaskListFilter export default class TaskList extends Node { @@ -14,7 +15,7 @@ export default class TaskList extends Node { content: '(task_list_item|list_item)+', parseDOM: [ { - priority: 51, + priority: HIGHER_PARSE_RULE_PRIORITY, tag: 'ul.task-list', }, ], diff --git a/app/assets/javascripts/behaviors/markdown/nodes/task_list_item.js b/app/assets/javascripts/behaviors/markdown/nodes/task_list_item.js index d0ee7333d5..7bb56b4c40 100644 --- a/app/assets/javascripts/behaviors/markdown/nodes/task_list_item.js +++ b/app/assets/javascripts/behaviors/markdown/nodes/task_list_item.js @@ -1,6 +1,7 @@ /* eslint-disable class-methods-use-this */ import { Node } from 'tiptap'; +import { HIGHER_PARSE_RULE_PRIORITY } from '../constants'; // Transforms generated HTML back to GFM for Banzai::Filter::TaskListFilter export default class TaskListItem extends Node { @@ -20,7 +21,7 @@ export default class TaskListItem extends Node { content: 'paragraph block*', parseDOM: [ { - priority: 51, + priority: HIGHER_PARSE_RULE_PRIORITY, tag: 'li.task-list-item', getAttrs: el => { const checkbox = el.querySelector('input[type=checkbox].task-list-item-checkbox'); diff --git a/app/assets/javascripts/behaviors/markdown/nodes/video.js b/app/assets/javascripts/behaviors/markdown/nodes/video.js index 516f983397..68085c2c41 100644 --- a/app/assets/javascripts/behaviors/markdown/nodes/video.js +++ b/app/assets/javascripts/behaviors/markdown/nodes/video.js @@ -1,54 +1,10 @@ -/* eslint-disable class-methods-use-this */ - -import { Node } from 'tiptap'; -import { defaultMarkdownSerializer } from 'prosemirror-markdown'; +import Playable from './playable'; // Transforms generated HTML back to GFM for Banzai::Filter::VideoLinkFilter -export default class Video extends Node { - get name() { - return 'video'; - } - - get schema() { - return { - attrs: { - src: {}, - alt: { - default: null, - }, - }, - group: 'block', - draggable: true, - parseDOM: [ - { - tag: '.video-container', - skip: true, - }, - { - tag: '.video-container p', - priority: 51, - ignore: true, - }, - { - tag: 'video[src]', - getAttrs: el => ({ src: el.getAttribute('src'), alt: el.dataset.title }), - }, - ], - toDOM: node => [ - 'video', - { - src: node.attrs.src, - width: '400', - controls: true, - 'data-setup': '{}', - 'data-title': node.attrs.alt, - }, - ], - }; - } - - toMarkdown(state, node) { - defaultMarkdownSerializer.nodes.image(state, node); - state.closeBlock(node); +export default class Video extends Playable { + constructor() { + super(); + this.mediaType = 'video'; + this.extraElementAttrs = { width: '400' }; } } diff --git a/app/assets/javascripts/behaviors/markdown/paste_markdown_table.js b/app/assets/javascripts/behaviors/markdown/paste_markdown_table.js new file mode 100644 index 0000000000..665a721642 --- /dev/null +++ b/app/assets/javascripts/behaviors/markdown/paste_markdown_table.js @@ -0,0 +1,122 @@ +const maxColumnWidth = (rows, columnIndex) => Math.max(...rows.map(row => row[columnIndex].length)); + +export default class PasteMarkdownTable { + constructor(clipboardData) { + this.data = clipboardData; + this.columnWidths = []; + this.rows = []; + this.tableFound = this.parseTable(); + } + + isTable() { + return this.tableFound; + } + + convertToTableMarkdown() { + this.calculateColumnWidths(); + + const markdownRows = this.rows.map( + row => + // | Name | Title | Email Address | + // |--------------|-------|----------------| + // | Jane Atler | CEO | jane@acme.com | + // | John Doherty | CTO | john@acme.com | + // | Sally Smith | CFO | sally@acme.com | + `| ${row.map((column, index) => this.formatColumn(column, index)).join(' | ')} |`, + ); + + // Insert a header break (e.g. -----) to the second row + markdownRows.splice(1, 0, this.generateHeaderBreak()); + + return markdownRows.join('\n'); + } + + // Private methods below + + // To determine whether the cut data is a table, the following criteria + // must be satisfied with the clipboard data: + // + // 1. MIME types "text/plain" and "text/html" exist + // 2. The "text/html" data must have a single element + // 3. The number of rows in the "text/plain" data matches that of the "text/html" data + // 4. The max number of columns in "text/plain" matches that of the "text/html" data + parseTable() { + if (!this.data.types.includes('text/html') || !this.data.types.includes('text/plain')) { + return false; + } + + const htmlData = this.data.getData('text/html'); + this.doc = new DOMParser().parseFromString(htmlData, 'text/html'); + const tables = this.doc.querySelectorAll('table'); + + // We're only looking for exactly one table. If there happens to be + // multiple tables, it's possible an application copied data into + // the clipboard that is not related to a simple table. It may also be + // complicated converting multiple tables into Markdown. + if (tables.length !== 1) { + return false; + } + + const text = this.data.getData('text/plain').trim(); + const splitRows = text.split(/[\n\u0085\u2028\u2029]|\r\n?/g); + + // Now check that the number of rows matches between HTML and text + if (this.doc.querySelectorAll('tr').length !== splitRows.length) { + return false; + } + + this.rows = splitRows.map(row => row.split('\t')); + this.normalizeRows(); + + // Check that the max number of columns in the HTML matches the number of + // columns in the text. GitHub, for example, copies a line number and the + // line itself into the HTML data. + if (!this.columnCountsMatch()) { + return false; + } + + return true; + } + + // Ensure each row has the same number of columns + normalizeRows() { + const rowLengths = this.rows.map(row => row.length); + const maxLength = Math.max(...rowLengths); + + this.rows.forEach(row => { + while (row.length < maxLength) { + row.push(''); + } + }); + } + + calculateColumnWidths() { + this.columnWidths = this.rows[0].map((_column, columnIndex) => + maxColumnWidth(this.rows, columnIndex), + ); + } + + columnCountsMatch() { + const textColumnCount = this.rows[0].length; + let htmlColumnCount = 0; + + this.doc.querySelectorAll('table tr').forEach(row => { + htmlColumnCount = Math.max(row.cells.length, htmlColumnCount); + }); + + return textColumnCount === htmlColumnCount; + } + + formatColumn(column, index) { + const spaces = Array(this.columnWidths[index] - column.length + 1).join(' '); + return column + spaces; + } + + generateHeaderBreak() { + // Add 3 dashes to line things up: there is additional spacing for the pipe characters + const dashes = this.columnWidths.map((width, index) => + Array(this.columnWidths[index] + 3).join('-'), + ); + return `|${dashes.join('|')}|`; + } +} diff --git a/app/assets/javascripts/behaviors/markdown/render_mermaid.js b/app/assets/javascripts/behaviors/markdown/render_mermaid.js index c3e2c09f1d..3856832de9 100644 --- a/app/assets/javascripts/behaviors/markdown/render_mermaid.js +++ b/app/assets/javascripts/behaviors/markdown/render_mermaid.js @@ -1,4 +1,5 @@ import flash from '~/flash'; +import $ from 'jquery'; import { sprintf, __ } from '../../locale'; // Renders diagrams and flowcharts from text using Mermaid in any element with the @@ -18,9 +19,12 @@ import { sprintf, __ } from '../../locale'; // This is an arbitrary number; Can be iterated upon when suitable. const MAX_CHAR_LIMIT = 5000; -export default function renderMermaid($els) { +function renderMermaids($els) { if (!$els.length) return; + // A diagram may have been truncated in search results which will cause errors, so abort the render. + if (document.querySelector('body').dataset.page === 'search:show') return; + import(/* webpackChunkName: 'mermaid' */ 'mermaid') .then(mermaid => { mermaid.initialize({ @@ -92,3 +96,19 @@ export default function renderMermaid($els) { flash(`Can't load mermaid module: ${err}`); }); } + +export default function renderMermaid($els) { + if (!$els.length) return; + + const visibleMermaids = $els.filter(function filter() { + return $(this).closest('details').length === 0; + }); + + renderMermaids(visibleMermaids); + + $els.closest('details').one('toggle', function toggle() { + if (this.open) { + renderMermaids($(this).find('.js-render-mermaid')); + } + }); +} diff --git a/app/assets/javascripts/behaviors/requires_input.js b/app/assets/javascripts/behaviors/requires_input.js index 7cf18d1fd8..2fa3f4fc78 100644 --- a/app/assets/javascripts/behaviors/requires_input.js +++ b/app/assets/javascripts/behaviors/requires_input.js @@ -1,5 +1,5 @@ import $ from 'jquery'; -import _ from 'underscore'; +import { isEmpty } from 'lodash'; import '../commons/bootstrap'; // Requires Input behavior @@ -23,10 +23,10 @@ $.fn.requiresInput = function requiresInput() { function requireInput() { // Collect the input values of *all* required fields - const values = _.map($(fieldSelector, $form), field => field.value); + const values = Array.from($(fieldSelector, $form)).map(field => field.value); // Disable the button if any required fields are empty - if (values.length && _.some(values, _.isEmpty)) { + if (values.length && values.some(isEmpty)) { $button.disable(); } else { $button.enable(); diff --git a/app/assets/javascripts/behaviors/shortcuts/shortcuts.js b/app/assets/javascripts/behaviors/shortcuts/shortcuts.js index 66cb9fd767..85636f3e5d 100644 --- a/app/assets/javascripts/behaviors/shortcuts/shortcuts.js +++ b/app/assets/javascripts/behaviors/shortcuts/shortcuts.js @@ -1,6 +1,9 @@ import $ from 'jquery'; import Cookies from 'js-cookie'; import Mousetrap from 'mousetrap'; +import Vue from 'vue'; +import { disableShortcuts, shouldDisableShortcuts } from './shortcuts_toggle'; +import ShortcutsToggle from './shortcuts_toggle.vue'; import axios from '../../lib/utils/axios_utils'; import { refreshCurrentPage, visitUrl } from '../../lib/utils/url_utility'; import findAndFollowLink from '../../lib/utils/navigation_utility'; @@ -15,6 +18,15 @@ Mousetrap.stopCallback = (e, element, combo) => { return defaultStopCallback(e, element, combo); }; +function initToggleButton() { + return new Vue({ + el: document.querySelector('.js-toggle-shortcuts'), + render(createElement) { + return createElement(ShortcutsToggle); + }, + }); +} + export default class Shortcuts { constructor() { this.onToggleHelp = this.onToggleHelp.bind(this); @@ -48,6 +60,14 @@ export default class Shortcuts { $(this).remove(); e.preventDefault(); }); + + $('.js-shortcuts-modal-trigger') + .off('click') + .on('click', this.onToggleHelp); + + if (shouldDisableShortcuts()) { + disableShortcuts(); + } } onToggleHelp(e) { @@ -104,7 +124,8 @@ export default class Shortcuts { } return $('.js-more-help-button').remove(); - }); + }) + .then(initToggleButton); } focusFilter(e) { diff --git a/app/assets/javascripts/behaviors/shortcuts/shortcuts_blob.js b/app/assets/javascripts/behaviors/shortcuts/shortcuts_blob.js index 052e33b4a2..d5d8edd5ac 100644 --- a/app/assets/javascripts/behaviors/shortcuts/shortcuts_blob.js +++ b/app/assets/javascripts/behaviors/shortcuts/shortcuts_blob.js @@ -1,26 +1,67 @@ import Mousetrap from 'mousetrap'; -import { getLocationHash, visitUrl } from '../../lib/utils/url_utility'; +import { + getLocationHash, + updateHistory, + urlIsDifferent, + urlContainsSha, + getShaFromUrl, +} from '~/lib/utils/url_utility'; +import { updateRefPortionOfTitle } from '~/repository/utils/title'; import Shortcuts from './shortcuts'; const defaults = { skipResetBindings: false, fileBlobPermalinkUrl: null, + fileBlobPermalinkUrlElement: null, }; +function eventHasModifierKeys(event) { + // We ignore alt because I don't think alt clicks normally do anything special? + return event.ctrlKey || event.metaKey || event.shiftKey; +} + export default class ShortcutsBlob extends Shortcuts { constructor(opts) { const options = Object.assign({}, defaults, opts); super(options.skipResetBindings); this.options = options; + this.shortcircuitPermalinkButton(); + Mousetrap.bind('y', this.moveToFilePermalink.bind(this)); } moveToFilePermalink() { - if (this.options.fileBlobPermalinkUrl) { + const permalink = this.options.fileBlobPermalinkUrl; + + if (permalink) { const hash = getLocationHash(); const hashUrlString = hash ? `#${hash}` : ''; - visitUrl(`${this.options.fileBlobPermalinkUrl}${hashUrlString}`); + + if (urlIsDifferent(permalink)) { + updateHistory({ + url: `${permalink}${hashUrlString}`, + title: document.title, + }); + } + + if (urlContainsSha({ url: permalink })) { + updateRefPortionOfTitle(getShaFromUrl({ url: permalink })); + } + } + } + + shortcircuitPermalinkButton() { + const button = this.options.fileBlobPermalinkUrlElement; + const handleButton = e => { + if (!eventHasModifierKeys(e)) { + e.preventDefault(); + this.moveToFilePermalink(); + } + }; + + if (button) { + button.addEventListener('click', handleButton); } } } diff --git a/app/assets/javascripts/behaviors/shortcuts/shortcuts_toggle.js b/app/assets/javascripts/behaviors/shortcuts/shortcuts_toggle.js new file mode 100644 index 0000000000..66aa1b752a --- /dev/null +++ b/app/assets/javascripts/behaviors/shortcuts/shortcuts_toggle.js @@ -0,0 +1,22 @@ +import Mousetrap from 'mousetrap'; +import 'mousetrap/plugins/pause/mousetrap-pause'; + +const shorcutsDisabledKey = 'shortcutsDisabled'; + +export const shouldDisableShortcuts = () => { + try { + return localStorage.getItem(shorcutsDisabledKey) === 'true'; + } catch (e) { + return false; + } +}; + +export function enableShortcuts() { + localStorage.setItem(shorcutsDisabledKey, false); + Mousetrap.unpause(); +} + +export function disableShortcuts() { + localStorage.setItem(shorcutsDisabledKey, true); + Mousetrap.pause(); +} diff --git a/app/assets/javascripts/behaviors/shortcuts/shortcuts_toggle.vue b/app/assets/javascripts/behaviors/shortcuts/shortcuts_toggle.vue new file mode 100644 index 0000000000..a53b1b06be --- /dev/null +++ b/app/assets/javascripts/behaviors/shortcuts/shortcuts_toggle.vue @@ -0,0 +1,60 @@ + + + diff --git a/app/assets/javascripts/blob/components/blob_content.vue b/app/assets/javascripts/blob/components/blob_content.vue new file mode 100644 index 0000000000..2639a09909 --- /dev/null +++ b/app/assets/javascripts/blob/components/blob_content.vue @@ -0,0 +1,51 @@ + + diff --git a/app/assets/javascripts/blob/components/blob_content_error.vue b/app/assets/javascripts/blob/components/blob_content_error.vue new file mode 100644 index 0000000000..0f1af0a962 --- /dev/null +++ b/app/assets/javascripts/blob/components/blob_content_error.vue @@ -0,0 +1,15 @@ + + diff --git a/app/assets/javascripts/blob/components/blob_embeddable.vue b/app/assets/javascripts/blob/components/blob_embeddable.vue new file mode 100644 index 0000000000..26bd020830 --- /dev/null +++ b/app/assets/javascripts/blob/components/blob_embeddable.vue @@ -0,0 +1,41 @@ + + diff --git a/app/assets/javascripts/blob/components/blob_header.vue b/app/assets/javascripts/blob/components/blob_header.vue new file mode 100644 index 0000000000..b7d9600ec4 --- /dev/null +++ b/app/assets/javascripts/blob/components/blob_header.vue @@ -0,0 +1,82 @@ + + diff --git a/app/assets/javascripts/blob/components/blob_header_default_actions.vue b/app/assets/javascripts/blob/components/blob_header_default_actions.vue new file mode 100644 index 0000000000..6b38b87160 --- /dev/null +++ b/app/assets/javascripts/blob/components/blob_header_default_actions.vue @@ -0,0 +1,74 @@ + + diff --git a/app/assets/javascripts/blob/components/blob_header_filepath.vue b/app/assets/javascripts/blob/components/blob_header_filepath.vue new file mode 100644 index 0000000000..6c6a22e2b3 --- /dev/null +++ b/app/assets/javascripts/blob/components/blob_header_filepath.vue @@ -0,0 +1,47 @@ + + diff --git a/app/assets/javascripts/blob/components/blob_header_viewer_switcher.vue b/app/assets/javascripts/blob/components/blob_header_viewer_switcher.vue new file mode 100644 index 0000000000..689fa7638f --- /dev/null +++ b/app/assets/javascripts/blob/components/blob_header_viewer_switcher.vue @@ -0,0 +1,70 @@ + + diff --git a/app/assets/javascripts/blob/components/constants.js b/app/assets/javascripts/blob/components/constants.js new file mode 100644 index 0000000000..d3fed9e51e --- /dev/null +++ b/app/assets/javascripts/blob/components/constants.js @@ -0,0 +1,11 @@ +import { __ } from '~/locale'; + +export const BTN_COPY_CONTENTS_TITLE = __('Copy file contents'); +export const BTN_RAW_TITLE = __('Open raw'); +export const BTN_DOWNLOAD_TITLE = __('Download'); + +export const SIMPLE_BLOB_VIEWER = 'simple'; +export const SIMPLE_BLOB_VIEWER_TITLE = __('Display source'); + +export const RICH_BLOB_VIEWER = 'rich'; +export const RICH_BLOB_VIEWER_TITLE = __('Display rendered file'); diff --git a/app/assets/javascripts/blob/file_template_mediator.js b/app/assets/javascripts/blob/file_template_mediator.js index 2df7a84ead..0fb02ca596 100644 --- a/app/assets/javascripts/blob/file_template_mediator.js +++ b/app/assets/javascripts/blob/file_template_mediator.js @@ -117,11 +117,7 @@ export default class FileTemplateMediator { selector.hide(); } }); - - if (this.editor.getValue() !== '') { - this.setTypeSelectorToggleText(item.name); - } - + this.setTypeSelectorToggleText(item.name); this.cacheToggleText(); } diff --git a/app/assets/javascripts/blob/notebook/index.js b/app/assets/javascripts/blob/notebook/index.js index 071022a9a7..35634d63e4 100644 --- a/app/assets/javascripts/blob/notebook/index.js +++ b/app/assets/javascripts/blob/notebook/index.js @@ -75,10 +75,10 @@ export default () => { class="text-center" v-if="error"> - An error occurred whilst loading the file. Please try again later. + An error occurred while loading the file. Please try again later. - An error occurred whilst parsing the file. + An error occurred while parsing the file.

diff --git a/app/assets/javascripts/blob/pdf/index.js b/app/assets/javascripts/blob/pdf/index.js index 7d5f487c4b..19778d0798 100644 --- a/app/assets/javascripts/blob/pdf/index.js +++ b/app/assets/javascripts/blob/pdf/index.js @@ -1,5 +1,6 @@ import Vue from 'vue'; import pdfLab from '../../pdf/index.vue'; +import { GlLoadingIcon } from '@gitlab/ui'; export default () => { const el = document.getElementById('js-pdf-viewer'); @@ -8,6 +9,7 @@ export default () => { el, components: { pdfLab, + GlLoadingIcon, }, data() { return { @@ -32,11 +34,7 @@ export default () => {
- +
{ class="text-center" v-if="error"> - An error occurred whilst loading the file. Please try again later. + An error occurred while loading the file. Please try again later. - An error occurred whilst decoding the file. + An error occurred while decoding the file.

diff --git a/app/assets/javascripts/boards/components/board.js b/app/assets/javascripts/boards/components/board.js index 8ebdfede8f..a6deb656b3 100644 --- a/app/assets/javascripts/boards/components/board.js +++ b/app/assets/javascripts/boards/components/board.js @@ -3,7 +3,7 @@ import Sortable from 'sortablejs'; import Vue from 'vue'; import { GlButtonGroup, GlButton, GlTooltip } from '@gitlab/ui'; import isWipLimitsOn from 'ee_else_ce/boards/mixins/is_wip_limits'; -import { n__, s__ } from '~/locale'; +import { s__, __, sprintf } from '~/locale'; import Icon from '~/vue_shared/components/icon.vue'; import Tooltip from '~/vue_shared/directives/tooltip'; import AccessorUtilities from '../../lib/utils/accessor'; @@ -67,10 +67,13 @@ export default Vue.extend({ !this.disabled && this.list.type !== ListType.closed && this.list.type !== ListType.blank ); }, - counterTooltip() { + issuesTooltip() { const { issuesSize } = this.list; - return `${n__('%d issue', '%d issues', issuesSize)}`; + + return sprintf(__('%{issuesSize} issues'), { issuesSize }); }, + // Only needed to make karma pass. + weightCountToolTip() {}, // eslint-disable-line vue/return-in-computed-property caretTooltip() { return this.list.isExpanded ? s__('Boards|Collapse') : s__('Boards|Expand'); }, diff --git a/app/assets/javascripts/boards/components/board_list.vue b/app/assets/javascripts/boards/components/board_list.vue index 1e54d4d6b7..4a64d9e04f 100644 --- a/app/assets/javascripts/boards/components/board_list.vue +++ b/app/assets/javascripts/boards/components/board_list.vue @@ -181,6 +181,8 @@ export default { boardsStore.startMoving(list, issue); + this.$root.$emit('bv::hide::tooltip'); + sortableStart(); }, onAdd: e => { @@ -256,7 +258,7 @@ export default { let toList; if (to) { const containerEl = to.closest('.js-board-list'); - toList = boardsStore.findList('id', Number(containerEl.dataset.board)); + toList = boardsStore.findList('id', Number(containerEl.dataset.board), ''); } /** diff --git a/app/assets/javascripts/boards/components/boards_selector.vue b/app/assets/javascripts/boards/components/boards_selector.vue index 5d7be0c705..eeb0fbec1e 100644 --- a/app/assets/javascripts/boards/components/boards_selector.vue +++ b/app/assets/javascripts/boards/components/boards_selector.vue @@ -9,7 +9,6 @@ import { GlDropdownItem, } from '@gitlab/ui'; -import Icon from '~/vue_shared/components/icon.vue'; import httpStatusCodes from '~/lib/utils/http_status'; import boardsStore from '../stores/boards_store'; import BoardForm from './board_form.vue'; @@ -19,7 +18,6 @@ const MIN_BOARDS_TO_VIEW_RECENT = 10; export default { name: 'BoardsSelector', components: { - Icon, BoardForm, GlLoadingIcon, GlSearchBoxByType, diff --git a/app/assets/javascripts/boards/components/issue_card_inner.vue b/app/assets/javascripts/boards/components/issue_card_inner.vue index 7f7510545c..bdaed17fd0 100644 --- a/app/assets/javascripts/boards/components/issue_card_inner.vue +++ b/app/assets/javascripts/boards/components/issue_card_inner.vue @@ -161,6 +161,14 @@ export default {

+