Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore3
-rw-r--r--.gitlab-ci.yml1
-rw-r--r--.gitlab/ci/docs.gitlab-ci.yml2
-rw-r--r--.gitlab/ci/ee-specific-checks.gitlab-ci.yml22
-rw-r--r--.gitlab/ci/frontend.gitlab-ci.yml19
-rw-r--r--.gitlab/ci/pages.gitlab-ci.yml3
-rw-r--r--.overcommit.yml.example28
-rw-r--r--GITLAB_SHELL_VERSION2
-rw-r--r--GITLAB_WORKHORSE_VERSION2
-rw-r--r--Gemfile5
-rw-r--r--Gemfile.lock17
-rw-r--r--app/assets/javascripts/behaviors/markdown/render_math.js2
-rw-r--r--app/assets/javascripts/ide/components/file_row_extra.vue2
-rw-r--r--app/assets/javascripts/jobs/components/job_app.vue6
-rw-r--r--app/assets/javascripts/jobs/components/job_log_json.vue10
-rw-r--r--app/assets/javascripts/pages/projects/shared/permissions/components/settings_panel.vue7
-rw-r--r--app/assets/javascripts/vue_shared/components/changed_file_icon.vue4
-rw-r--r--app/controllers/application_controller.rb6
-rw-r--r--app/controllers/concerns/lfs_request.rb2
-rw-r--r--app/controllers/concerns/with_performance_bar.rb16
-rw-r--r--app/controllers/projects/jobs_controller.rb15
-rw-r--r--app/controllers/projects/lfs_api_controller.rb2
-rw-r--r--app/controllers/sessions_controller.rb6
-rw-r--r--app/helpers/avatars_helper.rb9
-rw-r--r--app/helpers/performance_bar_helper.rb4
-rw-r--r--app/models/application_setting.rb15
-rw-r--r--app/models/award_emoji.rb4
-rw-r--r--app/models/blob_viewer/base.rb2
-rw-r--r--app/models/broadcast_message.rb2
-rw-r--r--app/models/ci/build.rb17
-rw-r--r--app/models/ci/build_runner_session.rb2
-rw-r--r--app/models/ci/runner.rb3
-rw-r--r--app/models/clusters/applications/cert_manager.rb33
-rw-r--r--app/models/clusters/applications/ingress.rb2
-rw-r--r--app/models/clusters/applications/jupyter.rb2
-rw-r--r--app/models/clusters/applications/knative.rb6
-rw-r--r--app/models/clusters/applications/runner.rb2
-rw-r--r--app/models/clusters/cluster.rb4
-rw-r--r--app/models/concerns/cacheable_attributes.rb2
-rw-r--r--app/models/concerns/has_status.rb2
-rw-r--r--app/models/concerns/ignorable_column.rb30
-rw-r--r--app/models/concerns/protected_ref_access.rb6
-rw-r--r--app/models/concerns/routable.rb24
-rw-r--r--app/models/concerns/taskable.rb4
-rw-r--r--app/models/deploy_key.rb3
-rw-r--r--app/models/deploy_token.rb2
-rw-r--r--app/models/diff_viewer/base.rb2
-rw-r--r--app/models/event.rb1
-rw-r--r--app/models/gpg_key.rb4
-rw-r--r--app/models/group.rb6
-rw-r--r--app/models/instance_configuration.rb4
-rw-r--r--app/models/members/group_member.rb2
-rw-r--r--app/models/members/project_member.rb2
-rw-r--r--app/models/merge_request_diff.rb1
-rw-r--r--app/models/namespace/aggregation_schedule.rb2
-rw-r--r--app/models/note.rb3
-rw-r--r--app/models/notification_reason.rb6
-rw-r--r--app/models/notification_setting.rb4
-rw-r--r--app/models/pages_domain.rb2
-rw-r--r--app/models/project.rb10
-rw-r--r--app/models/project_services/buildkite_service.rb2
-rw-r--r--app/models/project_services/chat_message/base_message.rb2
-rw-r--r--app/models/project_services/chat_message/push_message.rb8
-rw-r--r--app/models/project_services/microsoft_teams_service.rb2
-rw-r--r--app/models/project_services/pivotaltracker_service.rb2
-rw-r--r--app/models/project_services/pushover_service.rb2
-rw-r--r--app/models/project_services/slash_commands_service.rb4
-rw-r--r--app/models/repository.rb6
-rw-r--r--app/models/user.rb13
-rw-r--r--app/models/user_status.rb2
-rw-r--r--app/serializers/deployment_entity.rb2
-rw-r--r--app/services/clusters/create_service.rb2
-rw-r--r--app/services/clusters/gcp/finalize_creation_service.rb8
-rw-r--r--app/services/clusters/gcp/kubernetes.rb16
-rw-r--r--app/services/clusters/gcp/kubernetes/create_or_update_namespace_service.rb47
-rw-r--r--app/services/clusters/gcp/kubernetes/create_or_update_service_account_service.rb141
-rw-r--r--app/services/clusters/gcp/kubernetes/fetch_kubernetes_token_service.rb42
-rw-r--r--app/services/clusters/kubernetes/create_or_update_namespace_service.rb45
-rw-r--r--app/services/clusters/kubernetes/create_or_update_service_account_service.rb139
-rw-r--r--app/services/clusters/kubernetes/fetch_kubernetes_token_service.rb40
-rw-r--r--app/services/clusters/kubernetes/kubernetes.rb14
-rw-r--r--app/services/notification_service.rb15
-rw-r--r--app/services/quick_actions/interpret_service.rb2
-rw-r--r--app/views/layouts/devise.html.haml3
-rw-r--r--app/views/layouts/devise_empty.html.haml3
-rw-r--r--app/views/peek/_bar.html.haml4
-rw-r--r--app/views/projects/pages/_access.html.haml4
-rw-r--r--changelogs/unreleased/28643-access-request-emails-limit-to-ten-owners.yml5
-rw-r--r--changelogs/unreleased/56295-some-avatars-not-visible-in-commit-trailers.yml5
-rw-r--r--changelogs/unreleased/60561-quick-action-label-first-for-issue.yml5
-rw-r--r--changelogs/unreleased/65304-add-pages-first-deployment-message.yml5
-rw-r--r--changelogs/unreleased/65389-wrong-format-on-ms-teams-integration-push-events-with-multi-line-commit-messages.yml5
-rw-r--r--changelogs/unreleased/add-warning-note-to-project-container-registry-setting.yml6
-rw-r--r--changelogs/unreleased/cert_manager_v0_9.yml5
-rw-r--r--changelogs/unreleased/fix-nil-deployable-exception-on-job-controller-show.yml5
-rw-r--r--changelogs/unreleased/fix-peek-on-puma.yml5
-rw-r--r--changelogs/unreleased/improve-chatops-help.yml5
-rw-r--r--changelogs/unreleased/issue_10770.yml5
-rw-r--r--changelogs/unreleased/refactor-showStagedIcon.yml5
-rw-r--r--changelogs/unreleased/sh-fix-ci-lint-500-error.yml5
-rw-r--r--changelogs/unreleased/sh-mermaid-8-2-6.yml5
-rw-r--r--changelogs/unreleased/swagger-ui-ci-page-template.yml5
-rw-r--r--changelogs/unreleased/update-workhorse.yml5
-rw-r--r--config/dependency_decisions.yml7
-rw-r--r--db/fixtures/development/98_gitlab_instance_administration_project.rb3
-rw-r--r--db/fixtures/production/998_gitlab_instance_administration_project.rb3
-rw-r--r--db/migrate/20190822175441_rename_epics_state_to_state_id.rb17
-rw-r--r--db/post_migrate/20190822185441_cleanup_epics_state_id_rename.rb17
-rw-r--r--db/schema.rb2
-rw-r--r--doc/administration/auth/how_to_configure_ldap_gitlab_ee/img/group_linking.gifbin1504079 -> 1328162 bytes
-rw-r--r--doc/administration/auth/how_to_configure_ldap_gitlab_ee/img/manual_permissions.gifbin1703084 -> 1029427 bytes
-rw-r--r--doc/administration/geo/replication/updating_the_geo_nodes.md17
-rw-r--r--doc/api/applications.md4
-rw-r--r--doc/api/epics.md2
-rw-r--r--doc/api/merge_request_approvals.md272
-rw-r--r--doc/api/releases/index.md120
-rw-r--r--doc/api/settings.md73
-rw-r--r--doc/ci/ci_cd_for_external_repos/github_integration.md51
-rw-r--r--doc/ci/ci_cd_for_external_repos/img/github_repo_list.pngbin14282 -> 0 bytes
-rw-r--r--doc/ci/docker/using_docker_build.md2
-rw-r--r--doc/ci/yaml/README.md10
-rw-r--r--doc/development/contributing/style_guides.md5
-rw-r--r--doc/development/what_requires_downtime.md12
-rw-r--r--doc/integration/elasticsearch.md308
-rw-r--r--doc/security/asset_proxy.md12
-rw-r--r--doc/user/admin_area/settings/account_and_limit_settings.md19
-rw-r--r--doc/user/application_security/security_dashboard/img/group_security_dashboard.pngbin68332 -> 0 bytes
-rw-r--r--doc/user/application_security/security_dashboard/img/group_security_dashboard_v12_3.pngbin0 -> 60530 bytes
-rw-r--r--doc/user/application_security/security_dashboard/index.md14
-rw-r--r--doc/user/clusters/img/jupyter-git-extension.gifbin2120084 -> 495240 bytes
-rw-r--r--doc/user/gitlab_com/index.md2
-rw-r--r--doc/user/group/epics/index.md13
-rw-r--r--doc/user/group/index.md9
-rw-r--r--doc/user/project/integrations/img/grafana_live_embed.pngbin0 -> 44603 bytes
-rw-r--r--doc/user/project/integrations/prometheus.md21
-rw-r--r--doc/user/project/members/index.md11
-rw-r--r--doc/user/project/merge_requests/code_quality.md5
-rw-r--r--doc/user/project/merge_requests/img/code_quality.gifbin2617453 -> 0 bytes
-rw-r--r--doc/user/project/merge_requests/img/code_quality.pngbin0 -> 94062 bytes
-rw-r--r--doc/user/project/merge_requests/index.md2
-rw-r--r--doc/user/project/merge_requests/work_in_progress_merge_requests.md4
-rw-r--r--doc/user/project/pages/custom_domains_ssl_tls_certification/index.md2
-rw-r--r--doc/user/project/pages/custom_domains_ssl_tls_certification/lets_encrypt_integration.md3
-rw-r--r--doc/user/project/pages/index.md10
-rw-r--r--doc/user/project/quick_actions.md134
-rw-r--r--lib/banzai/filter/commit_trailers_filter.rb3
-rw-r--r--lib/gitlab/ci/build/prerequisite/kubernetes_namespace.rb2
-rw-r--r--lib/gitlab/ci/config/external/file/base.rb8
-rw-r--r--lib/gitlab/ci/templates/Pages/SwaggerUI.gitlab-ci.yml29
-rw-r--r--lib/gitlab/diff/suggestion.rb2
-rw-r--r--lib/gitlab/gitaly_client.rb8
-rw-r--r--lib/gitlab/performance_bar.rb6
-rw-r--r--lib/gitlab/performance_bar/redis_adapter_when_peek_enabled.rb4
-rw-r--r--lib/gitlab/regex.rb4
-rw-r--r--lib/gitlab/rugged_instrumentation.rb8
-rw-r--r--lib/gitlab/sidekiq_middleware/metrics.rb2
-rw-r--r--lib/gitlab/slash_commands/application_help.rb7
-rw-r--r--lib/gitlab/slash_commands/command.rb2
-rw-r--r--lib/gitlab/slash_commands/help.rb4
-rw-r--r--lib/gitlab/slash_commands/presenters/access.rb25
-rw-r--r--lib/gitlab/slash_commands/presenters/help.rb70
-rw-r--r--lib/peek/views/active_record.rb2
-rw-r--r--lib/peek/views/redis_detailed.rb6
-rw-r--r--locale/gitlab.pot12
-rw-r--r--package.json2
-rw-r--r--qa/qa/page/project/show.rb2
-rw-r--r--qa/qa/runtime/browser.rb2
-rw-r--r--spec/controllers/projects/jobs_controller_spec.rb1
-rw-r--r--spec/db/schema_spec.rb2
-rw-r--r--spec/factories/group_members.rb4
-rw-r--r--spec/factories/project_members.rb4
-rw-r--r--spec/factories/users.rb8
-rw-r--r--spec/features/groups/clusters/user_spec.rb2
-rw-r--r--spec/features/issues/user_comments_on_issue_spec.rb17
-rw-r--r--spec/features/projects/clusters/user_spec.rb2
-rw-r--r--spec/features/projects/jobs/user_browses_job_spec.rb2
-rw-r--r--spec/features/projects/jobs_spec.rb9
-rw-r--r--spec/features/projects/pages_spec.rb6
-rw-r--r--spec/features/security/project/internal_access_spec.rb4
-rw-r--r--spec/features/security/project/private_access_spec.rb4
-rw-r--r--spec/features/security/project/public_access_spec.rb4
-rw-r--r--spec/features/users/login_spec.rb8
-rw-r--r--spec/frontend/vue_shared/components/changed_file_icon_spec.js6
-rw-r--r--spec/helpers/avatars_helper_spec.rb42
-rw-r--r--spec/lib/banzai/filter/commit_trailers_filter_spec.rb21
-rw-r--r--spec/lib/gitlab/ci/build/prerequisite/kubernetes_namespace_spec.rb6
-rw-r--r--spec/lib/gitlab/ci/config/external/file/base_spec.rb6
-rw-r--r--spec/lib/gitlab/git/rugged_impl/use_rugged_spec.rb2
-rw-r--r--spec/lib/gitlab/performance_bar_spec.rb26
-rw-r--r--spec/lib/gitlab/sidekiq_middleware/metrics_spec.rb2
-rw-r--r--spec/lib/gitlab/slash_commands/application_help_spec.rb3
-rw-r--r--spec/lib/gitlab/slash_commands/command_spec.rb6
-rw-r--r--spec/lib/gitlab/slash_commands/presenters/access_spec.rb6
-rw-r--r--spec/lib/peek/views/rugged_spec.rb2
-rw-r--r--spec/models/clusters/applications/cert_manager_spec.rb27
-rw-r--r--spec/models/concerns/ignorable_column_spec.rb44
-rw-r--r--spec/models/concerns/routable_spec.rb20
-rw-r--r--spec/models/group_spec.rb19
-rw-r--r--spec/models/project_services/chat_message/push_message_spec.rb26
-rw-r--r--spec/models/project_spec.rb20
-rw-r--r--spec/serializers/deployment_entity_spec.rb9
-rw-r--r--spec/services/clusters/kubernetes/create_or_update_namespace_service_spec.rb (renamed from spec/services/clusters/gcp/kubernetes/create_or_update_namespace_service_spec.rb)10
-rw-r--r--spec/services/clusters/kubernetes/create_or_update_service_account_service_spec.rb (renamed from spec/services/clusters/gcp/kubernetes/create_or_update_service_account_service_spec.rb)10
-rw-r--r--spec/services/clusters/kubernetes/fetch_kubernetes_token_service_spec.rb (renamed from spec/services/clusters/gcp/kubernetes/fetch_kubernetes_token_service_spec.rb)2
-rw-r--r--spec/services/notification_service_spec.rb152
-rw-r--r--spec/support/services/clusters/create_service_shared.rb68
-rw-r--r--spec/support/shared_examples/chat_slash_commands_shared_examples.rb2
-rw-r--r--spec/support/shared_examples/controllers/issuables_requiring_filter_shared_examples.rb (renamed from spec/support/issuables_requiring_filter_shared_examples.rb)0
-rw-r--r--spec/support/shared_examples/models/active_record_enum_shared_examples.rb (renamed from spec/support/active_record_enum.rb)0
-rw-r--r--spec/support/shared_examples/services/notification_service_shared_examples.rb44
-rw-r--r--vendor/licenses.csv1
-rw-r--r--yarn.lock8
212 files changed, 2045 insertions, 1080 deletions
diff --git a/.gitignore b/.gitignore
index 104c6930050..3ffe4263c4f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -81,4 +81,5 @@ package-lock.json
/junit_*.xml
/coverage-frontend/
jsdoc/
-**/tmp/rubocop_cache/** \ No newline at end of file
+**/tmp/rubocop_cache/**
+.overcommit.yml
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 27992024265..5b5527284d3 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -41,3 +41,4 @@ include:
- local: .gitlab/ci/setup.gitlab-ci.yml
- local: .gitlab/ci/test-metadata.gitlab-ci.yml
- local: .gitlab/ci/yaml.gitlab-ci.yml
+ - local: .gitlab/ci/ee-specific-checks.gitlab-ci.yml
diff --git a/.gitlab/ci/docs.gitlab-ci.yml b/.gitlab/ci/docs.gitlab-ci.yml
index e77c773824f..3f29adddf73 100644
--- a/.gitlab/ci/docs.gitlab-ci.yml
+++ b/.gitlab/ci/docs.gitlab-ci.yml
@@ -74,7 +74,7 @@ docs lint:
script:
- scripts/lint-doc.sh
# Lint Markdown
- - markdownlint --config .markdownlint.json doc/**/*.md
+ - markdownlint --config .markdownlint.json 'doc/**/*.md'
# Prepare docs for build
- mv doc/ /tmp/gitlab-docs/content/$DOCS_GITLAB_REPO_SUFFIX
- cd /tmp/gitlab-docs
diff --git a/.gitlab/ci/ee-specific-checks.gitlab-ci.yml b/.gitlab/ci/ee-specific-checks.gitlab-ci.yml
new file mode 100644
index 00000000000..babb89b4606
--- /dev/null
+++ b/.gitlab/ci/ee-specific-checks.gitlab-ci.yml
@@ -0,0 +1,22 @@
+.ee-specific-check:
+ extends: .default-tags
+ dependencies: []
+ only:
+ - branches@gitlab-org/gitlab-ee
+ except:
+ - master
+ - tags
+ - /[\d-]+-stable(-ee)?/
+ - /[\d-]+-auto-deploy-\d{7}/
+ - /^security-/
+ - /\bce\-to\-ee\b/
+
+ee-files-location-check:
+ extends: .ee-specific-check
+ script:
+ - scripts/ee-files-location-check
+
+ee-specific-lines-check:
+ extends: .ee-specific-check
+ script:
+ - scripts/ee-specific-lines-check
diff --git a/.gitlab/ci/frontend.gitlab-ci.yml b/.gitlab/ci/frontend.gitlab-ci.yml
index df38cb4ff8e..0d73092cfba 100644
--- a/.gitlab/ci/frontend.gitlab-ci.yml
+++ b/.gitlab/ci/frontend.gitlab-ci.yml
@@ -234,25 +234,6 @@ qa-frontend-node:latest:
image: node:latest
allow_failure: true
-lint:javascript:report:
- extends:
- - .default-tags
- - .default-retry
- - .default-cache
- - .except-docs
- variables:
- SETUP_DB: "false"
- stage: post-test
- dependencies: []
- script:
- - date
- - yarn run eslint-report || true # ignore exit code
- artifacts:
- name: eslint-report
- expire_in: 31d
- paths:
- - eslint-report.html
-
jsdoc:
extends:
- .default-tags
diff --git a/.gitlab/ci/pages.gitlab-ci.yml b/.gitlab/ci/pages.gitlab-ci.yml
index 3247d7c4bce..5d13a72e224 100644
--- a/.gitlab/ci/pages.gitlab-ci.yml
+++ b/.gitlab/ci/pages.gitlab-ci.yml
@@ -9,13 +9,12 @@ pages:
- master@gitlab-org/gitlab-ce
- master@gitlab-org/gitlab-ee
stage: pages
- dependencies: ["coverage", "karma", "gitlab:assets:compile", "lint:javascript:report", "jsdoc"]
+ dependencies: ["coverage", "karma", "gitlab:assets:compile", "jsdoc"]
script:
- mv public/ .public/
- mkdir public/
- mv coverage/ public/coverage-ruby/ || true
- mv coverage-javascript/ public/coverage-javascript/ || true
- - mv eslint-report.html public/ || true
- mv webpack-report/ public/webpack-report/ || true
- cp .public/assets/application-*.css public/application.css || true
- cp .public/assets/application-*.css.gz public/application.css.gz || true
diff --git a/.overcommit.yml.example b/.overcommit.yml.example
new file mode 100644
index 00000000000..25823b9a8b3
--- /dev/null
+++ b/.overcommit.yml.example
@@ -0,0 +1,28 @@
+# Use this file to configure the Overcommit hooks you wish to use. This will
+# extend the default configuration defined in:
+# https://github.com/sds/overcommit/blob/master/config/default.yml
+#
+# At the topmost level of this YAML file is a key representing type of hook
+# being run (e.g. pre-commit, commit-msg, etc.). Within each type you can
+# customize each hook, such as whether to only run it on certain files (via
+# `include`), whether to only display output if it fails (via `quiet`), etc.
+#
+# For a complete list of hooks, see:
+# https://github.com/sds/overcommit/tree/master/lib/overcommit/hook
+#
+# For a complete list of options that you can use to customize hooks, see:
+# https://github.com/sds/overcommit#configuration
+#
+# Uncomment the following lines to make the configuration take effect.
+
+PreCommit:
+ RuboCop:
+ enabled: true
+# on_warn: fail # Treat all warnings as failures
+#
+#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
+#
+# IndexTags:
+# enabled: true # Generate a tags file with `ctags` each time HEAD changes
diff --git a/GITLAB_SHELL_VERSION b/GITLAB_SHELL_VERSION
index ccfb75e5120..3c40359d3dc 100644
--- a/GITLAB_SHELL_VERSION
+++ b/GITLAB_SHELL_VERSION
@@ -1 +1 @@
-9.4.1
+9.4.2
diff --git a/GITLAB_WORKHORSE_VERSION b/GITLAB_WORKHORSE_VERSION
index eec6dacbd48..7f6758ef97b 100644
--- a/GITLAB_WORKHORSE_VERSION
+++ b/GITLAB_WORKHORSE_VERSION
@@ -1 +1 @@
-8.8.1
+8.10.0
diff --git a/Gemfile b/Gemfile
index 6c7ef7264c3..aa17e01b34d 100644
--- a/Gemfile
+++ b/Gemfile
@@ -215,7 +215,7 @@ gem 'discordrb-webhooks-blackst0ne', '~> 3.3', require: false
gem 'hipchat', '~> 1.5.0'
# Jira integration
-gem 'jira-ruby', '~> 1.4'
+gem 'jira-ruby', '~> 1.7'
# Flowdock integration
gem 'flowdock', '~> 0.7'
@@ -295,7 +295,8 @@ gem 'gettext', '~> 3.2.2', require: false, group: :development
gem 'batch-loader', '~> 1.4.0'
# Perf bar
-gem 'peek', '~> 1.0.1'
+# https://gitlab.com/gitlab-org/gitlab-ee/issues/13996
+gem 'gitlab-peek', '~> 0.0.1', require: 'peek'
# Snowplow events tracking
gem 'snowplow-tracker', '~> 0.6.1'
diff --git a/Gemfile.lock b/Gemfile.lock
index dac68eac5b0..0803cf7f752 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -74,6 +74,8 @@ GEM
asciidoctor-plantuml (0.0.9)
asciidoctor (>= 1.5.6, < 3.0.0)
ast (2.4.0)
+ atlassian-jwt (0.2.0)
+ jwt (~> 2.1.0)
attr_encrypted (3.1.0)
encryptor (~> 3.0.0)
attr_required (1.0.1)
@@ -147,8 +149,6 @@ GEM
adamantium (~> 0.2.0)
equalizer (~> 0.0.9)
concurrent-ruby (1.1.5)
- concurrent-ruby-ext (1.1.5)
- concurrent-ruby (= 1.1.5)
connection_pool (2.2.2)
contracts (0.11.0)
crack (0.4.3)
@@ -319,6 +319,8 @@ GEM
opentracing (~> 0.4)
redis (> 3.0.0, < 5.0.0)
gitlab-markup (1.7.0)
+ gitlab-peek (0.0.1)
+ railties (>= 4.0.0)
gitlab-sidekiq-fetcher (0.5.1)
sidekiq (~> 5)
gitlab-styles (2.8.0)
@@ -444,8 +446,9 @@ GEM
opentracing (~> 0.3)
thrift
jaro_winkler (1.5.3)
- jira-ruby (1.4.1)
+ jira-ruby (1.7.1)
activesupport
+ atlassian-jwt
multipart-post
oauth (~> 0.5, >= 0.5.0)
js_regex (3.1.1)
@@ -632,10 +635,6 @@ GEM
parser (2.6.3.0)
ast (~> 2.4.0)
parslet (1.8.2)
- peek (1.0.1)
- concurrent-ruby (>= 0.9.0)
- concurrent-ruby-ext (>= 0.9.0)
- railties (>= 4.0.0)
pg (1.1.4)
po_to_json (1.0.1)
json (>= 1.6.0)
@@ -1097,6 +1096,7 @@ DEPENDENCIES
github-markup (~> 1.7.0)
gitlab-labkit (~> 0.5)
gitlab-markup (~> 1.7.0)
+ gitlab-peek (~> 0.0.1)
gitlab-sidekiq-fetcher (= 0.5.1)
gitlab-styles (~> 2.7)
gitlab_omniauth-ldap (~> 2.1.1)
@@ -1124,7 +1124,7 @@ DEPENDENCIES
icalendar
influxdb (~> 0.2)
invisible_captcha (~> 0.12.1)
- jira-ruby (~> 1.4)
+ jira-ruby (~> 1.7)
js_regex (~> 3.1)
json-schema (~> 2.8.0)
jwt (~> 2.1.0)
@@ -1167,7 +1167,6 @@ DEPENDENCIES
omniauth_crowd (~> 2.2.0)
omniauth_openid_connect (~> 0.3.1)
org-ruby (~> 0.9.12)
- peek (~> 1.0.1)
pg (~> 1.1)
premailer-rails (~> 1.9.7)
prometheus-client-mmap (~> 0.9.8)
diff --git a/app/assets/javascripts/behaviors/markdown/render_math.js b/app/assets/javascripts/behaviors/markdown/render_math.js
index 53867b3096b..b5dbdbb7e86 100644
--- a/app/assets/javascripts/behaviors/markdown/render_math.js
+++ b/app/assets/javascripts/behaviors/markdown/render_math.js
@@ -102,7 +102,7 @@ class SafeMathRenderer {
maxSize: 20,
maxExpand: 20,
});
- } catch {
+ } catch (e) {
// Don't show a flash for now because it would override an existing flash message
el.textContent = s__('math|There was an error rendering this math block');
// el.style.color = '#d00';
diff --git a/app/assets/javascripts/ide/components/file_row_extra.vue b/app/assets/javascripts/ide/components/file_row_extra.vue
index 7254c50a568..48be97c8952 100644
--- a/app/assets/javascripts/ide/components/file_row_extra.vue
+++ b/app/assets/javascripts/ide/components/file_row_extra.vue
@@ -86,7 +86,7 @@ export default {
v-else-if="showChangedFileIcon"
:file="file"
:show-tooltip="true"
- :show-staged-icon="true"
+ :show-staged-icon="false"
/>
<new-dropdown
:type="file.type"
diff --git a/app/assets/javascripts/jobs/components/job_app.vue b/app/assets/javascripts/jobs/components/job_app.vue
index 8da87f424c4..ad1072366f3 100644
--- a/app/assets/javascripts/jobs/components/job_app.vue
+++ b/app/assets/javascripts/jobs/components/job_app.vue
@@ -12,7 +12,6 @@ import createStore from '../store';
import EmptyState from './empty_state.vue';
import EnvironmentsBlock from './environments_block.vue';
import ErasedBlock from './erased_block.vue';
-import Log from './job_log.vue';
import LogTopBar from './job_log_controllers.vue';
import StuckBlock from './stuck_block.vue';
import UnmetPrerequisitesBlock from './unmet_prerequisites_block.vue';
@@ -30,7 +29,10 @@ export default {
EnvironmentsBlock,
ErasedBlock,
Icon,
- Log,
+ Log: () =>
+ gon && gon.features && gon.features.jobLogJson
+ ? import('./job_log_json.vue')
+ : import('./job_log.vue'),
LogTopBar,
StuckBlock,
UnmetPrerequisitesBlock,
diff --git a/app/assets/javascripts/jobs/components/job_log_json.vue b/app/assets/javascripts/jobs/components/job_log_json.vue
new file mode 100644
index 00000000000..2198b20eb8f
--- /dev/null
+++ b/app/assets/javascripts/jobs/components/job_log_json.vue
@@ -0,0 +1,10 @@
+<script>
+export default {
+ name: 'JobLogJSON',
+};
+</script>
+<template>
+ <pre>
+ {{ __('This feature is in development. Please disable the `job_log_json` feature flag') }}
+ </pre>
+</template>
diff --git a/app/assets/javascripts/pages/projects/shared/permissions/components/settings_panel.vue b/app/assets/javascripts/pages/projects/shared/permissions/components/settings_panel.vue
index a223a8f5b08..ea867d30ce8 100644
--- a/app/assets/javascripts/pages/projects/shared/permissions/components/settings_panel.vue
+++ b/app/assets/javascripts/pages/projects/shared/permissions/components/settings_panel.vue
@@ -144,6 +144,10 @@ export default {
visibilityLevelDescription() {
return visibilityLevelDescriptions[this.visibilityLevel];
},
+
+ showContainerRegistryPublicNote() {
+ return this.visibilityLevel === visibilityOptions.PUBLIC;
+ },
},
watch: {
@@ -286,6 +290,9 @@ export default {
label="Container registry"
help-text="Every project can have its own space to store its Docker images"
>
+ <div v-if="showContainerRegistryPublicNote" class="text-muted">
+ {{ __('Note: the container registry is always visible when a project is public') }}
+ </div>
<project-feature-toggle
v-model="containerRegistryEnabled"
:disabled-input="!repositoryEnabled"
diff --git a/app/assets/javascripts/vue_shared/components/changed_file_icon.vue b/app/assets/javascripts/vue_shared/components/changed_file_icon.vue
index beb2ac09992..a97538d813a 100644
--- a/app/assets/javascripts/vue_shared/components/changed_file_icon.vue
+++ b/app/assets/javascripts/vue_shared/components/changed_file_icon.vue
@@ -24,7 +24,7 @@ export default {
showStagedIcon: {
type: Boolean,
required: false,
- default: false,
+ default: true,
},
size: {
type: Number,
@@ -41,7 +41,7 @@ export default {
changedIcon() {
// False positive i18n lint: https://gitlab.com/gitlab-org/frontend/eslint-plugin-i18n/issues/26
// eslint-disable-next-line @gitlab/i18n/no-non-i18n-strings
- const suffix = !this.file.changed && this.file.staged && !this.showStagedIcon ? '-solid' : '';
+ const suffix = !this.file.changed && this.file.staged && this.showStagedIcon ? '-solid' : '';
return `${getCommitIconMap(this.file).icon}${suffix}`;
},
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb
index af6644b8fcc..2f7ac41781a 100644
--- a/app/controllers/application_controller.rb
+++ b/app/controllers/application_controller.rb
@@ -47,8 +47,8 @@ class ApplicationController < ActionController::Base
# Adds `no-store` to the DEFAULT_CACHE_CONTROL, to prevent security
# concerns due to caching private data.
- DEFAULT_GITLAB_CACHE_CONTROL = "#{ActionDispatch::Http::Cache::Response::DEFAULT_CACHE_CONTROL}, no-store".freeze
- DEFAULT_GITLAB_CONTROL_NO_CACHE = "#{DEFAULT_GITLAB_CACHE_CONTROL}, no-cache".freeze
+ DEFAULT_GITLAB_CACHE_CONTROL = "#{ActionDispatch::Http::Cache::Response::DEFAULT_CACHE_CONTROL}, no-store"
+ DEFAULT_GITLAB_CONTROL_NO_CACHE = "#{DEFAULT_GITLAB_CACHE_CONTROL}, no-cache"
rescue_from Encoding::CompatibilityError do |exception|
log_exception(exception)
@@ -143,7 +143,7 @@ class ApplicationController < ActionController::Base
payload[:username] = logged_user.try(:username)
end
- if response.status == 422 && response.body.present? && response.content_type == 'application/json'.freeze
+ if response.status == 422 && response.body.present? && response.content_type == 'application/json'
payload[:response] = response.body
end
diff --git a/app/controllers/concerns/lfs_request.rb b/app/controllers/concerns/lfs_request.rb
index f7137a04437..bff0715f192 100644
--- a/app/controllers/concerns/lfs_request.rb
+++ b/app/controllers/concerns/lfs_request.rb
@@ -12,7 +12,7 @@
module LfsRequest
extend ActiveSupport::Concern
- CONTENT_TYPE = 'application/vnd.git-lfs+json'.freeze
+ CONTENT_TYPE = 'application/vnd.git-lfs+json'
included do
before_action :require_lfs_enabled!
diff --git a/app/controllers/concerns/with_performance_bar.rb b/app/controllers/concerns/with_performance_bar.rb
index 4e0ae3c59eb..93ded59900d 100644
--- a/app/controllers/concerns/with_performance_bar.rb
+++ b/app/controllers/concerns/with_performance_bar.rb
@@ -3,15 +3,25 @@
module WithPerformanceBar
extend ActiveSupport::Concern
- def peek_enabled?
- return false unless Gitlab::PerformanceBar.enabled?(current_user)
+ included do
+ before_action :set_peek_enabled_for_current_request
+ end
+
+ private
+ def set_peek_enabled_for_current_request
Gitlab::SafeRequestStore.fetch(:peek_enabled) { cookie_or_default_value }
end
- private
+ # Needed for Peek's routing to work;
+ # Peek::ResultsController#restrict_non_access calls this method.
+ def peek_enabled?
+ Gitlab::PerformanceBar.enabled_for_request?
+ end
def cookie_or_default_value
+ return false unless Gitlab::PerformanceBar.enabled_for_user?(current_user)
+
if cookies[:perf_bar_enabled].present?
cookies[:perf_bar_enabled] == 'true'
else
diff --git a/app/controllers/projects/jobs_controller.rb b/app/controllers/projects/jobs_controller.rb
index adbc0159358..06d7579aff4 100644
--- a/app/controllers/projects/jobs_controller.rb
+++ b/app/controllers/projects/jobs_controller.rb
@@ -11,6 +11,9 @@ class Projects::JobsController < Projects::ApplicationController
before_action :authorize_erase_build!, only: [:erase]
before_action :authorize_use_build_terminal!, only: [:terminal, :terminal_websocket_authorize]
before_action :verify_api_request!, only: :terminal_websocket_authorize
+ before_action only: [:trace] do
+ push_frontend_feature_flag(:job_log_json)
+ end
layout 'project'
@@ -64,6 +67,14 @@ class Projects::JobsController < Projects::ApplicationController
# rubocop: enable CodeReuse/ActiveRecord
def trace
+ if Feature.enabled?(:job_log_json, @project)
+ json_trace
+ else
+ html_trace
+ end
+ end
+
+ def html_trace
build.trace.read do |stream|
respond_to do |format|
format.json do
@@ -84,6 +95,10 @@ class Projects::JobsController < Projects::ApplicationController
end
end
+ def json_trace
+ # will be implemented with https://gitlab.com/gitlab-org/gitlab-ce/issues/66454
+ end
+
def retry
return respond_422 unless @build.retryable?
diff --git a/app/controllers/projects/lfs_api_controller.rb b/app/controllers/projects/lfs_api_controller.rb
index 42c415757f9..c16736a756a 100644
--- a/app/controllers/projects/lfs_api_controller.rb
+++ b/app/controllers/projects/lfs_api_controller.rb
@@ -3,7 +3,7 @@
class Projects::LfsApiController < Projects::GitHttpClientController
include LfsRequest
- LFS_TRANSFER_CONTENT_TYPE = 'application/octet-stream'.freeze
+ LFS_TRANSFER_CONTENT_TYPE = 'application/octet-stream'
skip_before_action :lfs_check_access!, only: [:deprecated]
before_action :lfs_check_batch_operation!, only: [:batch]
diff --git a/app/controllers/sessions_controller.rb b/app/controllers/sessions_controller.rb
index 7b682cc0cc5..a6dd811ab8b 100644
--- a/app/controllers/sessions_controller.rb
+++ b/app/controllers/sessions_controller.rb
@@ -40,7 +40,7 @@ class SessionsController < Devise::SessionsController
# token mismatch.
protect_from_forgery with: :exception, prepend: true
- CAPTCHA_HEADER = 'X-GitLab-Show-Login-Captcha'.freeze
+ CAPTCHA_HEADER = 'X-GitLab-Show-Login-Captcha'
MAX_FAILED_LOGIN_ATTEMPTS = 5
def new
@@ -111,14 +111,14 @@ class SessionsController < Devise::SessionsController
def increment_failed_login_captcha_counter
Gitlab::Metrics.counter(
:failed_login_captcha_total,
- 'Number of failed CAPTCHA attempts for logins'.freeze
+ 'Number of failed CAPTCHA attempts for logins'
).increment
end
def increment_successful_login_captcha_counter
Gitlab::Metrics.counter(
:successful_login_captcha_total,
- 'Number of successful CAPTCHA attempts for logins'.freeze
+ 'Number of successful CAPTCHA attempts for logins'
).increment
end
diff --git a/app/helpers/avatars_helper.rb b/app/helpers/avatars_helper.rb
index 81ff359556d..b7f7e617825 100644
--- a/app/helpers/avatars_helper.rb
+++ b/app/helpers/avatars_helper.rb
@@ -56,13 +56,13 @@ module AvatarsHelper
}))
end
- def user_avatar_url_for(options = {})
+ def user_avatar_url_for(only_path: true, **options)
if options[:url]
options[:url]
elsif options[:user]
- avatar_icon_for_user(options[:user], options[:size])
+ avatar_icon_for_user(options[:user], options[:size], only_path: only_path)
else
- avatar_icon_for_email(options[:user_email], options[:size])
+ avatar_icon_for_email(options[:user_email], options[:size], only_path: only_path)
end
end
@@ -75,6 +75,7 @@ module AvatarsHelper
has_tooltip = options[:has_tooltip].nil? ? true : options[:has_tooltip]
data_attributes = options[:data] || {}
css_class = %W[avatar s#{avatar_size}].push(*options[:css_class])
+ alt_text = user_name ? "#{user_name}'s avatar" : "default avatar"
if has_tooltip
css_class.push('has-tooltip')
@@ -88,7 +89,7 @@ module AvatarsHelper
end
image_options = {
- alt: "#{user_name}'s avatar",
+ alt: alt_text,
src: avatar_url,
data: data_attributes,
class: css_class,
diff --git a/app/helpers/performance_bar_helper.rb b/app/helpers/performance_bar_helper.rb
index 7518cec160c..b225e4206a9 100644
--- a/app/helpers/performance_bar_helper.rb
+++ b/app/helpers/performance_bar_helper.rb
@@ -1,9 +1,7 @@
# frozen_string_literal: true
module PerformanceBarHelper
- # This is a hack since using `alias_method :performance_bar_enabled?, :peek_enabled?`
- # in WithPerformanceBar breaks tests (but works in the browser).
def performance_bar_enabled?
- peek_enabled?
+ Gitlab::PerformanceBar.enabled_for_request?
end
end
diff --git a/app/models/application_setting.rb b/app/models/application_setting.rb
index d6caf092ed0..e39d655325f 100644
--- a/app/models/application_setting.rb
+++ b/app/models/application_setting.rb
@@ -4,7 +4,6 @@ class ApplicationSetting < ApplicationRecord
include CacheableAttributes
include CacheMarkdownField
include TokenAuthenticatable
- include IgnorableColumn
include ChronicDurationAttribute
add_authentication_token_field :runners_registration_token, encrypted: -> { Feature.enabled?(:application_settings_tokens_optional_encryption, default_enabled: true) ? :optional : :required }
@@ -32,12 +31,14 @@ class ApplicationSetting < ApplicationRecord
serialize :repository_storages # rubocop:disable Cop/ActiveRecordSerialize
serialize :asset_proxy_whitelist, Array # rubocop:disable Cop/ActiveRecordSerialize
- ignore_column :koding_url
- ignore_column :koding_enabled
- ignore_column :sentry_enabled
- ignore_column :sentry_dsn
- ignore_column :clientside_sentry_enabled
- ignore_column :clientside_sentry_dsn
+ self.ignored_columns += %i[
+ clientside_sentry_dsn
+ clientside_sentry_enabled
+ koding_enabled
+ koding_url
+ sentry_dsn
+ sentry_enabled
+ ]
cache_markdown_field :sign_in_text
cache_markdown_field :help_page_text
diff --git a/app/models/award_emoji.rb b/app/models/award_emoji.rb
index 0ab302a0f3e..24fcb97db6e 100644
--- a/app/models/award_emoji.rb
+++ b/app/models/award_emoji.rb
@@ -1,8 +1,8 @@
# frozen_string_literal: true
class AwardEmoji < ApplicationRecord
- DOWNVOTE_NAME = "thumbsdown".freeze
- UPVOTE_NAME = "thumbsup".freeze
+ DOWNVOTE_NAME = "thumbsdown"
+ UPVOTE_NAME = "thumbsup"
include Participable
include GhostUser
diff --git a/app/models/blob_viewer/base.rb b/app/models/blob_viewer/base.rb
index df6b9bb2f0b..1c3a6599f36 100644
--- a/app/models/blob_viewer/base.rb
+++ b/app/models/blob_viewer/base.rb
@@ -2,7 +2,7 @@
module BlobViewer
class Base
- PARTIAL_PATH_PREFIX = 'projects/blob/viewers'.freeze
+ PARTIAL_PATH_PREFIX = 'projects/blob/viewers'
class_attribute :partial_name, :loading_partial_name, :type, :extensions, :file_types, :load_async, :binary, :switcher_icon, :switcher_title, :collapse_limit, :size_limit
diff --git a/app/models/broadcast_message.rb b/app/models/broadcast_message.rb
index da4584228ce..1338a585c9e 100644
--- a/app/models/broadcast_message.rb
+++ b/app/models/broadcast_message.rb
@@ -16,7 +16,7 @@ class BroadcastMessage < ApplicationRecord
default_value_for :color, '#E75E40'
default_value_for :font, '#FFFFFF'
- CACHE_KEY = 'broadcast_message_current_json'.freeze
+ CACHE_KEY = 'broadcast_message_current_json'
after_commit :flush_redis_cache
diff --git a/app/models/ci/build.rb b/app/models/ci/build.rb
index 7930bef5cf2..d558f66154e 100644
--- a/app/models/ci/build.rb
+++ b/app/models/ci/build.rb
@@ -11,19 +11,20 @@ module Ci
include ObjectStorage::BackgroundMove
include Presentable
include Importable
- include IgnorableColumn
include Gitlab::Utils::StrongMemoize
include Deployable
include HasRef
BuildArchivedError = Class.new(StandardError)
- ignore_column :commands
- ignore_column :artifacts_file
- ignore_column :artifacts_metadata
- ignore_column :artifacts_file_store
- ignore_column :artifacts_metadata_store
- ignore_column :artifacts_size
+ self.ignored_columns += %i[
+ artifacts_file
+ artifacts_file_store
+ artifacts_metadata
+ artifacts_metadata_store
+ artifacts_size
+ commands
+ ]
belongs_to :project, inverse_of: :builds
belongs_to :runner
@@ -444,7 +445,7 @@ module Ci
end
end
- CI_REGISTRY_USER = 'gitlab-ci-token'.freeze
+ CI_REGISTRY_USER = 'gitlab-ci-token'
def persisted_variables
Gitlab::Ci::Variables::Collection.new.tap do |variables|
diff --git a/app/models/ci/build_runner_session.rb b/app/models/ci/build_runner_session.rb
index 997bf298025..8075c15bbaf 100644
--- a/app/models/ci/build_runner_session.rb
+++ b/app/models/ci/build_runner_session.rb
@@ -6,7 +6,7 @@ module Ci
class BuildRunnerSession < ApplicationRecord
extend Gitlab::Ci::Model
- TERMINAL_SUBPROTOCOL = 'terminal.gitlab.com'.freeze
+ TERMINAL_SUBPROTOCOL = 'terminal.gitlab.com'
self.table_name = 'ci_builds_runner_session'
diff --git a/app/models/ci/runner.rb b/app/models/ci/runner.rb
index 1c1c7a5ae7a..e0e905ebfa8 100644
--- a/app/models/ci/runner.rb
+++ b/app/models/ci/runner.rb
@@ -4,7 +4,6 @@ module Ci
class Runner < ApplicationRecord
extend Gitlab::Ci::Model
include Gitlab::SQL::Pattern
- include IgnorableColumn
include RedisCacheable
include ChronicDurationAttribute
include FromUnion
@@ -36,7 +35,7 @@ module Ci
FORM_EDITABLE = %i[description tag_list active run_untagged locked access_level maximum_timeout_human_readable].freeze
- ignore_column :is_shared
+ self.ignored_columns = %i[is_shared]
has_many :builds
has_many :runner_projects, inverse_of: :runner, dependent: :destroy # rubocop:disable Cop/ActiveRecordDependent
diff --git a/app/models/clusters/applications/cert_manager.rb b/app/models/clusters/applications/cert_manager.rb
index 6bd7473c8ff..27d4180e5b9 100644
--- a/app/models/clusters/applications/cert_manager.rb
+++ b/app/models/clusters/applications/cert_manager.rb
@@ -3,7 +3,8 @@
module Clusters
module Applications
class CertManager < ApplicationRecord
- VERSION = 'v0.5.2'.freeze
+ VERSION = 'v0.9.1'
+ CRD_VERSION = '0.9'
self.table_name = 'clusters_applications_cert_managers'
@@ -21,16 +22,22 @@ module Clusters
validates :email, presence: true
def chart
- 'stable/cert-manager'
+ 'certmanager/cert-manager'
+ end
+
+ def repository
+ 'https://charts.jetstack.io'
end
def install_command
Gitlab::Kubernetes::Helm::InstallCommand.new(
name: 'certmanager',
+ repository: repository,
version: VERSION,
rbac: cluster.platform_kubernetes_rbac?,
chart: chart,
files: files.merge(cluster_issuer_file),
+ preinstall: pre_install_script,
postinstall: post_install_script
)
end
@@ -46,16 +53,30 @@ module Clusters
private
+ def pre_install_script
+ [
+ apply_file("https://raw.githubusercontent.com/jetstack/cert-manager/release-#{CRD_VERSION}/deploy/manifests/00-crds.yaml"),
+ "kubectl label --overwrite namespace #{Gitlab::Kubernetes::Helm::NAMESPACE} certmanager.k8s.io/disable-validation=true"
+ ]
+ end
+
def post_install_script
- ["kubectl create -f /data/helm/certmanager/config/cluster_issuer.yaml"]
+ [retry_command(apply_file('/data/helm/certmanager/config/cluster_issuer.yaml'))]
+ end
+
+ def retry_command(command)
+ "for i in $(seq 1 30); do #{command} && break; sleep 1s; echo \"Retrying ($i)...\"; done"
end
def post_delete_script
[
delete_private_key,
delete_crd('certificates.certmanager.k8s.io'),
+ delete_crd('certificaterequests.certmanager.k8s.io'),
+ delete_crd('challenges.certmanager.k8s.io'),
delete_crd('clusterissuers.certmanager.k8s.io'),
- delete_crd('issuers.certmanager.k8s.io')
+ delete_crd('issuers.certmanager.k8s.io'),
+ delete_crd('orders.certmanager.k8s.io')
].compact
end
@@ -75,6 +96,10 @@ module Clusters
Gitlab::Kubernetes::KubectlCmd.delete("crd", definition, "--ignore-not-found")
end
+ def apply_file(filename)
+ Gitlab::Kubernetes::KubectlCmd.apply_file(filename)
+ end
+
def cluster_issuer_file
{
'cluster_issuer.yaml': cluster_issuer_yaml_content
diff --git a/app/models/clusters/applications/ingress.rb b/app/models/clusters/applications/ingress.rb
index 1430b82c2f2..50def3ba38c 100644
--- a/app/models/clusters/applications/ingress.rb
+++ b/app/models/clusters/applications/ingress.rb
@@ -3,7 +3,7 @@
module Clusters
module Applications
class Ingress < ApplicationRecord
- VERSION = '1.1.2'.freeze
+ VERSION = '1.1.2'
self.table_name = 'clusters_applications_ingress'
diff --git a/app/models/clusters/applications/jupyter.rb b/app/models/clusters/applications/jupyter.rb
index 9ede0615fa3..fb74d96efe3 100644
--- a/app/models/clusters/applications/jupyter.rb
+++ b/app/models/clusters/applications/jupyter.rb
@@ -5,7 +5,7 @@ require 'securerandom'
module Clusters
module Applications
class Jupyter < ApplicationRecord
- VERSION = '0.9-174bbd5'.freeze
+ VERSION = '0.9-174bbd5'
self.table_name = 'clusters_applications_jupyter'
diff --git a/app/models/clusters/applications/knative.rb b/app/models/clusters/applications/knative.rb
index 244fe738396..a9b9374622d 100644
--- a/app/models/clusters/applications/knative.rb
+++ b/app/models/clusters/applications/knative.rb
@@ -3,9 +3,9 @@
module Clusters
module Applications
class Knative < ApplicationRecord
- VERSION = '0.6.0'.freeze
- REPOSITORY = 'https://storage.googleapis.com/triggermesh-charts'.freeze
- METRICS_CONFIG = 'https://storage.googleapis.com/triggermesh-charts/istio-metrics.yaml'.freeze
+ VERSION = '0.6.0'
+ REPOSITORY = 'https://storage.googleapis.com/triggermesh-charts'
+ METRICS_CONFIG = 'https://storage.googleapis.com/triggermesh-charts/istio-metrics.yaml'
FETCH_IP_ADDRESS_DELAY = 30.seconds
API_RESOURCES_PATH = 'config/knative/api_resources.yml'
diff --git a/app/models/clusters/applications/runner.rb b/app/models/clusters/applications/runner.rb
index 329250255fd..2d6af8f4f0b 100644
--- a/app/models/clusters/applications/runner.rb
+++ b/app/models/clusters/applications/runner.rb
@@ -3,7 +3,7 @@
module Clusters
module Applications
class Runner < ApplicationRecord
- VERSION = '0.8.0'.freeze
+ VERSION = '0.8.0'
self.table_name = 'clusters_applications_runners'
diff --git a/app/models/clusters/cluster.rb b/app/models/clusters/cluster.rb
index 97d39491b73..444e1a82c97 100644
--- a/app/models/clusters/cluster.rb
+++ b/app/models/clusters/cluster.rb
@@ -20,8 +20,8 @@ module Clusters
Applications::Runner.application_name => Applications::Runner,
Applications::Prometheus.application_name => Applications::Prometheus
}.merge(PROJECT_ONLY_APPLICATIONS).freeze
- DEFAULT_ENVIRONMENT = '*'.freeze
- KUBE_INGRESS_BASE_DOMAIN = 'KUBE_INGRESS_BASE_DOMAIN'.freeze
+ DEFAULT_ENVIRONMENT = '*'
+ KUBE_INGRESS_BASE_DOMAIN = 'KUBE_INGRESS_BASE_DOMAIN'
belongs_to :user
diff --git a/app/models/concerns/cacheable_attributes.rb b/app/models/concerns/cacheable_attributes.rb
index 0c800621a55..d459af23a2f 100644
--- a/app/models/concerns/cacheable_attributes.rb
+++ b/app/models/concerns/cacheable_attributes.rb
@@ -11,7 +11,7 @@ module CacheableAttributes
class_methods do
def cache_key
- "#{name}:#{Gitlab::VERSION}:#{Rails.version}".freeze
+ "#{name}:#{Gitlab::VERSION}:#{Rails.version}"
end
# Can be overridden
diff --git a/app/models/concerns/has_status.rb b/app/models/concerns/has_status.rb
index 71ebb586c13..cf88076ac74 100644
--- a/app/models/concerns/has_status.rb
+++ b/app/models/concerns/has_status.rb
@@ -3,7 +3,7 @@
module HasStatus
extend ActiveSupport::Concern
- DEFAULT_STATUS = 'created'.freeze
+ DEFAULT_STATUS = 'created'
BLOCKED_STATUS = %w[manual scheduled].freeze
AVAILABLE_STATUSES = %w[created preparing pending running success failed canceled skipped manual scheduled].freeze
STARTED_STATUSES = %w[running success failed skipped manual scheduled].freeze
diff --git a/app/models/concerns/ignorable_column.rb b/app/models/concerns/ignorable_column.rb
deleted file mode 100644
index 3bec44dc79b..00000000000
--- a/app/models/concerns/ignorable_column.rb
+++ /dev/null
@@ -1,30 +0,0 @@
-# frozen_string_literal: true
-
-# Module that can be included into a model to make it easier to ignore database
-# columns.
-#
-# Example:
-#
-# class User < ApplicationRecord
-# include IgnorableColumn
-#
-# ignore_column :updated_at
-# end
-#
-module IgnorableColumn
- extend ActiveSupport::Concern
-
- class_methods do
- def columns
- super.reject { |column| ignored_columns.include?(column.name) }
- end
-
- def ignored_columns
- @ignored_columns ||= Set.new
- end
-
- def ignore_column(*names)
- ignored_columns.merge(names.map(&:to_s))
- end
- end
-end
diff --git a/app/models/concerns/protected_ref_access.rb b/app/models/concerns/protected_ref_access.rb
index 583751ea6ac..208937f2aff 100644
--- a/app/models/concerns/protected_ref_access.rb
+++ b/app/models/concerns/protected_ref_access.rb
@@ -4,9 +4,9 @@ module ProtectedRefAccess
extend ActiveSupport::Concern
HUMAN_ACCESS_LEVELS = {
- Gitlab::Access::MAINTAINER => "Maintainers".freeze,
- Gitlab::Access::DEVELOPER => "Developers + Maintainers".freeze,
- Gitlab::Access::NO_ACCESS => "No one".freeze
+ Gitlab::Access::MAINTAINER => "Maintainers",
+ Gitlab::Access::DEVELOPER => "Developers + Maintainers",
+ Gitlab::Access::NO_ACCESS => "No one"
}.freeze
class_methods do
diff --git a/app/models/concerns/routable.rb b/app/models/concerns/routable.rb
index 116e8967651..3a486632800 100644
--- a/app/models/concerns/routable.rb
+++ b/app/models/concerns/routable.rb
@@ -33,8 +33,17 @@ module Routable
#
# Returns a single object, or nil.
def find_by_full_path(path, follow_redirects: false)
- order_sql = Arel.sql("(CASE WHEN routes.path = #{connection.quote(path)} THEN 0 ELSE 1 END)")
- found = where_full_path_in([path]).reorder(order_sql).take
+ increment_counter(:routable_find_by_full_path, 'Number of calls to Routable.find_by_full_path')
+
+ if Feature.enabled?(:routable_two_step_lookup)
+ # Case sensitive match first (it's cheaper and the usual case)
+ # If we didn't have an exact match, we perform a case insensitive search
+ found = joins(:route).find_by(routes: { path: path }) || where_full_path_in([path]).take
+ else
+ order_sql = Arel.sql("(CASE WHEN routes.path = #{connection.quote(path)} THEN 0 ELSE 1 END)")
+ found = where_full_path_in([path]).reorder(order_sql).take
+ end
+
return found if found
if follow_redirects
@@ -52,12 +61,23 @@ module Routable
def where_full_path_in(paths)
return none if paths.empty?
+ increment_counter(:routable_where_full_path_in, 'Number of calls to Routable.where_full_path_in')
+
wheres = paths.map do |path|
"(LOWER(routes.path) = LOWER(#{connection.quote(path)}))"
end
joins(:route).where(wheres.join(' OR '))
end
+
+ # Temporary instrumentation of method calls
+ def increment_counter(counter, description)
+ @counters[counter] ||= Gitlab::Metrics.counter(counter, description)
+
+ @counters[counter].increment
+ rescue
+ # ignore the error
+ end
end
def full_name
diff --git a/app/models/concerns/taskable.rb b/app/models/concerns/taskable.rb
index 8b536a123fc..98842242eb6 100644
--- a/app/models/concerns/taskable.rb
+++ b/app/models/concerns/taskable.rb
@@ -9,8 +9,8 @@ require 'task_list/filter'
#
# Used by MergeRequest and Issue
module Taskable
- COMPLETED = 'completed'.freeze
- INCOMPLETE = 'incomplete'.freeze
+ COMPLETED = 'completed'
+ INCOMPLETE = 'incomplete'
COMPLETE_PATTERN = /(\[[xX]\])/.freeze
INCOMPLETE_PATTERN = /(\[[\s]\])/.freeze
ITEM_PATTERN = %r{
diff --git a/app/models/deploy_key.rb b/app/models/deploy_key.rb
index 0bd90bd28e3..22ab326a0ab 100644
--- a/app/models/deploy_key.rb
+++ b/app/models/deploy_key.rb
@@ -1,7 +1,6 @@
# frozen_string_literal: true
class DeployKey < Key
- include IgnorableColumn
include FromUnion
has_many :deploy_keys_projects, inverse_of: :deploy_key, dependent: :destroy # rubocop:disable Cop/ActiveRecordDependent
@@ -11,7 +10,7 @@ class DeployKey < Key
scope :are_public, -> { where(public: true) }
scope :with_projects, -> { includes(deploy_keys_projects: { project: [:route, :namespace] }) }
- ignore_column :can_push
+ self.ignored_columns += %i[can_push]
accepts_nested_attributes_for :deploy_keys_projects
diff --git a/app/models/deploy_token.rb b/app/models/deploy_token.rb
index 85f5a2040c0..20e1d802178 100644
--- a/app/models/deploy_token.rb
+++ b/app/models/deploy_token.rb
@@ -8,7 +8,7 @@ class DeployToken < ApplicationRecord
add_authentication_token_field :token, encrypted: :optional
AVAILABLE_SCOPES = %i(read_repository read_registry).freeze
- GITLAB_DEPLOY_TOKEN_NAME = 'gitlab-deploy-token'.freeze
+ GITLAB_DEPLOY_TOKEN_NAME = 'gitlab-deploy-token'
default_value_for(:expires_at) { Forever.date }
diff --git a/app/models/diff_viewer/base.rb b/app/models/diff_viewer/base.rb
index 527ee33b83b..22c8fe73563 100644
--- a/app/models/diff_viewer/base.rb
+++ b/app/models/diff_viewer/base.rb
@@ -2,7 +2,7 @@
module DiffViewer
class Base
- PARTIAL_PATH_PREFIX = 'projects/diffs/viewers'.freeze
+ PARTIAL_PATH_PREFIX = 'projects/diffs/viewers'
class_attribute :partial_name, :type, :extensions, :file_types, :binary, :switcher_icon, :switcher_title
diff --git a/app/models/event.rb b/app/models/event.rb
index 738080eb584..392d7368033 100644
--- a/app/models/event.rb
+++ b/app/models/event.rb
@@ -2,7 +2,6 @@
class Event < ApplicationRecord
include Sortable
- include IgnorableColumn
include FromUnion
default_scope { reorder(nil) }
diff --git a/app/models/gpg_key.rb b/app/models/gpg_key.rb
index 116beac5c2a..995baf8565c 100644
--- a/app/models/gpg_key.rb
+++ b/app/models/gpg_key.rb
@@ -1,8 +1,8 @@
# frozen_string_literal: true
class GpgKey < ApplicationRecord
- KEY_PREFIX = '-----BEGIN PGP PUBLIC KEY BLOCK-----'.freeze
- KEY_SUFFIX = '-----END PGP PUBLIC KEY BLOCK-----'.freeze
+ KEY_PREFIX = '-----BEGIN PGP PUBLIC KEY BLOCK-----'
+ KEY_SUFFIX = '-----END PGP PUBLIC KEY BLOCK-----'
include ShaAttribute
diff --git a/app/models/group.rb b/app/models/group.rb
index 61a4802a6ee..abe93cf3c84 100644
--- a/app/models/group.rb
+++ b/app/models/group.rb
@@ -15,6 +15,8 @@ class Group < Namespace
include WithUploads
include Gitlab::Utils::StrongMemoize
+ ACCESS_REQUEST_APPROVERS_TO_BE_NOTIFIED_LIMIT = 10
+
has_many :group_members, -> { where(requested_at: nil) }, dependent: :destroy, as: :source # rubocop:disable Cop/ActiveRecordDependent
alias_method :members, :group_members
has_many :users, through: :group_members
@@ -429,6 +431,10 @@ class Group < Namespace
super || ::Gitlab::Access::OWNER_SUBGROUP_ACCESS
end
+ def access_request_approvers_to_be_notified
+ members.owners.order_recent_sign_in.limit(ACCESS_REQUEST_APPROVERS_TO_BE_NOTIFIED_LIMIT)
+ end
+
private
def update_two_factor_requirement
diff --git a/app/models/instance_configuration.rb b/app/models/instance_configuration.rb
index a9b1962f24c..f401c23e453 100644
--- a/app/models/instance_configuration.rb
+++ b/app/models/instance_configuration.rb
@@ -4,8 +4,8 @@ require 'resolv'
class InstanceConfiguration
SSH_ALGORITHMS = %w(DSA ECDSA ED25519 RSA).freeze
- SSH_ALGORITHMS_PATH = '/etc/ssh/'.freeze
- CACHE_KEY = 'instance_configuration'.freeze
+ SSH_ALGORITHMS_PATH = '/etc/ssh/'
+ CACHE_KEY = 'instance_configuration'
EXPIRATION_TIME = 24.hours
def settings
diff --git a/app/models/members/group_member.rb b/app/models/members/group_member.rb
index 3d6f397e599..ed5832ff989 100644
--- a/app/models/members/group_member.rb
+++ b/app/models/members/group_member.rb
@@ -3,7 +3,7 @@
class GroupMember < Member
include FromUnion
- SOURCE_TYPE = 'Namespace'.freeze
+ SOURCE_TYPE = 'Namespace'
belongs_to :group, foreign_key: 'source_id'
diff --git a/app/models/members/project_member.rb b/app/models/members/project_member.rb
index c64e2669b6a..2bb5806cd21 100644
--- a/app/models/members/project_member.rb
+++ b/app/models/members/project_member.rb
@@ -1,7 +1,7 @@
# frozen_string_literal: true
class ProjectMember < Member
- SOURCE_TYPE = 'Project'.freeze
+ SOURCE_TYPE = 'Project'
belongs_to :project, foreign_key: 'source_id'
diff --git a/app/models/merge_request_diff.rb b/app/models/merge_request_diff.rb
index 2c9dbf2585c..2402fa8e38f 100644
--- a/app/models/merge_request_diff.rb
+++ b/app/models/merge_request_diff.rb
@@ -4,7 +4,6 @@ class MergeRequestDiff < ApplicationRecord
include Sortable
include Importable
include ManualInverseAssociation
- include IgnorableColumn
include EachBatch
include Gitlab::Utils::StrongMemoize
include ObjectStorage::BackgroundMove
diff --git a/app/models/namespace/aggregation_schedule.rb b/app/models/namespace/aggregation_schedule.rb
index 61a7eb4b576..ed61c807519 100644
--- a/app/models/namespace/aggregation_schedule.rb
+++ b/app/models/namespace/aggregation_schedule.rb
@@ -7,7 +7,7 @@ class Namespace::AggregationSchedule < ApplicationRecord
self.primary_key = :namespace_id
DEFAULT_LEASE_TIMEOUT = 1.5.hours.to_i
- REDIS_SHARED_KEY = 'gitlab:update_namespace_statistics_delay'.freeze
+ REDIS_SHARED_KEY = 'gitlab:update_namespace_statistics_delay'
belongs_to :namespace
diff --git a/app/models/note.rb b/app/models/note.rb
index 3956ec192b1..ebd13675dc9 100644
--- a/app/models/note.rb
+++ b/app/models/note.rb
@@ -14,7 +14,6 @@ class Note < ApplicationRecord
include CacheMarkdownField
include AfterCommitQueue
include ResolvableNote
- include IgnorableColumn
include Editable
include Gitlab::SQL::Pattern
include ThrottledTouch
@@ -34,7 +33,7 @@ class Note < ApplicationRecord
end
end
- ignore_column :original_discussion_id
+ self.ignored_columns += %i[original_discussion_id]
cache_markdown_field :note, pipeline: :note, issuable_state_filter_enabled: true
diff --git a/app/models/notification_reason.rb b/app/models/notification_reason.rb
index 0a13487574f..6856d397413 100644
--- a/app/models/notification_reason.rb
+++ b/app/models/notification_reason.rb
@@ -3,9 +3,9 @@
# Holds reasons for a notification to have been sent as well as a priority list to select which reason to use
# above the rest
class NotificationReason
- OWN_ACTIVITY = 'own_activity'.freeze
- ASSIGNED = 'assigned'.freeze
- MENTIONED = 'mentioned'.freeze
+ OWN_ACTIVITY = 'own_activity'
+ ASSIGNED = 'assigned'
+ MENTIONED = 'mentioned'
# Priority list for selecting which reason to return in the notification
REASON_PRIORITY = [
diff --git a/app/models/notification_setting.rb b/app/models/notification_setting.rb
index 8306b11a7b6..637c017a342 100644
--- a/app/models/notification_setting.rb
+++ b/app/models/notification_setting.rb
@@ -1,9 +1,7 @@
# frozen_string_literal: true
class NotificationSetting < ApplicationRecord
- include IgnorableColumn
-
- ignore_column :events
+ self.ignored_columns += %i[events]
enum level: { global: 3, watch: 2, participating: 1, mention: 4, disabled: 0, custom: 5 }
diff --git a/app/models/pages_domain.rb b/app/models/pages_domain.rb
index 27c122d3559..12ce717efd7 100644
--- a/app/models/pages_domain.rb
+++ b/app/models/pages_domain.rb
@@ -1,7 +1,7 @@
# frozen_string_literal: true
class PagesDomain < ApplicationRecord
- VERIFICATION_KEY = 'gitlab-pages-verification-code'.freeze
+ VERIFICATION_KEY = 'gitlab-pages-verification-code'
VERIFICATION_THRESHOLD = 3.days.freeze
SSL_RENEWAL_THRESHOLD = 30.days.freeze
diff --git a/app/models/project.rb b/app/models/project.rb
index 8f568a5b840..17b52d0578e 100644
--- a/app/models/project.rb
+++ b/app/models/project.rb
@@ -37,8 +37,8 @@ class Project < ApplicationRecord
BoardLimitExceeded = Class.new(StandardError)
- STATISTICS_ATTRIBUTE = 'repositories_count'.freeze
- UNKNOWN_IMPORT_URL = 'http://unknown.git'.freeze
+ STATISTICS_ATTRIBUTE = 'repositories_count'
+ UNKNOWN_IMPORT_URL = 'http://unknown.git'
# Hashed Storage versions handle rolling out new storage to project and dependents models:
# nil: legacy
# 1: repository
@@ -55,6 +55,8 @@ class Project < ApplicationRecord
VALID_MIRROR_PORTS = [22, 80, 443].freeze
VALID_MIRROR_PROTOCOLS = %w(http https ssh git).freeze
+ ACCESS_REQUEST_APPROVERS_TO_BE_NOTIFIED_LIMIT = 10
+
SORTING_PREFERENCE_FIELD = :projects_sort
cache_markdown_field :description, pipeline: :description
@@ -2193,6 +2195,10 @@ class Project < ApplicationRecord
pool_repository.present?
end
+ def access_request_approvers_to_be_notified
+ members.maintainers.order_recent_sign_in.limit(ACCESS_REQUEST_APPROVERS_TO_BE_NOTIFIED_LIMIT)
+ end
+
private
def merge_requests_allowing_collaboration(source_branch = nil)
diff --git a/app/models/project_services/buildkite_service.rb b/app/models/project_services/buildkite_service.rb
index 43edfde851c..d058904dd9e 100644
--- a/app/models/project_services/buildkite_service.rb
+++ b/app/models/project_services/buildkite_service.rb
@@ -5,7 +5,7 @@ require "addressable/uri"
class BuildkiteService < CiService
include ReactiveService
- ENDPOINT = "https://buildkite.com".freeze
+ ENDPOINT = "https://buildkite.com"
prop_accessor :project_url, :token
boolean_accessor :enable_ssl_verification
diff --git a/app/models/project_services/chat_message/base_message.rb b/app/models/project_services/chat_message/base_message.rb
index 8c68ddc40f2..6542112ba32 100644
--- a/app/models/project_services/chat_message/base_message.rb
+++ b/app/models/project_services/chat_message/base_message.rb
@@ -10,6 +10,7 @@ module ChatMessage
attr_reader :user_avatar
attr_reader :project_name
attr_reader :project_url
+ attr_reader :commit_message_html
def initialize(params)
@markdown = params[:markdown] || false
@@ -18,6 +19,7 @@ module ChatMessage
@user_full_name = params.dig(:user, :name) || params[:user_full_name]
@user_name = params.dig(:user, :username) || params[:user_name]
@user_avatar = params.dig(:user, :avatar_url) || params[:user_avatar]
+ @commit_message_html = params[:commit_message_html] || false
end
def user_combined_name
diff --git a/app/models/project_services/chat_message/push_message.rb b/app/models/project_services/chat_message/push_message.rb
index 5dd0414b7e6..8163fca33a2 100644
--- a/app/models/project_services/chat_message/push_message.rb
+++ b/app/models/project_services/chat_message/push_message.rb
@@ -52,7 +52,8 @@ module ChatMessage
end
def commit_messages
- commits.map { |commit| compose_commit_message(commit) }.join("\n\n")
+ linebreak_chars = commit_message_html ? "<br/>\n<br/>\n" : "\n\n"
+ commits.map { |commit| compose_commit_message(commit) }.join(linebreak_chars)
end
def commit_message_attachments
@@ -63,6 +64,11 @@ module ChatMessage
author = commit[:author][:name]
id = Commit.truncate_sha(commit[:id])
message = commit[:message]
+
+ if commit_message_html
+ message = message.gsub(Gitlab::Regex.breakline_regex, "<br/>\n")
+ end
+
url = commit[:url]
"[#{id}](#{url}): #{message} - #{author}"
diff --git a/app/models/project_services/microsoft_teams_service.rb b/app/models/project_services/microsoft_teams_service.rb
index c22a6dc26f6..2334b3f7f66 100644
--- a/app/models/project_services/microsoft_teams_service.rb
+++ b/app/models/project_services/microsoft_teams_service.rb
@@ -58,6 +58,6 @@ class MicrosoftTeamsService < ChatNotificationService
end
def custom_data(data)
- super(data).merge(markdown: true)
+ super(data).merge(markdown: true, commit_message_html: true)
end
end
diff --git a/app/models/project_services/pivotaltracker_service.rb b/app/models/project_services/pivotaltracker_service.rb
index c15993bdc06..d3fff100964 100644
--- a/app/models/project_services/pivotaltracker_service.rb
+++ b/app/models/project_services/pivotaltracker_service.rb
@@ -1,7 +1,7 @@
# frozen_string_literal: true
class PivotaltrackerService < Service
- API_ENDPOINT = 'https://www.pivotaltracker.com/services/v5/source_commits'.freeze
+ API_ENDPOINT = 'https://www.pivotaltracker.com/services/v5/source_commits'
prop_accessor :token, :restrict_to_branch
validates :token, presence: true, if: :activated?
diff --git a/app/models/project_services/pushover_service.rb b/app/models/project_services/pushover_service.rb
index 0d35bab7f80..7324890551c 100644
--- a/app/models/project_services/pushover_service.rb
+++ b/app/models/project_services/pushover_service.rb
@@ -1,7 +1,7 @@
# frozen_string_literal: true
class PushoverService < Service
- BASE_URI = 'https://api.pushover.net/1'.freeze
+ BASE_URI = 'https://api.pushover.net/1'
prop_accessor :api_key, :user_key, :device, :priority, :sound
validates :api_key, :user_key, :priority, presence: true, if: :activated?
diff --git a/app/models/project_services/slash_commands_service.rb b/app/models/project_services/slash_commands_service.rb
index cb16ad75d14..5bfd06476f0 100644
--- a/app/models/project_services/slash_commands_service.rb
+++ b/app/models/project_services/slash_commands_service.rb
@@ -35,7 +35,9 @@ class SlashCommandsService < Service
chat_user = find_chat_user(params)
if chat_user&.user
- return Gitlab::SlashCommands::Presenters::Access.new.access_denied unless chat_user.user.can?(:use_slash_commands)
+ unless chat_user.user.can?(:use_slash_commands)
+ return Gitlab::SlashCommands::Presenters::Access.new.access_denied(project)
+ end
Gitlab::SlashCommands::Command.new(project, chat_user, params).execute
else
diff --git a/app/models/repository.rb b/app/models/repository.rb
index 6f63cd32da4..7882b2b3036 100644
--- a/app/models/repository.rb
+++ b/app/models/repository.rb
@@ -3,9 +3,9 @@
require 'securerandom'
class Repository
- REF_MERGE_REQUEST = 'merge-requests'.freeze
- REF_KEEP_AROUND = 'keep-around'.freeze
- REF_ENVIRONMENTS = 'environments'.freeze
+ REF_MERGE_REQUEST = 'merge-requests'
+ REF_KEEP_AROUND = 'keep-around'
+ REF_ENVIRONMENTS = 'environments'
ARCHIVE_CACHE_TIME = 60 # Cache archives referred to by a (mutable) ref for 1 minute
ARCHIVE_CACHE_TIME_IMMUTABLE = 3600 # Cache archives referred to by an immutable reference for 1 hour
diff --git a/app/models/user.rb b/app/models/user.rb
index 9952bc7e1ad..67d730e2fa3 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -13,7 +13,6 @@ class User < ApplicationRecord
include Sortable
include CaseSensitivity
include TokenAuthenticatable
- include IgnorableColumn
include FeatureGate
include CreatedAtFilterable
include BulkMemberAccessLoad
@@ -24,9 +23,11 @@ class User < ApplicationRecord
DEFAULT_NOTIFICATION_LEVEL = :participating
- ignore_column :external_email
- ignore_column :email_provider
- ignore_column :authentication_token
+ self.ignored_columns += %i[
+ authentication_token
+ email_provider
+ external_email
+ ]
add_authentication_token_field :incoming_email_token, token_generator: -> { SecureRandom.hex.to_i(16).to_s(36) }
add_authentication_token_field :feed_token
@@ -58,7 +59,7 @@ class User < ApplicationRecord
:validatable, :omniauthable, :confirmable, :registerable
BLOCKED_MESSAGE = "Your account has been blocked. Please contact your GitLab " \
- "administrator if you think this is an error.".freeze
+ "administrator if you think this is an error."
# Override Devise::Models::Trackable#update_tracked_fields!
# to limit database writes to at most once every hour
@@ -493,7 +494,7 @@ class User < ApplicationRecord
def by_login(login)
return unless login
- if login.include?('@'.freeze)
+ if login.include?('@')
unscoped.iwhere(email: login).take
else
unscoped.iwhere(username: login).take
diff --git a/app/models/user_status.rb b/app/models/user_status.rb
index 6ced4f56823..016b89bae81 100644
--- a/app/models/user_status.rb
+++ b/app/models/user_status.rb
@@ -5,7 +5,7 @@ class UserStatus < ApplicationRecord
self.primary_key = :user_id
- DEFAULT_EMOJI = 'speech_balloon'.freeze
+ DEFAULT_EMOJI = 'speech_balloon'
belongs_to :user
diff --git a/app/serializers/deployment_entity.rb b/app/serializers/deployment_entity.rb
index 8b967459173..94a827658f0 100644
--- a/app/serializers/deployment_entity.rb
+++ b/app/serializers/deployment_entity.rb
@@ -23,7 +23,7 @@ class DeploymentEntity < Grape::Entity
expose :last?
expose :deployed_by, as: :user, using: UserEntity
- expose :deployable do |deployment, opts|
+ expose :deployable, if: -> (deployment) { deployment.deployable.present? } do |deployment, opts|
deployment.deployable.yield_self do |deployable|
if include_details?
JobEntity.represent(deployable, opts)
diff --git a/app/services/clusters/create_service.rb b/app/services/clusters/create_service.rb
index e5a5b73321a..bbbeb4b30e4 100644
--- a/app/services/clusters/create_service.rb
+++ b/app/services/clusters/create_service.rb
@@ -37,7 +37,7 @@ module Clusters
end
def global_params
- { user: current_user, namespace_per_environment: Feature.enabled?(:kubernetes_namespace_per_environment, default_enabled: true) }
+ { user: current_user }
end
def clusterable_params
diff --git a/app/services/clusters/gcp/finalize_creation_service.rb b/app/services/clusters/gcp/finalize_creation_service.rb
index 2f3c1df7651..c5cde831964 100644
--- a/app/services/clusters/gcp/finalize_creation_service.rb
+++ b/app/services/clusters/gcp/finalize_creation_service.rb
@@ -26,7 +26,7 @@ module Clusters
private
def create_gitlab_service_account!
- Clusters::Gcp::Kubernetes::CreateOrUpdateServiceAccountService.gitlab_creator(
+ Clusters::Kubernetes::CreateOrUpdateServiceAccountService.gitlab_creator(
kube_client,
rbac: create_rbac_cluster?
).execute
@@ -49,10 +49,10 @@ module Clusters
end
def request_kubernetes_token
- Clusters::Gcp::Kubernetes::FetchKubernetesTokenService.new(
+ Clusters::Kubernetes::FetchKubernetesTokenService.new(
kube_client,
- Clusters::Gcp::Kubernetes::GITLAB_ADMIN_TOKEN_NAME,
- Clusters::Gcp::Kubernetes::GITLAB_SERVICE_ACCOUNT_NAMESPACE
+ Clusters::Kubernetes::GITLAB_ADMIN_TOKEN_NAME,
+ Clusters::Kubernetes::GITLAB_SERVICE_ACCOUNT_NAMESPACE
).execute
end
diff --git a/app/services/clusters/gcp/kubernetes.rb b/app/services/clusters/gcp/kubernetes.rb
deleted file mode 100644
index 85711764785..00000000000
--- a/app/services/clusters/gcp/kubernetes.rb
+++ /dev/null
@@ -1,16 +0,0 @@
-# frozen_string_literal: true
-
-module Clusters
- module Gcp
- module Kubernetes
- GITLAB_SERVICE_ACCOUNT_NAME = 'gitlab'
- GITLAB_SERVICE_ACCOUNT_NAMESPACE = 'default'
- GITLAB_ADMIN_TOKEN_NAME = 'gitlab-token'
- GITLAB_CLUSTER_ROLE_BINDING_NAME = 'gitlab-admin'
- GITLAB_CLUSTER_ROLE_NAME = 'cluster-admin'
- PROJECT_CLUSTER_ROLE_NAME = 'edit'
- GITLAB_KNATIVE_SERVING_ROLE_NAME = 'gitlab-knative-serving-role'
- GITLAB_KNATIVE_SERVING_ROLE_BINDING_NAME = 'gitlab-knative-serving-rolebinding'
- end
- end
-end
diff --git a/app/services/clusters/gcp/kubernetes/create_or_update_namespace_service.rb b/app/services/clusters/gcp/kubernetes/create_or_update_namespace_service.rb
deleted file mode 100644
index c45dac7b273..00000000000
--- a/app/services/clusters/gcp/kubernetes/create_or_update_namespace_service.rb
+++ /dev/null
@@ -1,47 +0,0 @@
-# frozen_string_literal: true
-
-module Clusters
- module Gcp
- module Kubernetes
- class CreateOrUpdateNamespaceService
- def initialize(cluster:, kubernetes_namespace:)
- @cluster = cluster
- @kubernetes_namespace = kubernetes_namespace
- @platform = cluster.platform
- end
-
- def execute
- create_project_service_account
- configure_kubernetes_token
-
- kubernetes_namespace.save!
- end
-
- private
-
- attr_reader :cluster, :kubernetes_namespace, :platform
-
- def create_project_service_account
- Clusters::Gcp::Kubernetes::CreateOrUpdateServiceAccountService.namespace_creator(
- platform.kubeclient,
- service_account_name: kubernetes_namespace.service_account_name,
- service_account_namespace: kubernetes_namespace.namespace,
- rbac: platform.rbac?
- ).execute
- end
-
- def configure_kubernetes_token
- kubernetes_namespace.service_account_token = fetch_service_account_token
- end
-
- def fetch_service_account_token
- Clusters::Gcp::Kubernetes::FetchKubernetesTokenService.new(
- platform.kubeclient,
- kubernetes_namespace.token_name,
- kubernetes_namespace.namespace
- ).execute
- end
- end
- end
- end
-end
diff --git a/app/services/clusters/gcp/kubernetes/create_or_update_service_account_service.rb b/app/services/clusters/gcp/kubernetes/create_or_update_service_account_service.rb
deleted file mode 100644
index 7c5450dbcd6..00000000000
--- a/app/services/clusters/gcp/kubernetes/create_or_update_service_account_service.rb
+++ /dev/null
@@ -1,141 +0,0 @@
-# frozen_string_literal: true
-
-module Clusters
- module Gcp
- module Kubernetes
- class CreateOrUpdateServiceAccountService
- def initialize(kubeclient, service_account_name:, service_account_namespace:, token_name:, rbac:, namespace_creator: false, role_binding_name: nil)
- @kubeclient = kubeclient
- @service_account_name = service_account_name
- @service_account_namespace = service_account_namespace
- @token_name = token_name
- @rbac = rbac
- @namespace_creator = namespace_creator
- @role_binding_name = role_binding_name
- end
-
- def self.gitlab_creator(kubeclient, rbac:)
- self.new(
- kubeclient,
- service_account_name: Clusters::Gcp::Kubernetes::GITLAB_SERVICE_ACCOUNT_NAME,
- service_account_namespace: Clusters::Gcp::Kubernetes::GITLAB_SERVICE_ACCOUNT_NAMESPACE,
- token_name: Clusters::Gcp::Kubernetes::GITLAB_ADMIN_TOKEN_NAME,
- rbac: rbac
- )
- end
-
- def self.namespace_creator(kubeclient, service_account_name:, service_account_namespace:, rbac:)
- self.new(
- kubeclient,
- service_account_name: service_account_name,
- service_account_namespace: service_account_namespace,
- token_name: "#{service_account_namespace}-token",
- rbac: rbac,
- namespace_creator: true,
- role_binding_name: "gitlab-#{service_account_namespace}"
- )
- end
-
- def execute
- ensure_project_namespace_exists if namespace_creator
-
- kubeclient.create_or_update_service_account(service_account_resource)
- kubeclient.create_or_update_secret(service_account_token_resource)
-
- return unless rbac
-
- create_role_or_cluster_role_binding
-
- return unless namespace_creator
-
- create_or_update_knative_serving_role
- create_or_update_knative_serving_role_binding
- end
-
- private
-
- attr_reader :kubeclient, :service_account_name, :service_account_namespace, :token_name, :rbac, :namespace_creator, :role_binding_name
-
- def ensure_project_namespace_exists
- Gitlab::Kubernetes::Namespace.new(
- service_account_namespace,
- kubeclient
- ).ensure_exists!
- end
-
- def create_role_or_cluster_role_binding
- if namespace_creator
- kubeclient.create_or_update_role_binding(role_binding_resource)
- else
- kubeclient.create_or_update_cluster_role_binding(cluster_role_binding_resource)
- end
- end
-
- def create_or_update_knative_serving_role
- kubeclient.update_role(knative_serving_role_resource)
- end
-
- def create_or_update_knative_serving_role_binding
- kubeclient.update_role_binding(knative_serving_role_binding_resource)
- end
-
- def service_account_resource
- Gitlab::Kubernetes::ServiceAccount.new(
- service_account_name,
- service_account_namespace
- ).generate
- end
-
- def service_account_token_resource
- Gitlab::Kubernetes::ServiceAccountToken.new(
- token_name,
- service_account_name,
- service_account_namespace
- ).generate
- end
-
- def cluster_role_binding_resource
- subjects = [{ kind: 'ServiceAccount', name: service_account_name, namespace: service_account_namespace }]
-
- Gitlab::Kubernetes::ClusterRoleBinding.new(
- Clusters::Gcp::Kubernetes::GITLAB_CLUSTER_ROLE_BINDING_NAME,
- Clusters::Gcp::Kubernetes::GITLAB_CLUSTER_ROLE_NAME,
- subjects
- ).generate
- end
-
- def role_binding_resource
- Gitlab::Kubernetes::RoleBinding.new(
- name: role_binding_name,
- role_name: Clusters::Gcp::Kubernetes::PROJECT_CLUSTER_ROLE_NAME,
- role_kind: :ClusterRole,
- namespace: service_account_namespace,
- service_account_name: service_account_name
- ).generate
- end
-
- def knative_serving_role_resource
- Gitlab::Kubernetes::Role.new(
- name: Clusters::Gcp::Kubernetes::GITLAB_KNATIVE_SERVING_ROLE_NAME,
- namespace: service_account_namespace,
- rules: [{
- apiGroups: %w(serving.knative.dev),
- resources: %w(configurations configurationgenerations routes revisions revisionuids autoscalers services),
- verbs: %w(get list create update delete patch watch)
- }]
- ).generate
- end
-
- def knative_serving_role_binding_resource
- Gitlab::Kubernetes::RoleBinding.new(
- name: Clusters::Gcp::Kubernetes::GITLAB_KNATIVE_SERVING_ROLE_BINDING_NAME,
- role_name: Clusters::Gcp::Kubernetes::GITLAB_KNATIVE_SERVING_ROLE_NAME,
- role_kind: :Role,
- namespace: service_account_namespace,
- service_account_name: service_account_name
- ).generate
- end
- end
- end
- end
-end
diff --git a/app/services/clusters/gcp/kubernetes/fetch_kubernetes_token_service.rb b/app/services/clusters/gcp/kubernetes/fetch_kubernetes_token_service.rb
deleted file mode 100644
index 5d9bdc52d37..00000000000
--- a/app/services/clusters/gcp/kubernetes/fetch_kubernetes_token_service.rb
+++ /dev/null
@@ -1,42 +0,0 @@
-# frozen_string_literal: true
-
-module Clusters
- module Gcp
- module Kubernetes
- class FetchKubernetesTokenService
- DEFAULT_TOKEN_RETRY_DELAY = 5.seconds
- TOKEN_RETRY_LIMIT = 5
-
- attr_reader :kubeclient, :service_account_token_name, :namespace
-
- def initialize(kubeclient, service_account_token_name, namespace, token_retry_delay: DEFAULT_TOKEN_RETRY_DELAY)
- @kubeclient = kubeclient
- @service_account_token_name = service_account_token_name
- @namespace = namespace
- @token_retry_delay = token_retry_delay
- end
-
- def execute
- # Kubernetes will create the Secret and set the token asynchronously
- # so it is necessary to retry
- # https://kubernetes.io/docs/reference/access-authn-authz/service-accounts-admin/#token-controller
- TOKEN_RETRY_LIMIT.times do
- token_base64 = get_secret&.dig('data', 'token')
- return Base64.decode64(token_base64) if token_base64
-
- sleep @token_retry_delay
- end
-
- nil
- end
-
- private
-
- def get_secret
- kubeclient.get_secret(service_account_token_name, namespace).as_json
- rescue Kubeclient::ResourceNotFoundError
- end
- end
- end
- end
-end
diff --git a/app/services/clusters/kubernetes/create_or_update_namespace_service.rb b/app/services/clusters/kubernetes/create_or_update_namespace_service.rb
new file mode 100644
index 00000000000..15be8446cc0
--- /dev/null
+++ b/app/services/clusters/kubernetes/create_or_update_namespace_service.rb
@@ -0,0 +1,45 @@
+# frozen_string_literal: true
+
+module Clusters
+ module Kubernetes
+ class CreateOrUpdateNamespaceService
+ def initialize(cluster:, kubernetes_namespace:)
+ @cluster = cluster
+ @kubernetes_namespace = kubernetes_namespace
+ @platform = cluster.platform
+ end
+
+ def execute
+ create_project_service_account
+ configure_kubernetes_token
+
+ kubernetes_namespace.save!
+ end
+
+ private
+
+ attr_reader :cluster, :kubernetes_namespace, :platform
+
+ def create_project_service_account
+ Clusters::Kubernetes::CreateOrUpdateServiceAccountService.namespace_creator(
+ platform.kubeclient,
+ service_account_name: kubernetes_namespace.service_account_name,
+ service_account_namespace: kubernetes_namespace.namespace,
+ rbac: platform.rbac?
+ ).execute
+ end
+
+ def configure_kubernetes_token
+ kubernetes_namespace.service_account_token = fetch_service_account_token
+ end
+
+ def fetch_service_account_token
+ Clusters::Kubernetes::FetchKubernetesTokenService.new(
+ platform.kubeclient,
+ kubernetes_namespace.token_name,
+ kubernetes_namespace.namespace
+ ).execute
+ end
+ end
+ end
+end
diff --git a/app/services/clusters/kubernetes/create_or_update_service_account_service.rb b/app/services/clusters/kubernetes/create_or_update_service_account_service.rb
new file mode 100644
index 00000000000..8b8ad924b64
--- /dev/null
+++ b/app/services/clusters/kubernetes/create_or_update_service_account_service.rb
@@ -0,0 +1,139 @@
+# frozen_string_literal: true
+
+module Clusters
+ module Kubernetes
+ class CreateOrUpdateServiceAccountService
+ def initialize(kubeclient, service_account_name:, service_account_namespace:, token_name:, rbac:, namespace_creator: false, role_binding_name: nil)
+ @kubeclient = kubeclient
+ @service_account_name = service_account_name
+ @service_account_namespace = service_account_namespace
+ @token_name = token_name
+ @rbac = rbac
+ @namespace_creator = namespace_creator
+ @role_binding_name = role_binding_name
+ end
+
+ def self.gitlab_creator(kubeclient, rbac:)
+ self.new(
+ kubeclient,
+ service_account_name: Clusters::Kubernetes::GITLAB_SERVICE_ACCOUNT_NAME,
+ service_account_namespace: Clusters::Kubernetes::GITLAB_SERVICE_ACCOUNT_NAMESPACE,
+ token_name: Clusters::Kubernetes::GITLAB_ADMIN_TOKEN_NAME,
+ rbac: rbac
+ )
+ end
+
+ def self.namespace_creator(kubeclient, service_account_name:, service_account_namespace:, rbac:)
+ self.new(
+ kubeclient,
+ service_account_name: service_account_name,
+ service_account_namespace: service_account_namespace,
+ token_name: "#{service_account_namespace}-token",
+ rbac: rbac,
+ namespace_creator: true,
+ role_binding_name: "gitlab-#{service_account_namespace}"
+ )
+ end
+
+ def execute
+ ensure_project_namespace_exists if namespace_creator
+
+ kubeclient.create_or_update_service_account(service_account_resource)
+ kubeclient.create_or_update_secret(service_account_token_resource)
+
+ return unless rbac
+
+ create_role_or_cluster_role_binding
+
+ return unless namespace_creator
+
+ create_or_update_knative_serving_role
+ create_or_update_knative_serving_role_binding
+ end
+
+ private
+
+ attr_reader :kubeclient, :service_account_name, :service_account_namespace, :token_name, :rbac, :namespace_creator, :role_binding_name
+
+ def ensure_project_namespace_exists
+ Gitlab::Kubernetes::Namespace.new(
+ service_account_namespace,
+ kubeclient
+ ).ensure_exists!
+ end
+
+ def create_role_or_cluster_role_binding
+ if namespace_creator
+ kubeclient.create_or_update_role_binding(role_binding_resource)
+ else
+ kubeclient.create_or_update_cluster_role_binding(cluster_role_binding_resource)
+ end
+ end
+
+ def create_or_update_knative_serving_role
+ kubeclient.update_role(knative_serving_role_resource)
+ end
+
+ def create_or_update_knative_serving_role_binding
+ kubeclient.update_role_binding(knative_serving_role_binding_resource)
+ end
+
+ def service_account_resource
+ Gitlab::Kubernetes::ServiceAccount.new(
+ service_account_name,
+ service_account_namespace
+ ).generate
+ end
+
+ def service_account_token_resource
+ Gitlab::Kubernetes::ServiceAccountToken.new(
+ token_name,
+ service_account_name,
+ service_account_namespace
+ ).generate
+ end
+
+ def cluster_role_binding_resource
+ subjects = [{ kind: 'ServiceAccount', name: service_account_name, namespace: service_account_namespace }]
+
+ Gitlab::Kubernetes::ClusterRoleBinding.new(
+ Clusters::Kubernetes::GITLAB_CLUSTER_ROLE_BINDING_NAME,
+ Clusters::Kubernetes::GITLAB_CLUSTER_ROLE_NAME,
+ subjects
+ ).generate
+ end
+
+ def role_binding_resource
+ Gitlab::Kubernetes::RoleBinding.new(
+ name: role_binding_name,
+ role_name: Clusters::Kubernetes::PROJECT_CLUSTER_ROLE_NAME,
+ role_kind: :ClusterRole,
+ namespace: service_account_namespace,
+ service_account_name: service_account_name
+ ).generate
+ end
+
+ def knative_serving_role_resource
+ Gitlab::Kubernetes::Role.new(
+ name: Clusters::Kubernetes::GITLAB_KNATIVE_SERVING_ROLE_NAME,
+ namespace: service_account_namespace,
+ rules: [{
+ apiGroups: %w(serving.knative.dev),
+ resources: %w(configurations configurationgenerations routes revisions revisionuids autoscalers services),
+ verbs: %w(get list create update delete patch watch)
+ }]
+ ).generate
+ end
+
+ def knative_serving_role_binding_resource
+ Gitlab::Kubernetes::RoleBinding.new(
+ name: Clusters::Kubernetes::GITLAB_KNATIVE_SERVING_ROLE_BINDING_NAME,
+ role_name: Clusters::Kubernetes::GITLAB_KNATIVE_SERVING_ROLE_NAME,
+ role_kind: :Role,
+ namespace: service_account_namespace,
+ service_account_name: service_account_name
+ ).generate
+ end
+ end
+ end
+end
diff --git a/app/services/clusters/kubernetes/fetch_kubernetes_token_service.rb b/app/services/clusters/kubernetes/fetch_kubernetes_token_service.rb
new file mode 100644
index 00000000000..aaf437abfad
--- /dev/null
+++ b/app/services/clusters/kubernetes/fetch_kubernetes_token_service.rb
@@ -0,0 +1,40 @@
+# frozen_string_literal: true
+
+module Clusters
+ module Kubernetes
+ class FetchKubernetesTokenService
+ DEFAULT_TOKEN_RETRY_DELAY = 5.seconds
+ TOKEN_RETRY_LIMIT = 5
+
+ attr_reader :kubeclient, :service_account_token_name, :namespace
+
+ def initialize(kubeclient, service_account_token_name, namespace, token_retry_delay: DEFAULT_TOKEN_RETRY_DELAY)
+ @kubeclient = kubeclient
+ @service_account_token_name = service_account_token_name
+ @namespace = namespace
+ @token_retry_delay = token_retry_delay
+ end
+
+ def execute
+ # Kubernetes will create the Secret and set the token asynchronously
+ # so it is necessary to retry
+ # https://kubernetes.io/docs/reference/access-authn-authz/service-accounts-admin/#token-controller
+ TOKEN_RETRY_LIMIT.times do
+ token_base64 = get_secret&.dig('data', 'token')
+ return Base64.decode64(token_base64) if token_base64
+
+ sleep @token_retry_delay
+ end
+
+ nil
+ end
+
+ private
+
+ def get_secret
+ kubeclient.get_secret(service_account_token_name, namespace).as_json
+ rescue Kubeclient::ResourceNotFoundError
+ end
+ end
+ end
+end
diff --git a/app/services/clusters/kubernetes/kubernetes.rb b/app/services/clusters/kubernetes/kubernetes.rb
new file mode 100644
index 00000000000..7d5d0c2c1d6
--- /dev/null
+++ b/app/services/clusters/kubernetes/kubernetes.rb
@@ -0,0 +1,14 @@
+# frozen_string_literal: true
+
+module Clusters
+ module Kubernetes
+ GITLAB_SERVICE_ACCOUNT_NAME = 'gitlab'
+ GITLAB_SERVICE_ACCOUNT_NAMESPACE = 'default'
+ GITLAB_ADMIN_TOKEN_NAME = 'gitlab-token'
+ GITLAB_CLUSTER_ROLE_BINDING_NAME = 'gitlab-admin'
+ GITLAB_CLUSTER_ROLE_NAME = 'cluster-admin'
+ PROJECT_CLUSTER_ROLE_NAME = 'edit'
+ GITLAB_KNATIVE_SERVING_ROLE_NAME = 'gitlab-knative-serving-role'
+ GITLAB_KNATIVE_SERVING_ROLE_BINDING_NAME = 'gitlab-knative-serving-rolebinding'
+ end
+end
diff --git a/app/services/notification_service.rb b/app/services/notification_service.rb
index 83710ffce2f..5b8c1288854 100644
--- a/app/services/notification_service.rb
+++ b/app/services/notification_service.rb
@@ -293,11 +293,16 @@ class NotificationService
def new_access_request(member)
return true unless member.notifiable?(:subscription)
- recipients = member.source.members.active_without_invites_and_requests.owners_and_maintainers
- if fallback_to_group_owners_maintainers?(recipients, member)
- recipients = member.source.group.members.active_without_invites_and_requests.owners_and_maintainers
+ source = member.source
+
+ recipients = source.access_request_approvers_to_be_notified
+
+ if fallback_to_group_access_request_approvers?(recipients, source)
+ recipients = source.group.access_request_approvers_to_be_notified
end
+ return true if recipients.empty?
+
recipients.each { |recipient| deliver_access_request_email(recipient, member) }
end
@@ -611,9 +616,9 @@ class NotificationService
mailer.member_access_requested_email(member.real_source_type, member.id, recipient.user.id).deliver_later
end
- def fallback_to_group_owners_maintainers?(recipients, member)
+ def fallback_to_group_access_request_approvers?(recipients, source)
return false if recipients.present?
- member.source.respond_to?(:group) && member.source.group
+ source.respond_to?(:group) && source.group
end
end
diff --git a/app/services/quick_actions/interpret_service.rb b/app/services/quick_actions/interpret_service.rb
index 7f944e25887..e0924608a6d 100644
--- a/app/services/quick_actions/interpret_service.rb
+++ b/app/services/quick_actions/interpret_service.rb
@@ -5,8 +5,8 @@ module QuickActions
include Gitlab::Utils::StrongMemoize
include Gitlab::QuickActions::Dsl
include Gitlab::QuickActions::IssueActions
- include Gitlab::QuickActions::IssueAndMergeRequestActions
include Gitlab::QuickActions::IssuableActions
+ include Gitlab::QuickActions::IssueAndMergeRequestActions
include Gitlab::QuickActions::MergeRequestActions
include Gitlab::QuickActions::CommitActions
include Gitlab::QuickActions::CommonActions
diff --git a/app/views/layouts/devise.html.haml b/app/views/layouts/devise.html.haml
index e9a4a068599..d36e08f44a4 100644
--- a/app/views/layouts/devise.html.haml
+++ b/app/views/layouts/devise.html.haml
@@ -1,8 +1,9 @@
!!! 5
%html.devise-layout-html{ class: system_message_class }
= render "layouts/head"
- %body.ui-indigo.login-page.application.navless{ data: { page: body_data_page, qa_selector: 'login_page' } }
+ %body.ui-indigo.login-page.application.navless{ class: "#{client_class_list}", data: { page: body_data_page, qa_selector: 'login_page' } }
= header_message
+ = render "layouts/init_client_detection_flags"
.page-wrap
= render "layouts/header/empty"
.login-page-broadcast
diff --git a/app/views/layouts/devise_empty.html.haml b/app/views/layouts/devise_empty.html.haml
index 6c9c8aa4431..ff2b00ea376 100644
--- a/app/views/layouts/devise_empty.html.haml
+++ b/app/views/layouts/devise_empty.html.haml
@@ -1,8 +1,9 @@
!!! 5
%html{ lang: "en", class: system_message_class }
= render "layouts/head"
- %body.ui-indigo.login-page.application.navless
+ %body.ui-indigo.login-page.application.navless{ class: "#{client_class_list}" }
= header_message
+ = render "layouts/init_client_detection_flags"
= render "layouts/header/empty"
= render "layouts/broadcast"
.container.navless-container
diff --git a/app/views/peek/_bar.html.haml b/app/views/peek/_bar.html.haml
index 5228930293c..9725f640be9 100644
--- a/app/views/peek/_bar.html.haml
+++ b/app/views/peek/_bar.html.haml
@@ -1,6 +1,6 @@
-- return unless peek_enabled?
+- return unless performance_bar_enabled?
#js-peek{ data: { env: Peek.env,
- request_id: Peek.request_id,
+ request_id: peek_request_id,
peek_url: "#{peek_routes_path}/results" },
class: Peek.env }
diff --git a/app/views/projects/pages/_access.html.haml b/app/views/projects/pages/_access.html.haml
index 73ea30e1d3d..539f223ca9b 100644
--- a/app/views/projects/pages/_access.html.haml
+++ b/app/views/projects/pages/_access.html.haml
@@ -5,9 +5,11 @@
.card-body
%p
%strong
- Congratulations! Your pages are served under:
+ = _("Your pages are served under:")
%p= link_to @project.pages_url, @project.pages_url
- @project.pages_domains.each do |domain|
%p= link_to domain.url, domain.url
+ .card-footer.alert-primary
+ = _("It may take up to 30 minutes before the site is available after the first deployment.")
diff --git a/changelogs/unreleased/28643-access-request-emails-limit-to-ten-owners.yml b/changelogs/unreleased/28643-access-request-emails-limit-to-ten-owners.yml
new file mode 100644
index 00000000000..25e83eaf68e
--- /dev/null
+++ b/changelogs/unreleased/28643-access-request-emails-limit-to-ten-owners.yml
@@ -0,0 +1,5 @@
+---
+title: Limit access request emails to ten most recently active owners or maintainers
+merge_request: 32141
+author:
+type: changed
diff --git a/changelogs/unreleased/56295-some-avatars-not-visible-in-commit-trailers.yml b/changelogs/unreleased/56295-some-avatars-not-visible-in-commit-trailers.yml
new file mode 100644
index 00000000000..23450c0fdc3
--- /dev/null
+++ b/changelogs/unreleased/56295-some-avatars-not-visible-in-commit-trailers.yml
@@ -0,0 +1,5 @@
+---
+title: Fix for missing avatar images dislpayed in commit trailers.
+merge_request: 32374
+author: Jesse Hall @jessehall3
+type: fixed
diff --git a/changelogs/unreleased/60561-quick-action-label-first-for-issue.yml b/changelogs/unreleased/60561-quick-action-label-first-for-issue.yml
new file mode 100644
index 00000000000..c4bcb2b05f3
--- /dev/null
+++ b/changelogs/unreleased/60561-quick-action-label-first-for-issue.yml
@@ -0,0 +1,5 @@
+---
+title: Quick action label must be first in issue comment
+merge_request: 32367
+author: Romain Maneschi
+type: fixed
diff --git a/changelogs/unreleased/65304-add-pages-first-deployment-message.yml b/changelogs/unreleased/65304-add-pages-first-deployment-message.yml
new file mode 100644
index 00000000000..d4c3533acaf
--- /dev/null
+++ b/changelogs/unreleased/65304-add-pages-first-deployment-message.yml
@@ -0,0 +1,5 @@
+---
+title: Add warning about initial deployment delay for GitLab Pages sites
+merge_request: 32122
+author:
+type: added
diff --git a/changelogs/unreleased/65389-wrong-format-on-ms-teams-integration-push-events-with-multi-line-commit-messages.yml b/changelogs/unreleased/65389-wrong-format-on-ms-teams-integration-push-events-with-multi-line-commit-messages.yml
new file mode 100644
index 00000000000..36e1da2c17c
--- /dev/null
+++ b/changelogs/unreleased/65389-wrong-format-on-ms-teams-integration-push-events-with-multi-line-commit-messages.yml
@@ -0,0 +1,5 @@
+---
+title: Wrong format on MS teams integration push events with multi line commit messages
+merge_request: 32180
+author: Massimeddu Cireddu
+type: fixed
diff --git a/changelogs/unreleased/add-warning-note-to-project-container-registry-setting.yml b/changelogs/unreleased/add-warning-note-to-project-container-registry-setting.yml
new file mode 100644
index 00000000000..0663788b680
--- /dev/null
+++ b/changelogs/unreleased/add-warning-note-to-project-container-registry-setting.yml
@@ -0,0 +1,6 @@
+---
+title: Added warning note on the project container registry setting informing users
+ that the registry is public for public projects
+merge_request: 32447
+author:
+type: other
diff --git a/changelogs/unreleased/cert_manager_v0_9.yml b/changelogs/unreleased/cert_manager_v0_9.yml
new file mode 100644
index 00000000000..bda5bbffab5
--- /dev/null
+++ b/changelogs/unreleased/cert_manager_v0_9.yml
@@ -0,0 +1,5 @@
+---
+title: Install cert-manager v0.9.1
+merge_request: 32243
+author:
+type: changed
diff --git a/changelogs/unreleased/fix-nil-deployable-exception-on-job-controller-show.yml b/changelogs/unreleased/fix-nil-deployable-exception-on-job-controller-show.yml
new file mode 100644
index 00000000000..b79317e3ab7
--- /dev/null
+++ b/changelogs/unreleased/fix-nil-deployable-exception-on-job-controller-show.yml
@@ -0,0 +1,5 @@
+---
+title: Fix users cannot access job detail page when deployable does not exist
+merge_request: 32247
+author:
+type: fixed
diff --git a/changelogs/unreleased/fix-peek-on-puma.yml b/changelogs/unreleased/fix-peek-on-puma.yml
new file mode 100644
index 00000000000..1071607b628
--- /dev/null
+++ b/changelogs/unreleased/fix-peek-on-puma.yml
@@ -0,0 +1,5 @@
+---
+title: Fix performance bar on Puma
+merge_request: 32213
+author:
+type: fixed
diff --git a/changelogs/unreleased/improve-chatops-help.yml b/changelogs/unreleased/improve-chatops-help.yml
new file mode 100644
index 00000000000..77e6f2e5308
--- /dev/null
+++ b/changelogs/unreleased/improve-chatops-help.yml
@@ -0,0 +1,5 @@
+---
+title: Improve chatops help output
+merge_request: 32208
+author:
+type: changed
diff --git a/changelogs/unreleased/issue_10770.yml b/changelogs/unreleased/issue_10770.yml
new file mode 100644
index 00000000000..728160b24ad
--- /dev/null
+++ b/changelogs/unreleased/issue_10770.yml
@@ -0,0 +1,5 @@
+---
+title: Rename epic column state to state_id
+merge_request: 32270
+author:
+type: changed
diff --git a/changelogs/unreleased/refactor-showStagedIcon.yml b/changelogs/unreleased/refactor-showStagedIcon.yml
new file mode 100644
index 00000000000..94c58c4dc45
--- /dev/null
+++ b/changelogs/unreleased/refactor-showStagedIcon.yml
@@ -0,0 +1,5 @@
+---
+title: Refactor showStagedIcon property to reflect the behavior its name represents.
+merge_request: 32333
+author: Arun Kumar Mohan
+type: other
diff --git a/changelogs/unreleased/sh-fix-ci-lint-500-error.yml b/changelogs/unreleased/sh-fix-ci-lint-500-error.yml
new file mode 100644
index 00000000000..74d9f980d46
--- /dev/null
+++ b/changelogs/unreleased/sh-fix-ci-lint-500-error.yml
@@ -0,0 +1,5 @@
+---
+title: Fix 500 error in CI lint when included templates are an array
+merge_request: 32232
+author:
+type: fixed
diff --git a/changelogs/unreleased/sh-mermaid-8-2-6.yml b/changelogs/unreleased/sh-mermaid-8-2-6.yml
new file mode 100644
index 00000000000..d5cee250385
--- /dev/null
+++ b/changelogs/unreleased/sh-mermaid-8-2-6.yml
@@ -0,0 +1,5 @@
+---
+title: Update Mermaid to v8.2.6
+merge_request: 32502
+author:
+type: fixed
diff --git a/changelogs/unreleased/swagger-ui-ci-page-template.yml b/changelogs/unreleased/swagger-ui-ci-page-template.yml
new file mode 100644
index 00000000000..6d17baf82c8
--- /dev/null
+++ b/changelogs/unreleased/swagger-ui-ci-page-template.yml
@@ -0,0 +1,5 @@
+---
+title: "Add SwaggerUI Pages template for .gitlab-ci.yml"
+merge_request: 31183
+author: mdhtr
+type: added
diff --git a/changelogs/unreleased/update-workhorse.yml b/changelogs/unreleased/update-workhorse.yml
new file mode 100644
index 00000000000..e6e5720e9b6
--- /dev/null
+++ b/changelogs/unreleased/update-workhorse.yml
@@ -0,0 +1,5 @@
+---
+title: Update GitLab Workhorse to v8.10.0
+merge_request: 32501
+author:
+type: other
diff --git a/config/dependency_decisions.yml b/config/dependency_decisions.yml
index 40a80429afa..33c90989548 100644
--- a/config/dependency_decisions.yml
+++ b/config/dependency_decisions.yml
@@ -606,3 +606,10 @@
:why: https://github.com/egonSchiele/contracts.ruby/blob/master/LICENSE
:versions: []
:when: 2019-04-01 11:29:39.361015000 Z
+- - :license
+ - atlassian-jwt
+ - Apache 2.0
+ - :who: Takuya Noguchi
+ :why: https://bitbucket.org/atlassian/atlassian-jwt-ruby/src/master/LICENSE.txt
+ :versions: []
+ :when: 2019-08-30 05:45:35.317663000 Z
diff --git a/db/fixtures/development/98_gitlab_instance_administration_project.rb b/db/fixtures/development/98_gitlab_instance_administration_project.rb
new file mode 100644
index 00000000000..6cf3ae95cee
--- /dev/null
+++ b/db/fixtures/development/98_gitlab_instance_administration_project.rb
@@ -0,0 +1,3 @@
+# frozen_string_literal: true
+
+::Gitlab::DatabaseImporters::SelfMonitoring::Project::CreateService.new.execute!
diff --git a/db/fixtures/production/998_gitlab_instance_administration_project.rb b/db/fixtures/production/998_gitlab_instance_administration_project.rb
new file mode 100644
index 00000000000..6cf3ae95cee
--- /dev/null
+++ b/db/fixtures/production/998_gitlab_instance_administration_project.rb
@@ -0,0 +1,3 @@
+# frozen_string_literal: true
+
+::Gitlab::DatabaseImporters::SelfMonitoring::Project::CreateService.new.execute!
diff --git a/db/migrate/20190822175441_rename_epics_state_to_state_id.rb b/db/migrate/20190822175441_rename_epics_state_to_state_id.rb
new file mode 100644
index 00000000000..7f40d164a8e
--- /dev/null
+++ b/db/migrate/20190822175441_rename_epics_state_to_state_id.rb
@@ -0,0 +1,17 @@
+# frozen_string_literal: true
+
+class RenameEpicsStateToStateId < ActiveRecord::Migration[5.2]
+ include Gitlab::Database::MigrationHelpers
+
+ DOWNTIME = false
+
+ disable_ddl_transaction!
+
+ def up
+ rename_column_concurrently :epics, :state, :state_id
+ end
+
+ def down
+ cleanup_concurrent_column_rename :epics, :state_id, :state
+ end
+end
diff --git a/db/post_migrate/20190822185441_cleanup_epics_state_id_rename.rb b/db/post_migrate/20190822185441_cleanup_epics_state_id_rename.rb
new file mode 100644
index 00000000000..471b2ab9ca2
--- /dev/null
+++ b/db/post_migrate/20190822185441_cleanup_epics_state_id_rename.rb
@@ -0,0 +1,17 @@
+# frozen_string_literal: true
+
+class CleanupEpicsStateIdRename < ActiveRecord::Migration[5.2]
+ include Gitlab::Database::MigrationHelpers
+
+ DOWNTIME = false
+
+ disable_ddl_transaction!
+
+ def up
+ cleanup_concurrent_column_rename :epics, :state, :state_id
+ end
+
+ def down
+ rename_column_concurrently :epics, :state_id, :state
+ end
+end
diff --git a/db/schema.rb b/db/schema.rb
index f1dbe5c322c..5999a859e77 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -1286,11 +1286,11 @@ ActiveRecord::Schema.define(version: 2019_08_28_083843) do
t.date "due_date_fixed"
t.boolean "start_date_is_fixed"
t.boolean "due_date_is_fixed"
- t.integer "state", limit: 2, default: 1, null: false
t.integer "closed_by_id"
t.datetime "closed_at"
t.integer "parent_id"
t.integer "relative_position"
+ t.integer "state_id", limit: 2, default: 1, null: false
t.index ["assignee_id"], name: "index_epics_on_assignee_id"
t.index ["author_id"], name: "index_epics_on_author_id"
t.index ["closed_by_id"], name: "index_epics_on_closed_by_id"
diff --git a/doc/administration/auth/how_to_configure_ldap_gitlab_ee/img/group_linking.gif b/doc/administration/auth/how_to_configure_ldap_gitlab_ee/img/group_linking.gif
index d35cf55804f..a0ec2d4f10a 100644
--- a/doc/administration/auth/how_to_configure_ldap_gitlab_ee/img/group_linking.gif
+++ b/doc/administration/auth/how_to_configure_ldap_gitlab_ee/img/group_linking.gif
Binary files differ
diff --git a/doc/administration/auth/how_to_configure_ldap_gitlab_ee/img/manual_permissions.gif b/doc/administration/auth/how_to_configure_ldap_gitlab_ee/img/manual_permissions.gif
index 29b28df1cbd..a9d5dd7e73e 100644
--- a/doc/administration/auth/how_to_configure_ldap_gitlab_ee/img/manual_permissions.gif
+++ b/doc/administration/auth/how_to_configure_ldap_gitlab_ee/img/manual_permissions.gif
Binary files differ
diff --git a/doc/administration/geo/replication/updating_the_geo_nodes.md b/doc/administration/geo/replication/updating_the_geo_nodes.md
index 39174780e24..8c27c4dac4f 100644
--- a/doc/administration/geo/replication/updating_the_geo_nodes.md
+++ b/doc/administration/geo/replication/updating_the_geo_nodes.md
@@ -1,15 +1,18 @@
# Updating the Geo nodes **(PREMIUM ONLY)**
-Depending on which version of Geo you are updating to/from, there may be
-different steps.
+Depending on which version of Geo you are updating to/from, there may be different steps.
## General update steps
-In order to update the Geo nodes when a new GitLab version is released,
-all you need to do is update GitLab itself:
+NOTE: **Note:** These general update steps are not intended for [high-availability deployments](https://docs.gitlab.com/omnibus/update/README.html#multi-node--ha-deployment), and will cause downtime. If you want to avoid downtime, consider using [zero downtime updates](https://docs.gitlab.com/omnibus/update/README.html#zero-downtime-updates).
-1. Log into each node (**primary** and **secondary** nodes).
-1. [Update GitLab][update].
+To update the Geo nodes when a new GitLab version is released, update **primary**
+and all **secondary** nodes:
+
+1. Log into the **primary** node.
+1. [Update GitLab on the **primary** node using Omnibus](https://docs.gitlab.com/omnibus/update/README.html).
+1. Log into each **secondary** node.
+1. [Update GitLab on each **secondary** node using Omnibus](https://docs.gitlab.com/omnibus/update/README.html).
1. [Test](#check-status-after-updating) **primary** and **secondary** nodes, and check version in each.
### Check status after updating
@@ -27,6 +30,8 @@ everything is working correctly:
1. Test the data replication by pushing code to the **primary** node and see if it
is received by **secondary** nodes.
+If you encounter any issues, please consult the [Geo troubleshooting guide](troubleshooting.md).
+
## Upgrading to GitLab 12.1
By default, GitLab 12.1 will attempt to automatically upgrade the embedded PostgreSQL server to 10.7 from 9.6. Please see [the omnibus documentation](https://docs.gitlab.com/omnibus/settings/database.html#upgrading-a-geo-instance) for the recommended procedure.
diff --git a/doc/api/applications.md b/doc/api/applications.md
index 82955f0c1db..807a0e57e8b 100644
--- a/doc/api/applications.md
+++ b/doc/api/applications.md
@@ -88,7 +88,9 @@ DELETE /applications/:id
Parameters:
-- `id` (required) - The id of the application (not the application_id)
+| Attribute | Type | Required | Description |
+|:----------|:--------|:---------|:----------------------------------------------------|
+| `id` | integer | yes | The id of the application (not the application_id). |
Example request:
diff --git a/doc/api/epics.md b/doc/api/epics.md
index 08eb84bfb63..675b88649e0 100644
--- a/doc/api/epics.md
+++ b/doc/api/epics.md
@@ -231,7 +231,7 @@ PUT /groups/:id/epics/:epic_iid
| `id` | integer/string | yes | The ID or [URL-encoded path of the group](README.md#namespaced-path-encoding) owned by the authenticated user |
| `epic_iid` | integer/string | yes | The internal ID of the epic |
| `title` | string | no | The title of an epic |
-| `description` | string | no | The description of an epic. Limited to 1 000 000 characters. |
+| `description` | string | no | The description of an epic. Limited to 1 000 000 characters. |
| `labels` | string | no | The comma separated list of labels |
| `start_date_is_fixed` | boolean | no | Whether start date should be sourced from `start_date_fixed` or from milestones (since 11.3) |
| `start_date_fixed` | string | no | The fixed start date of an epic (since 11.3) |
diff --git a/doc/api/merge_request_approvals.md b/doc/api/merge_request_approvals.md
index bf83bfd7e6a..b73fe38f53e 100644
--- a/doc/api/merge_request_approvals.md
+++ b/doc/api/merge_request_approvals.md
@@ -152,8 +152,8 @@ POST /projects/:id/approval_rules
| `id` | integer | yes | The ID of a project |
| `name` | string | yes | The name of the approval rule |
| `approvals_required` | integer | yes | The number of required approvals for this rule |
-| `users` | integer | no | The ids of users as approvers |
-| `groups` | integer | no | The ids of groups as approvers |
+| `user_ids` | Array | no | The ids of users as approvers |
+| `group_ids` | Array | no | The ids of groups as approvers |
```json
{
@@ -231,8 +231,8 @@ PUT /projects/:id/approval_rules/:approval_rule_id
| `approval_rule_id` | integer | yes | The ID of a approval rule |
| `name` | string | yes | The name of the approval rule |
| `approvals_required` | integer | yes | The number of required approvals for this rule |
-| `users` | integer | no | The ids of users as approvers |
-| `groups` | integer | no | The ids of groups as approvers |
+| `user_ids` | Array | no | The ids of users as approvers |
+| `group_ids` | Array | no | The ids of groups as approvers |
```json
{
@@ -525,6 +525,270 @@ PUT /projects/:id/merge_requests/:merge_request_iid/approvers
}
```
+### Get merge request level rules
+
+>**Note:** This API endpoint is only available on 12.3 Starter and above.
+
+You can request information about a merge request's approval rules using the following endpoint:
+
+```
+GET /projects/:id/merge_requests/:merge_request_iid/approval_rules
+```
+
+**Parameters:**
+
+| Attribute | Type | Required | Description |
+|---------------------|---------|----------|---------------------|
+| `id` | integer | yes | The ID of a project |
+| `merge_request_iid` | integer | yes | The IID of MR |
+
+```json
+[
+ {
+ "id": 1,
+ "name": "security",
+ "rule_type": "regular",
+ "eligible_approvers": [
+ {
+ "id": 5,
+ "name": "John Doe",
+ "username": "jdoe",
+ "state": "active",
+ "avatar_url": "https://www.gravatar.com/avatar/0?s=80&d=identicon",
+ "web_url": "http://localhost/jdoe"
+ },
+ {
+ "id": 50,
+ "name": "Group Member 1",
+ "username": "group_member_1",
+ "state": "active",
+ "avatar_url": "https://www.gravatar.com/avatar/0?s=80&d=identicon",
+ "web_url": "http://localhost/group_member_1"
+ }
+ ],
+ "approvals_required": 3,
+ "source_rule": null,
+ "users": [
+ {
+ "id": 5,
+ "name": "John Doe",
+ "username": "jdoe",
+ "state": "active",
+ "avatar_url": "https://www.gravatar.com/avatar/0?s=80&d=identicon",
+ "web_url": "http://localhost/jdoe"
+ }
+ ],
+ "groups": [
+ {
+ "id": 5,
+ "name": "group1",
+ "path": "group1",
+ "description": "",
+ "visibility": "public",
+ "lfs_enabled": false,
+ "avatar_url": null,
+ "web_url": "http://localhost/groups/group1",
+ "request_access_enabled": false,
+ "full_name": "group1",
+ "full_path": "group1",
+ "parent_id": null,
+ "ldap_cn": null,
+ "ldap_access": null
+ }
+ ],
+ "contains_hidden_groups": false
+ }
+]
+```
+
+### Create merge request level rule
+
+>**Note:** This API endpoint is only available on 12.3 Starter and above.
+
+You can create merge request approval rules using the following endpoint:
+
+```
+POST /projects/:id/merge_requests/:merge_request_iid/approval_rules
+```
+
+**Parameters:**
+
+| Attribute | Type | Required | Description |
+|----------------------------|---------|----------|------------------------------------------------|
+| `id` | integer | yes | The ID of a project |
+| `merge_request_iid` | integer | yes | The IID of MR |
+| `name` | string | yes | The name of the approval rule |
+| `approvals_required` | integer | yes | The number of required approvals for this rule |
+| `approval_project_rule_id` | integer | no | The ID of a project-level approval rule |
+| `user_ids` | Array | no | The ids of users as approvers |
+| `group_ids` | Array | no | The ids of groups as approvers |
+
+**Important:** When `approval_project_rule_id` is set, the `name`, `users` and
+`groups` of project-level rule will be copied. The `approvals_required` specified
+will be used.
+
+```json
+{
+ "id": 1,
+ "name": "security",
+ "rule_type": "regular",
+ "eligible_approvers": [
+ {
+ "id": 2,
+ "name": "John Doe",
+ "username": "jdoe",
+ "state": "active",
+ "avatar_url": "https://www.gravatar.com/avatar/0?s=80&d=identicon",
+ "web_url": "http://localhost/jdoe"
+ },
+ {
+ "id": 50,
+ "name": "Group Member 1",
+ "username": "group_member_1",
+ "state": "active",
+ "avatar_url": "https://www.gravatar.com/avatar/0?s=80&d=identicon",
+ "web_url": "http://localhost/group_member_1"
+ }
+ ],
+ "approvals_required": 1,
+ "source_rule": null,
+ "users": [
+ {
+ "id": 2,
+ "name": "John Doe",
+ "username": "jdoe",
+ "state": "active",
+ "avatar_url": "https://www.gravatar.com/avatar/0?s=80&d=identicon",
+ "web_url": "http://localhost/jdoe"
+ }
+ ],
+ "groups": [
+ {
+ "id": 5,
+ "name": "group1",
+ "path": "group1",
+ "description": "",
+ "visibility": "public",
+ "lfs_enabled": false,
+ "avatar_url": null,
+ "web_url": "http://localhost/groups/group1",
+ "request_access_enabled": false,
+ "full_name": "group1",
+ "full_path": "group1",
+ "parent_id": null,
+ "ldap_cn": null,
+ "ldap_access": null
+ }
+ ],
+ "contains_hidden_groups": false
+}
+```
+
+### Update merge request level rule
+
+>**Note:** This API endpoint is only available on 12.3 Starter and above.
+
+You can update merge request approval rules using the following endpoint:
+
+```
+PUT /projects/:id/merge_request/:merge_request_iid/approval_rules/:approval_rule_id
+```
+
+**Important:** Approvers and groups not in the `users`/`groups` param will be **removed**
+
+**Important:** Updating a `report_approver` or `code_owner` rule is not allowed.
+These are system generated rules.
+
+**Parameters:**
+
+| Attribute | Type | Required | Description |
+|----------------------|---------|----------|------------------------------------------------|
+| `id` | integer | yes | The ID of a project |
+| `merge_request_iid` | integer | yes | The ID of MR |
+| `approval_rule_id` | integer | yes | The ID of a approval rule |
+| `name` | string | yes | The name of the approval rule |
+| `approvals_required` | integer | yes | The number of required approvals for this rule |
+| `user_ids` | Array | no | The ids of users as approvers |
+| `group_ids` | Array | no | The ids of groups as approvers |
+
+```json
+{
+ "id": 1,
+ "name": "security",
+ "rule_type": "regular",
+ "eligible_approvers": [
+ {
+ "id": 2,
+ "name": "John Doe",
+ "username": "jdoe",
+ "state": "active",
+ "avatar_url": "https://www.gravatar.com/avatar/0?s=80&d=identicon",
+ "web_url": "http://localhost/jdoe"
+ },
+ {
+ "id": 50,
+ "name": "Group Member 1",
+ "username": "group_member_1",
+ "state": "active",
+ "avatar_url": "https://www.gravatar.com/avatar/0?s=80&d=identicon",
+ "web_url": "http://localhost/group_member_1"
+ }
+ ],
+ "approvals_required": 1,
+ "source_rule": null,
+ "users": [
+ {
+ "id": 2,
+ "name": "John Doe",
+ "username": "jdoe",
+ "state": "active",
+ "avatar_url": "https://www.gravatar.com/avatar/0?s=80&d=identicon",
+ "web_url": "http://localhost/jdoe"
+ }
+ ],
+ "groups": [
+ {
+ "id": 5,
+ "name": "group1",
+ "path": "group1",
+ "description": "",
+ "visibility": "public",
+ "lfs_enabled": false,
+ "avatar_url": null,
+ "web_url": "http://localhost/groups/group1",
+ "request_access_enabled": false,
+ "full_name": "group1",
+ "full_path": "group1",
+ "parent_id": null,
+ "ldap_cn": null,
+ "ldap_access": null
+ }
+ ],
+ "contains_hidden_groups": false
+}
+```
+
+### Delete merge request level rule
+
+>**Note:** This API endpoint is only available on 12.3 Starter and above.
+
+You can delete merge request approval rules using the following endpoint:
+
+```
+DELETE /projects/:id/merge_requests/:merge_request_iid/approval_rules/:approval_rule_id
+```
+
+**Important:** Deleting a `report_approver` or `code_owner` rule is not allowed.
+These are system generated rules.
+
+**Parameters:**
+
+| Attribute | Type | Required | Description |
+|---------------------|---------|----------|---------------------------|
+| `id` | integer | yes | The ID of a project |
+| `merge_request_iid` | integer | yes | The ID of MR |
+| `approval_rule_id` | integer | yes | The ID of a approval rule |
+
## Approve Merge Request
>**Note:** This API endpoint is only available on 8.9 Starter and above.
diff --git a/doc/api/releases/index.md b/doc/api/releases/index.md
index e74b35fd959..850cf57a06f 100644
--- a/doc/api/releases/index.md
+++ b/doc/api/releases/index.md
@@ -12,14 +12,14 @@ Paginated list of Releases, sorted by `released_at`.
GET /projects/:id/releases
```
-| Attribute | Type | Required | Description |
-| ------------- | -------------- | -------- | --------------------------------------- |
+| Attribute | Type | Required | Description |
+| ------------- | -------------- | -------- | ----------------------------------------------------------------------------------- |
| `id` | integer/string | yes | The ID or [URL-encoded path of the project](../README.md#namespaced-path-encoding). |
Example request:
```sh
-curl --header "PRIVATE-TOKEN: gDybLx3yrUK_HLp3qPjS" "http://localhost:3000/api/v4/projects/24/releases"
+curl --header "PRIVATE-TOKEN: gDybLx3yrUK_HLp3qPjS" "https://gitlab.example.com/api/v4/projects/24/releases"
```
Example response:
@@ -39,7 +39,7 @@ Example response:
"username":"root",
"state":"active",
"avatar_url":"https://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80\u0026d=identicon",
- "web_url":"http://localhost:3000/root"
+ "web_url":"https://gitlab.example.com/root"
},
"commit":{
"id":"079e90101242458910cccd35eab0e211dfc359c0",
@@ -62,19 +62,19 @@ Example response:
"sources":[
{
"format":"zip",
- "url":"http://localhost:3000/root/awesome-app/-/archive/v0.2/awesome-app-v0.2.zip"
+ "url":"https://gitlab.example.com/root/awesome-app/-/archive/v0.2/awesome-app-v0.2.zip"
},
{
"format":"tar.gz",
- "url":"http://localhost:3000/root/awesome-app/-/archive/v0.2/awesome-app-v0.2.tar.gz"
+ "url":"https://gitlab.example.com/root/awesome-app/-/archive/v0.2/awesome-app-v0.2.tar.gz"
},
{
"format":"tar.bz2",
- "url":"http://localhost:3000/root/awesome-app/-/archive/v0.2/awesome-app-v0.2.tar.bz2"
+ "url":"https://gitlab.example.com/root/awesome-app/-/archive/v0.2/awesome-app-v0.2.tar.bz2"
},
{
"format":"tar",
- "url":"http://localhost:3000/root/awesome-app/-/archive/v0.2/awesome-app-v0.2.tar"
+ "url":"https://gitlab.example.com/root/awesome-app/-/archive/v0.2/awesome-app-v0.2.tar"
}
],
"links":[
@@ -106,7 +106,7 @@ Example response:
"username":"root",
"state":"active",
"avatar_url":"https://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80\u0026d=identicon",
- "web_url":"http://localhost:3000/root"
+ "web_url":"https://gitlab.example.com/root"
},
"commit":{
"id":"f8d3d94cbd347e924aa7b715845e439d00e80ca4",
@@ -129,19 +129,19 @@ Example response:
"sources":[
{
"format":"zip",
- "url":"http://localhost:3000/root/awesome-app/-/archive/v0.1/awesome-app-v0.1.zip"
+ "url":"https://gitlab.example.com/root/awesome-app/-/archive/v0.1/awesome-app-v0.1.zip"
},
{
"format":"tar.gz",
- "url":"http://localhost:3000/root/awesome-app/-/archive/v0.1/awesome-app-v0.1.tar.gz"
+ "url":"https://gitlab.example.com/root/awesome-app/-/archive/v0.1/awesome-app-v0.1.tar.gz"
},
{
"format":"tar.bz2",
- "url":"http://localhost:3000/root/awesome-app/-/archive/v0.1/awesome-app-v0.1.tar.bz2"
+ "url":"https://gitlab.example.com/root/awesome-app/-/archive/v0.1/awesome-app-v0.1.tar.bz2"
},
{
"format":"tar",
- "url":"http://localhost:3000/root/awesome-app/-/archive/v0.1/awesome-app-v0.1.tar"
+ "url":"https://gitlab.example.com/root/awesome-app/-/archive/v0.1/awesome-app-v0.1.tar"
}
],
"links":[
@@ -160,15 +160,15 @@ Get a Release for the given tag.
GET /projects/:id/releases/:tag_name
```
-| Attribute | Type | Required | Description |
-| ------------- | -------------- | -------- | --------------------------------------- |
+| Attribute | Type | Required | Description |
+| ------------- | -------------- | -------- | ----------------------------------------------------------------------------------- |
| `id` | integer/string | yes | The ID or [URL-encoded path of the project](../README.md#namespaced-path-encoding). |
-| `tag_name` | string | yes | The tag where the release will be created from. |
+| `tag_name` | string | yes | The tag where the release will be created from. |
Example request:
```sh
-curl --header "PRIVATE-TOKEN: gDybLx3yrUK_HLp3qPjS" "http://localhost:3000/api/v4/projects/24/releases/v0.1"
+curl --header "PRIVATE-TOKEN: gDybLx3yrUK_HLp3qPjS" "https://gitlab.example.com/api/v4/projects/24/releases/v0.1"
```
Example response:
@@ -187,7 +187,7 @@ Example response:
"username":"root",
"state":"active",
"avatar_url":"https://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80\u0026d=identicon",
- "web_url":"http://localhost:3000/root"
+ "web_url":"https://gitlab.example.com/root"
},
"commit":{
"id":"f8d3d94cbd347e924aa7b715845e439d00e80ca4",
@@ -210,19 +210,19 @@ Example response:
"sources":[
{
"format":"zip",
- "url":"http://localhost:3000/root/awesome-app/-/archive/v0.1/awesome-app-v0.1.zip"
+ "url":"https://gitlab.example.com/root/awesome-app/-/archive/v0.1/awesome-app-v0.1.zip"
},
{
"format":"tar.gz",
- "url":"http://localhost:3000/root/awesome-app/-/archive/v0.1/awesome-app-v0.1.tar.gz"
+ "url":"https://gitlab.example.com/root/awesome-app/-/archive/v0.1/awesome-app-v0.1.tar.gz"
},
{
"format":"tar.bz2",
- "url":"http://localhost:3000/root/awesome-app/-/archive/v0.1/awesome-app-v0.1.tar.bz2"
+ "url":"https://gitlab.example.com/root/awesome-app/-/archive/v0.1/awesome-app-v0.1.tar.bz2"
},
{
"format":"tar",
- "url":"http://localhost:3000/root/awesome-app/-/archive/v0.1/awesome-app-v0.1.tar"
+ "url":"https://gitlab.example.com/root/awesome-app/-/archive/v0.1/awesome-app-v0.1.tar"
}
],
"links":[
@@ -240,24 +240,24 @@ Create a Release. You need push access to the repository to create a Release.
POST /projects/:id/releases
```
-| Attribute | Type | Required | Description |
-| ------------- | -------------- | -------- | --------------------------------------- |
-| `id` | integer/string | yes | The ID or [URL-encoded path of the project](../README.md#namespaced-path-encoding). |
-| `name` | string | yes | The release name. |
-| `tag_name` | string | yes | The tag where the release will be created from. |
-| `description` | string | yes | The description of the release. You can use [markdown](../../user/markdown.md). |
-| `ref` | string | no | If `tag_name` doesn't exist, the release will be created from `ref`. It can be a commit SHA, another tag name, or a branch name. |
-| `assets:links`| array of hash | no | An array of assets links. |
-| `assets:links:name`| string | no (if `assets:links` specified, it's required) | The name of the link. |
-| `assets:links:url`| string | no (if `assets:links` specified, it's required) | The url of the link. |
-| `released_at` | datetime | no | The date when the release will be/was ready. Defaults to the current time. Expected in ISO 8601 format (`2019-03-15T08:00:00Z`). |
+| Attribute | Type | Required | Description |
+| -------------------| -------------- | -------- | -------------------------------------------------------------------------------------------------------------------------------- |
+| `id` | integer/string | yes | The ID or [URL-encoded path of the project](../README.md#namespaced-path-encoding). |
+| `name` | string | yes | The release name. |
+| `tag_name` | string | yes | The tag where the release will be created from. |
+| `description` | string | yes | The description of the release. You can use [markdown](../../user/markdown.md). |
+| `ref` | string | no | If `tag_name` doesn't exist, the release will be created from `ref`. It can be a commit SHA, another tag name, or a branch name. |
+| `assets:links` | array of hash | no | An array of assets links. |
+| `assets:links:name`| string | required by: `assets:links` | The name of the link. |
+| `assets:links:url` | string | required by: `assets:links` | The url of the link. |
+| `released_at` | datetime | no | The date when the release will be/was ready. Defaults to the current time. Expected in ISO 8601 format (`2019-03-15T08:00:00Z`). |
Example request:
```sh
curl --header 'Content-Type: application/json' --header "PRIVATE-TOKEN: gDybLx3yrUK_HLp3qPjS" \
--data '{ "name": "New release", "tag_name": "v0.3", "description": "Super nice release", "assets": { "links": [{ "name": "hoge", "url": "https://google.com" }] } }' \
- --request POST http://localhost:3000/api/v4/projects/24/releases
+ --request POST https://gitlab.example.com/api/v4/projects/24/releases
```
Example response:
@@ -276,7 +276,7 @@ Example response:
"username":"root",
"state":"active",
"avatar_url":"https://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80\u0026d=identicon",
- "web_url":"http://localhost:3000/root"
+ "web_url":"https://gitlab.example.com/root"
},
"commit":{
"id":"079e90101242458910cccd35eab0e211dfc359c0",
@@ -299,19 +299,19 @@ Example response:
"sources":[
{
"format":"zip",
- "url":"http://localhost:3000/root/awesome-app/-/archive/v0.3/awesome-app-v0.3.zip"
+ "url":"https://gitlab.example.com/root/awesome-app/-/archive/v0.3/awesome-app-v0.3.zip"
},
{
"format":"tar.gz",
- "url":"http://localhost:3000/root/awesome-app/-/archive/v0.3/awesome-app-v0.3.tar.gz"
+ "url":"https://gitlab.example.com/root/awesome-app/-/archive/v0.3/awesome-app-v0.3.tar.gz"
},
{
"format":"tar.bz2",
- "url":"http://localhost:3000/root/awesome-app/-/archive/v0.3/awesome-app-v0.3.tar.bz2"
+ "url":"https://gitlab.example.com/root/awesome-app/-/archive/v0.3/awesome-app-v0.3.tar.bz2"
},
{
"format":"tar",
- "url":"http://localhost:3000/root/awesome-app/-/archive/v0.3/awesome-app-v0.3.tar"
+ "url":"https://gitlab.example.com/root/awesome-app/-/archive/v0.3/awesome-app-v0.3.tar"
}
],
"links":[
@@ -334,18 +334,18 @@ Update a Release.
PUT /projects/:id/releases/:tag_name
```
-| Attribute | Type | Required | Description |
-| ------------- | -------------- | -------- | --------------------------------------- |
-| `id` | integer/string | yes | The ID or [URL-encoded path of the project](../README.md#namespaced-path-encoding). |
-| `tag_name` | string | yes | The tag where the release will be created from. |
-| `name` | string | no | The release name. |
-| `description` | string | no | The description of the release. You can use [markdown](../../user/markdown.md). |
+| Attribute | Type | Required | Description |
+| ------------- | -------------- | -------- | -------------------------------------------------------------------------------------------------- |
+| `id` | integer/string | yes | The ID or [URL-encoded path of the project](../README.md#namespaced-path-encoding). |
+| `tag_name` | string | yes | The tag where the release will be created from. |
+| `name` | string | no | The release name. |
+| `description` | string | no | The description of the release. You can use [markdown](../../user/markdown.md). |
| `released_at` | datetime | no | The date when the release will be/was ready. Expected in ISO 8601 format (`2019-03-15T08:00:00Z`). |
Example request:
```sh
-curl --request PUT --data name="new name" --header "PRIVATE-TOKEN: gDybLx3yrUK_HLp3qPjS" "http://localhost:3000/api/v4/projects/24/releases/v0.1"
+curl --request PUT --data name="new name" --header "PRIVATE-TOKEN: gDybLx3yrUK_HLp3qPjS" "https://gitlab.example.com/api/v4/projects/24/releases/v0.1"
```
Example response:
@@ -364,7 +364,7 @@ Example response:
"username":"root",
"state":"active",
"avatar_url":"https://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80\u0026d=identicon",
- "web_url":"http://localhost:3000/root"
+ "web_url":"https://gitlab.example.com/root"
},
"commit":{
"id":"f8d3d94cbd347e924aa7b715845e439d00e80ca4",
@@ -387,19 +387,19 @@ Example response:
"sources":[
{
"format":"zip",
- "url":"http://localhost:3000/root/awesome-app/-/archive/v0.1/awesome-app-v0.1.zip"
+ "url":"https://gitlab.example.com/root/awesome-app/-/archive/v0.1/awesome-app-v0.1.zip"
},
{
"format":"tar.gz",
- "url":"http://localhost:3000/root/awesome-app/-/archive/v0.1/awesome-app-v0.1.tar.gz"
+ "url":"https://gitlab.example.com/root/awesome-app/-/archive/v0.1/awesome-app-v0.1.tar.gz"
},
{
"format":"tar.bz2",
- "url":"http://localhost:3000/root/awesome-app/-/archive/v0.1/awesome-app-v0.1.tar.bz2"
+ "url":"https://gitlab.example.com/root/awesome-app/-/archive/v0.1/awesome-app-v0.1.tar.bz2"
},
{
"format":"tar",
- "url":"http://localhost:3000/root/awesome-app/-/archive/v0.1/awesome-app-v0.1.tar"
+ "url":"https://gitlab.example.com/root/awesome-app/-/archive/v0.1/awesome-app-v0.1.tar"
}
],
"links":[
@@ -417,15 +417,15 @@ Delete a Release. Deleting a Release will not delete the associated tag.
DELETE /projects/:id/releases/:tag_name
```
-| Attribute | Type | Required | Description |
-| ------------- | -------------- | -------- | --------------------------------------- |
+| Attribute | Type | Required | Description |
+| ------------- | -------------- | -------- | ----------------------------------------------------------------------------------- |
| `id` | integer/string | yes | The ID or [URL-encoded path of the project](../README.md#namespaced-path-encoding). |
-| `tag_name` | string | yes | The tag where the release will be created from. |
+| `tag_name` | string | yes | The tag where the release will be created from. |
Example request:
```sh
-curl --request DELETE --header "PRIVATE-TOKEN: gDybLx3yrUK_HLp3qPjS" "http://localhost:3000/api/v4/projects/24/releases/v0.1"
+curl --request DELETE --header "PRIVATE-TOKEN: gDybLx3yrUK_HLp3qPjS" "https://gitlab.example.com/api/v4/projects/24/releases/v0.1"
```
Example response:
@@ -444,7 +444,7 @@ Example response:
"username":"root",
"state":"active",
"avatar_url":"https://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80\u0026d=identicon",
- "web_url":"http://localhost:3000/root"
+ "web_url":"https://gitlab.example.com/root"
},
"commit":{
"id":"f8d3d94cbd347e924aa7b715845e439d00e80ca4",
@@ -467,19 +467,19 @@ Example response:
"sources":[
{
"format":"zip",
- "url":"http://localhost:3000/root/awesome-app/-/archive/v0.1/awesome-app-v0.1.zip"
+ "url":"https://gitlab.example.com/root/awesome-app/-/archive/v0.1/awesome-app-v0.1.zip"
},
{
"format":"tar.gz",
- "url":"http://localhost:3000/root/awesome-app/-/archive/v0.1/awesome-app-v0.1.tar.gz"
+ "url":"https://gitlab.example.com/root/awesome-app/-/archive/v0.1/awesome-app-v0.1.tar.gz"
},
{
"format":"tar.bz2",
- "url":"http://localhost:3000/root/awesome-app/-/archive/v0.1/awesome-app-v0.1.tar.bz2"
+ "url":"https://gitlab.example.com/root/awesome-app/-/archive/v0.1/awesome-app-v0.1.tar.bz2"
},
{
"format":"tar",
- "url":"http://localhost:3000/root/awesome-app/-/archive/v0.1/awesome-app-v0.1.tar"
+ "url":"https://gitlab.example.com/root/awesome-app/-/archive/v0.1/awesome-app-v0.1.tar"
}
],
"links":[
diff --git a/doc/api/settings.md b/doc/api/settings.md
index e3d8fe68e08..a14b0d3632a 100644
--- a/doc/api/settings.md
+++ b/doc/api/settings.md
@@ -67,7 +67,7 @@ Example response:
"local_markdown_version": 0,
"allow_local_requests_from_hooks_and_services": true,
"allow_local_requests_from_web_hooks_and_services": true,
- "allow_local_requests_from_system_hooks": false
+ "allow_local_requests_from_system_hooks": false,
"asset_proxy_enabled": true,
"asset_proxy_url": "https://assets.example.com",
"asset_proxy_whitelist": ["example.com", "*.example.com", "your-instance.com"]
@@ -124,6 +124,10 @@ Example response:
"domain_whitelist": [],
"domain_blacklist_enabled" : false,
"domain_blacklist" : [],
+ "external_authorization_service_enabled": true,
+ "external_authorization_service_url": "https://authorize.me",
+ "external_authorization_service_default_label": "default",
+ "external_authorization_service_timeout": 0.5,
"user_oauth_applications": true,
"after_sign_out_path": "",
"container_registry_token_expire_delay": 5,
@@ -157,20 +161,13 @@ Example response:
Users on GitLab [Premium or Ultimate](https://about.gitlab.com/pricing/) may also see
these parameters:
-- `external_authorization_service_enabled`
-- `external_authorization_service_url`
-- `external_authorization_service_default_label`
-- `external_authorization_service_timeout`
- `file_template_project_id`
- `geo_node_allowed_ips`
+- `geo_status_timeout`
Example responses: **(PREMIUM ONLY)**
```json
- "external_authorization_service_enabled": true,
- "external_authorization_service_url": "https://authorize.me",
- "external_authorization_service_default_label": "default",
- "external_authorization_service_timeout": 0.5,
"file_template_project_id": 1,
"geo_node_allowed_ips": "0.0.0.0/0, ::/0"
```
@@ -190,8 +187,9 @@ are listed in the descriptions of the relevant settings.
| `akismet_enabled` | boolean | no | (**If enabled, requires:** `akismet_api_key`) Enable or disable akismet spam protection. |
| `allow_group_owners_to_manage_ldap` | boolean | no | **(PREMIUM)** Set to `true` to allow group owners to manage LDAP |
| `allow_local_requests_from_hooks_and_services` | boolean | no | (Deprecated: Use `allow_local_requests_from_web_hooks_and_services` instead) Allow requests to the local network from hooks and services. |
-| `allow_local_requests_from_web_hooks_and_services` | boolean | no | Allow requests to the local network from web hooks and services. |
| `allow_local_requests_from_system_hooks` | boolean | no | Allow requests to the local network from system hooks. |
+| `allow_local_requests_from_web_hooks_and_services` | boolean | no | Allow requests to the local network from web hooks and services. |
+| `archive_builds_in_human_readable` | string | no | Set the duration for which the jobs will be considered as old and expired. Once that time passes, the jobs will be archived and no longer able to be retried. Make it empty to never expire jobs. It has to be no less than 1 day, for example: <code>15 days</code>, <code>1 month</code>, <code>2 years</code>. |
| `asset_proxy_enabled` | boolean | no | (**If enabled, requires:** `asset_proxy_url`) Enable proxying of assets. GitLab restart is required to apply changes. |
| `asset_proxy_secret_key` | string | no | Shared secret with the asset proxy server. GitLab restart is required to apply changes. |
| `asset_proxy_url` | string | no | URL of the asset proxy server. GitLab restart is required to apply changes. |
@@ -200,51 +198,55 @@ are listed in the descriptions of the relevant settings.
| `auto_devops_domain` | string | no | Specify a domain to use by default for every project's Auto Review Apps and Auto Deploy stages. |
| `auto_devops_enabled` | boolean | no | Enable Auto DevOps for projects by default. It will automatically build, test, and deploy applications based on a predefined CI/CD configuration. |
| `check_namespace_plan` | boolean | no | **(PREMIUM)** Enabling this will make only licensed EE features available to projects if the project namespace's plan includes the feature or if the project is public. |
-| `clientside_sentry_dsn` | string | required by: `clientside_sentry_enabled` | Clientside Sentry Data Source Name. |
-| `clientside_sentry_enabled` | boolean | no | (**If enabled, requires:** `clientside_sentry_dsn`) Enable Sentry error reporting for the client side. |
+| `commit_email_hostname` | string | no | Custom hostname (for private commit emails). |
| `container_registry_token_expire_delay` | integer | no | Container Registry token duration in minutes. |
| `default_artifacts_expire_in` | string | no | Set the default expiration time for each job's artifacts. |
| `default_branch_protection` | integer | no | Determine if developers can push to master. Can take: `0` _(not protected, both developers and maintainers can push new commits, force push, or delete the branch)_, `1` _(partially protected, developers and maintainers can push new commits, but cannot force push or delete the branch)_ or `2` _(fully protected, developers cannot push new commits, but maintainers can; no-one can force push or delete the branch)_ as a parameter. Default is `2`. |
| `default_group_visibility` | string | no | What visibility level new groups receive. Can take `private`, `internal` and `public` as a parameter. Default is `private`. |
-| `default_project_visibility` | string | no | What visibility level new projects receive. Can take `private`, `internal` and `public` as a parameter. Default is `private`. |
+| `default_project_creation` | integer | no | Default project creation protection. Can take: `0` _(No one)_, `1` _(Maintainers)_ or `2` _(Developers + Maintainers)_|
| `default_projects_limit` | integer | no | Project limit per user. Default is `100000`. |
+| `default_project_visibility` | string | no | What visibility level new projects receive. Can take `private`, `internal` and `public` as a parameter. Default is `private`. |
| `default_snippet_visibility` | string | no | What visibility level new snippets receive. Can take `private`, `internal` and `public` as a parameter. Default is `private`. |
+| `diff_max_patch_bytes` | integer | no | Maximum diff patch size (Bytes). |
| `disabled_oauth_sign_in_sources` | array of strings | no | Disabled OAuth sign-in sources. |
+| `dns_rebinding_protection_enabled` | boolean | no | Enforce DNS rebinding attack protection. |
| `domain_blacklist` | array of strings | required by: `domain_blacklist_enabled` | Users with e-mail addresses that match these domain(s) will NOT be able to sign-up. Wildcards allowed. Use separate lines for multiple entries. Ex: `domain.com`, `*.domain.com`. |
| `domain_blacklist_enabled` | boolean | no | (**If enabled, requires:** `domain_blacklist`) Allows blocking sign-ups from emails from specific domains. |
| `domain_whitelist` | array of strings | no | Force people to use only corporate emails for sign-up. Default is `null`, meaning there is no restriction. |
-| `outbound_local_requests_whitelist` | array of strings | no | Define a list of trusted domains or ip addresses to which local requests are allowed when local requests for hooks and services are disabled.
| `dsa_key_restriction` | integer | no | The minimum allowed bit length of an uploaded DSA key. Default is `0` (no restriction). `-1` disables DSA keys. |
| `ecdsa_key_restriction` | integer | no | The minimum allowed curve size (in bits) of an uploaded ECDSA key. Default is `0` (no restriction). `-1` disables ECDSA keys. |
| `ed25519_key_restriction` | integer | no | The minimum allowed curve size (in bits) of an uploaded ED25519 key. Default is `0` (no restriction). `-1` disables ED25519 keys. |
-| `elasticsearch_aws` | boolean | no | **(PREMIUM)** Enable the use of AWS hosted Elasticsearch |
| `elasticsearch_aws_access_key` | string | no | **(PREMIUM)** AWS IAM access key |
+| `elasticsearch_aws` | boolean | no | **(PREMIUM)** Enable the use of AWS hosted Elasticsearch |
| `elasticsearch_aws_region` | string | no | **(PREMIUM)** The AWS region the elasticsearch domain is configured |
| `elasticsearch_aws_secret_access_key` | string | no | **(PREMIUM)** AWS IAM secret access key |
| `elasticsearch_experimental_indexer` | boolean | no | **(PREMIUM)** Use the experimental elasticsearch indexer. More info: <https://gitlab.com/gitlab-org/gitlab-elasticsearch-indexer> |
| `elasticsearch_indexing` | boolean | no | **(PREMIUM)** Enable Elasticsearch indexing |
-| `elasticsearch_search` | boolean | no | **(PREMIUM)** Enable Elasticsearch search |
-| `elasticsearch_url` | string | no | **(PREMIUM)** The url to use for connecting to Elasticsearch. Use a comma-separated list to support cluster (e.g., `http://localhost:9200, http://localhost:9201"`). If your Elasticsearch instance is password protected, pass the `username:password` in the URL (e.g., `http://<username>:<password>@<elastic_host>:9200/`). |
| `elasticsearch_limit_indexing` | boolean | no | **(PREMIUM)** Limit Elasticsearch to index certain namespaces and projects |
-| `elasticsearch_project_ids` | array of integers | no | **(PREMIUM)** The projects to index via Elasticsearch if `elasticsearch_limit_indexing` is enabled. |
| `elasticsearch_namespace_ids` | array of integers | no | **(PREMIUM)** The namespaces to index via Elasticsearch if `elasticsearch_limit_indexing` is enabled. |
+| `elasticsearch_project_ids` | array of integers | no | **(PREMIUM)** The projects to index via Elasticsearch if `elasticsearch_limit_indexing` is enabled. |
+| `elasticsearch_search` | boolean | no | **(PREMIUM)** Enable Elasticsearch search |
+| `elasticsearch_url` | string | no | **(PREMIUM)** The url to use for connecting to Elasticsearch. Use a comma-separated list to support cluster (e.g., `http://localhost:9200, http://localhost:9201"`). If your Elasticsearch instance is password protected, pass the `username:password` in the URL (e.g., `http://<username>:<password>@<elastic_host>:9200/`). |
| `email_additional_text` | string | no | **(PREMIUM)** Additional text added to the bottom of every email for legal/auditing/compliance reasons |
| `email_author_in_body` | boolean | no | Some email servers do not support overriding the email sender name. Enable this option to include the name of the author of the issue, merge request or comment in the email body instead. |
| `enabled_git_access_protocol` | string | no | Enabled protocols for Git access. Allowed values are: `ssh`, `http`, and `nil` to allow both protocols. |
| `enforce_terms` | boolean | no | (**If enabled, requires:** `terms`) Enforce application ToS to all users. |
-| `external_auth_client_cert` | string | no | **(PREMIUM)** (**If enabled, requires:** `external_auth_client_key`) The certificate to use to authenticate with the external authorization service |
-| `external_auth_client_key` | string | required by: `external_auth_client_cert` | **(PREMIUM)** Private key for the certificate when authentication is required for the external authorization service, this is encrypted when stored |
-| `external_auth_client_key_pass` | string | no | **(PREMIUM)** Passphrase to use for the private key when authenticating with the external service this is encrypted when stored |
-| `external_authorization_service_enabled` | boolean | no | **(PREMIUM)** (**If enabled, requires:** `external_authorization_service_default_label`, `external_authorization_service_timeout` and `external_authorization_service_url` ) Enable using an external authorization service for accessing projects |
-| `external_authorization_service_default_label` | string | required by: `external_authorization_service_enabled` | **(PREMIUM)** The default classification label to use when requesting authorization and no classification label has been specified on the project |
-| `external_authorization_service_timeout` | float | required by: `external_authorization_service_enabled` | **(PREMIUM)** The timeout after which an authorization request is aborted, in seconds. When a request times out, access is denied to the user. (min: 0.001, max: 10, step: 0.001) |
-| `external_authorization_service_url` | string | required by: `external_authorization_service_enabled` | **(PREMIUM)** URL to which authorization requests will be directed |
+| `external_auth_client_cert` | string | no | (**If enabled, requires:** `external_auth_client_key`) The certificate to use to authenticate with the external authorization service |
+| `external_auth_client_key_pass` | string | no | Passphrase to use for the private key when authenticating with the external service this is encrypted when stored |
+| `external_auth_client_key` | string | required by: `external_auth_client_cert` | Private key for the certificate when authentication is required for the external authorization service, this is encrypted when stored |
+| `external_authorization_service_default_label` | string | required by: `external_authorization_service_enabled` | The default classification label to use when requesting authorization and no classification label has been specified on the project |
+| `external_authorization_service_enabled` | boolean | no | (**If enabled, requires:** `external_authorization_service_default_label`, `external_authorization_service_timeout` and `external_authorization_service_url` ) Enable using an external authorization service for accessing projects |
+| `external_authorization_service_timeout` | float | required by: `external_authorization_service_enabled` | The timeout after which an authorization request is aborted, in seconds. When a request times out, access is denied to the user. (min: 0.001, max: 10, step: 0.001) |
+| `external_authorization_service_url` | string | required by: `external_authorization_service_enabled` | URL to which authorization requests will be directed |
| `file_template_project_id` | integer | no | **(PREMIUM)** The ID of a project to load custom file templates from |
| `first_day_of_week` | integer | no | Start day of the week for calendar views and date pickers. Valid values are `0` (default) for Sunday, `1` for Monday, and `6` for Saturday. |
+| `geo_node_allowed_ips` | string | yes | **(PREMIUM)** Comma-separated list of IPs and CIDRs of allowed secondary nodes. For example, `1.1.1.1, 2.2.2.0/24`. |
| `geo_status_timeout` | integer | no | **(PREMIUM)** The amount of seconds after which a request to get a secondary node status will time out. |
| `gitaly_timeout_default` | integer | no | Default Gitaly timeout, in seconds. This timeout is not enforced for Git fetch/push operations or Sidekiq jobs. Set to `0` to disable timeouts. |
| `gitaly_timeout_fast` | integer | no | Gitaly fast operation timeout, in seconds. Some Gitaly operations are expected to be fast. If they exceed this threshold, there may be a problem with a storage shard and 'failing fast' can help maintain the stability of the GitLab instance. Set to `0` to disable timeouts. |
| `gitaly_timeout_medium` | integer | no | Medium Gitaly timeout, in seconds. This should be a value between the Fast and the Default timeout. Set to `0` to disable timeouts. |
+| `grafana_enabled` | boolean | no | Enable Grafana. |
+| `grafana_url` | string | no | Grafana URL. |
| `gravatar_enabled` | boolean | no | Enable Gravatar. |
| `hashed_storage_enabled` | boolean | no | Create new projects using hashed storage paths: Enable immutable, hash-based paths and repository names to store repositories on disk. This prevents repositories from having to be moved or renamed when the Project URL changes and may improve disk I/O performance. (EXPERIMENTAL) |
| `help_page_hide_commercial_content` | boolean | no | Hide marketing-related entries from help. |
@@ -259,8 +261,10 @@ are listed in the descriptions of the relevant settings.
| `housekeeping_gc_period` | integer | required by: `housekeeping_enabled` | Number of Git pushes after which `git gc` is run. |
| `housekeeping_incremental_repack_period` | integer | required by: `housekeeping_enabled` | Number of Git pushes after which an incremental `git repack` is run. |
| `html_emails_enabled` | boolean | no | Enable HTML emails. |
+| `import_sources` | array of strings | no | Sources to allow project import from, possible values: `github`, `bitbucket`, `bitbucket_server`, `gitlab`, `google_code`, `fogbugz`, `git`, `gitlab_project`, `gitea`, `manifest`, and `phabricator`. |
+
| `instance_statistics_visibility_private` | boolean | no | When set to `true` Instance statistics will only be available to admins. |
-| `import_sources` | array of strings | no | Sources to allow project import from, possible values: `github`, `bitbucket`, `gitlab`, `google_code`, `fogbugz`, `git`, and `gitlab_project`. |
+| `local_markdown_version` | integer | no | Increase this value when any cached markdown should be invalidated. |
| `max_artifacts_size` | integer | no | Maximum artifacts size in MB |
| `max_attachment_size` | integer | no | Limit attachment size in MB |
| `max_pages_size` | integer | no | Maximum size of pages repositories in MB |
@@ -276,6 +280,7 @@ are listed in the descriptions of the relevant settings.
| `mirror_capacity_threshold` | integer | no | **(PREMIUM)** Minimum capacity to be available before scheduling more mirrors preemptively |
| `mirror_max_capacity` | integer | no | **(PREMIUM)** Maximum number of mirrors that can be synchronizing at the same time. |
| `mirror_max_delay` | integer | no | **(PREMIUM)** Maximum time (in minutes) between updates that a mirror can have when scheduled to synchronize. |
+| `outbound_local_requests_whitelist` | array of strings | no | Define a list of trusted domains or ip addresses to which local requests are allowed when local requests for hooks and services are disabled.
| `pages_domain_verification_enabled` | boolean | no | Require users to prove ownership of custom domains. Domain verification is an essential security measure for public GitLab sites. Users are required to demonstrate they control a domain before it is enabled. |
| `password_authentication_enabled_for_git` | boolean | no | Enable authentication for Git over HTTP(S) via a GitLab account password. Default is `true`. |
| `password_authentication_enabled_for_web` | boolean | no | Enable authentication for the web interface via a GitLab account password. Default is `true`. |
@@ -287,10 +292,12 @@ are listed in the descriptions of the relevant settings.
| `polling_interval_multiplier` | decimal | no | Interval multiplier used by endpoints that perform polling. Set to `0` to disable polling. |
| `project_export_enabled` | boolean | no | Enable project export. |
| `prometheus_metrics_enabled` | boolean | no | Enable prometheus metrics. |
+| `protected_ci_variables` | boolean | no | Environment variables are protected by default. |
| `pseudonymizer_enabled` | boolean | no | **(PREMIUM)** When enabled, GitLab will run a background job that will produce pseudonymized CSVs of the GitLab database that will be uploaded to your configured object storage directory.
| `recaptcha_enabled` | boolean | no | (**If enabled, requires:** `recaptcha_private_key` and `recaptcha_site_key`) Enable recaptcha. |
| `recaptcha_private_key` | string | required by: `recaptcha_enabled` | Private key for recaptcha. |
| `recaptcha_site_key` | string | required by: `recaptcha_enabled` | Site key for recaptcha. |
+| `receive_max_input_size` | integer | no | Maximum push size (MB). |
| `repository_checks_enabled` | boolean | no | GitLab will periodically run `git fsck` in all project and wiki repositories to look for silent disk corruption issues. |
| `repository_size_limit` | integer | no | **(PREMIUM)** Size limit per repository (MB) |
| `repository_storages` | array of strings | no | A list of names of enabled storage paths, taken from `gitlab.yml`. New projects will be created in one of these stores, chosen at random. |
@@ -302,13 +309,17 @@ are listed in the descriptions of the relevant settings.
| `shared_runners_enabled` | boolean | no | (**If enabled, requires:** `shared_runners_text` and `shared_runners_minutes`) Enable shared runners for new projects. |
| `shared_runners_minutes` | integer | required by: `shared_runners_enabled` | **(PREMIUM)** Set the maximum number of pipeline minutes that a group can use on shared Runners per month. |
| `shared_runners_text` | string | required by: `shared_runners_enabled` | Shared runners text. |
-| `sign_in_text` | string | no | Text on the login page. |
| `signin_enabled` | string | no | (Deprecated: Use `password_authentication_enabled_for_web` instead) Flag indicating if password authentication is enabled for the web interface. |
+| `sign_in_text` | string | no | Text on the login page. |
| `signup_enabled` | boolean | no | Enable registration. Default is `true`. |
| `slack_app_enabled` | boolean | no | **(PREMIUM)** (**If enabled, requires:** `slack_app_id`, `slack_app_secret` and `slack_app_secret`) Enable Slack app. |
| `slack_app_id` | string | required by: `slack_app_enabled` | **(PREMIUM)** The app id of the Slack-app. |
| `slack_app_secret` | string | required by: `slack_app_enabled` | **(PREMIUM)** The app secret of the Slack-app. |
| `slack_app_verification_token` | string | required by: `slack_app_enabled` | **(PREMIUM)** The verification token of the Slack-app. |
+| `snowplow_collector_hostname` | string | required by: `snowplow_enabled` | The Snowplow collector hostname. (e.g. `snowplow.trx.gitlab.net`) |
+| `snowplow_cookie_domain` | string | no | The Snowplow cookie domain. (e.g. `.gitlab.com`) |
+| `snowplow_enabled` | boolean | no | Enable snowplow tracking. |
+| `snowplow_site_id` | string | no | The Snowplow site name / application id. (e.g. `gitlab`) |
| `terminal_max_session_time` | integer | no | Maximum time for web terminal websocket connection (in seconds). Set to `0` for unlimited time. |
| `terms` | text | required by: `enforce_terms` | (**Required by:** `enforce_terms`) Markdown content for the ToS. |
| `throttle_authenticated_api_enabled` | boolean | no | (**If enabled, requires:** `throttle_authenticated_api_period_in_seconds` and `throttle_authenticated_api_requests_per_period`) Enable authenticated API request rate limit. Helps reduce request volume (e.g. from crawlers or abusive bots). |
@@ -327,12 +338,8 @@ are listed in the descriptions of the relevant settings.
| `unique_ips_limit_time_window` | integer | required by: `unique_ips_limit_enabled` | How many seconds an IP will be counted towards the limit. |
| `usage_ping_enabled` | boolean | no | Every week GitLab will report license usage back to GitLab, Inc. |
| `user_default_external` | boolean | no | Newly registered users will be external by default. |
+| `user_default_internal_regex` | string | no | Specify an e-mail address regex pattern to identify default internal users. |
| `user_oauth_applications` | boolean | no | Allow users to register any application to use GitLab as an OAuth provider. |
| `user_show_add_ssh_key_message` | boolean | no | When set to `false` disable the "You won't be able to pull or push project code via SSH" warning shown to users with no uploaded SSH key. |
| `version_check_enabled` | boolean | no | Let GitLab inform you when an update is available. |
-| `local_markdown_version` | integer | no | Increase this value when any cached markdown should be invalidated. |
-| `snowplow_enabled` | boolean | no | Enable snowplow tracking. |
-| `snowplow_collector_hostname` | string | required by: `snowplow_enabled` | The Snowplow collector hostname. (e.g. `snowplow.trx.gitlab.net`) |
-| `snowplow_site_id` | string | no | The Snowplow site name / application id. (e.g. `gitlab`) |
-| `snowplow_cookie_domain` | string | no | The Snowplow cookie domain. (e.g. `.gitlab.com`) |
-| `geo_node_allowed_ips` | string | yes | **(PREMIUM)** Comma-separated list of IPs and CIDRs of allowed secondary nodes. For example, `1.1.1.1, 2.2.2.0/24`. |
+| `web_ide_clientside_preview_enabled` | boolean | no | Client side evaluation (allow live previews of JavaScript projects in the Web IDE using CodeSandbox client side evaluation). |
diff --git a/doc/ci/ci_cd_for_external_repos/github_integration.md b/doc/ci/ci_cd_for_external_repos/github_integration.md
index f639e3dadee..fa56503072d 100644
--- a/doc/ci/ci_cd_for_external_repos/github_integration.md
+++ b/doc/ci/ci_cd_for_external_repos/github_integration.md
@@ -11,35 +11,10 @@ GitLab.
<i class="fa fa-youtube-play youtube" aria-hidden="true"></i>
Watch a video on [Using GitLab CI/CD pipelines with GitHub repositories](https://www.youtube.com/watch?v=qgl3F2j-1cI).
-## Connect with GitHub integration
-
-If the [GitHub integration](../../integration/github.md) has been enabled by your GitLab
-administrator:
-
-1. In GitLab create a **CI/CD for external repo** project and select
- **GitHub**.
-
- ![Create project](img/github_omniauth.png)
-
-1. Once authenticated, you will be redirected to a list of your repositories to
- connect. Click **Connect** to select the repository.
-
- ![Create project](img/github_repo_list.png)
-
-1. In GitHub, add a `.gitlab-ci.yml` to [configure GitLab CI/CD](../quick_start/README.md).
-
-GitLab will:
-
-1. Import the project.
-1. Enable [Pull Mirroring](../../workflow/repository_mirroring.md#pulling-from-a-remote-repository-starter).
-1. Enable [GitHub project integration](../../user/project/integrations/github.md).
-1. Create a web hook on GitHub to notify GitLab of new commits.
-
-CAUTION: **Caution:**
-Due to a 10-token limitation on the [GitHub OAuth Implementation](https://developer.github.com/apps/building-oauth-apps/authorizing-oauth-apps/#creating-multiple-tokens-for-oauth-apps),
-if you import more than 10 times, your oldest imported project's token will be
-revoked. See issue [#9147](https://gitlab.com/gitlab-org/gitlab-ee/issues/9147)
-for more information.
+NOTE: **Note:**
+Because of [GitHub limitations](https://gitlab.com/gitlab-org/gitlab-ee/issues/9147),
+[GitHub OAuth](../../integration/github.html#enabling-github-oauth)
+cannot be used to authenticate with GitHub as an external CI/CD repository.
## Connect with Personal Access Token
@@ -47,8 +22,7 @@ NOTE: **Note:**
Personal access tokens can only be used to connect GitHub.com
repositories to GitLab.
-If you are not using the [GitHub integration](../../integration/github.md), you can
-still perform a one-off authorization with GitHub to grant GitLab access your
+To perform a one-off authorization with GitHub to grant GitLab access your
repositories:
1. Open <https://github.com/settings/tokens/new> to create a **Personal Access
@@ -69,18 +43,19 @@ repositories:
1. In GitHub, add a `.gitlab-ci.yml` to [configure GitLab CI/CD](../quick_start/README.md).
-GitLab will import the project, enable [Pull Mirroring](../../workflow/repository_mirroring.md#pulling-from-a-remote-repository-starter), enable
-[GitHub project integration](../../user/project/integrations/github.md), and create a web hook
-on GitHub to notify GitLab of new commits.
+GitLab will:
+
+1. Import the project.
+1. Enable [Pull Mirroring](../../workflow/repository_mirroring.md#pulling-from-a-remote-repository-starter)
+1. Enable [GitHub project integration](../../user/project/integrations/github.md)
+1. Create a web hook on GitHub to notify GitLab of new commits.
## Connect manually
NOTE: **Note:**
-To use **GitHub Enterprise** with **GitLab.com** use this method.
+To use **GitHub Enterprise** with **GitLab.com**, use this method.
-If the [GitHub integration](../../integration/github.md) is not enabled, or is enabled
-for a different GitHub instance, you GitLab CI/CD can be manually enabled for
-your repository:
+To manually enable GitLab CI/CD for your repository:
1. In GitHub open <https://github.com/settings/tokens/new> create a **Personal
Access Token.** GitLab will use this token to access your repository and
diff --git a/doc/ci/ci_cd_for_external_repos/img/github_repo_list.png b/doc/ci/ci_cd_for_external_repos/img/github_repo_list.png
deleted file mode 100644
index 73579dd3cf1..00000000000
--- a/doc/ci/ci_cd_for_external_repos/img/github_repo_list.png
+++ /dev/null
Binary files differ
diff --git a/doc/ci/docker/using_docker_build.md b/doc/ci/docker/using_docker_build.md
index 7c173970324..730e46f994e 100644
--- a/doc/ci/docker/using_docker_build.md
+++ b/doc/ci/docker/using_docker_build.md
@@ -603,7 +603,7 @@ Below is an example of how your `.gitlab-ci.yml` should look like, assuming you
- docker run my-docker-image /script/to/run/tests
```
-If you forget to set the service alias the `docker:19.03.1` image won't find the
+If you forget to set the service alias the `docker:19.03.1` image won't find the
`dind` service, and an error like the following is thrown:
```sh
diff --git a/doc/ci/yaml/README.md b/doc/ci/yaml/README.md
index 38276de6791..06bd9e68a18 100644
--- a/doc/ci/yaml/README.md
+++ b/doc/ci/yaml/README.md
@@ -100,7 +100,7 @@ The following table lists available parameters for jobs:
| [`stage`](#stage) | Defines a job stage (default: `test`). |
| [`only`](#onlyexcept-basic) | Limit when jobs are created. Also available: [`only:refs`, `only:kubernetes`, `only:variables`, and `only:changes`](#onlyexcept-advanced). |
| [`except`](#onlyexcept-basic) | Limit when jobs are not created. Also available: [`except:refs`, `except:kubernetes`, `except:variables`, and `except:changes`](#onlyexcept-advanced). |
-| [`rules`](#rules) | List of coniditions to evaluate and determine selected attributes of a build and whether or not it is created. May not be used alongside `only`/`except`.
+| [`rules`](#rules) | List of conditions to evaluate and determine selected attributes of a build and whether or not it is created. May not be used alongside `only`/`except`.
| [`tags`](#tags) | List of tags which are used to select Runner. |
| [`allow_failure`](#allow_failure) | Allow job to fail. Failed job doesn't contribute to commit status. |
| [`when`](#when) | When to run job. Also available: `when:manual` and `when:delayed`. |
@@ -2171,6 +2171,14 @@ include:
- template: Auto-DevOps.gitlab-ci.yml
```
+Multiple `include:template` files:
+
+```yaml
+include:
+ - template: Android-Fastlane.gitlab-ci.yml
+ - template: Auto-DevOps.gitlab-ci.yml
+```
+
All [nested includes](#nested-includes) will be executed only with the permission of the user,
so it is possible to use project, remote or template includes.
diff --git a/doc/development/contributing/style_guides.md b/doc/development/contributing/style_guides.md
index 7832850a9f0..f825b3d7088 100644
--- a/doc/development/contributing/style_guides.md
+++ b/doc/development/contributing/style_guides.md
@@ -25,8 +25,13 @@
1. [Python](../python_guide/index.md)
1. [Shell scripting](../shell_scripting_guide/index.md)
+## Checking the style and other issues
+
This is also the style used by linting tools such as
[RuboCop](https://github.com/rubocop-hq/rubocop) and [Hound CI](https://houndci.com).
+You can run RuboCop by hand or install a tool like [Overcommit](https://github.com/sds/overcommit) to run it for you.
+Overcommit will automatically run the configured checks (like Rubocop) on every modified file before commit. You can use the example overcommit configuration found in `.overcommit.yml.example` as a quickstart.
+This saves you time as you don't have to wait for the same errors to be detected by the CI.
---
diff --git a/doc/development/what_requires_downtime.md b/doc/development/what_requires_downtime.md
index 944bf5900c5..f4cee410066 100644
--- a/doc/development/what_requires_downtime.md
+++ b/doc/development/what_requires_downtime.md
@@ -45,15 +45,12 @@ rule.
The first step is to ignore the column in the application code. This is
necessary because Rails caches the columns and re-uses this cache in various
-places. This can be done by including the `IgnorableColumn` module into the
-model, followed by defining the columns to ignore. For example, to ignore
+places. This can be done by defining the columns to ignore. For example, to ignore
`updated_at` in the User model you'd use the following:
```ruby
-class User < ActiveRecord::Base
- include IgnorableColumn
-
- ignore_column :updated_at
+class User < ApplicationRecord
+ self.ignored_columns += %i[updated_at]
end
```
@@ -64,8 +61,7 @@ column. Both these changes should be submitted in the same merge request.
Once the changes from step 1 have been released & deployed you can set up a
separate merge request that removes the ignore rule. This merge request can
-simply remove the `ignore_column` line, and the `include IgnorableColumn` line
-if no other `ignore_column` calls remain.
+simply remove the `self.ignored_columns` line.
## Renaming Columns
diff --git a/doc/integration/elasticsearch.md b/doc/integration/elasticsearch.md
index de49508b47a..c8c1bb00d83 100644
--- a/doc/integration/elasticsearch.md
+++ b/doc/integration/elasticsearch.md
@@ -92,10 +92,11 @@ export PKG_CONFIG_PATH="/usr/local/opt/icu4c/lib/pkgconfig:$PKG_CONFIG_PATH"
To build and install the indexer, run:
```sh
-git clone https://gitlab.com/gitlab-org/gitlab-elasticsearch-indexer.git
-cd gitlab-elasticsearch-indexer
-make
-sudo make install
+indexer_path=/home/git/gitlab-elasticsearch-indexer
+
+# Run the installation task for gitlab-elasticsearch-indexer:
+sudo -u git -H bundle exec rake gitlab:indexer:install[$indexer_path] RAILS_ENV=production
+cd $indexer_path && sudo make install
```
The `gitlab-elasticsearch-indexer` will be installed to `/usr/local/bin`.
@@ -128,8 +129,10 @@ total are being tracked in [epic &153](https://gitlab.com/groups/gitlab-org/-/ep
## Enabling Elasticsearch
-In order to enable Elasticsearch, you need to have admin access. Go to
-**Admin > Settings > Integrations** and find the "Elasticsearch" section.
+In order to enable Elasticsearch, you need to have admin access. Navigate to
+**Admin Area** (wrench icon), then **Settings > Integrations** and expand the **Elasticsearch** section.
+
+Click **Save changes** for the changes to take effect.
The following Elasticsearch settings are available:
@@ -171,171 +174,222 @@ from the Elasticsearch index as expected.
To disable the Elasticsearch integration:
-1. Navigate to the **Admin > Settings > Integrations**
-1. Find the 'Elasticsearch' section and uncheck 'Search with Elasticsearch enabled'
- and 'Elasticsearch indexing'
-1. Click **Save** for the changes to take effect
-1. (Optional) Delete the existing index by running the command `sudo gitlab-rake gitlab:elastic:delete_index`
+1. Navigate to the **Admin Area** (wrench icon), then **Settings > Integrations**.
+1. Expand the **Elasticsearch** section and uncheck **Elasticsearch indexing**
+ and **Search with Elasticsearch enabled**.
+1. Click **Save changes** for the changes to take effect.
+1. (Optional) Delete the existing index by running one of these commands:
+
+ ```sh
+ # Omnibus installations
+ sudo gitlab-rake gitlab:elastic:delete_index
+
+ # Installations from source
+ bundle exec rake gitlab:elastic:delete_index RAILS_ENV=production
+ ```
## Adding GitLab's data to the Elasticsearch index
-### Indexing small instances (database size less than 500 MiB, size of repos less than 5 GiB)
+While Elasticsearch indexing is enabled, new changes in your GitLab instance will be automatically indexed as they happen.
+To backfill existing data, you can use one of the methods below to index it in background jobs.
-Configure Elasticsearch's host and port in **Admin > Settings**. Then index the data using one of the following commands:
+### Indexing through the administration UI
-```sh
-# Omnibus installations
-sudo gitlab-rake gitlab:elastic:index
+> [Introduced](https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/15390) in [GitLab Starter](https://about.gitlab.com/pricing/) 12.3.
-# Installations from source
-bundle exec rake gitlab:elastic:index RAILS_ENV=production
-```
+To index via the admin area:
+
+1. Navigate to the **Admin Area** (wrench icon), then **Settings > Integrations** and expand the **Elasticsearch** section.
+1. [Enable **Elasticsearch indexing** and configure your host and port](#enabling-elasticsearch).
+1. Create empty indexes using one of the following commands:
+
+ ```sh
+ # Omnibus installations
+ sudo gitlab-rake gitlab:elastic:create_empty_index
+
+ # Installations from source
+ bundle exec rake gitlab:elastic:create_empty_index RAILS_ENV=production
+ ```
+
+1. Click **Index all projects**.
+1. Click **Check progress** in the confirmation message to see the status of the background jobs.
+1. Personal snippets need to be indexed manually by running one of these commands:
+
+ ```sh
+ # Omnibus installations
+ sudo gitlab-rake gitlab:elastic:index_snippets
+
+ # Installations from source
+ bundle exec rake gitlab:elastic:index_snippets RAILS_ENV=production
+ ```
+
+1. After the indexing has completed, enable [**Search with Elasticsearch**](#enabling-elasticsearch).
+
+### Indexing through Rake tasks
+
+#### Indexing small instances
+
+CAUTION: **Warning**:
+This will delete your existing indexes.
+
+If the database size is less than 500 MiB, and the size of all hosted repos is less than 5 GiB:
+
+1. [Enable **Elasticsearch indexing** and configure your host and port](#enabling-elasticsearch).
+1. Index your data using one of the following commands:
+
+ ```sh
+ # Omnibus installations
+ sudo gitlab-rake gitlab:elastic:index
+
+ # Installations from source
+ bundle exec rake gitlab:elastic:index RAILS_ENV=production
+ ```
-After it completes the indexing process, [enable Elasticsearch searching](elasticsearch.md#enabling-elasticsearch).
+1. After the indexing has completed, enable [**Search with Elasticsearch**](#enabling-elasticsearch).
-### Indexing large instances
+#### Indexing large instances
-WARNING: **Warning**:
-Performing asynchronous indexing, as this will describe, will generate a lot of sidekiq jobs.
+CAUTION: **Warning**:
+Performing asynchronous indexing will generate a lot of Sidekiq jobs.
Make sure to prepare for this task by either [Horizontally Scaling](../administration/high_availability/README.md#basic-scaling)
-or creating [extra sidekiq processes](../administration/operations/extra_sidekiq_processes.md)
+or creating [extra Sidekiq processes](../administration/operations/extra_sidekiq_processes.md)
-Configure Elasticsearch's host and port in **Admin > Settings > Integrations**. Then create empty indexes using one of the following commands:
+1. [Enable **Elasticsearch indexing** and configure your host and port](#enabling-elasticsearch).
+1. Create empty indexes using one of the following commands:
-```sh
-# Omnibus installations
-sudo gitlab-rake gitlab:elastic:create_empty_index
+ ```sh
+ # Omnibus installations
+ sudo gitlab-rake gitlab:elastic:create_empty_index
-# Installations from source
-bundle exec rake gitlab:elastic:create_empty_index RAILS_ENV=production
-```
+ # Installations from source
+ bundle exec rake gitlab:elastic:create_empty_index RAILS_ENV=production
+ ```
-Indexing large Git repositories can take a while. To speed up the process, you
-can temporarily disable auto-refreshing and replicating. In our experience, you can expect a 20%
-decrease in indexing time. We'll enable them when indexing is done. This step is optional!
+1. Indexing large Git repositories can take a while. To speed up the process, you
+ can temporarily disable auto-refreshing and replicating. In our experience, you can expect a 20%
+ decrease in indexing time. We'll enable them when indexing is done. This step is optional!
-```bash
-curl --request PUT localhost:9200/gitlab-production/_settings --data '{
- "index" : {
- "refresh_interval" : "-1",
- "number_of_replicas" : 0
- } }'
-```
+ ```bash
+ curl --request PUT localhost:9200/gitlab-production/_settings --data '{
+ "index" : {
+ "refresh_interval" : "-1",
+ "number_of_replicas" : 0
+ } }'
+ ```
-Then enable Elasticsearch indexing and run project indexing tasks:
+1. Index projects and their associated data:
-```sh
-# Omnibus installations
-sudo gitlab-rake gitlab:elastic:index_projects
+ ```sh
+ # Omnibus installations
+ sudo gitlab-rake gitlab:elastic:index_projects
-# Installations from source
-bundle exec rake gitlab:elastic:index_projects RAILS_ENV=production
-```
+ # Installations from source
+ bundle exec rake gitlab:elastic:index_projects RAILS_ENV=production
+ ```
-This enqueues a Sidekiq job for each project that needs to be indexed.
-You can view the jobs in the admin panel (they are placed in the `elastic_indexer`
-queue), or you can query indexing status using a rake task:
+ This enqueues a Sidekiq job for each project that needs to be indexed.
+ You can view the jobs in **Admin Area > Monitoring > Background Jobs > Queues Tab**
+ and click `elastic_indexer`, or you can query indexing status using a rake task:
-```sh
-# Omnibus installations
-sudo gitlab-rake gitlab:elastic:index_projects_status
+ ```sh
+ # Omnibus installations
+ sudo gitlab-rake gitlab:elastic:index_projects_status
-# Installations from source
-bundle exec rake gitlab:elastic:index_projects_status RAILS_ENV=production
+ # Installations from source
+ bundle exec rake gitlab:elastic:index_projects_status RAILS_ENV=production
-Indexing is 65.55% complete (6555/10000 projects)
-```
+ Indexing is 65.55% complete (6555/10000 projects)
+ ```
-If you want to limit the index to a range of projects you can provide the
-`ID_FROM` and `ID_TO` parameters:
+ If you want to limit the index to a range of projects you can provide the
+ `ID_FROM` and `ID_TO` parameters:
-```sh
-# Omnibus installations
-sudo gitlab-rake gitlab:elastic:index_projects ID_FROM=1001 ID_TO=2000
+ ```sh
+ # Omnibus installations
+ sudo gitlab-rake gitlab:elastic:index_projects ID_FROM=1001 ID_TO=2000
-# Installations from source
-bundle exec rake gitlab:elastic:index_projects ID_FROM=1001 ID_TO=2000 RAILS_ENV=production
-```
+ # Installations from source
+ bundle exec rake gitlab:elastic:index_projects ID_FROM=1001 ID_TO=2000 RAILS_ENV=production
+ ```
-Where `ID_FROM` and `ID_TO` are project IDs. Both parameters are optional.
-The above examples will index all projects starting with ID `1001` up to (and including) ID `2000`.
+ Where `ID_FROM` and `ID_TO` are project IDs. Both parameters are optional.
+ The above example will index all projects from ID `1001` up to (and including) ID `2000`.
-TIP: **Troubleshooting:**
-Sometimes the project indexing jobs queued by `gitlab:elastic:index_projects`
-can get interrupted. This may happen for many reasons, but it's always safe
-to run the indexing task again - it will skip those repositories that have
-already been indexed.
+ TIP: **Troubleshooting:**
+ Sometimes the project indexing jobs queued by `gitlab:elastic:index_projects`
+ can get interrupted. This may happen for many reasons, but it's always safe
+ to run the indexing task again. It will skip repositories that have
+ already been indexed.
-As the indexer stores the last commit SHA of every indexed repository in the
-database, you can run the indexer with the special parameter `UPDATE_INDEX` and
-it will check every project repository again to make sure that every commit in
-that repository is indexed, it can be useful in case if your index is outdated:
+ As the indexer stores the last commit SHA of every indexed repository in the
+ database, you can run the indexer with the special parameter `UPDATE_INDEX` and
+ it will check every project repository again to make sure that every commit in
+ a repository is indexed, which can be useful in case if your index is outdated:
-```sh
-# Omnibus installations
-sudo gitlab-rake gitlab:elastic:index_projects UPDATE_INDEX=true ID_TO=1000
+ ```sh
+ # Omnibus installations
+ sudo gitlab-rake gitlab:elastic:index_projects UPDATE_INDEX=true ID_TO=1000
-# Installations from source
-bundle exec rake gitlab:elastic:index_projects UPDATE_INDEX=true ID_TO=1000 RAILS_ENV=production
-```
+ # Installations from source
+ bundle exec rake gitlab:elastic:index_projects UPDATE_INDEX=true ID_TO=1000 RAILS_ENV=production
+ ```
-You can also use the `gitlab:elastic:clear_index_status` Rake task to force the
-indexer to "forget" all progress, so retrying the indexing process from the
-start.
+ You can also use the `gitlab:elastic:clear_index_status` Rake task to force the
+ indexer to "forget" all progress, so it will retry the indexing process from the
+ start.
-The `index_projects` command enqueues jobs to index all project and wiki
-repositories, and most database content. However, snippets still need to be
-indexed separately. To do so, run one of these commands:
+1. Personal snippets are not associated with a project and need to be indexed separately
+ by running one of these commands:
-```sh
-# Omnibus installations
-sudo gitlab-rake gitlab:elastic:index_snippets
+ ```sh
+ # Omnibus installations
+ sudo gitlab-rake gitlab:elastic:index_snippets
-# Installations from source
-bundle exec rake gitlab:elastic:index_snippets RAILS_ENV=production
-```
+ # Installations from source
+ bundle exec rake gitlab:elastic:index_snippets RAILS_ENV=production
+ ```
-Enable replication and refreshing again after indexing (only if you previously disabled it):
+1. Enable replication and refreshing again after indexing (only if you previously disabled it):
-```bash
-curl --request PUT localhost:9200/gitlab-production/_settings --data '{
- "index" : {
- "number_of_replicas" : 1,
- "refresh_interval" : "1s"
- } }'
-```
+ ```bash
+ curl --request PUT localhost:9200/gitlab-production/_settings --data '{
+ "index" : {
+ "number_of_replicas" : 1,
+ "refresh_interval" : "1s"
+ } }'
+ ```
-A force merge should be called after enabling the refreshing above.
+ A force merge should be called after enabling the refreshing above.
-For Elasticsearch 6.x, before proceeding with the force merge, the index should be in read-only mode:
+ For Elasticsearch 6.x, the index should be in read-only mode before proceeding with the force merge:
-```bash
-curl --request PUT localhost:9200/gitlab-production/_settings --data '{
- "settings": {
- "index.blocks.write": true
- } }'
-```
+ ```bash
+ curl --request PUT localhost:9200/gitlab-production/_settings --data '{
+ "settings": {
+ "index.blocks.write": true
+ } }'
+ ```
-Then, initiate the force merge:
+ Then, initiate the force merge:
-```bash
-curl --request POST 'http://localhost:9200/gitlab-production/_forcemerge?max_num_segments=5'
-```
+ ```bash
+ curl --request POST 'http://localhost:9200/gitlab-production/_forcemerge?max_num_segments=5'
+ ```
-After this, if your index is in read-only, switch back to read-write:
+ After this, if your index is in read-only mode, switch back to read-write:
-```bash
-curl --request PUT localhost:9200/gitlab-production/_settings --data '{
- "settings": {
- "index.blocks.write": false
- } }'
-```
+ ```bash
+ curl --request PUT localhost:9200/gitlab-production/_settings --data '{
+ "settings": {
+ "index.blocks.write": false
+ } }'
+ ```
-Enable Elasticsearch search in **Admin > Settings > Integrations**. That's it. Enjoy it!
+1. After the indexing has completed, enable [**Search with Elasticsearch**](#enabling-elasticsearch).
-### Index limit
+### Indexing limitations
-Currently for repository and snippet files, GitLab would only index up to 1 MB of content, in order to avoid indexing timeout.
+For repository and snippet files, GitLab will only index up to 1 MiB of content, in order to avoid indexing timeouts.
## GitLab Elasticsearch Rake Tasks
@@ -352,7 +406,7 @@ There are several rake tasks available to you via the command line:
- [`sudo gitlab-rake gitlab:elastic:index_projects_status`](https://gitlab.com/gitlab-org/gitlab-ee/blob/master/ee/lib/tasks/gitlab/elastic.rake)
- This determines the overall status of the indexing. It is done by counting the total number of indexed projects, dividing by a count of the total number of projects, then multiplying by 100.
- [`sudo gitlab-rake gitlab:elastic:create_empty_index`](https://gitlab.com/gitlab-org/gitlab-ee/blob/master/ee/lib/tasks/gitlab/elastic.rake)
- - This generates an empty index on the Elasticsearch side.
+ - This generates an empty index on the Elasticsearch side, deleting the existing one if present.
- [`sudo gitlab-rake gitlab:elastic:clear_index_status`](https://gitlab.com/gitlab-org/gitlab-ee/blob/master/ee/lib/tasks/gitlab/elastic.rake)
- This deletes all instances of IndexStatus for all projects.
- [`sudo gitlab-rake gitlab:elastic:delete_index`](https://gitlab.com/gitlab-org/gitlab-ee/blob/master/ee/lib/tasks/gitlab/elastic.rake)
@@ -468,7 +522,7 @@ Here are some common pitfalls and how to overcome them:
pp s.search_objects.to_a
```
- See [Elasticsearch Index Scopes](elasticsearch.md#elasticsearch-index-scopes) for more information on searching for specific types of data.
+ See [Elasticsearch Index Scopes](#elasticsearch-index-scopes) for more information on searching for specific types of data.
- **I indexed all the repositories but then switched Elasticsearch servers and now I can't find anything**
diff --git a/doc/security/asset_proxy.md b/doc/security/asset_proxy.md
index f25910d3db7..6a2341c28c8 100644
--- a/doc/security/asset_proxy.md
+++ b/doc/security/asset_proxy.md
@@ -16,12 +16,12 @@ of your Camo server.
Once you have your Camo server up and running, you can configure GitLab to
proxy image requests to it. The following settings are supported:
-| Attribute | Description |
-| ------------------------ | ----------- |
-| `asset_proxy_enabled` | (**If enabled, requires:** `asset_proxy_url`) Enable proxying of assets. |
-| `asset_proxy_secret_key` | Shared secret with the asset proxy server. |
-| `asset_proxy_url` | URL of the asset proxy server. |
-| `asset_proxy_whitelist` | Assets that match these domain(s) will NOT be proxied. Wildcards allowed. Your GitLab installation URL is automatically whitelisted. |
+| Attribute | Description |
+| ------------------------- | ----------- |
+| `asset_proxy_enabled` | (**If enabled, requires:** `asset_proxy_url`) Enable proxying of assets. |
+| `asset_proxy_secret_key` | Shared secret with the asset proxy server. |
+| `asset_proxy_url` | URL of the asset proxy server. |
+| `asset_proxy_whitelist` | Assets that match these domain(s) will NOT be proxied. Wildcards allowed. Your GitLab installation URL is automatically whitelisted. |
These can be set via the [Application setting API](../api/settings.md)
diff --git a/doc/user/admin_area/settings/account_and_limit_settings.md b/doc/user/admin_area/settings/account_and_limit_settings.md
index 5e385b7216d..20691210fbd 100644
--- a/doc/user/admin_area/settings/account_and_limit_settings.md
+++ b/doc/user/admin_area/settings/account_and_limit_settings.md
@@ -44,12 +44,19 @@ there are no restrictions.
These settings can be found within:
-- Each project's settings.
-- A group's settings.
-- The **Size limit per repository (MB)** field in the **Account and limit** section of a GitLab instance's
- settings by navigating to either:
- - **Admin Area > Settings > General**.
- - The path `/admin/application_settings`.
+- Each project's settings:
+ 1. From the Project's homepage, navigate to **Settings > General**.
+ 1. Fill in the **Repository size limit (MB)** field in the **Naming, topics, avatar** section.
+ 1. Click **Save changes**.
+- Each group's settings:
+ 1. From the Group's homepage, navigate to **Settings > General**.
+ 1. Fill in the **Repository size limit (MB)** field in the **Naming, visibility** section.
+ 1. Click **Save changes**.
+- GitLab's global settings:
+ 1. From the Dashboard, navigate to **Admin Area > Settings > General**.
+ 1. Expand the **Account and limit** section.
+ 1. Fill in the **Size limit per repository (MB)** field.
+ 1. Click **Save changes**.
The first push of a new project, including LFS objects, will be checked for size
and **will** be rejected if the sum of their sizes exceeds the maximum allowed
diff --git a/doc/user/application_security/security_dashboard/img/group_security_dashboard.png b/doc/user/application_security/security_dashboard/img/group_security_dashboard.png
deleted file mode 100644
index 85ab124f74c..00000000000
--- a/doc/user/application_security/security_dashboard/img/group_security_dashboard.png
+++ /dev/null
Binary files differ
diff --git a/doc/user/application_security/security_dashboard/img/group_security_dashboard_v12_3.png b/doc/user/application_security/security_dashboard/img/group_security_dashboard_v12_3.png
new file mode 100644
index 00000000000..61f683c1335
--- /dev/null
+++ b/doc/user/application_security/security_dashboard/img/group_security_dashboard_v12_3.png
Binary files differ
diff --git a/doc/user/application_security/security_dashboard/index.md b/doc/user/application_security/security_dashboard/index.md
index 3d7f264c295..e7cda35eb98 100644
--- a/doc/user/application_security/security_dashboard/index.md
+++ b/doc/user/application_security/security_dashboard/index.md
@@ -65,16 +65,11 @@ Once you're on the dashboard, at the top you should see a series of filters for:
NOTE: **Note:**
The dashboard only shows projects with [security reports](#supported-reports) enabled in a group.
-![dashboard with action buttons and metrics](img/group_security_dashboard.png)
+![dashboard with action buttons and metrics](img/group_security_dashboard_v12_3.png)
Selecting one or more filters will filter the results in this page.
-The first section is an overview of all the vulnerabilities, grouped by severity.
-Underneath this overview is a timeline chart that shows how many open
-vulnerabilities your projects had at various points in time. You can filter among 30, 60, and
-90 days, with the default being 90. Hover over the chart to get more details about
-the open vulnerabilities at a specific time.
-Finally, there is a list of all the vulnerabilities in the group, sorted by severity.
+The main section is a list of all the vulnerabilities in the group, sorted by severity.
In that list, you can see the severity of the vulnerability, its name, its
confidence (likelihood of the vulnerability to be a positive one), and the project
it's from.
@@ -85,6 +80,11 @@ If you hover over a row, there will appear some actions you can take:
- "Create issue"
- "Dismiss vulnerability"
+Next to the list is a timeline chart that shows how many open
+vulnerabilities your projects had at various points in time. You can filter among 30, 60, and
+90 days, with the default being 90. Hover over the chart to get more details about
+the open vulnerabilities at a specific time.
+
Read more on how to [interact with the vulnerabilities](../index.md#interacting-with-the-vulnerabilities).
## Keeping the dashboards up to date
diff --git a/doc/user/clusters/img/jupyter-git-extension.gif b/doc/user/clusters/img/jupyter-git-extension.gif
index 13a88d97425..14dc567af2a 100644
--- a/doc/user/clusters/img/jupyter-git-extension.gif
+++ b/doc/user/clusters/img/jupyter-git-extension.gif
Binary files differ
diff --git a/doc/user/gitlab_com/index.md b/doc/user/gitlab_com/index.md
index ca9450f94b9..2f2955f5a1c 100644
--- a/doc/user/gitlab_com/index.md
+++ b/doc/user/gitlab_com/index.md
@@ -334,7 +334,7 @@ No response headers are provided.
GitLab.com:
- Has [rate limits on raw endpoints](../../user/admin_area/settings/rate_limits_on_raw_endpoints.md)
- set to the default.
+ set to the default.
- Does not have the user and IP rate limits settings enabled.
## GitLab.com at scale
diff --git a/doc/user/group/epics/index.md b/doc/user/group/epics/index.md
index 5968b91c9b7..b947a587b2b 100644
--- a/doc/user/group/epics/index.md
+++ b/doc/user/group/epics/index.md
@@ -4,7 +4,7 @@ type: reference, howto
# Epics **(ULTIMATE)**
-> Introduced in [GitLab Ultimate][ee] 10.2.
+> Introduced in [GitLab Ultimate](https://about.gitlab.com/pricing/) 10.2.
Epics let you manage your portfolio of projects more efficiently and with less
effort by tracking groups of issues that share a theme, across projects and
@@ -116,7 +116,7 @@ To apply labels across multiple epics:
## Deleting an epic
NOTE: **Note:**
-To delete an epic, you need to be an [Owner][permissions] of a group/subgroup.
+To delete an epic, you need to be an [Owner](../../permissions.md#group-members-permissions) of a group/subgroup.
When inside a single epic view, click the **Delete** button to delete the epic.
A modal will pop-up to confirm your action.
@@ -154,7 +154,7 @@ link in the issue sidebar.
If you have [permissions](../../permissions.md) to close an issue and create an
epic in the parent group, you can promote an issue to an epic with the `/promote`
-[quick action](../../project/quick_actions.md#quick-actions-for-epics-ultimate).
+[quick action](../../project/quick_actions.md#quick-actions-for-issues-merge-requests-and-epics).
Only issues from projects that are in groups can be promoted.
When the quick action is executed:
@@ -171,7 +171,7 @@ The following issue metadata will be copied to the epic:
## Searching for an epic from epics list page
-> Introduced in [GitLab Ultimate][ee] 10.5.
+> Introduced in [GitLab Ultimate](https://about.gitlab.com/pricing/) 10.5.
You can search for an epic from the list of epics using filtered search bar (similar to
that of Issues and Merge requests) based on following parameters:
@@ -210,10 +210,7 @@ Note that for a given group, the visibility of all projects must be the same as
the group, or less restrictive. That means if you have access to a group's epic,
then you already have access to its projects' issues.
-You may also consult the [group permissions table][permissions].
-
-[ee]: https://about.gitlab.com/pricing/
-[permissions]: ../../permissions.md#group-members-permissions
+You may also consult the [group permissions table](../../permissions.md#group-members-permissions).
## Thread
diff --git a/doc/user/group/index.md b/doc/user/group/index.md
index 403071f2513..86fb7533e70 100644
--- a/doc/user/group/index.md
+++ b/doc/user/group/index.md
@@ -150,8 +150,11 @@ side of your screen.
![Request access button](img/request_access_button.png)
-Group owners and maintainers will be notified of your request and will be able to approve or
-decline it on the members page.
+Once access is requested:
+
+- Up to ten group owners are notified of your request via email.
+ Email is sent to the most recently active group owners.
+- Any group owner can approve or decline your request on the members page.
![Manage access requests](img/access_requests_management.png)
@@ -346,7 +349,7 @@ Add one or more whitelisted IP subnets using CIDR notation in comma separated fo
coming from a different IP address won't be able to access the restricted
content.
-Restriction currently applies to UI, API access is not restricted.
+Restriction currently applies to UI and API access, Git actions via ssh are not restricted.
To avoid accidental lock-out, admins and group owners are are able to access
the group regardless of the IP restriction.
diff --git a/doc/user/project/integrations/img/grafana_live_embed.png b/doc/user/project/integrations/img/grafana_live_embed.png
new file mode 100644
index 00000000000..91970cd379a
--- /dev/null
+++ b/doc/user/project/integrations/img/grafana_live_embed.png
Binary files differ
diff --git a/doc/user/project/integrations/prometheus.md b/doc/user/project/integrations/prometheus.md
index d13592559b9..3583c0554ee 100644
--- a/doc/user/project/integrations/prometheus.md
+++ b/doc/user/project/integrations/prometheus.md
@@ -393,6 +393,27 @@ The following requirements must be met for the metric to unfurl:
![Embedded Metrics](img/embed_metrics.png)
+### Embedding live Grafana charts
+
+It is also possible to embed live [Grafana](https://docs.gitlab.com/omnibus/settings/grafana.html) charts within issues, as a [Direct Linked Rendered Image](https://grafana.com/docs/reference/sharing/#direct-link-rendered-image).
+
+The sharing dialog within Grafana provides the link, as highlighted below.
+
+![Grafana Direct Linked Rendered Image](img/grafana_live_embed.png)
+
+NOTE: **Note:**
+For this embed to display correctly the Grafana instance must be available to the target user, either as a public dashboard or on the same network.
+
+Copy the link and add an image tag as [inline HTML](../../markdown.md#inline-html) in your markdown. You may tweak the query parameters as required. For instance, removing the `&from=` and `&to=` parameters will give you a live chart. Here is example markup for a live chart from GitLab's public dashboard:
+
+```html
+<img src="https://dashboards.gitlab.com/render/d-solo/RZmbBr7mk/gitlab-triage?orgId=1&refresh=30s&var-env=gprd&var-environment=gprd&var-prometheus=prometheus-01-inf-gprd&var-prometheus_app=prometheus-app-01-inf-gprd&var-backend=All&var-type=All&var-stage=main&panelId=1247&width=1000&height=300"/>
+```
+
+This will render like so:
+
+<img src="https://dashboards.gitlab.com/render/d-solo/RZmbBr7mk/gitlab-triage?orgId=1&refresh=30s&var-env=gprd&var-environment=gprd&var-prometheus=prometheus-01-inf-gprd&var-prometheus_app=prometheus-app-01-inf-gprd&var-backend=All&var-type=All&var-stage=main&panelId=1247&width=1000&height=300"/>
+
## Troubleshooting
If the "No data found" screen continues to appear, it could be due to:
diff --git a/doc/user/project/members/index.md b/doc/user/project/members/index.md
index e343fd45488..21016dca358 100644
--- a/doc/user/project/members/index.md
+++ b/doc/user/project/members/index.md
@@ -79,8 +79,15 @@ side of your screen.
![Request access button](img/request_access_button.png)
-Project owners & maintainers will be notified of your request and will be able to approve or
-decline it on the members page.
+Once access is requested:
+
+- Up to ten project maintainers are notified of your request via email.
+ Email is sent to the most recently active project maintainers.
+- Any project maintainer can approve or decline your request on the members page.
+
+NOTE: **Note:**
+If a project does not have any maintainers, the notification is sent to the
+most recently active owners of the project's group.
![Manage access requests](img/access_requests_management.png)
diff --git a/doc/user/project/merge_requests/code_quality.md b/doc/user/project/merge_requests/code_quality.md
index 3a409bab19d..3c6b660c63d 100644
--- a/doc/user/project/merge_requests/code_quality.md
+++ b/doc/user/project/merge_requests/code_quality.md
@@ -5,8 +5,7 @@ disqus_identifier: 'https://docs.gitlab.com/ee/user/project/merge_requests/code_
# Code Quality **(STARTER)**
-> [Introduced](https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/1984)
-in [GitLab Starter](https://about.gitlab.com/pricing/) 9.3.
+> [Introduced](https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/1984) in [GitLab Starter](https://about.gitlab.com/pricing/) 9.3.
With the help of [GitLab CI/CD](../../../ci/README.md), you can analyze your
source code quality using GitLab Code Quality.
@@ -26,7 +25,7 @@ Code Quality:
Going a step further, GitLab can show the Code Quality report right
in the merge request widget area:
-![Code Quality Widget](img/code_quality.gif)
+![Code Quality Widget](img/code_quality.png)
## Use cases
diff --git a/doc/user/project/merge_requests/img/code_quality.gif b/doc/user/project/merge_requests/img/code_quality.gif
deleted file mode 100644
index bab921cf38b..00000000000
--- a/doc/user/project/merge_requests/img/code_quality.gif
+++ /dev/null
Binary files differ
diff --git a/doc/user/project/merge_requests/img/code_quality.png b/doc/user/project/merge_requests/img/code_quality.png
new file mode 100644
index 00000000000..a20f6476fb8
--- /dev/null
+++ b/doc/user/project/merge_requests/img/code_quality.png
Binary files differ
diff --git a/doc/user/project/merge_requests/index.md b/doc/user/project/merge_requests/index.md
index a94057dc3a1..d6da8cb99c7 100644
--- a/doc/user/project/merge_requests/index.md
+++ b/doc/user/project/merge_requests/index.md
@@ -218,7 +218,7 @@ Similarly, assignees are removed by deselecting them from the same dropdown menu
It's also possible to manage multiple assignees:
- When creating a merge request.
-- Using [quick actions](../quick_actions.md#quick-actions-for-issues-and-merge-requests).
+- Using [quick actions](../quick_actions.md#quick-actions-for-issues-merge-requests-and-epics).
## Resolve conflicts
diff --git a/doc/user/project/merge_requests/work_in_progress_merge_requests.md b/doc/user/project/merge_requests/work_in_progress_merge_requests.md
index ea59644fce6..8ac4131e10b 100644
--- a/doc/user/project/merge_requests/work_in_progress_merge_requests.md
+++ b/doc/user/project/merge_requests/work_in_progress_merge_requests.md
@@ -18,7 +18,7 @@ There are several ways to flag a merge request as a Work In Progress:
- Add `[WIP]` or `WIP:` to the start of the merge request's title. Clicking on
**Start the title with WIP:**, under the title box, when editing the merge request's
description will have the same effect.
-- Add the `/wip` [quick action](../quick_actions.md#quick-actions-for-issues-and-merge-requests)
+- Add the `/wip` [quick action](../quick_actions.md#quick-actions-for-issues-merge-requests-and-epics)
in a comment in the merge request. This is a toggle, and can be repeated
to change the status back. Note that any other text in the comment will be discarded.
- Add "wip" or "WIP" to the start of a commit message targeting the merge request's
@@ -33,7 +33,7 @@ Similar to above, when a Merge Request is ready to be merged, you can remove the
- Remove `[WIP]` or `WIP:` from the start of the merge request's title. Clicking on
**Remove the WIP: prefix from the title**, under the title box, when editing the merge
request's description, will have the same effect.
-- Add the `/wip` [quick action](../quick_actions.md#quick-actions-for-issues-and-merge-requests)
+- Add the `/wip` [quick action](../quick_actions.md#quick-actions-for-issues-merge-requests-and-epics)
in a comment in the merge request. This is a toggle, and can be repeated
to change the status back. Note that any other text in the comment will be discarded.
- Click on the **Resolve WIP status** button near the bottom of the merge request description,
diff --git a/doc/user/project/pages/custom_domains_ssl_tls_certification/index.md b/doc/user/project/pages/custom_domains_ssl_tls_certification/index.md
index 1821d954af3..f68dfdf02cc 100644
--- a/doc/user/project/pages/custom_domains_ssl_tls_certification/index.md
+++ b/doc/user/project/pages/custom_domains_ssl_tls_certification/index.md
@@ -24,7 +24,7 @@ and steps below.
(`*.gitlab.io`, for GitLab.com).
- A custom domain name `example.com` or subdomain `subdomain.example.com`.
- Access to your domain's server control panel to set up DNS records:
- - A DNS A or CNAME record poiting your domain to GitLab Pages server.
+ - A DNS A or CNAME record pointing your domain to GitLab Pages server.
- A DNS TXT record to verify your domain's ownership.
### Steps
diff --git a/doc/user/project/pages/custom_domains_ssl_tls_certification/lets_encrypt_integration.md b/doc/user/project/pages/custom_domains_ssl_tls_certification/lets_encrypt_integration.md
index ffd9bc04c3e..16fd0149101 100644
--- a/doc/user/project/pages/custom_domains_ssl_tls_certification/lets_encrypt_integration.md
+++ b/doc/user/project/pages/custom_domains_ssl_tls_certification/lets_encrypt_integration.md
@@ -22,7 +22,8 @@ See all the related issues linked from this [issue's description](https://gitlab
for more information.
Note: **Note:**
-Using this feature requires **2 IP addresses** to be configured to the machine.
+Using this feature requires two separate IP addresses, one for the GitLab domain
+and one GitLab Pages domain.
## Requirements
diff --git a/doc/user/project/pages/index.md b/doc/user/project/pages/index.md
index a0bc10b0ed7..a9fd6544e64 100644
--- a/doc/user/project/pages/index.md
+++ b/doc/user/project/pages/index.md
@@ -106,12 +106,14 @@ To get started with GitLab Pages, you can either:
1. From the left sidebar, navigate to your project's **CI/CD > Pipelines**
and click **Run pipeline** to trigger GitLab CI/CD to build and deploy your
site to the server.
-1. Once the pipeline has finished successfully, find the link to visit your
- website from your project's **Settings > Pages**.
+1. After the pipeline has finished successfully, wait approximately 30 minutes
+ for your website to be visible. After waiting 30 minutes, find the link to
+ visit your website from your project's **Settings > Pages**. If the link
+ leads to a 404 page, wait a few minutes and try again.
-Your website is then visible on your domain, and you can modify yourfiles
+Your website is then visible on your domain and you can modify your files
as you wish. For every modification pushed to your repository, GitLab CI/CD
-will run a new pipeline to publish your changes to the server.
+will run a new pipeline to immediately publish your changes to the server.
_Advanced options:_
diff --git a/doc/user/project/quick_actions.md b/doc/user/project/quick_actions.md
index 647250bd02a..e373d605098 100644
--- a/doc/user/project/quick_actions.md
+++ b/doc/user/project/quick_actions.md
@@ -12,59 +12,63 @@ on a separate line in order to be properly detected and executed. Once executed,
> From [GitLab 12.1](https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/26672), an alert is displayed when a quick action is successfully applied.
-## Quick Actions for issues and merge requests
-
-The following quick actions are applicable to both issues and merge requests threads,
-discussions, and descriptions:
-
-| Command | Action | Issue | Merge request |
-|:---------------------------|:------------------------------ |:------|:--------------|
-| `/tableflip <Comment>` | Append the comment with `(╯°□°)╯︵ ┻━┻` | ✓ | ✓ |
-| `/shrug <Comment>` | Append the comment with `¯\_(ツ)_/¯` | ✓ | ✓ |
-| `/todo` | Add a To Do | ✓ | ✓ |
-| `/done` | Mark To Do as done | ✓ | ✓ |
-| `/subscribe` | Subscribe | ✓ | ✓ |
-| `/unsubscribe` | Unsubscribe | ✓ | ✓ |
-| `/close` | Close | ✓ | ✓ |
-| `/reopen` | Reopen | ✓ | ✓ |
-| `/title <New title>` | Change title | ✓ | ✓ |
-| `/award :emoji:` | Toggle emoji award | ✓ | ✓ |
-| `/assign me` | Assign yourself | ✓ | ✓ |
-| `/assign @user` | Assign one user | ✓ | ✓ |
-| `/assign @user1 @user2` | Assign multiple users **(STARTER)** | ✓ | ✓ |
-| `/unassign @user1 @user2` | Remove assignee(s) **(STARTER)** | ✓ | ✓ |
-| `/reassign @user1 @user2` | Change assignee **(STARTER)** | ✓ | ✓ |
-| `/unassign` | Remove current assignee | ✓ | ✓ |
-| `/milestone %milestone` | Set milestone | ✓ | ✓ |
-| `/remove_milestone` | Remove milestone | ✓ | ✓ |
-| `/label ~label1 ~label2` | Add label(s). Label names can also start without ~ but mixed syntax is not supported. | ✓ | ✓ |
-| `/unlabel ~label1 ~label2` | Remove all or specific label(s)| ✓ | ✓ |
-| `/relabel ~label1 ~label2` | Replace existing label(s) with those specified | ✓ | ✓ |
-| `/copy_metadata <#issue>` | Copy labels and milestone from another issue in the project | ✓ | ✓ |
-| `/copy_metadata <!merge_request>` | Copy labels and milestone from another merge request in the project | ✓ | ✓ |
-| `/estimate <1w 3d 2h 14m>` | Set time estimate | ✓ | ✓ |
-| `/remove_estimate` | Remove time estimate | ✓ | ✓ |
-| `/spend <time(1h 30m)> <date(YYYY-MM-DD)>` | Add spent time; optionally, specify the date that time was spent on | ✓ | ✓ |
-| `/spend <time(-1h 5m)> <date(YYYY-MM-DD)>` | Subtract spent time; optionally, specify the date that time was spent on | ✓ | ✓ |
-| `/remove_time_spent` | Remove time spent | ✓ | ✓ |
-| `/lock` | Lock the thread | ✓ | ✓ |
-| `/unlock` | Unlock the thread | ✓ | ✓ |
-| `/due <date>` | Set due date. Examples of valid `<date>` include `in 2 days`, `this Friday` and `December 31st`. | ✓ | |
-| `/remove_due_date` | Remove due date | ✓ | |
-| `/weight <value>` | Set weight. Valid options for `<value>` include `0`, `1`, `2`, etc. **(STARTER)** | ✓ | |
-| `/clear_weight` | Clears weight **(STARTER)** | ✓ | |
-| `/epic <epic>` | Add to epic `<epic>`. The `<epic>` value should be in the format of `&epic`, `group&epic` or `epic-URL`. **(ULTIMATE)** | ✓ | |
-| `/remove_epic` | Removes from epic **(ULTIMATE)** | ✓ | |
-| `/promote` | Promote issue to epic **(ULTIMATE)** | ✓ | |
-| `/confidential` | Make confidential | ✓ | |
-| `/duplicate <#issue>` | Mark this issue as a duplicate of another issue | ✓ |
-| `/move <path/to/project>` | Move this issue to another project | ✓ | |
-| `/target_branch <Local branch Name>` | Set target branch | | ✓ |
-| `/wip` | Toggle the Work In Progress status | | ✓ |
-| `/approve` | Approve the merge request | | ✓ |
-| `/merge` | Merge (when pipeline succeeds) | | ✓ |
-| `/create_merge_request <branch name>` | Create a new merge request starting from the current issue | ✓ | |
-| `/relate #issue1 #issue2` | Mark issues as related **(STARTER)** | ✓ | |
+## Quick Actions for issues, merge requests and epics
+
+The following quick actions are applicable to descriptions, discussions and threads
+in issues and merge requests, as well as epics.**(ULTIMATE)**
+
+| Command | Issue | Merge request | Epic | Action |
+|:--------------------------------------|:------|:--------------|:-----|:------ |
+| `/tableflip <comment>` | ✓ | ✓ | ✓ | Append the comment with `(╯°□°)╯︵ ┻━┻` |
+| `/shrug <comment>` | ✓ | ✓ | ✓ | Append the comment with `¯\_(ツ)_/¯` |
+| `/todo` | ✓ | ✓ | ✓ | Add a To Do |
+| `/done` | ✓ | ✓ | ✓ | Mark To Do as done |
+| `/subscribe` | ✓ | ✓ | ✓ | Subscribe |
+| `/unsubscribe` | ✓ | ✓ | ✓ | Unsubscribe |
+| `/close` | ✓ | ✓ | ✓ | Close |
+| `/reopen` | ✓ | ✓ | ✓ | Reopen |
+| `/title <new title>` | ✓ | ✓ | ✓ | Change title |
+| `/award :emoji:` | ✓ | ✓ | ✓ | Toggle emoji award |
+| `/assign me` | ✓ | ✓ | | Assign yourself |
+| `/assign @user` | ✓ | ✓ | | Assign one user |
+| `/assign @user1 @user2` | ✓ | ✓ | | Assign multiple users **(STARTER)** |
+| `/reassign @user1 @user2` | ✓ | ✓ | | Change assignee **(STARTER)** |
+| `/unassign` | ✓ | ✓ | | Remove current assignee |
+| `/unassign @user1 @user2` | ✓ | ✓ | | Remove assignee(s) **(STARTER)** |
+| `/milestone %milestone` | ✓ | ✓ | | Set milestone |
+| `/remove_milestone` | ✓ | ✓ | | Remove milestone |
+| `/label ~label1 ~label2` | ✓ | ✓ | ✓ | Add label(s). Label names can also start without `~` but mixed syntax is not supported |
+| `/relabel ~label1 ~label2` | ✓ | ✓ | ✓ | Replace existing label(s) with those specified |
+| `/unlabel ~label1 ~label2` | ✓ | ✓ | ✓ | Remove all or specific label(s) |
+| `/copy_metadata <#issue>` | ✓ | ✓ | | Copy labels and milestone from another issue in the project |
+| `/copy_metadata <!merge_request>` | ✓ | ✓ | | Copy labels and milestone from another merge request in the project |
+| `/estimate <<W>w <DD>d <hh>h <mm>m>` | ✓ | ✓ | | Set time estimate. For example, `/estimate 1w 3d 2h 14m` |
+| `/remove_estimate` | ✓ | ✓ | | Remove time estimate |
+| `/spend <time(<h>h <mm>m)> <date(<YYYY-MM-DD>)>` | ✓ | ✓ | | Add spent time; optionally specify the date that time was spent on. For example, `/spend time(1h 30m)` or `/spend time(1h 30m) date(2018-08-26)` |
+| `/spend <time(-<h>h <mm>m)> <date(<YYYY-MM-DD>)>` | ✓ | ✓ | | Subtract spent time; optionally specify the date that time was spent on. For example, `/spend time(-1h 30m)` or `/spend time(-1h 30m) date(2018-08-26)` |
+| `/remove_time_spent` | ✓ | ✓ | | Remove time spent |
+| `/lock` | ✓ | ✓ | | Lock the thread |
+| `/unlock` | ✓ | ✓ | | Unlock the thread |
+| `/due <date>` | ✓ | | | Set due date. Examples of valid `<date>` include `in 2 days`, `this Friday` and `December 31st` |
+| `/remove_due_date` | ✓ | | | Remove due date |
+| `/weight <value>` | ✓ | | | Set weight. Valid options for `<value>` include `0`, `1`, `2`, etc **(STARTER)** |
+| `/clear_weight` | ✓ | | | Clear weight **(STARTER)** |
+| `/epic <epic>` | ✓ | | | Add to epic `<epic>`. The `<epic>` value should be in the format of `&epic`, `group&epic`, or a URL to an epic. **(ULTIMATE)** |
+| `/remove_epic` | ✓ | | | Remove from epic **(ULTIMATE)** |
+| `/promote` | ✓ | | | Promote issue to epic **(ULTIMATE)** |
+| `/confidential` | ✓ | | | Make confidential |
+| `/duplicate <#issue>` | ✓ | | | Mark this issue as a duplicate of another issue |
+| `/create_merge_request <branch name>` | ✓ | | | Create a new merge request starting from the current issue |
+| `/relate #issue1 #issue2` | ✓ | | | Mark issues as related **(STARTER)** |
+| `/move <path/to/project>` | ✓ | | | Move this issue to another project |
+| `/target_branch <local branch name>` | | ✓ | | Set target branch |
+| `/wip` | | ✓ | | Toggle the Work In Progress status |
+| `/approve` | | ✓ | | Approve the merge request |
+| `/merge` | | ✓ | | Merge (when pipeline succeeds) |
+| `/child_epic <epic>` | | | ✓ | Add child epic to `<epic>`. The `<epic>` value should be in the format of `&epic`, `group&epic`, or a URL to an epic. ([Introduced in GitLab 12.0](https://gitlab.com/gitlab-org/gitlab-ee/issues/7330)) **(ULTIMATE)** |
+| `/remove_child_epic <epic>` | | | ✓ | Remove child epic from `<epic>`. The `<epic>` value should be in the format of `&epic`, `group&epic`, or a URL to an epic. ([Introduced in GitLab 12.0](https://gitlab.com/gitlab-org/gitlab-ee/issues/7330)) **(ULTIMATE)** |
+| `/parent_epic <epic>` | | | ✓ | Set parent epic to `<epic>`. The `<epic>` value should be in the format of `&epic`, `group&epic`, or a URL to an epic. ([introduced in GitLab 12.1](https://gitlab.com/gitlab-org/gitlab-ee/issues/10556)) **(ULTIMATE)** |
+| `/remove_parent_epic` | | | ✓ | Remove parent epic from epic ([introduced in GitLab 12.1](https://gitlab.com/gitlab-org/gitlab-ee/issues/10556)) **(ULTIMATE)** |
## Autocomplete characters
@@ -93,30 +97,6 @@ The following quick actions are applicable for commit messages:
|:------------------------|:------------------------------------------|
| `/tag v1.2.3 <message>` | Tags this commit with an optional message |
-## Quick actions for Epics **(ULTIMATE)**
-
-The following quick actions are applicable for epics threads and description:
-
-| Command | Action |
-|:---------------------------|:----------------------------------------|
-| `/tableflip <Comment>` | Append the comment with `(╯°□°)╯︵ ┻━┻` |
-| `/shrug <Comment>` | Append the comment with `¯\_(ツ)_/¯` |
-| `/todo` | Add a To Do |
-| `/done` | Mark To Do as done |
-| `/subscribe` | Subscribe |
-| `/unsubscribe` | Unsubscribe |
-| `/close` | Close |
-| `/reopen` | Reopen |
-| `/title <New title>` | Change title |
-| `/award :emoji:` | Toggle emoji award |
-| `/label ~label1 ~label2` | Add label(s) |
-| `/unlabel ~label1 ~label2` | Remove all or specific label(s) |
-| `/relabel ~label1 ~label2` | Replace existing label(s) with those specified |
-| `/child_epic <epic>` | Adds child epic to `<epic>`. The `<epic>` value should be in the format of `&epic`, `group&epic` or `epic-URL`. ([Introduced in GitLab 12.0](https://gitlab.com/gitlab-org/gitlab-ee/issues/7330)) **(ULTIMATE)**|
-| `/remove_child_epic <epic>` | Removes child epic from `<epic>`. The `<epic>` value should be in the format of `&epic`, `group&epic` or `epic-URL`. ([Introduced in GitLab 12.0](https://gitlab.com/gitlab-org/gitlab-ee/issues/7330)) **(ULTIMATE)** |
-| `/parent_epic <epic>` | Sets parent epic to `<epic>`. The `<epic>` value should be in the format of `&epic`, `group&epic` or `epic-URL`. ([introduced in GitLab 12.1](https://gitlab.com/gitlab-org/gitlab-ee/issues/10556)) **(ULTIMATE)** |
-| `/remove_parent_epic` | Removes parent epic from epic ([introduced in GitLab 12.1](https://gitlab.com/gitlab-org/gitlab-ee/issues/10556)) |
-
<!-- ## Troubleshooting
Include any troubleshooting steps that you can foresee. If you know beforehand what issues
diff --git a/lib/banzai/filter/commit_trailers_filter.rb b/lib/banzai/filter/commit_trailers_filter.rb
index f49c4b403db..02a47556151 100644
--- a/lib/banzai/filter/commit_trailers_filter.rb
+++ b/lib/banzai/filter/commit_trailers_filter.rb
@@ -88,7 +88,8 @@ module Banzai
user: user,
user_email: email,
css_class: 'avatar-inline',
- has_tooltip: false
+ has_tooltip: false,
+ only_path: false
)
link_href = user.nil? ? "mailto:#{email}" : urls.user_url(user)
diff --git a/lib/gitlab/ci/build/prerequisite/kubernetes_namespace.rb b/lib/gitlab/ci/build/prerequisite/kubernetes_namespace.rb
index 6ab4fca3854..f448d55f00a 100644
--- a/lib/gitlab/ci/build/prerequisite/kubernetes_namespace.rb
+++ b/lib/gitlab/ci/build/prerequisite/kubernetes_namespace.rb
@@ -43,7 +43,7 @@ module Gitlab
end
def create_namespace
- Clusters::Gcp::Kubernetes::CreateOrUpdateNamespaceService.new(
+ Clusters::Kubernetes::CreateOrUpdateNamespaceService.new(
cluster: deployment_cluster,
kubernetes_namespace: kubernetes_namespace || build_namespace_record
).execute
diff --git a/lib/gitlab/ci/config/external/file/base.rb b/lib/gitlab/ci/config/external/file/base.rb
index 2ffbb214a92..c56d33544ba 100644
--- a/lib/gitlab/ci/config/external/file/base.rb
+++ b/lib/gitlab/ci/config/external/file/base.rb
@@ -26,6 +26,10 @@ module Gitlab
location.present?
end
+ def invalid_location_type?
+ !location.is_a?(String)
+ end
+
def invalid_extension?
location.nil? || !::File.basename(location).match?(YAML_WHITELIST_EXTENSION)
end
@@ -71,7 +75,9 @@ module Gitlab
end
def validate_location!
- if invalid_extension?
+ if invalid_location_type?
+ errors.push("Included file `#{location}` needs to be a string")
+ elsif invalid_extension?
errors.push("Included file `#{location}` does not have YAML extension!")
end
end
diff --git a/lib/gitlab/ci/templates/Pages/SwaggerUI.gitlab-ci.yml b/lib/gitlab/ci/templates/Pages/SwaggerUI.gitlab-ci.yml
new file mode 100644
index 00000000000..8fd08ea7995
--- /dev/null
+++ b/lib/gitlab/ci/templates/Pages/SwaggerUI.gitlab-ci.yml
@@ -0,0 +1,29 @@
+image: node:10-alpine
+
+# specify the location of the Open API Specification files within your project
+# and the filename of the specification that you would like to display by default
+variables:
+ DOCS_FOLDER: "api-docs"
+ SPEC_TO_DISPLAY: "my-project_specification_0.0.1.json"
+
+# These folders are cached between builds
+cache:
+ paths:
+ - ./node_modules
+
+# publishes all files from the $DOCS_FOLDER together with the static version of SwaggerUI
+# sets the specification file named in $SPEC_TO_DISPLAY to be displayed by default
+pages:
+ stage: deploy
+ before_script:
+ - npm install swagger-ui-dist@3.22.1
+ script:
+ - mkdir public
+ - cp -rp node_modules/swagger-ui-dist/* public
+ - cp -rp $DOCS_FOLDER/* public
+ - sed -i "s#https://petstore\.swagger\.io/v2/swagger\.json#$SPEC_TO_DISPLAY#g" public/index.html
+ artifacts:
+ paths:
+ - public
+ only:
+ - master
diff --git a/lib/gitlab/diff/suggestion.rb b/lib/gitlab/diff/suggestion.rb
index 4a3ac2106e2..b669e785721 100644
--- a/lib/gitlab/diff/suggestion.rb
+++ b/lib/gitlab/diff/suggestion.rb
@@ -46,7 +46,7 @@ module Gitlab
private
def line_break_chars(line)
- match = /\r\n|\r|\n/.match(line)
+ match = Gitlab::Regex.breakline_regex.match(line)
match[0] if match
end
end
diff --git a/lib/gitlab/gitaly_client.rb b/lib/gitlab/gitaly_client.rb
index d65c0d3e78d..2ac99b1ff02 100644
--- a/lib/gitlab/gitaly_client.rb
+++ b/lib/gitlab/gitaly_client.rb
@@ -157,7 +157,7 @@ module Gitlab
# Keep track, separately, for the performance bar
self.query_time += duration
- if peek_enabled?
+ if Gitlab::PerformanceBar.enabled_for_request?
add_call_details(feature: "#{service}##{rpc}", duration: duration, request: request_hash, rpc: rpc,
backtrace: Gitlab::Profiler.clean_backtrace(caller))
end
@@ -335,17 +335,13 @@ module Gitlab
Gitlab::SafeRequestStore["gitaly_call_permitted"] = 0
end
- def self.peek_enabled?
- Gitlab::SafeRequestStore[:peek_enabled]
- end
-
def self.add_call_details(details)
Gitlab::SafeRequestStore['gitaly_call_details'] ||= []
Gitlab::SafeRequestStore['gitaly_call_details'] << details
end
def self.list_call_details
- return [] unless peek_enabled?
+ return [] unless Gitlab::PerformanceBar.enabled_for_request?
Gitlab::SafeRequestStore['gitaly_call_details'] || []
end
diff --git a/lib/gitlab/performance_bar.rb b/lib/gitlab/performance_bar.rb
index 07439d8e011..68af290d069 100644
--- a/lib/gitlab/performance_bar.rb
+++ b/lib/gitlab/performance_bar.rb
@@ -6,7 +6,11 @@ module Gitlab
EXPIRY_TIME_L1_CACHE = 1.minute
EXPIRY_TIME_L2_CACHE = 5.minutes
- def self.enabled?(user = nil)
+ def self.enabled_for_request?
+ Gitlab::SafeRequestStore[:peek_enabled]
+ end
+
+ def self.enabled_for_user?(user = nil)
return true if Rails.env.development?
return true if user&.admin?
return false unless user && allowed_group_id
diff --git a/lib/gitlab/performance_bar/redis_adapter_when_peek_enabled.rb b/lib/gitlab/performance_bar/redis_adapter_when_peek_enabled.rb
index 2d997760c46..cddd4f18cc3 100644
--- a/lib/gitlab/performance_bar/redis_adapter_when_peek_enabled.rb
+++ b/lib/gitlab/performance_bar/redis_adapter_when_peek_enabled.rb
@@ -4,8 +4,8 @@
module Gitlab
module PerformanceBar
module RedisAdapterWhenPeekEnabled
- def save
- super unless ::Peek.request_id.blank?
+ def save(request_id)
+ super if ::Gitlab::PerformanceBar.enabled_for_request? && request_id.present?
end
end
end
diff --git a/lib/gitlab/regex.rb b/lib/gitlab/regex.rb
index e6372a42dda..6636ffa448e 100644
--- a/lib/gitlab/regex.rb
+++ b/lib/gitlab/regex.rb
@@ -115,5 +115,9 @@ module Gitlab
def jira_transition_id_regex
@jira_transition_id_regex ||= /\d+/
end
+
+ def breakline_regex
+ @breakline_regex ||= /\r\n|\r|\n/
+ end
end
end
diff --git a/lib/gitlab/rugged_instrumentation.rb b/lib/gitlab/rugged_instrumentation.rb
index 8bb8c547ae1..c2b55431547 100644
--- a/lib/gitlab/rugged_instrumentation.rb
+++ b/lib/gitlab/rugged_instrumentation.rb
@@ -27,19 +27,15 @@ module Gitlab
SafeRequestStore.active?
end
- def self.peek_enabled?
- SafeRequestStore[:peek_enabled]
- end
-
def self.add_call_details(details)
- return unless peek_enabled?
+ return unless Gitlab::PerformanceBar.enabled_for_request?
Gitlab::SafeRequestStore[:rugged_call_details] ||= []
Gitlab::SafeRequestStore[:rugged_call_details] << details
end
def self.list_call_details
- return [] unless peek_enabled?
+ return [] unless Gitlab::PerformanceBar.enabled_for_request?
Gitlab::SafeRequestStore[:rugged_call_details] || []
end
diff --git a/lib/gitlab/sidekiq_middleware/metrics.rb b/lib/gitlab/sidekiq_middleware/metrics.rb
index 3dc9521ee8b..368f37a5d8c 100644
--- a/lib/gitlab/sidekiq_middleware/metrics.rb
+++ b/lib/gitlab/sidekiq_middleware/metrics.rb
@@ -35,7 +35,7 @@ module Gitlab
def init_metrics
{
- sidekiq_jobs_completion_seconds: ::Gitlab::Metrics.histogram(:sidekiq_jobs_completion_seconds, 'Seconds to complete sidekiq job', buckets: SIDEKIQ_LATENCY_BUCKETS),
+ sidekiq_jobs_completion_seconds: ::Gitlab::Metrics.histogram(:sidekiq_jobs_completion_seconds, 'Seconds to complete sidekiq job', {}, SIDEKIQ_LATENCY_BUCKETS),
sidekiq_jobs_failed_total: ::Gitlab::Metrics.counter(:sidekiq_jobs_failed_total, 'Sidekiq jobs failed'),
sidekiq_jobs_retried_total: ::Gitlab::Metrics.counter(:sidekiq_jobs_retried_total, 'Sidekiq jobs retried'),
sidekiq_running_jobs: ::Gitlab::Metrics.gauge(:sidekiq_running_jobs, 'Number of Sidekiq jobs running', {}, :livesum)
diff --git a/lib/gitlab/slash_commands/application_help.rb b/lib/gitlab/slash_commands/application_help.rb
index 0ea7554ba64..1a92346be15 100644
--- a/lib/gitlab/slash_commands/application_help.rb
+++ b/lib/gitlab/slash_commands/application_help.rb
@@ -3,12 +3,15 @@
module Gitlab
module SlashCommands
class ApplicationHelp < BaseCommand
- def initialize(params)
+ def initialize(project, params)
+ @project = project
@params = params
end
def execute
- Gitlab::SlashCommands::Presenters::Help.new(commands).present(trigger, params[:text])
+ Gitlab::SlashCommands::Presenters::Help
+ .new(project, commands)
+ .present(trigger, params[:text])
end
private
diff --git a/lib/gitlab/slash_commands/command.rb b/lib/gitlab/slash_commands/command.rb
index 905e0ec5cc1..079b5916566 100644
--- a/lib/gitlab/slash_commands/command.rb
+++ b/lib/gitlab/slash_commands/command.rb
@@ -22,7 +22,7 @@ module Gitlab
if command.allowed?(project, current_user)
command.new(project, chat_name, params).execute(match)
else
- Gitlab::SlashCommands::Presenters::Access.new.access_denied
+ Gitlab::SlashCommands::Presenters::Access.new.access_denied(project)
end
else
Gitlab::SlashCommands::Help.new(project, chat_name, params)
diff --git a/lib/gitlab/slash_commands/help.rb b/lib/gitlab/slash_commands/help.rb
index dbe15baa3d7..3eff64192ab 100644
--- a/lib/gitlab/slash_commands/help.rb
+++ b/lib/gitlab/slash_commands/help.rb
@@ -19,7 +19,9 @@ module Gitlab
end
def execute(commands, text)
- Gitlab::SlashCommands::Presenters::Help.new(commands).present(trigger, text)
+ Gitlab::SlashCommands::Presenters::Help
+ .new(project, commands)
+ .present(trigger, text)
end
def trigger
diff --git a/lib/gitlab/slash_commands/presenters/access.rb b/lib/gitlab/slash_commands/presenters/access.rb
index fa163cb098e..b1bfaa6cb59 100644
--- a/lib/gitlab/slash_commands/presenters/access.rb
+++ b/lib/gitlab/slash_commands/presenters/access.rb
@@ -4,8 +4,15 @@ module Gitlab
module SlashCommands
module Presenters
class Access < Presenters::Base
- def access_denied
- ephemeral_response(text: "Whoops! This action is not allowed. This incident will be [reported](https://xkcd.com/838/).")
+ def access_denied(project)
+ ephemeral_response(text: <<~MESSAGE)
+ You are not allowed to perform the given chatops command. Most
+ likely you do not have access to the GitLab project for this chatops
+ integration.
+
+ The GitLab project for this chatops integration can be found at
+ #{url_for(project)}.
+ MESSAGE
end
def not_found
@@ -22,20 +29,6 @@ module Gitlab
ephemeral_response(text: message)
end
-
- def unknown_command(commands)
- ephemeral_response(text: help_message(trigger))
- end
-
- private
-
- def help_message(trigger)
- header_with_list("Command not found, these are the commands you can use", full_commands(trigger))
- end
-
- def full_commands(trigger)
- @resource.map { |command| "#{trigger} #{command.help_message}" }
- end
end
end
end
diff --git a/lib/gitlab/slash_commands/presenters/help.rb b/lib/gitlab/slash_commands/presenters/help.rb
index 480d7aa6a30..342dae456a8 100644
--- a/lib/gitlab/slash_commands/presenters/help.rb
+++ b/lib/gitlab/slash_commands/presenters/help.rb
@@ -4,6 +4,11 @@ module Gitlab
module SlashCommands
module Presenters
class Help < Presenters::Base
+ def initialize(project, commands)
+ @project = project
+ @commands = commands
+ end
+
def present(trigger, text)
ephemeral_response(text: help_message(trigger, text))
end
@@ -11,17 +16,72 @@ module Gitlab
private
def help_message(trigger, text)
- return "No commands available :thinking_face:" unless @resource.present?
+ unless @commands.present?
+ return <<~MESSAGE
+ This chatops integration does not have any commands that can be
+ executed.
+
+ #{footer}
+ MESSAGE
+ end
if text.start_with?('help')
- header_with_list("Available commands", full_commands(trigger))
+ <<~MESSAGE
+ #{full_commands_message(trigger)}
+
+ #{help_footer}
+ MESSAGE
else
- header_with_list("Unknown command, these commands are available", full_commands(trigger))
+ <<~MESSAGE
+ The specified command is not valid.
+
+ #{full_commands_message(trigger)}
+
+ #{help_footer}
+ MESSAGE
end
end
- def full_commands(trigger)
- @resource.map { |command| "#{trigger} #{command.help_message}" }
+ def help_footer
+ message = @project ? project_info : ''
+ message += <<~MESSAGE
+ *Documentation*
+
+ For more information about GitLab chatops, refer to its
+ documentation: https://docs.gitlab.com/ce/ci/chatops/README.html.
+ MESSAGE
+
+ message
+ end
+
+ def project_info
+ <<~MESSAGE
+ *Project*
+
+ The GitLab project for this chatops integration can be found at
+ #{url_for(@project)}.
+
+ MESSAGE
+ end
+
+ def full_commands_message(trigger)
+ list = @commands
+ .map { |command| "#{trigger} #{command.help_message}" }
+ .join("\n")
+
+ <<~MESSAGE
+ *Available commands*
+
+ The following commands are available for this chatops integration:
+
+ #{list}
+
+ If available, the `run` command is used for running GitLab CI jobs
+ defined in this project's `.gitlab-ci.yml` file. For example, if a
+ job called "help" is defined you can run it like so:
+
+ `#{trigger} run help`
+ MESSAGE
end
end
end
diff --git a/lib/peek/views/active_record.rb b/lib/peek/views/active_record.rb
index a35783c1971..bbc9f11e90f 100644
--- a/lib/peek/views/active_record.rb
+++ b/lib/peek/views/active_record.rb
@@ -27,7 +27,7 @@ module Peek
super
subscribe('sql.active_record') do |_, start, finish, _, data|
- if Gitlab::SafeRequestStore.store[:peek_enabled]
+ if Gitlab::PerformanceBar.enabled_for_request?
unless data[:cached]
detail_store << {
duration: finish - start,
diff --git a/lib/peek/views/redis_detailed.rb b/lib/peek/views/redis_detailed.rb
index f36f581d5e9..84041b6be73 100644
--- a/lib/peek/views/redis_detailed.rb
+++ b/lib/peek/views/redis_detailed.rb
@@ -16,7 +16,7 @@ module Gitlab
private
def add_call_details(duration, args)
- return unless peek_enabled?
+ return unless Gitlab::PerformanceBar.enabled_for_request?
# redis-rb passes an array (e.g. [:get, key])
return unless args.length == 1
@@ -27,10 +27,6 @@ module Gitlab
}
end
- def peek_enabled?
- Gitlab::SafeRequestStore.store[:peek_enabled]
- end
-
def detail_store
::Gitlab::SafeRequestStore['redis_call_details'] ||= []
end
diff --git a/locale/gitlab.pot b/locale/gitlab.pot
index 401b46b78f1..e91061e74c2 100644
--- a/locale/gitlab.pot
+++ b/locale/gitlab.pot
@@ -6257,6 +6257,9 @@ msgstr ""
msgid "Issues, merge requests, pushes, and comments."
msgstr ""
+msgid "It may take up to 30 minutes before the site is available after the first deployment."
+msgstr ""
+
msgid "It must have a header row and at least two columns: the first column is the issue title and the second column is the issue description. The separator is automatically detected."
msgstr ""
@@ -7643,6 +7646,9 @@ msgstr ""
msgid "Note: Consider asking your GitLab administrator to configure %{github_integration_link}, which will allow login via GitHub and allow importing repositories without generating a Personal Access Token."
msgstr ""
+msgid "Note: the container registry is always visible when a project is public"
+msgstr ""
+
msgid "NoteForm|Note"
msgstr ""
@@ -11760,6 +11766,9 @@ msgstr ""
msgid "This domain is not verified. You will need to verify ownership before access is enabled."
msgstr ""
+msgid "This feature is in development. Please disable the `job_log_json` feature flag"
+msgstr ""
+
msgid "This feature requires local storage to be enabled"
msgstr ""
@@ -13608,6 +13617,9 @@ msgstr ""
msgid "Your new personal access token has been created."
msgstr ""
+msgid "Your pages are served under:"
+msgstr ""
+
msgid "Your password reset token has expired."
msgstr ""
diff --git a/package.json b/package.json
index 3d9e0838893..4244dc2d52b 100644
--- a/package.json
+++ b/package.json
@@ -96,7 +96,7 @@
"jszip-utils": "^0.0.2",
"katex": "^0.10.0",
"marked": "^0.3.12",
- "mermaid": "^8.2.4",
+ "mermaid": "^8.2.6",
"monaco-editor": "^0.15.6",
"monaco-editor-webpack-plugin": "^1.7.0",
"mousetrap": "^1.4.6",
diff --git a/qa/qa/page/project/show.rb b/qa/qa/page/project/show.rb
index 850a96d87b0..549992f271b 100644
--- a/qa/qa/page/project/show.rb
+++ b/qa/qa/page/project/show.rb
@@ -132,4 +132,4 @@ module QA
end
end
-QA::Page::Project.prepend_if_ee('QA::EE::Page::Project::Show')
+QA::Page::Project::Show.prepend_if_ee('QA::EE::Page::Project::Show')
diff --git a/qa/qa/runtime/browser.rb b/qa/qa/runtime/browser.rb
index 2987bb1a213..197008ed8bf 100644
--- a/qa/qa/runtime/browser.rb
+++ b/qa/qa/runtime/browser.rb
@@ -68,7 +68,7 @@ module QA
options = Selenium::WebDriver.const_get(QA::Runtime::Env.browser.capitalize)::Options.new
if QA::Runtime::Env.browser == :chrome
- options.add_argument("window-size=1240,1680")
+ options.add_argument("window-size=1480,2200")
# Chrome won't work properly in a Docker container in sandbox mode
options.add_argument("no-sandbox")
diff --git a/spec/controllers/projects/jobs_controller_spec.rb b/spec/controllers/projects/jobs_controller_spec.rb
index f076a5e769f..bd3e66efd58 100644
--- a/spec/controllers/projects/jobs_controller_spec.rb
+++ b/spec/controllers/projects/jobs_controller_spec.rb
@@ -12,6 +12,7 @@ describe Projects::JobsController, :clean_gitlab_redis_shared_state do
before do
stub_feature_flags(ci_enable_live_trace: true)
+ stub_feature_flags(job_log_json: false)
stub_not_protect_default_branch
end
diff --git a/spec/db/schema_spec.rb b/spec/db/schema_spec.rb
index 232890b1bba..52af470efac 100644
--- a/spec/db/schema_spec.rb
+++ b/spec/db/schema_spec.rb
@@ -30,7 +30,7 @@ describe 'Database schema' do
draft_notes: %w[discussion_id commit_id],
emails: %w[user_id],
events: %w[target_id],
- epics: %w[updated_by_id last_edited_by_id start_date_sourcing_milestone_id due_date_sourcing_milestone_id],
+ epics: %w[updated_by_id last_edited_by_id start_date_sourcing_milestone_id due_date_sourcing_milestone_id state_id],
forked_project_links: %w[forked_from_project_id],
geo_event_log: %w[hashed_storage_attachments_event_id],
geo_job_artifact_deleted_events: %w[job_artifact_id],
diff --git a/spec/factories/group_members.rb b/spec/factories/group_members.rb
index 4c875935d82..a93f13395a2 100644
--- a/spec/factories/group_members.rb
+++ b/spec/factories/group_members.rb
@@ -24,5 +24,9 @@ FactoryBot.define do
trait(:ldap) do
ldap true
end
+
+ trait :blocked do
+ after(:build) { |group_member, _| group_member.user.block! }
+ end
end
end
diff --git a/spec/factories/project_members.rb b/spec/factories/project_members.rb
index 6dcac0400ca..723fa6058fe 100644
--- a/spec/factories/project_members.rb
+++ b/spec/factories/project_members.rb
@@ -17,5 +17,9 @@ FactoryBot.define do
invite_token 'xxx'
invite_email 'email@email.com'
end
+
+ trait :blocked do
+ after(:build) { |project_member, _| project_member.user.block! }
+ end
end
end
diff --git a/spec/factories/users.rb b/spec/factories/users.rb
index b2c8bdab013..57e58513529 100644
--- a/spec/factories/users.rb
+++ b/spec/factories/users.rb
@@ -39,6 +39,14 @@ FactoryBot.define do
avatar { fixture_file_upload('spec/fixtures/dk.png') }
end
+ trait :with_sign_ins do
+ sign_in_count 3
+ current_sign_in_at { Time.now }
+ last_sign_in_at { FFaker::Time.between(10.days.ago, 1.day.ago) }
+ current_sign_in_ip '127.0.0.1'
+ last_sign_in_ip '127.0.0.1'
+ end
+
trait :two_factor_via_otp do
before(:create) do |user|
user.otp_required_for_login = true
diff --git a/spec/features/groups/clusters/user_spec.rb b/spec/features/groups/clusters/user_spec.rb
index 84a8691a7f2..8891866c1f8 100644
--- a/spec/features/groups/clusters/user_spec.rb
+++ b/spec/features/groups/clusters/user_spec.rb
@@ -13,7 +13,7 @@ describe 'User Cluster', :js do
gitlab_sign_in(user)
allow(Groups::ClustersController).to receive(:STATUS_POLLING_INTERVAL) { 100 }
- allow_any_instance_of(Clusters::Gcp::Kubernetes::CreateOrUpdateNamespaceService).to receive(:execute)
+ allow_any_instance_of(Clusters::Kubernetes::CreateOrUpdateNamespaceService).to receive(:execute)
allow_any_instance_of(Clusters::Cluster).to receive(:retrieve_connection_status).and_return(:connected)
end
diff --git a/spec/features/issues/user_comments_on_issue_spec.rb b/spec/features/issues/user_comments_on_issue_spec.rb
index bdaaea5bf7f..829f945c47f 100644
--- a/spec/features/issues/user_comments_on_issue_spec.rb
+++ b/spec/features/issues/user_comments_on_issue_spec.rb
@@ -55,6 +55,23 @@ describe "User comments on issue", :js do
expect(page.find('svg.mermaid')).to have_content escaped_content
end
+
+ it 'opens autocomplete menu for quick actions and have `/label` first choice' do
+ project.add_maintainer(user)
+ create(:label, project: project, title: 'label')
+
+ page.within '.timeline-content-form' do
+ find('#note-body').native.send_keys('/l')
+ end
+
+ wait_for_requests
+
+ expect(page).to have_selector('.atwho-container')
+
+ page.within '.atwho-container #at-view-commands' do
+ expect(find('li', match: :first)).to have_content('/label')
+ end
+ end
end
context "when editing comments" do
diff --git a/spec/features/projects/clusters/user_spec.rb b/spec/features/projects/clusters/user_spec.rb
index 3899aab8170..84f2e3e09ae 100644
--- a/spec/features/projects/clusters/user_spec.rb
+++ b/spec/features/projects/clusters/user_spec.rb
@@ -13,7 +13,7 @@ describe 'User Cluster', :js do
gitlab_sign_in(user)
allow(Projects::ClustersController).to receive(:STATUS_POLLING_INTERVAL) { 100 }
- allow_any_instance_of(Clusters::Gcp::Kubernetes::CreateOrUpdateNamespaceService).to receive(:execute)
+ allow_any_instance_of(Clusters::Kubernetes::CreateOrUpdateNamespaceService).to receive(:execute)
allow_any_instance_of(Clusters::Cluster).to receive(:retrieve_connection_status).and_return(:connected)
end
diff --git a/spec/features/projects/jobs/user_browses_job_spec.rb b/spec/features/projects/jobs/user_browses_job_spec.rb
index 1b277e17b0c..4d8a4812123 100644
--- a/spec/features/projects/jobs/user_browses_job_spec.rb
+++ b/spec/features/projects/jobs/user_browses_job_spec.rb
@@ -10,6 +10,8 @@ describe 'User browses a job', :js do
let!(:build) { create(:ci_build, :success, :trace_artifact, :coverage, pipeline: pipeline) }
before do
+ stub_feature_flags(job_log_json: false)
+
project.add_maintainer(user)
project.enable_ci
diff --git a/spec/features/projects/jobs_spec.rb b/spec/features/projects/jobs_spec.rb
index 8ed420300af..d1783de0330 100644
--- a/spec/features/projects/jobs_spec.rb
+++ b/spec/features/projects/jobs_spec.rb
@@ -20,6 +20,7 @@ describe 'Jobs', :clean_gitlab_redis_shared_state do
before do
project.add_role(user, user_access_level)
sign_in(user)
+ stub_feature_flags(job_log_json: false)
end
describe "GET /:project/jobs" do
@@ -609,6 +610,14 @@ describe 'Jobs', :clean_gitlab_redis_shared_state do
expect(find('.js-environment-link')['href']).to match("environments/#{environment.id}")
expect(find('.js-job-deployment-link')['href']).to include(second_deployment.deployable.project.path, second_deployment.deployable_id.to_s)
end
+
+ context 'when deployment does not have a deployable' do
+ let!(:second_deployment) { create(:deployment, :success, environment: environment, deployable: nil) }
+
+ it 'has an empty href' do
+ expect(find('.js-job-deployment-link')['href']).to be_empty
+ end
+ end
end
context 'job failed to deploy' do
diff --git a/spec/features/projects/pages_spec.rb b/spec/features/projects/pages_spec.rb
index c4b3ddb2088..d55e9d12801 100644
--- a/spec/features/projects/pages_spec.rb
+++ b/spec/features/projects/pages_spec.rb
@@ -30,6 +30,12 @@ shared_examples 'pages settings editing' do
expect(page).to have_content('Access pages')
end
+ it 'renders first deployment warning' do
+ visit project_pages_path(project)
+
+ expect(page).to have_content('It may take up to 30 minutes before the site is available after the first deployment.')
+ end
+
context 'when support for external domains is disabled' do
it 'renders message that support is disabled' do
visit project_pages_path(project)
diff --git a/spec/features/security/project/internal_access_spec.rb b/spec/features/security/project/internal_access_spec.rb
index 42c747c674f..d089fa718d2 100644
--- a/spec/features/security/project/internal_access_spec.rb
+++ b/spec/features/security/project/internal_access_spec.rb
@@ -7,6 +7,10 @@ describe "Internal Project Access" do
set(:project) { create(:project, :internal, :repository) }
+ before do
+ stub_feature_flags(job_log_json: false)
+ end
+
describe "Project should be internal" do
describe '#internal?' do
subject { project.internal? }
diff --git a/spec/features/security/project/private_access_spec.rb b/spec/features/security/project/private_access_spec.rb
index a86d240b7d6..b868cd595cb 100644
--- a/spec/features/security/project/private_access_spec.rb
+++ b/spec/features/security/project/private_access_spec.rb
@@ -7,6 +7,10 @@ describe "Private Project Access" do
set(:project) { create(:project, :private, :repository, public_builds: false) }
+ before do
+ stub_feature_flags(job_log_json: false)
+ end
+
describe "Project should be private" do
describe '#private?' do
subject { project.private? }
diff --git a/spec/features/security/project/public_access_spec.rb b/spec/features/security/project/public_access_spec.rb
index 8d7f8c84358..8db2f2d69e5 100644
--- a/spec/features/security/project/public_access_spec.rb
+++ b/spec/features/security/project/public_access_spec.rb
@@ -7,6 +7,10 @@ describe "Public Project Access" do
set(:project) { create(:project, :public, :repository) }
+ before do
+ stub_feature_flags(job_log_json: false)
+ end
+
describe "Project should be public" do
describe '#public?' do
subject { project.public? }
diff --git a/spec/features/users/login_spec.rb b/spec/features/users/login_spec.rb
index 8e4db2ca840..d1f3b3f4076 100644
--- a/spec/features/users/login_spec.rb
+++ b/spec/features/users/login_spec.rb
@@ -624,6 +624,14 @@ describe 'Login' do
end
end
+ describe 'Client helper classes and flags' do
+ it 'adds client browser and platform classes to page body' do
+ visit root_path
+ expect(find('body')[:class]).to include('gl-browser-generic')
+ expect(find('body')[:class]).to include('gl-platform-other')
+ end
+ end
+
context 'when terms are enforced' do
let(:user) { create(:user) }
diff --git a/spec/frontend/vue_shared/components/changed_file_icon_spec.js b/spec/frontend/vue_shared/components/changed_file_icon_spec.js
index 806602877ef..d0586f9e63f 100644
--- a/spec/frontend/vue_shared/components/changed_file_icon_spec.js
+++ b/spec/frontend/vue_shared/components/changed_file_icon_spec.js
@@ -106,12 +106,10 @@ describe('Changed file icon', () => {
expect(findIcon().props('size')).toBe(size);
});
- // NOTE: It looks like 'showStagedIcon' behavior is backwards to what the name suggests
- // https://gitlab.com/gitlab-org/gitlab-ce/issues/66071
it.each`
showStagedIcon | iconName | desc
- ${false} | ${'file-modified-solid'} | ${'with showStagedIcon false, renders staged icon'}
- ${true} | ${'file-modified'} | ${'with showStagedIcon true, renders regular icon'}
+ ${true} | ${'file-modified-solid'} | ${'with showStagedIcon true, renders staged icon'}
+ ${false} | ${'file-modified'} | ${'with showStagedIcon false, renders regular icon'}
`('$desc', ({ showStagedIcon, iconName }) => {
factory({
file: stagedFile(),
diff --git a/spec/helpers/avatars_helper_spec.rb b/spec/helpers/avatars_helper_spec.rb
index 94998d302f9..6fbb6147d84 100644
--- a/spec/helpers/avatars_helper_spec.rb
+++ b/spec/helpers/avatars_helper_spec.rb
@@ -324,5 +324,47 @@ describe AvatarsHelper do
)
end
end
+
+ context 'with only_path parameter set to false' do
+ let(:user_with_avatar) { create(:user, :with_avatar, username: 'foobar') }
+
+ context 'with user parameter' do
+ let(:options) { { user: user_with_avatar, only_path: false } }
+
+ it 'will return avatar with a full path' do
+ is_expected.to eq tag(
+ :img,
+ alt: "#{user_with_avatar.name}'s avatar",
+ src: avatar_icon_for_user(user_with_avatar, 16, only_path: false),
+ data: { container: 'body' },
+ class: "avatar s16 has-tooltip",
+ title: user_with_avatar.name
+ )
+ end
+ end
+
+ context 'with user_name and user_email' do
+ let(:options) { { user_email: user_with_avatar.email, user_name: user_with_avatar.username, only_path: false } }
+
+ it 'will return avatar with a full path' do
+ is_expected.to eq tag(
+ :img,
+ alt: "#{user_with_avatar.username}'s avatar",
+ src: avatar_icon_for_email(user_with_avatar.email, 16, only_path: false),
+ data: { container: 'body' },
+ class: "avatar s16 has-tooltip",
+ title: user_with_avatar.username
+ )
+ end
+ end
+ end
+
+ context 'with unregistered email address' do
+ let(:options) { { user_email: "unregistered_email@example.com" } }
+
+ it 'will return default alt text for avatar' do
+ expect(subject).to include("default avatar")
+ end
+ end
end
end
diff --git a/spec/lib/banzai/filter/commit_trailers_filter_spec.rb b/spec/lib/banzai/filter/commit_trailers_filter_spec.rb
index bcb74be1034..192d00805e0 100644
--- a/spec/lib/banzai/filter/commit_trailers_filter_spec.rb
+++ b/spec/lib/banzai/filter/commit_trailers_filter_spec.rb
@@ -189,5 +189,26 @@ describe Banzai::Filter::CommitTrailersFilter do
expect_to_have_user_link_with_avatar(doc, user: user, trailer: trailer)
expect(doc.text).to include(commit_body)
end
+
+ context 'with Gitlab-hosted avatars in commit trailers' do
+ # Because commit trailers are contained within markdown,
+ # any path-only link will automatically be prefixed
+ # with the path of its repository.
+ # See: "build_relative_path" in "lib/banzai/filter/relative_link_filter.rb"
+ let(:user_with_avatar) { create(:user, :with_avatar, username: 'foobar') }
+
+ it 'returns a full path for avatar urls' do
+ _, message_html = build_commit_message(
+ trailer: trailer,
+ name: user_with_avatar.name,
+ email: user_with_avatar.email
+ )
+
+ doc = filter(message_html)
+ expected = "#{Gitlab.config.gitlab.url}#{user_with_avatar.avatar_url}"
+
+ expect(doc.css('img')[0].attr('src')).to start_with expected
+ end
+ end
end
end
diff --git a/spec/lib/gitlab/ci/build/prerequisite/kubernetes_namespace_spec.rb b/spec/lib/gitlab/ci/build/prerequisite/kubernetes_namespace_spec.rb
index 775550f2acc..c7a5ac783b3 100644
--- a/spec/lib/gitlab/ci/build/prerequisite/kubernetes_namespace_spec.rb
+++ b/spec/lib/gitlab/ci/build/prerequisite/kubernetes_namespace_spec.rb
@@ -87,7 +87,7 @@ describe Gitlab::Ci::Build::Prerequisite::KubernetesNamespace do
.with(cluster, environment: deployment.environment)
.and_return(namespace_builder)
- expect(Clusters::Gcp::Kubernetes::CreateOrUpdateNamespaceService)
+ expect(Clusters::Kubernetes::CreateOrUpdateNamespaceService)
.to receive(:new)
.with(cluster: cluster, kubernetes_namespace: kubernetes_namespace)
.and_return(service)
@@ -107,7 +107,7 @@ describe Gitlab::Ci::Build::Prerequisite::KubernetesNamespace do
it 'creates a namespace using the tokenless record' do
expect(Clusters::BuildKubernetesNamespaceService).not_to receive(:new)
- expect(Clusters::Gcp::Kubernetes::CreateOrUpdateNamespaceService)
+ expect(Clusters::Kubernetes::CreateOrUpdateNamespaceService)
.to receive(:new)
.with(cluster: cluster, kubernetes_namespace: kubernetes_namespace)
.and_return(service)
@@ -123,7 +123,7 @@ describe Gitlab::Ci::Build::Prerequisite::KubernetesNamespace do
end
it 'does not create a namespace' do
- expect(Clusters::Gcp::Kubernetes::CreateOrUpdateNamespaceService).not_to receive(:new)
+ expect(Clusters::Kubernetes::CreateOrUpdateNamespaceService).not_to receive(:new)
subject
end
diff --git a/spec/lib/gitlab/ci/config/external/file/base_spec.rb b/spec/lib/gitlab/ci/config/external/file/base_spec.rb
index dd536a241bd..af995f4869a 100644
--- a/spec/lib/gitlab/ci/config/external/file/base_spec.rb
+++ b/spec/lib/gitlab/ci/config/external/file/base_spec.rb
@@ -41,6 +41,12 @@ describe Gitlab::Ci::Config::External::File::Base do
end
describe '#valid?' do
+ context 'when location is not a string' do
+ let(:location) { %w(some/file.txt other/file.txt) }
+
+ it { is_expected.not_to be_valid }
+ end
+
context 'when location is not a YAML file' do
let(:location) { 'some/file.txt' }
diff --git a/spec/lib/gitlab/git/rugged_impl/use_rugged_spec.rb b/spec/lib/gitlab/git/rugged_impl/use_rugged_spec.rb
index 1a4168f7317..474240cf620 100644
--- a/spec/lib/gitlab/git/rugged_impl/use_rugged_spec.rb
+++ b/spec/lib/gitlab/git/rugged_impl/use_rugged_spec.rb
@@ -35,7 +35,7 @@ describe Gitlab::Git::RuggedImpl::UseRugged, :seed_helper do
let(:args) { ['refs/heads/master', 1] }
before do
- allow(Gitlab::RuggedInstrumentation).to receive(:peek_enabled?).and_return(true)
+ allow(Gitlab::PerformanceBar).to receive(:enabled_for_request?).and_return(true)
end
it 'instruments Rugged call' do
diff --git a/spec/lib/gitlab/performance_bar_spec.rb b/spec/lib/gitlab/performance_bar_spec.rb
index 8d8ac2aebbe..816db49d94a 100644
--- a/spec/lib/gitlab/performance_bar_spec.rb
+++ b/spec/lib/gitlab/performance_bar_spec.rb
@@ -6,14 +6,14 @@ describe Gitlab::PerformanceBar do
shared_examples 'allowed user IDs are cached' do
before do
# Warm the caches
- described_class.enabled?(user)
+ described_class.enabled_for_user?(user)
end
it 'caches the allowed user IDs in cache', :use_clean_rails_memory_store_caching do
expect do
expect(described_class.l1_cache_backend).to receive(:fetch).and_call_original
expect(described_class.l2_cache_backend).not_to receive(:fetch)
- expect(described_class.enabled?(user)).to be_truthy
+ expect(described_class.enabled_for_user?(user)).to be_truthy
end.not_to exceed_query_limit(0)
end
@@ -22,7 +22,7 @@ describe Gitlab::PerformanceBar do
expect do
expect(described_class.l1_cache_backend).to receive(:fetch).and_call_original
expect(described_class.l2_cache_backend).to receive(:fetch).and_call_original
- expect(described_class.enabled?(user)).to be_truthy
+ expect(described_class.enabled_for_user?(user)).to be_truthy
end.not_to exceed_query_limit(0)
end
end
@@ -32,7 +32,7 @@ describe Gitlab::PerformanceBar do
expect do
expect(described_class.l1_cache_backend).to receive(:fetch).and_call_original
expect(described_class.l2_cache_backend).to receive(:fetch).and_call_original
- expect(described_class.enabled?(user)).to be_truthy
+ expect(described_class.enabled_for_user?(user)).to be_truthy
end.not_to exceed_query_limit(2)
end
end
@@ -41,7 +41,7 @@ describe Gitlab::PerformanceBar do
it { expect(described_class.l1_cache_backend).to eq(Gitlab::ThreadMemoryCache.cache_backend) }
it { expect(described_class.l2_cache_backend).to eq(Rails.cache) }
- describe '.enabled?' do
+ describe '.enabled_for_user?' do
let(:user) { create(:user) }
before do
@@ -49,24 +49,24 @@ describe Gitlab::PerformanceBar do
end
it 'returns false when given user is nil' do
- expect(described_class.enabled?(nil)).to be_falsy
+ expect(described_class.enabled_for_user?(nil)).to be_falsy
end
it 'returns true when given user is an admin' do
user = build_stubbed(:user, :admin)
- expect(described_class.enabled?(user)).to be_truthy
+ expect(described_class.enabled_for_user?(user)).to be_truthy
end
it 'returns false when allowed_group_id is nil' do
expect(described_class).to receive(:allowed_group_id).and_return(nil)
- expect(described_class.enabled?(user)).to be_falsy
+ expect(described_class.enabled_for_user?(user)).to be_falsy
end
context 'when allowed group ID does not exist' do
it 'returns false' do
- expect(described_class.enabled?(user)).to be_falsy
+ expect(described_class.enabled_for_user?(user)).to be_falsy
end
end
@@ -79,7 +79,7 @@ describe Gitlab::PerformanceBar do
context 'when user is not a member of the allowed group' do
it 'returns false' do
- expect(described_class.enabled?(user)).to be_falsy
+ expect(described_class.enabled_for_user?(user)).to be_falsy
end
it_behaves_like 'allowed user IDs are cached'
@@ -91,7 +91,7 @@ describe Gitlab::PerformanceBar do
end
it 'returns true' do
- expect(described_class.enabled?(user)).to be_truthy
+ expect(described_class.enabled_for_user?(user)).to be_truthy
end
it_behaves_like 'allowed user IDs are cached'
@@ -108,7 +108,7 @@ describe Gitlab::PerformanceBar do
end
it 'returns the nested group' do
- expect(described_class.enabled?(user)).to be_truthy
+ expect(described_class.enabled_for_user?(user)).to be_truthy
end
end
@@ -118,7 +118,7 @@ describe Gitlab::PerformanceBar do
end
it 'returns false' do
- expect(described_class.enabled?(user)).to be_falsy
+ expect(described_class.enabled_for_user?(user)).to be_falsy
end
end
end
diff --git a/spec/lib/gitlab/sidekiq_middleware/metrics_spec.rb b/spec/lib/gitlab/sidekiq_middleware/metrics_spec.rb
index e430599bd94..ac97a5ebd15 100644
--- a/spec/lib/gitlab/sidekiq_middleware/metrics_spec.rb
+++ b/spec/lib/gitlab/sidekiq_middleware/metrics_spec.rb
@@ -13,7 +13,7 @@ describe Gitlab::SidekiqMiddleware::Metrics do
let(:running_jobs_metric) { double('running jobs metric') }
before do
- allow(Gitlab::Metrics).to receive(:histogram).with(:sidekiq_jobs_completion_seconds, anything, anything).and_return(completion_seconds_metric)
+ allow(Gitlab::Metrics).to receive(:histogram).with(:sidekiq_jobs_completion_seconds, anything, anything, anything).and_return(completion_seconds_metric)
allow(Gitlab::Metrics).to receive(:counter).with(:sidekiq_jobs_failed_total, anything).and_return(failed_total_metric)
allow(Gitlab::Metrics).to receive(:counter).with(:sidekiq_jobs_retried_total, anything).and_return(retried_total_metric)
allow(Gitlab::Metrics).to receive(:gauge).with(:sidekiq_running_jobs, anything, {}, :livesum).and_return(running_jobs_metric)
diff --git a/spec/lib/gitlab/slash_commands/application_help_spec.rb b/spec/lib/gitlab/slash_commands/application_help_spec.rb
index b203a1ee79c..afa63c21584 100644
--- a/spec/lib/gitlab/slash_commands/application_help_spec.rb
+++ b/spec/lib/gitlab/slash_commands/application_help_spec.rb
@@ -4,10 +4,11 @@ require 'spec_helper'
describe Gitlab::SlashCommands::ApplicationHelp do
let(:params) { { command: '/gitlab', text: 'help' } }
+ let(:project) { build(:project) }
describe '#execute' do
subject do
- described_class.new(params).execute
+ described_class.new(project, params).execute
end
it 'displays the help section' do
diff --git a/spec/lib/gitlab/slash_commands/command_spec.rb b/spec/lib/gitlab/slash_commands/command_spec.rb
index c4ea8cbf2b1..dc412c80e68 100644
--- a/spec/lib/gitlab/slash_commands/command_spec.rb
+++ b/spec/lib/gitlab/slash_commands/command_spec.rb
@@ -27,7 +27,7 @@ describe Gitlab::SlashCommands::Command do
it 'displays the help message' do
expect(subject[:response_type]).to be(:ephemeral)
- expect(subject[:text]).to start_with('Unknown command')
+ expect(subject[:text]).to start_with('The specified command is not valid')
expect(subject[:text]).to match('/gitlab issue show')
end
end
@@ -37,7 +37,7 @@ describe Gitlab::SlashCommands::Command do
it 'rejects the actions' do
expect(subject[:response_type]).to be(:ephemeral)
- expect(subject[:text]).to start_with('Whoops! This action is not allowed')
+ expect(subject[:text]).to start_with('You are not allowed')
end
end
@@ -57,7 +57,7 @@ describe Gitlab::SlashCommands::Command do
context 'and user can not create deployment' do
it 'returns action' do
expect(subject[:response_type]).to be(:ephemeral)
- expect(subject[:text]).to start_with('Whoops! This action is not allowed')
+ expect(subject[:text]).to start_with('You are not allowed')
end
end
diff --git a/spec/lib/gitlab/slash_commands/presenters/access_spec.rb b/spec/lib/gitlab/slash_commands/presenters/access_spec.rb
index 286fec892e6..f00039c634f 100644
--- a/spec/lib/gitlab/slash_commands/presenters/access_spec.rb
+++ b/spec/lib/gitlab/slash_commands/presenters/access_spec.rb
@@ -4,12 +4,14 @@ require 'spec_helper'
describe Gitlab::SlashCommands::Presenters::Access do
describe '#access_denied' do
- subject { described_class.new.access_denied }
+ let(:project) { build(:project) }
+
+ subject { described_class.new.access_denied(project) }
it { is_expected.to be_a(Hash) }
it 'displays an error message' do
- expect(subject[:text]).to match("is not allowed")
+ expect(subject[:text]).to match('are not allowed')
expect(subject[:response_type]).to be(:ephemeral)
end
end
diff --git a/spec/lib/peek/views/rugged_spec.rb b/spec/lib/peek/views/rugged_spec.rb
index d07d6b51a1f..b9507f772d2 100644
--- a/spec/lib/peek/views/rugged_spec.rb
+++ b/spec/lib/peek/views/rugged_spec.rb
@@ -8,7 +8,7 @@ describe Peek::Views::Rugged, :request_store do
let(:project) { create(:project) }
before do
- allow(Gitlab::RuggedInstrumentation).to receive(:peek_enabled?).and_return(true)
+ allow(Gitlab::PerformanceBar).to receive(:enabled_for_request?).and_return(true)
end
it 'returns no results' do
diff --git a/spec/models/clusters/applications/cert_manager_spec.rb b/spec/models/clusters/applications/cert_manager_spec.rb
index 93050e80b07..f6d5d05e4a0 100644
--- a/spec/models/clusters/applications/cert_manager_spec.rb
+++ b/spec/models/clusters/applications/cert_manager_spec.rb
@@ -44,11 +44,18 @@ describe Clusters::Applications::CertManager do
it 'is initialized with cert_manager arguments' do
expect(subject.name).to eq('certmanager')
- expect(subject.chart).to eq('stable/cert-manager')
- expect(subject.version).to eq('v0.5.2')
+ expect(subject.chart).to eq('certmanager/cert-manager')
+ expect(subject.repository).to eq('https://charts.jetstack.io')
+ expect(subject.version).to eq('v0.9.1')
expect(subject).to be_rbac
expect(subject.files).to eq(cert_manager.files.merge(cluster_issuer_file))
- expect(subject.postinstall).to eq(['kubectl create -f /data/helm/certmanager/config/cluster_issuer.yaml'])
+ expect(subject.preinstall).to eq([
+ 'kubectl apply -f https://raw.githubusercontent.com/jetstack/cert-manager/release-0.9/deploy/manifests/00-crds.yaml',
+ 'kubectl label --overwrite namespace gitlab-managed-apps certmanager.k8s.io/disable-validation=true'
+ ])
+ expect(subject.postinstall).to eq([
+ 'for i in $(seq 1 30); do kubectl apply -f /data/helm/certmanager/config/cluster_issuer.yaml && break; sleep 1s; echo "Retrying ($i)..."; done'
+ ])
end
context 'for a specific user' do
@@ -75,7 +82,7 @@ describe Clusters::Applications::CertManager do
let(:cert_manager) { create(:clusters_applications_cert_manager, :errored, version: '0.0.1') }
it 'is initialized with the locked version' do
- expect(subject.version).to eq('v0.5.2')
+ expect(subject.version).to eq('v0.9.1')
end
end
end
@@ -93,10 +100,13 @@ describe Clusters::Applications::CertManager do
it 'specifies a post delete command to remove custom resource definitions' do
expect(subject.postdelete).to eq([
- "kubectl delete secret -n gitlab-managed-apps letsencrypt-prod --ignore-not-found",
+ 'kubectl delete secret -n gitlab-managed-apps letsencrypt-prod --ignore-not-found',
'kubectl delete crd certificates.certmanager.k8s.io --ignore-not-found',
+ 'kubectl delete crd certificaterequests.certmanager.k8s.io --ignore-not-found',
+ 'kubectl delete crd challenges.certmanager.k8s.io --ignore-not-found',
'kubectl delete crd clusterissuers.certmanager.k8s.io --ignore-not-found',
- 'kubectl delete crd issuers.certmanager.k8s.io --ignore-not-found'
+ 'kubectl delete crd issuers.certmanager.k8s.io --ignore-not-found',
+ 'kubectl delete crd orders.certmanager.k8s.io --ignore-not-found'
])
end
@@ -111,8 +121,11 @@ describe Clusters::Applications::CertManager do
it 'does not try and delete the secret' do
expect(subject.postdelete).to eq([
'kubectl delete crd certificates.certmanager.k8s.io --ignore-not-found',
+ 'kubectl delete crd certificaterequests.certmanager.k8s.io --ignore-not-found',
+ 'kubectl delete crd challenges.certmanager.k8s.io --ignore-not-found',
'kubectl delete crd clusterissuers.certmanager.k8s.io --ignore-not-found',
- 'kubectl delete crd issuers.certmanager.k8s.io --ignore-not-found'
+ 'kubectl delete crd issuers.certmanager.k8s.io --ignore-not-found',
+ 'kubectl delete crd orders.certmanager.k8s.io --ignore-not-found'
])
end
end
diff --git a/spec/models/concerns/ignorable_column_spec.rb b/spec/models/concerns/ignorable_column_spec.rb
deleted file mode 100644
index 6b82825d2cc..00000000000
--- a/spec/models/concerns/ignorable_column_spec.rb
+++ /dev/null
@@ -1,44 +0,0 @@
-# frozen_string_literal: true
-
-require 'spec_helper'
-
-describe IgnorableColumn do
- let :base_class do
- Class.new do
- def self.columns
- # This method does not have access to "double"
- [
- Struct.new(:name).new('id'),
- Struct.new(:name).new('title'),
- Struct.new(:name).new('date')
- ]
- end
- end
- end
-
- let :model do
- Class.new(base_class) do
- include IgnorableColumn
- end
- end
-
- describe '.columns' do
- it 'returns the columns, excluding the ignored ones' do
- model.ignore_column(:title, :date)
-
- expect(model.columns.map(&:name)).to eq(%w(id))
- end
- end
-
- describe '.ignored_columns' do
- it 'returns a Set' do
- expect(model.ignored_columns).to be_an_instance_of(Set)
- end
-
- it 'returns the names of the ignored columns' do
- model.ignore_column(:title, :date)
-
- expect(model.ignored_columns).to eq(Set.new(%w(title date)))
- end
- end
-end
diff --git a/spec/models/concerns/routable_spec.rb b/spec/models/concerns/routable_spec.rb
index 31163a5bb5c..cff86afe768 100644
--- a/spec/models/concerns/routable_spec.rb
+++ b/spec/models/concerns/routable_spec.rb
@@ -58,7 +58,7 @@ describe Group, 'Routable' do
end
end
- describe '.find_by_full_path' do
+ shared_examples_for '.find_by_full_path' do
let!(:nested_group) { create(:group, parent: group) }
context 'without any redirect routes' do
@@ -110,6 +110,24 @@ describe Group, 'Routable' do
end
end
+ describe '.find_by_full_path' do
+ context 'with routable_two_step_lookup feature' do
+ before do
+ stub_feature_flags(routable_two_step_lookup: true)
+ end
+
+ it_behaves_like '.find_by_full_path'
+ end
+
+ context 'without routable_two_step_lookup feature' do
+ before do
+ stub_feature_flags(routable_two_step_lookup: false)
+ end
+
+ it_behaves_like '.find_by_full_path'
+ end
+ end
+
describe '.where_full_path_in' do
context 'without any paths' do
it 'returns an empty relation' do
diff --git a/spec/models/group_spec.rb b/spec/models/group_spec.rb
index 1c41ceb7deb..796b6917fb2 100644
--- a/spec/models/group_spec.rb
+++ b/spec/models/group_spec.rb
@@ -1039,4 +1039,23 @@ describe Group do
.to eq(Gitlab::Access::MAINTAINER_SUBGROUP_ACCESS)
end
end
+
+ describe '#access_request_approvers_to_be_notified' do
+ it 'returns a maximum of ten, active, non_requested owners of the group in recent_sign_in descending order' do
+ group = create(:group, :public)
+
+ users = create_list(:user, 12, :with_sign_ins)
+ active_owners = users.map do |user|
+ create(:group_member, :owner, group: group, user: user)
+ end
+
+ create(:group_member, :owner, :blocked, group: group)
+ create(:group_member, :maintainer, group: group)
+ create(:group_member, :access_request, :owner, group: group)
+
+ active_owners_in_recent_sign_in_desc_order = group.members_and_requesters.where(id: active_owners).order_recent_sign_in.limit(10)
+
+ expect(group.access_request_approvers_to_be_notified).to eq(active_owners_in_recent_sign_in_desc_order)
+ end
+ end
end
diff --git a/spec/models/project_services/chat_message/push_message_spec.rb b/spec/models/project_services/chat_message/push_message_spec.rb
index a89645a3ea8..2bde0b93fda 100644
--- a/spec/models/project_services/chat_message/push_message_spec.rb
+++ b/spec/models/project_services/chat_message/push_message_spec.rb
@@ -23,7 +23,7 @@ describe ChatMessage::PushMessage do
before do
args[:commits] = [
{ message: 'message1', url: 'http://url1.com', id: 'abcdefghijkl', author: { name: 'author1' } },
- { message: 'message2', url: 'http://url2.com', id: '123456789012', author: { name: 'author2' } }
+ { message: "message2\nsecondline", url: 'http://url2.com', id: '123456789012', author: { name: 'author2' } }
]
end
@@ -34,7 +34,7 @@ describe ChatMessage::PushMessage do
'<http://url.com|project_name> (<http://url.com/compare/before...after|Compare changes>)')
expect(subject.attachments).to eq([{
text: "<http://url1.com|abcdefgh>: message1 - author1\n\n"\
- "<http://url2.com|12345678>: message2 - author2",
+ "<http://url2.com|12345678>: message2\nsecondline - author2",
color: color
}])
end
@@ -49,7 +49,27 @@ describe ChatMessage::PushMessage do
expect(subject.pretext).to eq(
'test.user pushed to branch [master](http://url.com/commits/master) of [project_name](http://url.com) ([Compare changes](http://url.com/compare/before...after))')
expect(subject.attachments).to eq(
- "[abcdefgh](http://url1.com): message1 - author1\n\n[12345678](http://url2.com): message2 - author2")
+ "[abcdefgh](http://url1.com): message1 - author1\n\n[12345678](http://url2.com): message2\nsecondline - author2")
+ expect(subject.activity).to eq(
+ title: 'test.user pushed to branch [master](http://url.com/commits/master)',
+ subtitle: 'in [project_name](http://url.com)',
+ text: '[Compare changes](http://url.com/compare/before...after)',
+ image: 'http://someavatar.com'
+ )
+ end
+ end
+
+ context 'with markdown and commit message html' do
+ before do
+ args[:commit_message_html] = true
+ args[:markdown] = true
+ end
+
+ it 'returns a message regarding pushes' do
+ expect(subject.pretext).to eq(
+ 'test.user pushed to branch [master](http://url.com/commits/master) of [project_name](http://url.com) ([Compare changes](http://url.com/compare/before...after))')
+ expect(subject.attachments).to eq(
+ "[abcdefgh](http://url1.com): message1 - author1<br/>\n<br/>\n[12345678](http://url2.com): message2<br/>\nsecondline - author2")
expect(subject.activity).to eq(
title: 'test.user pushed to branch [master](http://url.com/commits/master)',
subtitle: 'in [project_name](http://url.com)',
diff --git a/spec/models/project_spec.rb b/spec/models/project_spec.rb
index bd352db2236..bfbcac60fea 100644
--- a/spec/models/project_spec.rb
+++ b/spec/models/project_spec.rb
@@ -4991,6 +4991,26 @@ describe Project do
end
end
+ describe '#access_request_approvers_to_be_notified' do
+ it 'returns a maximum of ten, active, non_requested maintainers of the project in recent_sign_in descending order' do
+ group = create(:group, :public)
+ project = create(:project, group: group)
+
+ users = create_list(:user, 12, :with_sign_ins)
+ active_maintainers = users.map do |user|
+ create(:project_member, :maintainer, user: user)
+ end
+
+ create(:project_member, :maintainer, :blocked, project: project)
+ create(:project_member, :developer, project: project)
+ create(:project_member, :access_request, :maintainer, project: project)
+
+ active_maintainers_in_recent_sign_in_desc_order = project.members_and_requesters.where(id: active_maintainers).order_recent_sign_in.limit(10)
+
+ expect(project.access_request_approvers_to_be_notified).to eq(active_maintainers_in_recent_sign_in_desc_order)
+ end
+ end
+
def rugged_config
rugged_repo(project.repository).config
end
diff --git a/spec/serializers/deployment_entity_spec.rb b/spec/serializers/deployment_entity_spec.rb
index 1b19eac9a97..79f89dc1a9c 100644
--- a/spec/serializers/deployment_entity_spec.rb
+++ b/spec/serializers/deployment_entity_spec.rb
@@ -36,6 +36,15 @@ describe DeploymentEntity do
expect(subject).to include(:deployed_at)
end
+ context 'when deployable is nil' do
+ let(:entity) { described_class.new(deployment, request: request, deployment_details: false) }
+ let(:deployment) { create(:deployment, deployable: nil, project: project) }
+
+ it 'does not expose deployable entry' do
+ expect(subject).not_to include(:deployable)
+ end
+ end
+
context 'when the pipeline has another manual action' do
let(:other_build) { create(:ci_build, :manual, name: 'another deploy', pipeline: pipeline) }
let!(:other_deployment) { create(:deployment, deployable: other_build) }
diff --git a/spec/services/clusters/gcp/kubernetes/create_or_update_namespace_service_spec.rb b/spec/services/clusters/kubernetes/create_or_update_namespace_service_spec.rb
index e44cc3f5a78..5a3b1cd6cfb 100644
--- a/spec/services/clusters/gcp/kubernetes/create_or_update_namespace_service_spec.rb
+++ b/spec/services/clusters/kubernetes/create_or_update_namespace_service_spec.rb
@@ -2,7 +2,7 @@
require 'spec_helper'
-describe Clusters::Gcp::Kubernetes::CreateOrUpdateNamespaceService, '#execute' do
+describe Clusters::Kubernetes::CreateOrUpdateNamespaceService, '#execute' do
include KubernetesHelpers
let(:cluster) { create(:cluster, :project, :provided_by_gcp) }
@@ -35,8 +35,8 @@ describe Clusters::Gcp::Kubernetes::CreateOrUpdateNamespaceService, '#execute' d
stub_kubeclient_create_service_account(api_url, namespace: namespace)
stub_kubeclient_create_secret(api_url, namespace: namespace)
stub_kubeclient_put_secret(api_url, "#{namespace}-token", namespace: namespace)
- stub_kubeclient_put_role(api_url, Clusters::Gcp::Kubernetes::GITLAB_KNATIVE_SERVING_ROLE_NAME, namespace: namespace)
- stub_kubeclient_put_role_binding(api_url, Clusters::Gcp::Kubernetes::GITLAB_KNATIVE_SERVING_ROLE_BINDING_NAME, namespace: namespace)
+ stub_kubeclient_put_role(api_url, Clusters::Kubernetes::GITLAB_KNATIVE_SERVING_ROLE_NAME, namespace: namespace)
+ stub_kubeclient_put_role_binding(api_url, Clusters::Kubernetes::GITLAB_KNATIVE_SERVING_ROLE_BINDING_NAME, namespace: namespace)
stub_kubeclient_get_secret(
api_url,
@@ -56,7 +56,7 @@ describe Clusters::Gcp::Kubernetes::CreateOrUpdateNamespaceService, '#execute' d
end
it 'creates project service account' do
- expect_any_instance_of(Clusters::Gcp::Kubernetes::CreateOrUpdateServiceAccountService).to receive(:execute).once
+ expect_any_instance_of(Clusters::Kubernetes::CreateOrUpdateServiceAccountService).to receive(:execute).once
subject
end
@@ -123,7 +123,7 @@ describe Clusters::Gcp::Kubernetes::CreateOrUpdateNamespaceService, '#execute' d
end
it 'creates project service account' do
- expect_any_instance_of(Clusters::Gcp::Kubernetes::CreateOrUpdateServiceAccountService).to receive(:execute).once
+ expect_any_instance_of(Clusters::Kubernetes::CreateOrUpdateServiceAccountService).to receive(:execute).once
subject
end
diff --git a/spec/services/clusters/gcp/kubernetes/create_or_update_service_account_service_spec.rb b/spec/services/clusters/kubernetes/create_or_update_service_account_service_spec.rb
index 8b874989758..10dbfc800ff 100644
--- a/spec/services/clusters/gcp/kubernetes/create_or_update_service_account_service_spec.rb
+++ b/spec/services/clusters/kubernetes/create_or_update_service_account_service_spec.rb
@@ -1,7 +1,7 @@
# frozen_string_literal: true
require 'spec_helper'
-describe Clusters::Gcp::Kubernetes::CreateOrUpdateServiceAccountService do
+describe Clusters::Kubernetes::CreateOrUpdateServiceAccountService do
include KubernetesHelpers
let(:api_url) { 'http://111.111.111.111' }
@@ -143,8 +143,8 @@ describe Clusters::Gcp::Kubernetes::CreateOrUpdateServiceAccountService do
stub_kubeclient_get_role_binding_error(api_url, role_binding_name, namespace: namespace)
stub_kubeclient_create_role_binding(api_url, namespace: namespace)
- stub_kubeclient_put_role(api_url, Clusters::Gcp::Kubernetes::GITLAB_KNATIVE_SERVING_ROLE_NAME, namespace: namespace)
- stub_kubeclient_put_role_binding(api_url, Clusters::Gcp::Kubernetes::GITLAB_KNATIVE_SERVING_ROLE_BINDING_NAME, namespace: namespace)
+ stub_kubeclient_put_role(api_url, Clusters::Kubernetes::GITLAB_KNATIVE_SERVING_ROLE_NAME, namespace: namespace)
+ stub_kubeclient_put_role_binding(api_url, Clusters::Kubernetes::GITLAB_KNATIVE_SERVING_ROLE_BINDING_NAME, namespace: namespace)
end
it_behaves_like 'creates service account and token'
@@ -175,10 +175,10 @@ describe Clusters::Gcp::Kubernetes::CreateOrUpdateServiceAccountService do
it 'creates a role and role binding granting knative serving permissions to the service account' do
subject
- expect(WebMock).to have_requested(:put, api_url + "/apis/rbac.authorization.k8s.io/v1/namespaces/#{namespace}/roles/#{Clusters::Gcp::Kubernetes::GITLAB_KNATIVE_SERVING_ROLE_NAME}").with(
+ expect(WebMock).to have_requested(:put, api_url + "/apis/rbac.authorization.k8s.io/v1/namespaces/#{namespace}/roles/#{Clusters::Kubernetes::GITLAB_KNATIVE_SERVING_ROLE_NAME}").with(
body: hash_including(
metadata: {
- name: Clusters::Gcp::Kubernetes::GITLAB_KNATIVE_SERVING_ROLE_NAME,
+ name: Clusters::Kubernetes::GITLAB_KNATIVE_SERVING_ROLE_NAME,
namespace: namespace
},
rules: [{
diff --git a/spec/services/clusters/gcp/kubernetes/fetch_kubernetes_token_service_spec.rb b/spec/services/clusters/kubernetes/fetch_kubernetes_token_service_spec.rb
index 93c0dc37ade..145528616ee 100644
--- a/spec/services/clusters/gcp/kubernetes/fetch_kubernetes_token_service_spec.rb
+++ b/spec/services/clusters/kubernetes/fetch_kubernetes_token_service_spec.rb
@@ -2,7 +2,7 @@
require 'spec_helper'
-describe Clusters::Gcp::Kubernetes::FetchKubernetesTokenService do
+describe Clusters::Kubernetes::FetchKubernetesTokenService do
include KubernetesHelpers
describe '#execute' do
diff --git a/spec/services/notification_service_spec.rb b/spec/services/notification_service_spec.rb
index d925aa2b6c3..ab0e01e27d7 100644
--- a/spec/services/notification_service_spec.rb
+++ b/spec/services/notification_service_spec.rb
@@ -1932,31 +1932,39 @@ describe NotificationService, :mailer do
let(:added_user) { create(:user) }
describe '#new_access_request' do
- let(:maintainer) { create(:user) }
- let(:owner) { create(:user) }
- let(:developer) { create(:user) }
- let!(:group) do
- create(:group, :public, :access_requestable) do |group|
- group.add_owner(owner)
- group.add_maintainer(maintainer)
- group.add_developer(developer)
+ context 'recipients' do
+ let(:maintainer) { create(:user) }
+ let(:owner) { create(:user) }
+ let(:developer) { create(:user) }
+
+ let!(:group) do
+ create(:group, :public, :access_requestable) do |group|
+ group.add_owner(owner)
+ group.add_maintainer(maintainer)
+ group.add_developer(developer)
+ end
end
- end
- before do
- reset_delivered_emails!
- end
+ before do
+ reset_delivered_emails!
+ end
- it 'sends notification to group owners_and_maintainers' do
- group.request_access(added_user)
+ it 'sends notification only to group owners' do
+ group.request_access(added_user)
+
+ should_email(owner)
+ should_not_email(maintainer)
+ should_not_email(developer)
+ end
- should_email(owner)
- should_email(maintainer)
- should_not_email(developer)
+ it_behaves_like 'group emails are disabled' do
+ let(:notification_target) { group }
+ let(:notification_trigger) { group.request_access(added_user) }
+ end
end
- it_behaves_like 'group emails are disabled' do
- let(:notification_target) { group }
+ it_behaves_like 'sends notification only to a maximum of ten, most recently active group owners' do
+ let(:group) { create(:group, :public, :access_requestable) }
let(:notification_trigger) { group.request_access(added_user) }
end
end
@@ -2012,20 +2020,36 @@ describe NotificationService, :mailer do
describe '#new_access_request' do
context 'for a project in a user namespace' do
- let(:project) do
- create(:project, :public, :access_requestable) do |project|
- project.add_maintainer(project.owner)
+ context 'recipients' do
+ let(:developer) { create(:user) }
+ let(:maintainer) { create(:user) }
+
+ let!(:project) do
+ create(:project, :public, :access_requestable) do |project|
+ project.add_developer(developer)
+ project.add_maintainer(maintainer)
+ end
end
- end
- it 'sends notification to project owners_and_maintainers' do
- project.request_access(added_user)
+ before do
+ reset_delivered_emails!
+ end
+
+ it 'sends notification only to project maintainers' do
+ project.request_access(added_user)
+
+ should_email(maintainer)
+ should_not_email(developer)
+ end
- should_only_email(project.owner)
+ it_behaves_like 'project emails are disabled' do
+ let(:notification_target) { project }
+ let(:notification_trigger) { project.request_access(added_user) }
+ end
end
- it_behaves_like 'project emails are disabled' do
- let(:notification_target) { project }
+ it_behaves_like 'sends notification only to a maximum of ten, most recently active project maintainers' do
+ let(:project) { create(:project, :public, :access_requestable) }
let(:notification_trigger) { project.request_access(added_user) }
end
end
@@ -2033,16 +2057,76 @@ describe NotificationService, :mailer do
context 'for a project in a group' do
let(:group_owner) { create(:user) }
let(:group) { create(:group).tap { |g| g.add_owner(group_owner) } }
- let!(:project) { create(:project, :public, :access_requestable, namespace: group) }
- before do
- reset_delivered_emails!
+ context 'when the project has no maintainers' do
+ context 'when the group has at least one owner' do
+ let!(:project) { create(:project, :public, :access_requestable, namespace: group) }
+
+ before do
+ reset_delivered_emails!
+ end
+
+ context 'recipients' do
+ it 'sends notifications to the group owners' do
+ project.request_access(added_user)
+
+ should_only_email(group_owner)
+ end
+ end
+
+ it_behaves_like 'sends notification only to a maximum of ten, most recently active group owners' do
+ let(:group) { create(:group, :public, :access_requestable) }
+ let(:notification_trigger) { project.request_access(added_user) }
+ end
+ end
+
+ context 'when the group does not have any owners' do
+ let(:group) { create(:group) }
+ let!(:project) { create(:project, :public, :access_requestable, namespace: group) }
+
+ context 'recipients' do
+ before do
+ reset_delivered_emails!
+ end
+
+ it 'does not send any notifications' do
+ project.request_access(added_user)
+
+ should_not_email_anyone
+ end
+ end
+ end
end
- it 'sends notification to group owners_and_maintainers' do
- project.request_access(added_user)
+ context 'when the project has maintainers' do
+ let(:maintainer) { create(:user) }
+ let(:developer) { create(:user) }
+
+ let!(:project) do
+ create(:project, :public, :access_requestable, namespace: group) do |project|
+ project.add_maintainer(maintainer)
+ project.add_developer(developer)
+ end
+ end
+
+ before do
+ reset_delivered_emails!
+ end
+
+ context 'recipients' do
+ it 'sends notifications only to project maintainers' do
+ project.request_access(added_user)
- should_only_email(group_owner)
+ should_email(maintainer)
+ should_not_email(developer)
+ should_not_email(group_owner)
+ end
+ end
+
+ it_behaves_like 'sends notification only to a maximum of ten, most recently active project maintainers' do
+ let(:project) { create(:project, :public, :access_requestable, namespace: group) }
+ let(:notification_trigger) { project.request_access(added_user) }
+ end
end
end
end
diff --git a/spec/support/services/clusters/create_service_shared.rb b/spec/support/services/clusters/create_service_shared.rb
index 27f6d0570b6..468f25bfffe 100644
--- a/spec/support/services/clusters/create_service_shared.rb
+++ b/spec/support/services/clusters/create_service_shared.rb
@@ -32,56 +32,24 @@ shared_context 'invalid cluster create params' do
end
shared_examples 'create cluster service success' do
- context 'namespace per environment feature is enabled' do
- before do
- stub_feature_flags(kubernetes_namespace_per_environment: true)
- end
-
- it 'creates a cluster object and performs a worker' do
- expect(ClusterProvisionWorker).to receive(:perform_async)
-
- expect { subject }
- .to change { Clusters::Cluster.count }.by(1)
- .and change { Clusters::Providers::Gcp.count }.by(1)
-
- expect(subject.name).to eq('test-cluster')
- expect(subject.user).to eq(user)
- expect(subject.project).to eq(project)
- expect(subject.provider.gcp_project_id).to eq('gcp-project')
- expect(subject.provider.zone).to eq('us-central1-a')
- expect(subject.provider.num_nodes).to eq(1)
- expect(subject.provider.machine_type).to eq('machine_type-a')
- expect(subject.provider.access_token).to eq(access_token)
- expect(subject.provider).to be_legacy_abac
- expect(subject.platform).to be_nil
- expect(subject.namespace_per_environment).to eq true
- end
- end
-
- context 'namespace per environment feature is disabled' do
- before do
- stub_feature_flags(kubernetes_namespace_per_environment: false)
- end
-
- it 'creates a cluster object and performs a worker' do
- expect(ClusterProvisionWorker).to receive(:perform_async)
-
- expect { subject }
- .to change { Clusters::Cluster.count }.by(1)
- .and change { Clusters::Providers::Gcp.count }.by(1)
-
- expect(subject.name).to eq('test-cluster')
- expect(subject.user).to eq(user)
- expect(subject.project).to eq(project)
- expect(subject.provider.gcp_project_id).to eq('gcp-project')
- expect(subject.provider.zone).to eq('us-central1-a')
- expect(subject.provider.num_nodes).to eq(1)
- expect(subject.provider.machine_type).to eq('machine_type-a')
- expect(subject.provider.access_token).to eq(access_token)
- expect(subject.provider).to be_legacy_abac
- expect(subject.platform).to be_nil
- expect(subject.namespace_per_environment).to eq false
- end
+ it 'creates a cluster object and performs a worker' do
+ expect(ClusterProvisionWorker).to receive(:perform_async)
+
+ expect { subject }
+ .to change { Clusters::Cluster.count }.by(1)
+ .and change { Clusters::Providers::Gcp.count }.by(1)
+
+ expect(subject.name).to eq('test-cluster')
+ expect(subject.user).to eq(user)
+ expect(subject.project).to eq(project)
+ expect(subject.provider.gcp_project_id).to eq('gcp-project')
+ expect(subject.provider.zone).to eq('us-central1-a')
+ expect(subject.provider.num_nodes).to eq(1)
+ expect(subject.provider.machine_type).to eq('machine_type-a')
+ expect(subject.provider.access_token).to eq(access_token)
+ expect(subject.provider).to be_legacy_abac
+ expect(subject.platform).to be_nil
+ expect(subject.namespace_per_environment).to eq true
end
end
diff --git a/spec/support/shared_examples/chat_slash_commands_shared_examples.rb b/spec/support/shared_examples/chat_slash_commands_shared_examples.rb
index dcc92dda950..a99068ab678 100644
--- a/spec/support/shared_examples/chat_slash_commands_shared_examples.rb
+++ b/spec/support/shared_examples/chat_slash_commands_shared_examples.rb
@@ -103,7 +103,7 @@ RSpec.shared_examples 'chat slash commands service' do
expect_any_instance_of(Gitlab::SlashCommands::Command).not_to receive(:execute)
result = subject.trigger(params)
- expect(result).to include(text: /^Whoops! This action is not allowed/)
+ expect(result).to include(text: /^You are not allowed/)
end
end
end
diff --git a/spec/support/issuables_requiring_filter_shared_examples.rb b/spec/support/shared_examples/controllers/issuables_requiring_filter_shared_examples.rb
index ee25df00dfb..ee25df00dfb 100644
--- a/spec/support/issuables_requiring_filter_shared_examples.rb
+++ b/spec/support/shared_examples/controllers/issuables_requiring_filter_shared_examples.rb
diff --git a/spec/support/active_record_enum.rb b/spec/support/shared_examples/models/active_record_enum_shared_examples.rb
index fb1189c7f17..fb1189c7f17 100644
--- a/spec/support/active_record_enum.rb
+++ b/spec/support/shared_examples/models/active_record_enum_shared_examples.rb
diff --git a/spec/support/shared_examples/services/notification_service_shared_examples.rb b/spec/support/shared_examples/services/notification_service_shared_examples.rb
index dd338ea47c7..ad580b581d6 100644
--- a/spec/support/shared_examples/services/notification_service_shared_examples.rb
+++ b/spec/support/shared_examples/services/notification_service_shared_examples.rb
@@ -52,3 +52,47 @@ shared_examples 'group emails are disabled' do
should_email_anyone
end
end
+
+shared_examples 'sends notification only to a maximum of ten, most recently active group owners' do
+ let(:owners) { create_list(:user, 12, :with_sign_ins) }
+
+ before do
+ owners.each do |owner|
+ group.add_owner(owner)
+ end
+
+ reset_delivered_emails!
+ end
+
+ context 'limit notification emails' do
+ it 'sends notification only to a maximum of ten, most recently active group owners' do
+ ten_most_recently_active_group_owners = owners.sort_by(&:last_sign_in_at).last(10)
+
+ notification_trigger
+
+ should_only_email(*ten_most_recently_active_group_owners)
+ end
+ end
+end
+
+shared_examples 'sends notification only to a maximum of ten, most recently active project maintainers' do
+ let(:maintainers) { create_list(:user, 12, :with_sign_ins) }
+
+ before do
+ maintainers.each do |maintainer|
+ project.add_maintainer(maintainer)
+ end
+
+ reset_delivered_emails!
+ end
+
+ context 'limit notification emails' do
+ it 'sends notification only to a maximum of ten, most recently active project maintainers' do
+ ten_most_recently_active_project_maintainers = maintainers.sort_by(&:last_sign_in_at).last(10)
+
+ notification_trigger
+
+ should_only_email(*ten_most_recently_active_project_maintainers)
+ end
+ end
+end
diff --git a/vendor/licenses.csv b/vendor/licenses.csv
index 20aacff75fd..41dd9eb5256 100644
--- a/vendor/licenses.csv
+++ b/vendor/licenses.csv
@@ -152,6 +152,7 @@ assert,1.4.1,MIT
assign-symbols,1.0.0,MIT
async-each,1.0.1,MIT
async-limiter,1.0.0,MIT
+atlassian-jwt,0.2.0,Apache 2.0
atob,2.1.2,(MIT OR Apache-2.0)
atomic,1.1.99,Apache 2.0
attr_encrypted,3.1.0,MIT
diff --git a/yarn.lock b/yarn.lock
index 6ab2aa24685..4cf3a9584f1 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -8116,10 +8116,10 @@ merge2@^1.2.3:
resolved "https://registry.yarnpkg.com/merge2/-/merge2-1.2.3.tgz#7ee99dbd69bb6481689253f018488a1b902b0ed5"
integrity sha512-gdUU1Fwj5ep4kplwcmftruWofEFt6lfpkkr3h860CXbAB9c3hGb55EOL2ali0Td5oebvW0E1+3Sr+Ur7XfKpRA==
-mermaid@^8.2.4:
- version "8.2.4"
- resolved "https://registry.yarnpkg.com/mermaid/-/mermaid-8.2.4.tgz#52bcd45611fd8552ab9ac4e385d2766a0e38dcf7"
- integrity sha512-2la1eJhu4n+Uug4zbxFnkETFDJ9U32OY/fRP8g8A1DrRdfT3Er+7CuUSvxfhIDxl+AxSEU4dXdqCiToZAVMCmQ==
+mermaid@^8.2.6:
+ version "8.2.6"
+ resolved "https://registry.yarnpkg.com/mermaid/-/mermaid-8.2.6.tgz#e73f396461a435c39a998819171c2114f59e46e1"
+ integrity sha512-A8y4zW2aXPj8Yw+BkrCkV6fvzhsFWVESV1IkzRjqQ6T/+tzhkz946+bdebCmHqicEJGTncu/U6h8dgjo5pWo6Q==
dependencies:
"@braintree/sanitize-url" "^3.1.0"
d3 "^5.7.0"