From 898e2cc1dfa88b4ac39cb4b35011f61b37f57b51 Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Fri, 20 Dec 2019 09:24:38 +0000 Subject: Add latest changes from gitlab-org/gitlab@master --- .eslintrc.yml | 1 - .gitlab-ci.yml | 1 + .gitlab/ci/dev-fixtures.gitlab-ci.yml | 30 + .rubocop.yml | 73 +++ Gemfile | 8 +- Gemfile.lock | 36 +- app/assets/javascripts/awards_handler.js | 2 + .../clusters/components/application_row.vue | 5 + app/assets/javascripts/lib/utils/common_utils.js | 5 +- .../components/shared/prometheus_header.vue | 2 +- app/assets/javascripts/pages/admin/admin.js | 2 + app/assets/stylesheets/framework/files.scss | 8 + app/assets/stylesheets/pages/boards.scss | 1 + app/controllers/admin/system_info_controller.rb | 8 +- app/controllers/omniauth_callbacks_controller.rb | 2 +- app/controllers/projects/pages_controller.rb | 10 +- app/controllers/projects/starrers_controller.rb | 4 +- app/graphql/types/ci/pipeline_type.rb | 6 +- .../container_expiration_policies_helper.rb | 12 +- app/helpers/dashboard_helper.rb | 2 +- app/helpers/snippets_helper.rb | 2 +- app/models/application_setting.rb | 5 + app/models/clusters/applications/prometheus.rb | 2 +- .../project_error_tracking_setting.rb | 3 + app/models/namespace.rb | 2 + app/models/project.rb | 1 + app/presenters/clusters/cluster_presenter.rb | 8 +- app/services/projects/update_pages_service.rb | 13 +- app/views/clusters/clusters/_cluster.html.haml | 2 +- app/views/clusters/clusters/aws/_new.html.haml | 4 +- app/views/projects/blame/show.html.haml | 10 +- ...rage-size-limitations-by-project-or-group-4.yml | 5 + .../19132-comment-anchor-twice-firefox.yml | 5 + .../unreleased/19299-blame-previous-revision.yml | 5 + changelogs/unreleased/I-118638.yml | 5 + changelogs/unreleased/sh-add-pipeline-index.yml | 5 + changelogs/unreleased/update-prometheus-chart.yml | 5 + config/application.rb | 4 +- config/initializers/1_settings.rb | 42 +- config/routes/admin.rb | 2 - config/routes/project.rb | 1 - db/fixtures/development/10_merge_requests.rb | 2 +- db/fixtures/development/17_cycle_analytics.rb | 2 +- db/migrate/20191213120427_fix_max_pages_size.rb | 20 + ...5624_add_index_on_project_id_to_ci_pipelines.rb | 18 + db/schema.rb | 3 +- doc/administration/gitaly/index.md | 7 +- .../monitoring/performance/gitlab_configuration.md | 2 +- .../performance/grafana_configuration.md | 6 +- .../performance/influxdb_configuration.md | 6 +- .../monitoring/performance/influxdb_schema.md | 2 +- .../troubleshooting/elasticsearch.md | 9 +- doc/api/graphql/reference/gitlab_schema.graphql | 56 +- doc/api/graphql/reference/gitlab_schema.json | 34 +- doc/api/graphql/reference/index.md | 26 +- doc/api/project_level_variables.md | 1 - doc/development/elasticsearch.md | 14 - doc/gitlab-basics/start-using-git.md | 2 +- doc/integration/elasticsearch.md | 12 +- doc/update/patch_versions.md | 6 +- doc/update/upgrading_from_ce_to_ee.md | 6 +- doc/user/admin_area/index.md | 1 + doc/user/clusters/applications.md | 4 + doc/user/group/clusters/index.md | 9 +- doc/user/instance/clusters/index.md | 14 +- doc/user/project/clusters/add_remove_clusters.md | 434 ++++++------ doc/user/project/clusters/eks_and_gitlab/index.md | 4 +- doc/user/project/clusters/img/add_cluster.png | Bin 59516 -> 0 bytes doc/user/project/clusters/index.md | 20 +- doc/user/project/clusters/serverless/index.md | 2 +- doc/user/project/repository/git_blame.md | 5 + .../img/file_blame_previous_commit_v12_7.png | Bin 0 -> 105806 bytes lib/api/award_emoji.rb | 1 - .../background_migration/archive_legacy_traces.rb | 1 - lib/gitlab/import_export/project_tree_restorer.rb | 2 +- lib/gitlab/metrics/subscribers/action_view.rb | 2 +- lib/gitlab/pages.rb | 1 + lib/gitlab/sherlock/file_sample.rb | 2 +- lib/gitlab/sherlock/line_profiler.rb | 2 +- lib/gitlab/usage_data.rb | 1 - lib/tasks/gitlab/lfs/migrate.rake | 2 - locale/gitlab.pot | 40 +- qa/Dockerfile | 6 + qa/qa.rb | 1 + qa/qa/page/project/operations/kubernetes/index.rb | 4 + qa/qa/page/project/operations/kubernetes/show.rb | 22 +- qa/qa/runtime/application_settings.rb | 46 ++ qa/qa/runtime/env.rb | 4 + qa/qa/service/cluster_provider/k3d.rb | 3 + qa/qa/service/kubernetes_cluster.rb | 4 + .../kubernetes/kubernetes_integration_spec.rb | 53 ++ qa/spec/runtime/application_settings_spec.rb | 43 ++ qa/spec/runtime/env_spec.rb | 14 + .../concerns/confirm_email_warning_spec.rb | 2 +- ...troller_with_cross_project_access_check_spec.rb | 4 +- spec/controllers/concerns/group_tree_spec.rb | 2 +- spec/controllers/concerns/lfs_request_spec.rb | 2 +- .../controllers/concerns/metrics_dashboard_spec.rb | 2 +- spec/controllers/concerns/renders_commits_spec.rb | 2 +- spec/controllers/concerns/routable_actions_spec.rb | 2 +- spec/controllers/concerns/sourcegraph_gon_spec.rb | 2 +- .../static_object_external_storage_spec.rb | 2 +- .../projects/branches_controller_spec.rb | 4 +- spec/controllers/projects/pages_controller_spec.rb | 11 + .../projects/files/user_browses_files_spec.rb | 10 + spec/features/projects/pages_spec.rb | 4 +- .../projects/snippets/create_snippet_spec.rb | 4 +- spec/finders/branches_finder_spec.rb | 2 +- spec/finders/todos_finder_spec.rb | 2 +- .../monitoring/components/dashboard_spec.js | 573 ++++++++++++++++ .../components/dashboard_time_url_spec.js | 54 ++ .../components/dashboard_time_window_spec.js | 75 +++ .../monitoring/components/graph_group_spec.js | 120 ++++ spec/frontend/monitoring/init_utils.js | 56 ++ .../monitoring/shared/prometheus_header_spec.js | 26 + .../container_expiration_policies_helper_spec.rb | 6 +- spec/helpers/projects_helper_spec.rb | 4 +- spec/javascripts/lib/utils/common_utils_spec.js | 3 + .../monitoring/components/dashboard_resize_spec.js | 140 ++++ .../monitoring/components/dashboard_spec.js | 729 --------------------- .../monitoring/components/graph_group_spec.js | 120 ---- .../monitoring/shared/prometheus_header_spec.js | 26 - spec/lib/expand_variables_spec.rb | 2 +- spec/lib/gitlab/asciidoc_spec.rb | 1 - spec/lib/gitlab/ci/config/entry/cache_spec.rb | 6 +- .../rename_reserved_paths_migration/v1_spec.rb | 4 +- spec/lib/gitlab/experimentation_spec.rb | 4 +- spec/lib/gitlab/gitaly_client/blob_service_spec.rb | 2 +- .../gitlab/gitaly_client/remote_service_spec.rb | 2 +- .../gitlab/phabricator_import/conduit/user_spec.rb | 6 +- .../gitlab/phabricator_import/user_finder_spec.rb | 2 +- spec/lib/gitlab/quick_actions/dsl_spec.rb | 2 +- spec/lib/quality/helm_client_spec.rb | 2 +- spec/lib/quality/kubernetes_client_spec.rb | 2 +- spec/migrations/fix_max_pages_size_spec.rb | 19 + spec/models/active_session_spec.rb | 2 +- spec/models/application_setting_spec.rb | 7 + .../clusters/applications/prometheus_spec.rb | 6 +- .../project_error_tracking_setting_spec.rb | 21 +- spec/models/merge_request_spec.rb | 2 +- spec/models/namespace_spec.rb | 1 + spec/models/project_spec.rb | 1 + spec/requests/api/wikis_spec.rb | 2 +- spec/services/notification_service_spec.rb | 2 +- .../services/projects/update_pages_service_spec.rb | 48 +- .../features/discussion_comments_shared_example.rb | 4 +- spec/support/helpers/test_env.rb | 1 - .../pages_size_limit_shared_examples.rb | 30 + .../projects/commit/branches.html.haml_spec.rb | 4 +- vendor/prometheus/values.yaml | 4 - 150 files changed, 2083 insertions(+), 1425 deletions(-) create mode 100644 .gitlab/ci/dev-fixtures.gitlab-ci.yml create mode 100644 changelogs/unreleased/16610-gitlab-pages-storage-size-limitations-by-project-or-group-4.yml create mode 100644 changelogs/unreleased/19132-comment-anchor-twice-firefox.yml create mode 100644 changelogs/unreleased/19299-blame-previous-revision.yml create mode 100644 changelogs/unreleased/I-118638.yml create mode 100644 changelogs/unreleased/sh-add-pipeline-index.yml create mode 100644 changelogs/unreleased/update-prometheus-chart.yml create mode 100644 db/migrate/20191213120427_fix_max_pages_size.rb create mode 100644 db/post_migrate/20191218225624_add_index_on_project_id_to_ci_pipelines.rb delete mode 100644 doc/user/project/clusters/img/add_cluster.png create mode 100644 doc/user/project/repository/img/file_blame_previous_commit_v12_7.png create mode 100644 qa/qa/runtime/application_settings.rb create mode 100644 qa/qa/specs/features/browser_ui/7_configure/kubernetes/kubernetes_integration_spec.rb create mode 100644 qa/spec/runtime/application_settings_spec.rb create mode 100644 spec/frontend/monitoring/components/dashboard_spec.js create mode 100644 spec/frontend/monitoring/components/dashboard_time_url_spec.js create mode 100644 spec/frontend/monitoring/components/dashboard_time_window_spec.js create mode 100644 spec/frontend/monitoring/components/graph_group_spec.js create mode 100644 spec/frontend/monitoring/init_utils.js create mode 100644 spec/frontend/monitoring/shared/prometheus_header_spec.js create mode 100644 spec/javascripts/monitoring/components/dashboard_resize_spec.js delete mode 100644 spec/javascripts/monitoring/components/dashboard_spec.js delete mode 100644 spec/javascripts/monitoring/components/graph_group_spec.js delete mode 100644 spec/javascripts/monitoring/shared/prometheus_header_spec.js create mode 100644 spec/migrations/fix_max_pages_size_spec.rb create mode 100644 spec/support/shared_examples/pages_size_limit_shared_examples.rb diff --git a/.eslintrc.yml b/.eslintrc.yml index 94a8d017c28..07542c42891 100644 --- a/.eslintrc.yml +++ b/.eslintrc.yml @@ -45,7 +45,6 @@ rules: vue/no-use-v-if-with-v-for: off vue/no-v-html: off vue/use-v-on-exact: off - no-jquery/no-animate: off # all offenses of no-jquery/no-animate-toggle are false positives ( $toast.show() ) no-jquery/no-animate-toggle: off no-jquery/no-event-shorthand: off diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 388f3f4b3e3..f59e8759e6d 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -43,6 +43,7 @@ include: - local: .gitlab/ci/rails.gitlab-ci.yml - local: .gitlab/ci/review.gitlab-ci.yml - local: .gitlab/ci/setup.gitlab-ci.yml + - local: .gitlab/ci/dev-fixtures.gitlab-ci.yml - local: .gitlab/ci/test-metadata.gitlab-ci.yml - local: .gitlab/ci/yaml.gitlab-ci.yml - local: .gitlab/ci/releases.gitlab-ci.yml diff --git a/.gitlab/ci/dev-fixtures.gitlab-ci.yml b/.gitlab/ci/dev-fixtures.gitlab-ci.yml new file mode 100644 index 00000000000..a5dab5d8708 --- /dev/null +++ b/.gitlab/ci/dev-fixtures.gitlab-ci.yml @@ -0,0 +1,30 @@ +.run-dev-fixtures: + extends: + - .only-code-rails-job-base + - .use-pg9 + stage: test + needs: ["setup-test-env"] + dependencies: ["setup-test-env"] + variables: + FIXTURE_PATH: "db/fixtures/development" + SEED_CYCLE_ANALYTICS: "true" + SEED_PRODUCTIVITY_ANALYTICS: "true" + CYCLE_ANALYTICS_ISSUE_COUNT: 1 + SIZE: 0 # number of external projects to fork, requires network connection + # SEED_NESTED_GROUPS: "false" # requires network connection + +run-dev-fixtures-foss: + extends: .run-dev-fixtures + script: + - scripts/gitaly-test-spawn + - RAILS_ENV=test bundle exec rake db:seed_fu + +run-dev-fixtures-ee: + extends: + - .only-ee + - .use-pg9-ee + - .run-dev-fixtures + script: + - scripts/gitaly-test-spawn + - cp ee/db/fixtures/development/* $FIXTURE_PATH + - RAILS_ENV=test bundle exec rake db:seed_fu diff --git a/.rubocop.yml b/.rubocop.yml index 27dce2239d8..da3707972d3 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -299,3 +299,76 @@ Graphql/Descriptions: RSpec/AnyInstanceOf: Enabled: false + +# Cops for upgrade to gitlab-styles 3.1.0 +FactoryBot/FactoryClassName: + Enabled: false + +FactoryBot/CreateList: + Enabled: false + +Rails/SafeNavigationWithBlank: + Enabled: false + +Rails/ApplicationController: + Enabled: false + +Rails/ApplicationMailer: + Enabled: false + +Rails/RakeEnvironment: + Enabled: false + +Rails/HelperInstanceVariable: + Enabled: false + +Rails/EnumHash: + Enabled: false + +RSpec/ReceiveCounts: + Enabled: false + +RSpec/ContextMethod: + Enabled: false + +RSpec/ImplicitSubject: + Enabled: false + +RSpec/LeakyConstantDeclaration: + Enabled: false + +RSpec/EmptyLineAfterHook: + Enabled: false + +RSpec/HooksBeforeExamples: + Enabled: false + +RSpec/EmptyLineAfterExample: + Enabled: false + +RSpec/Be: + Enabled: false + +RSpec/DescribedClass: + Enabled: false + +RSpec/SharedExamples: + Enabled: false + +RSpec/EmptyLineAfterExampleGroup: + Enabled: false + +RSpec/ReceiveNever: + Enabled: false + +RSpec/MissingExampleGroupArgument: + Enabled: false + +RSpec/UnspecifiedException: + Enabled: false + +Style/MultilineWhenThen: + Enabled: false + +Style/FloatDivision: + Enabled: false \ No newline at end of file diff --git a/Gemfile b/Gemfile index 212a6860480..9949ae7d681 100644 --- a/Gemfile +++ b/Gemfile @@ -366,11 +366,11 @@ group :development, :test do gem 'spring', '~> 2.0.0' gem 'spring-commands-rspec', '~> 1.0.4' - gem 'gitlab-styles', '~> 2.7', require: false + gem 'gitlab-styles', '~> 3.1.0', require: false # Pin these dependencies, otherwise a new rule could break the CI pipelines - gem 'rubocop', '~> 0.69.0' - gem 'rubocop-performance', '~> 1.1.0' - gem 'rubocop-rspec', '~> 1.22.1' + gem 'rubocop', '~> 0.74.0' + gem 'rubocop-performance', '~> 1.4.1' + gem 'rubocop-rspec', '~> 1.37.0' gem 'scss_lint', '~> 0.56.0', require: false gem 'haml_lint', '~> 0.34.0', require: false diff --git a/Gemfile.lock b/Gemfile.lock index fb660e53765..0086f7004f5 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -379,11 +379,12 @@ GEM gitlab-puma (>= 2.7, < 5) gitlab-sidekiq-fetcher (0.5.2) sidekiq (~> 5) - gitlab-styles (2.8.0) - rubocop (~> 0.69.0) + gitlab-styles (3.1.0) + rubocop (~> 0.74.0) rubocop-gitlab-security (~> 0.1.0) - rubocop-performance (~> 1.1.0) - rubocop-rspec (~> 1.19) + rubocop-performance (~> 1.4.1) + rubocop-rails (~> 2.0) + rubocop-rspec (~> 1.36) gitlab_chronic_duration (0.10.6.2) numerizer (~> 0.2) gitlab_omniauth-ldap (2.1.1) @@ -519,7 +520,7 @@ GEM jaeger-client (0.10.0) opentracing (~> 0.3) thrift - jaro_winkler (1.5.3) + jaro_winkler (1.5.4) jira-ruby (1.7.1) activesupport atlassian-jwt @@ -726,8 +727,8 @@ GEM rubypants (~> 0.2) orm_adapter (0.5.0) os (1.0.0) - parallel (1.17.0) - parser (2.6.3.0) + parallel (1.19.1) + parser (2.6.5.0) ast (~> 2.4.0) parslet (1.8.2) peek (1.1.0) @@ -904,7 +905,7 @@ GEM pg rails sqlite3 - rubocop (0.69.0) + rubocop (0.74.0) jaro_winkler (~> 1.5.1) parallel (~> 1.10) parser (>= 2.6) @@ -913,10 +914,13 @@ GEM unicode-display_width (>= 1.4.0, < 1.7) rubocop-gitlab-security (0.1.1) rubocop (>= 0.51) - rubocop-performance (1.1.0) - rubocop (>= 0.67.0) - rubocop-rspec (1.22.2) - rubocop (>= 0.52.1) + rubocop-performance (1.4.1) + rubocop (>= 0.71.0) + rubocop-rails (2.4.0) + rack (>= 1.1) + rubocop (>= 0.72.0) + rubocop-rspec (1.37.0) + rubocop (>= 0.68.1) ruby-enum (0.7.2) i18n ruby-fogbugz (0.2.1) @@ -1207,7 +1211,7 @@ DEPENDENCIES gitlab-puma (~> 4.3.1.gitlab.2) gitlab-puma_worker_killer (~> 0.1.1.gitlab.1) gitlab-sidekiq-fetcher (= 0.5.2) - gitlab-styles (~> 2.7) + gitlab-styles (~> 3.1.0) gitlab_chronic_duration (~> 0.10.6.2) gitlab_omniauth-ldap (~> 2.1.1) gon (~> 6.2) @@ -1318,9 +1322,9 @@ DEPENDENCIES rspec-set (~> 0.1.3) rspec_junit_formatter rspec_profiling (~> 0.0.5) - rubocop (~> 0.69.0) - rubocop-performance (~> 1.1.0) - rubocop-rspec (~> 1.22.1) + rubocop (~> 0.74.0) + rubocop-performance (~> 1.4.1) + rubocop-rspec (~> 1.37.0) ruby-fogbugz (~> 0.2.1) ruby-prof (~> 1.0.0) ruby-progressbar diff --git a/app/assets/javascripts/awards_handler.js b/app/assets/javascripts/awards_handler.js index 2fc8b9efc1b..de10d5397df 100644 --- a/app/assets/javascripts/awards_handler.js +++ b/app/assets/javascripts/awards_handler.js @@ -506,6 +506,8 @@ export class AwardsHandler { const options = { scrollTop: $('.awards').offset().top - 110, }; + + // eslint-disable-next-line no-jquery/no-animate return $('body, html').animate(options, 200); } diff --git a/app/assets/javascripts/clusters/components/application_row.vue b/app/assets/javascripts/clusters/components/application_row.vue index ab1e5f92698..7db9898396b 100644 --- a/app/assets/javascripts/clusters/components/application_row.vue +++ b/app/assets/javascripts/clusters/components/application_row.vue @@ -290,6 +290,7 @@ export default { disabled && 'cluster-application-disabled', ]" class="cluster-application-row gl-responsive-table-row gl-responsive-table-row-col-span" + :data-qa-selector="id" >
@@ -381,12 +382,16 @@ export default { :disabled="disabled || installButtonDisabled" :label="installButtonLabel" class="js-cluster-application-install-button" + data-qa-selector="install_button" + :data-qa-application="id" @click="installClicked" /> { adjustment -= topPadding; } - window.scrollBy(0, adjustment); + setTimeout(() => { + window.scrollBy(0, adjustment); + }); }; // Check if element scrolled into viewport from above or below @@ -247,6 +249,7 @@ export const scrollToElement = element => { } const { top } = $el.offset(); + // eslint-disable-next-line no-jquery/no-animate return $('body, html').animate( { scrollTop: top - contentTop(), diff --git a/app/assets/javascripts/monitoring/components/shared/prometheus_header.vue b/app/assets/javascripts/monitoring/components/shared/prometheus_header.vue index 153c8f389db..ceeec51ee65 100644 --- a/app/assets/javascripts/monitoring/components/shared/prometheus_header.vue +++ b/app/assets/javascripts/monitoring/components/shared/prometheus_header.vue @@ -10,6 +10,6 @@ export default { diff --git a/app/assets/javascripts/pages/admin/admin.js b/app/assets/javascripts/pages/admin/admin.js index 4616a075729..88967d82b2f 100644 --- a/app/assets/javascripts/pages/admin/admin.js +++ b/app/assets/javascripts/pages/admin/admin.js @@ -36,6 +36,8 @@ export default function adminInit() { $('.log-bottom').on('click', e => { e.preventDefault(); const $visibleLog = $('.file-content:visible'); + + // eslint-disable-next-line no-jquery/no-animate $visibleLog.animate( { scrollTop: $visibleLog.find('ol').height(), diff --git a/app/assets/stylesheets/framework/files.scss b/app/assets/stylesheets/framework/files.scss index 8e0314bc6da..1a017f03ebb 100644 --- a/app/assets/stylesheets/framework/files.scss +++ b/app/assets/stylesheets/framework/files.scss @@ -207,6 +207,14 @@ border-left-color: mix($blame-gray, $blame-cyan, $i / 4 * 100%); } } + + .doc-versions { + color: $gray-600; + + &:hover { + color: $gray-900; + } + } } &.logs { diff --git a/app/assets/stylesheets/pages/boards.scss b/app/assets/stylesheets/pages/boards.scss index 90c2e369ccd..c4c1bb0bcc1 100644 --- a/app/assets/stylesheets/pages/boards.scss +++ b/app/assets/stylesheets/pages/boards.scss @@ -133,6 +133,7 @@ .issue-count-badge { border: 0; white-space: nowrap; + padding: 0; } .board-title-text > span, diff --git a/app/controllers/admin/system_info_controller.rb b/app/controllers/admin/system_info_controller.rb index 244fc2b31bb..657aa177ecf 100644 --- a/app/controllers/admin/system_info_controller.rb +++ b/app/controllers/admin/system_info_controller.rb @@ -1,10 +1,10 @@ # frozen_string_literal: true class Admin::SystemInfoController < Admin::ApplicationController - EXCLUDED_MOUNT_OPTIONS = [ - 'nobrowse', - 'read-only', - 'ro' + EXCLUDED_MOUNT_OPTIONS = %w[ + nobrowse + read-only + ro ].freeze EXCLUDED_MOUNT_TYPES = [ diff --git a/app/controllers/omniauth_callbacks_controller.rb b/app/controllers/omniauth_callbacks_controller.rb index 92f36c031f1..1f1c01c8fcc 100644 --- a/app/controllers/omniauth_callbacks_controller.rb +++ b/app/controllers/omniauth_callbacks_controller.rb @@ -31,7 +31,7 @@ class OmniauthCallbacksController < Devise::OmniauthCallbacksController # Extend the standard message generation to accept our custom exception def failure_message exception = request.env["omniauth.error"] - error = exception.error_reason if exception.respond_to?(:error_reason) + error = exception.error_reason if exception.respond_to?(:error_reason) error ||= exception.error if exception.respond_to?(:error) error ||= exception.message if exception.respond_to?(:message) error ||= request.env["omniauth.error.type"].to_s diff --git a/app/controllers/projects/pages_controller.rb b/app/controllers/projects/pages_controller.rb index f1e591ea1ec..18a171700e9 100644 --- a/app/controllers/projects/pages_controller.rb +++ b/app/controllers/projects/pages_controller.rb @@ -34,7 +34,7 @@ class Projects::PagesController < Projects::ApplicationController if result[:status] == :success flash[:notice] = 'Your changes have been saved' else - flash[:alert] = 'Something went wrong on our end' + flash[:alert] = result[:message] end redirect_to project_pages_path(@project) @@ -45,6 +45,12 @@ class Projects::PagesController < Projects::ApplicationController private def project_params - params.require(:project).permit(:pages_https_only) + params.require(:project).permit(project_params_attributes) + end + + def project_params_attributes + %i[pages_https_only] end end + +Projects::PagesController.prepend_if_ee('EE::Projects::PagesController') diff --git a/app/controllers/projects/starrers_controller.rb b/app/controllers/projects/starrers_controller.rb index 4efe956e973..d9654f4f72a 100644 --- a/app/controllers/projects/starrers_controller.rb +++ b/app/controllers/projects/starrers_controller.rb @@ -7,8 +7,8 @@ class Projects::StarrersController < Projects::ApplicationController @starrers = UsersStarProjectsFinder.new(@project, params, current_user: @current_user).execute @sort = params[:sort].presence || sort_value_name @starrers = @starrers.preload_users.sort_by_attribute(@sort).page(params[:page]) - @public_count = @project.starrers.with_public_profile.size - @total_count = @project.starrers.size + @public_count = @project.starrers.with_public_profile.size + @total_count = @project.starrers.size @private_count = @total_count - @public_count end diff --git a/app/graphql/types/ci/pipeline_type.rb b/app/graphql/types/ci/pipeline_type.rb index e786add6359..d77b2a2ba32 100644 --- a/app/graphql/types/ci/pipeline_type.rb +++ b/app/graphql/types/ci/pipeline_type.rb @@ -17,16 +17,16 @@ module Types field :sha, GraphQL::STRING_TYPE, null: false, description: "SHA of the pipeline's commit" field :before_sha, GraphQL::STRING_TYPE, null: true, - description: "Base SHA of the source branch" + description: 'Base SHA of the source branch' field :status, PipelineStatusEnum, null: false, description: "Status of the pipeline (#{::Ci::Pipeline.all_state_names.compact.join(', ').upcase})" field :detailed_status, Types::Ci::DetailedStatusType, null: false, description: 'Detailed status of the pipeline', resolve: -> (obj, _args, ctx) { obj.detailed_status(ctx[:current_user]) } field :duration, GraphQL::INT_TYPE, null: true, - description: "Duration of the pipeline in seconds" + description: 'Duration of the pipeline in seconds' field :coverage, GraphQL::FLOAT_TYPE, null: true, - description: "Coverage percentage" + description: 'Coverage percentage' field :created_at, Types::TimeType, null: false, description: "Timestamp of the pipeline's creation" field :updated_at, Types::TimeType, null: false, diff --git a/app/helpers/container_expiration_policies_helper.rb b/app/helpers/container_expiration_policies_helper.rb index 17791e7b0ff..5fb7b5afa6e 100644 --- a/app/helpers/container_expiration_policies_helper.rb +++ b/app/helpers/container_expiration_policies_helper.rb @@ -3,19 +3,25 @@ module ContainerExpirationPoliciesHelper def cadence_options ContainerExpirationPolicy.cadence_options.map do |key, val| - { key: key.to_s, label: val } + { key: key.to_s, label: val }.tap do |base| + base[:default] = true if key.to_s == '1d' + end end end def keep_n_options ContainerExpirationPolicy.keep_n_options.map do |key, val| - { key: key, label: val } + { key: key, label: val }.tap do |base| + base[:default] = true if key == 10 + end end end def older_than_options ContainerExpirationPolicy.older_than_options.map do |key, val| - { key: key.to_s, label: val } + { key: key.to_s, label: val }.tap do |base| + base[:default] = true if key.to_s == '30d' + end end end end diff --git a/app/helpers/dashboard_helper.rb b/app/helpers/dashboard_helper.rb index 99ede8c3557..b38feb0fb6c 100644 --- a/app/helpers/dashboard_helper.rb +++ b/app/helpers/dashboard_helper.rb @@ -35,7 +35,7 @@ module DashboardHelper tag.p(aria: { label: label }) do concat(link_or_title) - concat(tag.span(class: ['light', 'float-right']) do + concat(tag.span(class: %w[light float-right]) do boolean_to_icon(enabled) end) diff --git a/app/helpers/snippets_helper.rb b/app/helpers/snippets_helper.rb index 1c7690f30d2..fd7e58826b5 100644 --- a/app/helpers/snippets_helper.rb +++ b/app/helpers/snippets_helper.rb @@ -127,7 +127,7 @@ module SnippetsHelper return unless attrs = snippet_badge_attributes(snippet) css_class, text = attrs - tag.span(class: ['badge', 'badge-gray']) do + tag.span(class: %w[badge badge-gray]) do concat(tag.i(class: ['fa', css_class])) concat(' ') concat(text) diff --git a/app/models/application_setting.rb b/app/models/application_setting.rb index 456b6430088..3858adfc71f 100644 --- a/app/models/application_setting.rb +++ b/app/models/application_setting.rb @@ -121,6 +121,11 @@ class ApplicationSetting < ApplicationRecord presence: true, numericality: { only_integer: true, greater_than: 0 } + validates :max_pages_size, + presence: true, + numericality: { only_integer: true, greater_than: 0, + less_than: ::Gitlab::Pages::MAX_SIZE / 1.megabyte } + validates :default_artifacts_expire_in, presence: true, duration: true validates :container_registry_token_expire_delay, diff --git a/app/models/clusters/applications/prometheus.rb b/app/models/clusters/applications/prometheus.rb index 4ac33d4e3be..5716614b8ac 100644 --- a/app/models/clusters/applications/prometheus.rb +++ b/app/models/clusters/applications/prometheus.rb @@ -5,7 +5,7 @@ module Clusters class Prometheus < ApplicationRecord include PrometheusAdapter - VERSION = '6.7.3' + VERSION = '9.5.2' self.table_name = 'clusters_applications_prometheus' diff --git a/app/models/error_tracking/project_error_tracking_setting.rb b/app/models/error_tracking/project_error_tracking_setting.rb index 6a9986e806b..bbafcaed46e 100644 --- a/app/models/error_tracking/project_error_tracking_setting.rb +++ b/app/models/error_tracking/project_error_tracking_setting.rb @@ -122,6 +122,9 @@ module ErrorTracking { error: e.message, error_type: SENTRY_API_ERROR_INVALID_SIZE } rescue Sentry::Client::BadRequestError => e { error: e.message, error_type: SENTRY_API_ERROR_TYPE_BAD_REQUEST } + rescue StandardError => e + Gitlab::ErrorTracking.track_exception(e) + { error: 'Unexpected Error' } end # http://HOST/api/0/projects/ORG/PROJECT diff --git a/app/models/namespace.rb b/app/models/namespace.rb index d5a7c172fec..74774a22a37 100644 --- a/app/models/namespace.rb +++ b/app/models/namespace.rb @@ -46,6 +46,8 @@ class Namespace < ApplicationRecord length: { maximum: 255 }, namespace_path: true + validates :max_artifacts_size, numericality: { only_integer: true, greater_than: 0, allow_nil: true } + validate :nesting_level_allowed validates_associated :runners diff --git a/app/models/project.rb b/app/models/project.rb index 1a84827b5ec..9062377943f 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -375,6 +375,7 @@ class Project < ApplicationRecord inclusion: { in: ->(_object) { Gitlab.config.repositories.storages.keys } } validates :variables, variable_duplicates: { scope: :environment_scope } validates :bfg_object_map, file_size: { maximum: :max_attachment_size } + validates :max_artifacts_size, numericality: { only_integer: true, greater_than: 0, allow_nil: true } # Scopes scope :pending_delete, -> { where(pending_delete: true) } diff --git a/app/presenters/clusters/cluster_presenter.rb b/app/presenters/clusters/cluster_presenter.rb index 97771d84031..3ace27c72d5 100644 --- a/app/presenters/clusters/cluster_presenter.rb +++ b/app/presenters/clusters/cluster_presenter.rb @@ -10,11 +10,11 @@ module Clusters # We do not want to show the group path for clusters belonging to the # clusterable, only for the ancestor clusters. - def item_link(clusterable_presenter) + def item_link(clusterable_presenter, *html_options) if cluster.group_type? && clusterable != clusterable_presenter.subject contracted_group_name(cluster.group) + ' / ' + link_to_cluster else - link_to_cluster + link_to_cluster(*html_options) end end @@ -84,8 +84,8 @@ module Clusters sprite_icon('ellipsis_h', size: 12, css_class: 'vertical-align-middle') end - def link_to_cluster - link_to_if(can_read_cluster?, cluster.name, show_path) + def link_to_cluster(html_options: {}) + link_to_if(can_read_cluster?, cluster.name, show_path, html_options) end end end diff --git a/app/services/projects/update_pages_service.rb b/app/services/projects/update_pages_service.rb index e8a87fc4320..8b23f610ad1 100644 --- a/app/services/projects/update_pages_service.rb +++ b/app/services/projects/update_pages_service.rb @@ -6,7 +6,6 @@ module Projects FailedToExtractError = Class.new(StandardError) BLOCK_SIZE = 32.kilobytes - MAX_SIZE = 1.terabyte PUBLIC_DIR = 'public' # this has to be invalid group name, @@ -130,12 +129,16 @@ module Projects 1 + max_size / BLOCK_SIZE end + def max_size_from_settings + Gitlab::CurrentSettings.max_pages_size.megabytes + end + def max_size - max_pages_size = Gitlab::CurrentSettings.max_pages_size.megabytes + max_pages_size = max_size_from_settings - return MAX_SIZE if max_pages_size.zero? + return ::Gitlab::Pages::MAX_SIZE if max_pages_size.zero? - [max_pages_size, MAX_SIZE].min + max_pages_size end def tmp_path @@ -200,3 +203,5 @@ module Projects end end end + +Projects::UpdatePagesService.prepend_if_ee('EE::Projects::UpdatePagesService') diff --git a/app/views/clusters/clusters/_cluster.html.haml b/app/views/clusters/clusters/_cluster.html.haml index b89789e9915..04afc38a056 100644 --- a/app/views/clusters/clusters/_cluster.html.haml +++ b/app/views/clusters/clusters/_cluster.html.haml @@ -3,7 +3,7 @@ .table-section.section-60 .table-mobile-header{ role: "rowheader" }= s_("ClusterIntegration|Kubernetes cluster") .table-mobile-content - = cluster.item_link(clusterable) + = cluster.item_link(clusterable, html_options: { data: { qa_selector: 'cluster', qa_cluster_name: cluster.name } }) - unless cluster.enabled? %span.badge.badge-danger Connection disabled .table-section.section-25 diff --git a/app/views/clusters/clusters/aws/_new.html.haml b/app/views/clusters/clusters/aws/_new.html.haml index d89e6965dac..5bbdadf83f3 100644 --- a/app/views/clusters/clusters/aws/_new.html.haml +++ b/app/views/clusters/clusters/aws/_new.html.haml @@ -11,6 +11,6 @@ 'role-arn' => @aws_role.role_arn, 'instance-types' => @instance_types, 'kubernetes-integration-help-path' => help_page_path('user/project/clusters/index'), - 'account-and-external-ids-help-path' => help_page_path('user/project/clusters/add_remove_clusters.md', anchor: 'eks-cluster'), - 'create-role-arn-help-path' => help_page_path('user/project/clusters/add_remove_clusters.md', anchor: 'eks-cluster'), + 'account-and-external-ids-help-path' => help_page_path('user/project/clusters/add_remove_clusters.md', anchor: 'new-eks-cluster'), + 'create-role-arn-help-path' => help_page_path('user/project/clusters/add_remove_clusters.md', anchor: 'new-eks-cluster'), 'external-link-icon' => icon('external-link') } } diff --git a/app/views/projects/blame/show.html.haml b/app/views/projects/blame/show.html.haml index 30fe5622ebd..b17207c0da6 100644 --- a/app/views/projects/blame/show.html.haml +++ b/app/views/projects/blame/show.html.haml @@ -20,8 +20,14 @@ .commit-row-title %span.item-title.str-truncated-100 = link_to commit.title, project_commit_path(@project, commit.id), class: "cdark", title: commit.title - .float-right - = link_to commit.short_id, project_commit_path(@project, commit), class: "commit-sha" + %span + - previous_commit_id = commit.parent_id + - if previous_commit_id + = link_to project_blame_path(@project, tree_join(previous_commit_id, @path)), + title: _('View blame prior to this change'), + aria: { label: _('View blame prior to this change') }, + data: { toggle: 'tooltip', placement: 'right', container: 'body' } do + = sprite_icon('doc-versions', size: 16, css_class: 'doc-versions align-text-bottom')   .light = commit_author_link(commit, avatar: false) diff --git a/changelogs/unreleased/16610-gitlab-pages-storage-size-limitations-by-project-or-group-4.yml b/changelogs/unreleased/16610-gitlab-pages-storage-size-limitations-by-project-or-group-4.yml new file mode 100644 index 00000000000..039656ce20a --- /dev/null +++ b/changelogs/unreleased/16610-gitlab-pages-storage-size-limitations-by-project-or-group-4.yml @@ -0,0 +1,5 @@ +--- +title: Fix pages size limit setting in database if it is above the hard limit +merge_request: 20154 +author: +type: fixed diff --git a/changelogs/unreleased/19132-comment-anchor-twice-firefox.yml b/changelogs/unreleased/19132-comment-anchor-twice-firefox.yml new file mode 100644 index 00000000000..02a7e1007b3 --- /dev/null +++ b/changelogs/unreleased/19132-comment-anchor-twice-firefox.yml @@ -0,0 +1,5 @@ +--- +title: Fix bug when clicking on same note twice in Firefox +merge_request: 21699 +author: Jan Beckmann +type: fixed diff --git a/changelogs/unreleased/19299-blame-previous-revision.yml b/changelogs/unreleased/19299-blame-previous-revision.yml new file mode 100644 index 00000000000..2b99dfb76f8 --- /dev/null +++ b/changelogs/unreleased/19299-blame-previous-revision.yml @@ -0,0 +1,5 @@ +--- +title: Add previous revision link to blame +merge_request: 17088 +author: Hiroyuki Sato +type: added diff --git a/changelogs/unreleased/I-118638.yml b/changelogs/unreleased/I-118638.yml new file mode 100644 index 00000000000..6d8e0c1e17b --- /dev/null +++ b/changelogs/unreleased/I-118638.yml @@ -0,0 +1,5 @@ +--- +title: fix CSS when board issue is collapsed +merge_request: 21940 +author: allenlai18 +type: fixed diff --git a/changelogs/unreleased/sh-add-pipeline-index.yml b/changelogs/unreleased/sh-add-pipeline-index.yml new file mode 100644 index 00000000000..1d7b5edf29a --- /dev/null +++ b/changelogs/unreleased/sh-add-pipeline-index.yml @@ -0,0 +1,5 @@ +--- +title: Add index to optimize loading pipeline charts +merge_request: 22052 +author: +type: performance diff --git a/changelogs/unreleased/update-prometheus-chart.yml b/changelogs/unreleased/update-prometheus-chart.yml new file mode 100644 index 00000000000..afce595f70e --- /dev/null +++ b/changelogs/unreleased/update-prometheus-chart.yml @@ -0,0 +1,5 @@ +--- +title: Update prometheus chart version to 9.5.2 +merge_request: 21935 +author: +type: changed diff --git a/config/application.rb b/config/application.rb index cad5c8bbe76..4cb623ac1c5 100644 --- a/config/application.rb +++ b/config/application.rb @@ -234,7 +234,7 @@ module Gitlab credentials: true, headers: :any, methods: :any, - expose: ['Link', 'X-Total', 'X-Total-Pages', 'X-Per-Page', 'X-Page', 'X-Next-Page', 'X-Prev-Page'] + expose: %w[Link X-Total X-Total-Pages X-Per-Page X-Page X-Next-Page X-Prev-Page] end # Cross-origin requests must not have the session cookie available @@ -244,7 +244,7 @@ module Gitlab credentials: false, headers: :any, methods: :any, - expose: ['Link', 'X-Total', 'X-Total-Pages', 'X-Per-Page', 'X-Page', 'X-Next-Page', 'X-Prev-Page'] + expose: %w[Link X-Total X-Total-Pages X-Per-Page X-Page X-Next-Page X-Prev-Page] end end diff --git a/config/initializers/1_settings.rb b/config/initializers/1_settings.rb index 691e4339bf0..2283000dc89 100644 --- a/config/initializers/1_settings.rb +++ b/config/initializers/1_settings.rb @@ -162,8 +162,8 @@ Settings.gitlab['default_projects_limit'] ||= 100000 Settings.gitlab['default_branch_protection'] ||= 2 Settings.gitlab['default_can_create_group'] = true if Settings.gitlab['default_can_create_group'].nil? Settings.gitlab['default_theme'] = Gitlab::Themes::APPLICATION_DEFAULT if Settings.gitlab['default_theme'].nil? -Settings.gitlab['host'] ||= ENV['GITLAB_HOST'] || 'localhost' -Settings.gitlab['ssh_host'] ||= Settings.gitlab.host +Settings.gitlab['host'] ||= ENV['GITLAB_HOST'] || 'localhost' +Settings.gitlab['ssh_host'] ||= Settings.gitlab.host Settings.gitlab['https'] = false if Settings.gitlab['https'].nil? Settings.gitlab['port'] ||= ENV['GITLAB_PORT'] || (Settings.gitlab.https ? 443 : 80) Settings.gitlab['relative_url_root'] ||= ENV['RAILS_RELATIVE_URL_ROOT'] || '' @@ -176,10 +176,10 @@ Settings.gitlab['email_display_name'] ||= ENV['GITLAB_EMAIL_DISPLAY_NAME'] || 'G Settings.gitlab['email_reply_to'] ||= ENV['GITLAB_EMAIL_REPLY_TO'] || "noreply@#{Settings.gitlab.host}" Settings.gitlab['email_subject_suffix'] ||= ENV['GITLAB_EMAIL_SUBJECT_SUFFIX'] || "" Settings.gitlab['email_smime'] = SmimeSignatureSettings.parse(Settings.gitlab['email_smime']) -Settings.gitlab['base_url'] ||= Settings.__send__(:build_base_gitlab_url) -Settings.gitlab['url'] ||= Settings.__send__(:build_gitlab_url) -Settings.gitlab['user'] ||= 'git' -Settings.gitlab['user_home'] ||= begin +Settings.gitlab['base_url'] ||= Settings.__send__(:build_base_gitlab_url) +Settings.gitlab['url'] ||= Settings.__send__(:build_gitlab_url) +Settings.gitlab['user'] ||= 'git' +Settings.gitlab['user_home'] ||= begin Etc.getpwnam(Settings.gitlab['user']).dir rescue ArgumentError # no user configured '/home/' + Settings.gitlab['user'] @@ -257,13 +257,13 @@ Settings.artifacts['object_store'] = ObjectStoreSettings.parse(Settings.artifact # Registry # Settings['registry'] ||= Settingslogic.new({}) -Settings.registry['enabled'] ||= false -Settings.registry['host'] ||= "example.com" -Settings.registry['port'] ||= nil -Settings.registry['api_url'] ||= "http://localhost:5000/" -Settings.registry['key'] ||= nil -Settings.registry['issuer'] ||= nil -Settings.registry['host_port'] ||= [Settings.registry['host'], Settings.registry['port']].compact.join(':') +Settings.registry['enabled'] ||= false +Settings.registry['host'] ||= "example.com" +Settings.registry['port'] ||= nil +Settings.registry['api_url'] ||= "http://localhost:5000/" +Settings.registry['key'] ||= nil +Settings.registry['issuer'] ||= nil +Settings.registry['host_port'] ||= [Settings.registry['host'], Settings.registry['port']].compact.join(':') Settings.registry['path'] = Settings.absolute(Settings.registry['path'] || File.join(Settings.shared['path'], 'registry')) Settings.registry['notifications'] ||= [] @@ -284,13 +284,13 @@ Settings.pages['enabled'] = false if Settings.pages['enabled'].nil? Settings.pages['access_control'] = false if Settings.pages['access_control'].nil? Settings.pages['path'] = Settings.absolute(Settings.pages['path'] || File.join(Settings.shared['path'], "pages")) Settings.pages['https'] = false if Settings.pages['https'].nil? -Settings.pages['host'] ||= "example.com" -Settings.pages['port'] ||= Settings.pages.https ? 443 : 80 -Settings.pages['protocol'] ||= Settings.pages.https ? "https" : "http" -Settings.pages['url'] ||= Settings.__send__(:build_pages_url) -Settings.pages['external_http'] ||= false unless Settings.pages['external_http'].present? -Settings.pages['external_https'] ||= false unless Settings.pages['external_https'].present? -Settings.pages['artifacts_server'] ||= Settings.pages['enabled'] if Settings.pages['artifacts_server'].nil? +Settings.pages['host'] ||= "example.com" +Settings.pages['port'] ||= Settings.pages.https ? 443 : 80 +Settings.pages['protocol'] ||= Settings.pages.https ? "https" : "http" +Settings.pages['url'] ||= Settings.__send__(:build_pages_url) +Settings.pages['external_http'] ||= false unless Settings.pages['external_http'].present? +Settings.pages['external_https'] ||= false unless Settings.pages['external_https'].present? +Settings.pages['artifacts_server'] ||= Settings.pages['enabled'] if Settings.pages['artifacts_server'].nil? Settings.pages['secret_file'] ||= Rails.root.join('.gitlab_pages_secret') # @@ -590,7 +590,7 @@ end # Backup # Settings['backup'] ||= Settingslogic.new({}) -Settings.backup['keep_time'] ||= 0 +Settings.backup['keep_time'] ||= 0 Settings.backup['pg_schema'] = nil Settings.backup['path'] = Settings.absolute(Settings.backup['path'] || "tmp/backups/") Settings.backup['archive_permissions'] ||= 0600 diff --git a/config/routes/admin.rb b/config/routes/admin.rb index 9238eae3a8e..34660358234 100644 --- a/config/routes/admin.rb +++ b/config/routes/admin.rb @@ -45,7 +45,6 @@ namespace :admin do scope(path: 'groups/*id', controller: :groups, constraints: { id: Gitlab::PathRegex.full_namespace_route_regex, format: /(html|json|atom)/ }) do - scope(as: :group) do put :members_update get :edit, action: :edit @@ -90,7 +89,6 @@ namespace :admin do path: '/', constraints: { id: Gitlab::PathRegex.project_route_regex }, only: [:show, :destroy]) do - member do put :transfer post :repository_check diff --git a/config/routes/project.rb b/config/routes/project.rb index 9e40e891fd5..398041083ef 100644 --- a/config/routes/project.rb +++ b/config/routes/project.rb @@ -29,7 +29,6 @@ constraints(::Constraints::ProjectUrlConstrainer.new) do constraints: { project_id: Gitlab::PathRegex.project_route_regex }, module: :projects, as: :project) do - # Begin of the /-/ scope. # Use this scope for all new project routes. scope '-' do diff --git a/db/fixtures/development/10_merge_requests.rb b/db/fixtures/development/10_merge_requests.rb index 77650ebb1bc..9157045a7fd 100644 --- a/db/fixtures/development/10_merge_requests.rb +++ b/db/fixtures/development/10_merge_requests.rb @@ -47,7 +47,7 @@ Gitlab::Seeder.quiet do project = Project.find_by_full_path('gitlab-org/gitlab-test') - next if project.empty_repo? # We don't have repository on CI + next if !project || project.empty_repo? # We don't have repository on CI params = { source_branch: 'feature', diff --git a/db/fixtures/development/17_cycle_analytics.rb b/db/fixtures/development/17_cycle_analytics.rb index 2532b71ad26..3e017b810b6 100644 --- a/db/fixtures/development/17_cycle_analytics.rb +++ b/db/fixtures/development/17_cycle_analytics.rb @@ -5,7 +5,7 @@ class Gitlab::Seeder::CycleAnalytics def initialize(project, perf: false) @project = project @user = User.admins.first - @issue_count = perf ? 1000 : 5 + @issue_count = perf ? 1000 : ENV.fetch('CYCLE_ANALYTICS_ISSUE_COUNT', 5).to_i end def seed_metrics! diff --git a/db/migrate/20191213120427_fix_max_pages_size.rb b/db/migrate/20191213120427_fix_max_pages_size.rb new file mode 100644 index 00000000000..498ea91b773 --- /dev/null +++ b/db/migrate/20191213120427_fix_max_pages_size.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +class FixMaxPagesSize < ActiveRecord::Migration[5.2] + DOWNTIME = false + MAX_SIZE = 1.terabyte / 1.megabyte + + class ApplicationSetting < ActiveRecord::Base + self.table_name = 'application_settings' + self.inheritance_column = :_type_disabled + end + + def up + table = ApplicationSetting.arel_table + ApplicationSetting.where(table[:max_pages_size].gt(MAX_SIZE)).update_all(max_pages_size: MAX_SIZE) + end + + def down + # no-op + end +end diff --git a/db/post_migrate/20191218225624_add_index_on_project_id_to_ci_pipelines.rb b/db/post_migrate/20191218225624_add_index_on_project_id_to_ci_pipelines.rb new file mode 100644 index 00000000000..ab6c3b0616a --- /dev/null +++ b/db/post_migrate/20191218225624_add_index_on_project_id_to_ci_pipelines.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +class AddIndexOnProjectIdToCiPipelines < ActiveRecord::Migration[5.2] + include Gitlab::Database::MigrationHelpers + + DOWNTIME = false + INDEX_NAME = 'index_ci_pipelines_on_project_id_and_id_desc' + + disable_ddl_transaction! + + def up + add_concurrent_index :ci_pipelines, [:project_id, :id], name: INDEX_NAME, order: { id: :desc } + end + + def down + remove_concurrent_index :ci_pipelines, [:project_id, :id], name: INDEX_NAME, order: { id: :desc } + end +end diff --git a/db/schema.rb b/db/schema.rb index 91fbcd42f30..dee28ea4287 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -10,7 +10,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 2019_12_16_183532) do +ActiveRecord::Schema.define(version: 2019_12_18_225624) do # These are extensions that must be enabled in order to support this database enable_extension "pg_trgm" @@ -863,6 +863,7 @@ ActiveRecord::Schema.define(version: 2019_12_16_183532) do t.index ["external_pull_request_id"], name: "index_ci_pipelines_on_external_pull_request_id", where: "(external_pull_request_id IS NOT NULL)" t.index ["merge_request_id"], name: "index_ci_pipelines_on_merge_request_id", where: "(merge_request_id IS NOT NULL)" t.index ["pipeline_schedule_id"], name: "index_ci_pipelines_on_pipeline_schedule_id" + t.index ["project_id", "id"], name: "index_ci_pipelines_on_project_id_and_id_desc", order: { id: :desc } t.index ["project_id", "iid"], name: "index_ci_pipelines_on_project_id_and_iid", unique: true, where: "(iid IS NOT NULL)" t.index ["project_id", "ref", "id"], name: "index_ci_pipelines_on_project_idandrefandiddesc", order: { id: :desc } t.index ["project_id", "ref", "status", "id"], name: "index_ci_pipelines_on_project_id_and_ref_and_status_and_id" diff --git a/doc/administration/gitaly/index.md b/doc/administration/gitaly/index.md index 9218ffa4006..47ecfaec36c 100644 --- a/doc/administration/gitaly/index.md +++ b/doc/administration/gitaly/index.md @@ -47,10 +47,11 @@ But since 11.8 the indexer uses Gitaly for data access as well. NFS can still be leveraged for redudancy on block level of the Git data. But only has to be mounted on the Gitaly server. -Starting with GitLab 11.8, it is possible to use Elasticsearch in conjunction with +From GitLab v11.8 to v12.2, it is possible to use Elasticsearch in conjunction with a Gitaly setup that isn't utilising NFS. In order to use Elasticsearch in this -scenario, the [new repository indexer](../../integration/elasticsearch.md#elasticsearch-repository-indexer-beta) -needs to be enabled in your GitLab configuration. +scenario, the [new repository indexer](../../integration/elasticsearch.md#elasticsearch-repository-indexer) +needs to be enabled in your GitLab configuration. [Since GitLab v12.3](https://gitlab.com/gitlab-org/gitlab/issues/6481), +the new indexer becomes the default and no configuration is required. NOTE: **Note:** While Gitaly can be used as a replacement for NFS, it's not recommended to use EFS as it may impact GitLab's performance. Review the [relevant documentation](../high_availability/nfs.md#avoid-using-awss-elastic-file-system-efs) diff --git a/doc/administration/monitoring/performance/gitlab_configuration.md b/doc/administration/monitoring/performance/gitlab_configuration.md index 528e032417a..1bff170768a 100644 --- a/doc/administration/monitoring/performance/gitlab_configuration.md +++ b/doc/administration/monitoring/performance/gitlab_configuration.md @@ -32,7 +32,7 @@ have been performed. Read more on: -- [Introduction to GitLab Performance Monitoring](introduction.md) +- [Introduction to GitLab Performance Monitoring](index.md) - [InfluxDB Configuration](influxdb_configuration.md) - [InfluxDB Schema](influxdb_schema.md) - [Grafana Install/Configuration](grafana_configuration.md) diff --git a/doc/administration/monitoring/performance/grafana_configuration.md b/doc/administration/monitoring/performance/grafana_configuration.md index ccba0a55479..5f3882918a8 100644 --- a/doc/administration/monitoring/performance/grafana_configuration.md +++ b/doc/administration/monitoring/performance/grafana_configuration.md @@ -1,5 +1,9 @@ # Grafana Configuration +CAUTION: **InfluxDB is deprecated in favor of Prometheus:** +InfluxDB support is scheduled to be removed in GitLab 13.0. +You are advised to use [Prometheus](../prometheus/index.md) instead. + [Grafana](https://grafana.com/) is a tool that allows you to visualize time series metrics through graphs and dashboards. It supports several backend data stores, including InfluxDB. GitLab writes performance data to InfluxDB @@ -152,7 +156,7 @@ For more information and further mitigation details, please refer to our [blog p Read more on: -- [Introduction to GitLab Performance Monitoring](introduction.md) +- [Introduction to GitLab Performance Monitoring](index.md) - [GitLab Configuration](gitlab_configuration.md) - [InfluxDB Installation/Configuration](influxdb_configuration.md) - [InfluxDB Schema](influxdb_schema.md) diff --git a/doc/administration/monitoring/performance/influxdb_configuration.md b/doc/administration/monitoring/performance/influxdb_configuration.md index aaea0a5968d..49076d3f47d 100644 --- a/doc/administration/monitoring/performance/influxdb_configuration.md +++ b/doc/administration/monitoring/performance/influxdb_configuration.md @@ -1,7 +1,7 @@ # InfluxDB Configuration -CAUTION: **InfluxDB is being deprecated in favor of Prometheus:** -InfluxDB support is scheduled to be dropped in GitLab 13.0. +CAUTION: **InfluxDB is deprecated in favor of Prometheus:** +InfluxDB support is scheduled to be removed in GitLab 13.0. You are advised to use [Prometheus](../prometheus/index.md) instead. The default settings provided by [InfluxDB] are not sufficient for a high traffic @@ -182,7 +182,7 @@ That's it! Now your GitLab instance should send data to InfluxDB. Read more on: -- [Introduction to GitLab Performance Monitoring](introduction.md) +- [Introduction to GitLab Performance Monitoring](index.md) - [GitLab Configuration](gitlab_configuration.md) - [InfluxDB Schema](influxdb_schema.md) - [Grafana Install/Configuration](grafana_configuration.md) diff --git a/doc/administration/monitoring/performance/influxdb_schema.md b/doc/administration/monitoring/performance/influxdb_schema.md index 71814deb2bc..34d35492ccf 100644 --- a/doc/administration/monitoring/performance/influxdb_schema.md +++ b/doc/administration/monitoring/performance/influxdb_schema.md @@ -95,7 +95,7 @@ Depending on the event type additional tags may be available as well. Read more on: -- [Introduction to GitLab Performance Monitoring](introduction.md) +- [Introduction to GitLab Performance Monitoring](index.md) - [GitLab Configuration](gitlab_configuration.md) - [InfluxDB Configuration](influxdb_configuration.md) - [Grafana Install/Configuration](grafana_configuration.md) diff --git a/doc/administration/troubleshooting/elasticsearch.md b/doc/administration/troubleshooting/elasticsearch.md index 5846514c574..560c6b2f53a 100644 --- a/doc/administration/troubleshooting/elasticsearch.md +++ b/doc/administration/troubleshooting/elasticsearch.md @@ -106,7 +106,7 @@ graph TD; D2 --> |Yes| D4 D4 --> |No| D5 D4 --> |Yes| D6 - D{Is the error concerning
the beta indexer?} + D{Is the error concerning
the Go indexer?} D1[It would be best
to speak with an
Elasticsearch admin.] D2{Is the ICU development
package installed?} D3>This package is required.
Install the package
and retry.] @@ -245,12 +245,13 @@ much to "integrate" here. If the issue is: -- Not concerning the beta indexer, it is almost always an +- With the Go indexer, check if the ICU development package is installed. + This is a required package so make sure you install it. + Go indexer was a beta indexer which can be optionally turned on/off, but in 12.3 it reached stable status and is now the default. +- Not concerning the Go indexer, it is almost always an Elasticsearch-side issue. This means you should reach out to your Elasticsearch admin regarding the error(s) you are seeing. If you are unsure here, it never hurts to reach out to GitLab support. -- With the beta indexer, check if the ICU development package is installed. - This is a required package so make sure you install it. Beyond that, you will want to review the error. If it is: diff --git a/doc/api/graphql/reference/gitlab_schema.graphql b/doc/api/graphql/reference/gitlab_schema.graphql index bc3395920ab..1e25e977286 100644 --- a/doc/api/graphql/reference/gitlab_schema.graphql +++ b/doc/api/graphql/reference/gitlab_schema.graphql @@ -503,6 +503,9 @@ type CreateSnippetPayload { } type Design implements Noteable { + """ + Diff refs of the design + """ diffRefs: DiffRefs! """ @@ -531,13 +534,34 @@ type Design implements Noteable { ): DiscussionConnection! """ - The change that happened to the design at this version + Type of change made to the design at the version specified by the `atVersion` + argument if supplied. Defaults to the latest version """ event: DesignVersionEvent! + + """ + Filename of the design file + """ filename: String! + + """ + Full path of the design file + """ fullPath: String! + + """ + ID of the design + """ id: ID! + + """ + Image of the design + """ image: String! + + """ + Issue associated with the design + """ issue: Issue! """ @@ -566,13 +590,17 @@ type Design implements Noteable { ): NoteConnection! """ - The total count of user-created notes for this design + Total count of user-created notes for the design """ notesCount: Int! + + """ + Project associated with the design + """ project: Project! """ - All versions related to this design ordered newest first + All versions related to the design, ordered newest first """ versions( """ @@ -599,7 +627,7 @@ type Design implements Noteable { type DesignCollection { """ - All designs for this collection + All designs for the design collection """ designs( """ @@ -638,11 +666,19 @@ type DesignCollection { """ last: Int ): DesignConnection! + + """ + Issue associated with the design collection + """ issue: Issue! + + """ + Project associated with the design collection + """ project: Project! """ - All versions related to all designs ordered newest first + All versions related to all designs, ordered newest first """ versions( """ @@ -799,7 +835,7 @@ type DesignManagementUploadPayload { type DesignVersion { """ - All designs that were changed in this version + All designs that were changed in the version """ designs( """ @@ -822,7 +858,15 @@ type DesignVersion { """ last: Int ): DesignConnection! + + """ + ID of the design version + """ id: ID! + + """ + SHA of the design version + """ sha: ID! } diff --git a/doc/api/graphql/reference/gitlab_schema.json b/doc/api/graphql/reference/gitlab_schema.json index 3c30d2482e8..e71fd3fc71b 100644 --- a/doc/api/graphql/reference/gitlab_schema.json +++ b/doc/api/graphql/reference/gitlab_schema.json @@ -9206,7 +9206,7 @@ "fields": [ { "name": "designs", - "description": "All designs for this collection", + "description": "All designs for the design collection", "args": [ { "name": "ids", @@ -9309,7 +9309,7 @@ }, { "name": "issue", - "description": null, + "description": "Issue associated with the design collection", "args": [ ], @@ -9327,7 +9327,7 @@ }, { "name": "project", - "description": null, + "description": "Project associated with the design collection", "args": [ ], @@ -9345,7 +9345,7 @@ }, { "name": "versions", - "description": "All versions related to all designs ordered newest first", + "description": "All versions related to all designs, ordered newest first", "args": [ { "name": "after", @@ -10322,7 +10322,7 @@ "fields": [ { "name": "diffRefs", - "description": null, + "description": "Diff refs of the design", "args": [ ], @@ -10397,7 +10397,7 @@ }, { "name": "event", - "description": "The change that happened to the design at this version", + "description": "Type of change made to the design at the version specified by the `atVersion` argument if supplied. Defaults to the latest version", "args": [ ], @@ -10415,7 +10415,7 @@ }, { "name": "filename", - "description": null, + "description": "Filename of the design file", "args": [ ], @@ -10433,7 +10433,7 @@ }, { "name": "fullPath", - "description": null, + "description": "Full path of the design file", "args": [ ], @@ -10451,7 +10451,7 @@ }, { "name": "id", - "description": null, + "description": "ID of the design", "args": [ ], @@ -10469,7 +10469,7 @@ }, { "name": "image", - "description": null, + "description": "Image of the design", "args": [ ], @@ -10487,7 +10487,7 @@ }, { "name": "issue", - "description": null, + "description": "Issue associated with the design", "args": [ ], @@ -10562,7 +10562,7 @@ }, { "name": "notesCount", - "description": "The total count of user-created notes for this design", + "description": "Total count of user-created notes for the design", "args": [ ], @@ -10580,7 +10580,7 @@ }, { "name": "project", - "description": null, + "description": "Project associated with the design", "args": [ ], @@ -10598,7 +10598,7 @@ }, { "name": "versions", - "description": "All versions related to this design ordered newest first", + "description": "All versions related to the design, ordered newest first", "args": [ { "name": "after", @@ -10819,7 +10819,7 @@ "fields": [ { "name": "designs", - "description": "All designs that were changed in this version", + "description": "All designs that were changed in the version", "args": [ { "name": "after", @@ -10876,7 +10876,7 @@ }, { "name": "id", - "description": null, + "description": "ID of the design version", "args": [ ], @@ -10894,7 +10894,7 @@ }, { "name": "sha", - "description": null, + "description": "SHA of the design version", "args": [ ], diff --git a/doc/api/graphql/reference/index.md b/doc/api/graphql/reference/index.md index 1669e3d604c..f142cee8544 100644 --- a/doc/api/graphql/reference/index.md +++ b/doc/api/graphql/reference/index.md @@ -104,22 +104,22 @@ The API can be explored interactively using the [GraphiQL IDE](../index.md#graph | Name | Type | Description | | --- | ---- | ---------- | -| `id` | ID! | | -| `project` | Project! | | -| `issue` | Issue! | | -| `notesCount` | Int! | The total count of user-created notes for this design | -| `filename` | String! | | -| `fullPath` | String! | | -| `event` | DesignVersionEvent! | The change that happened to the design at this version | -| `image` | String! | | -| `diffRefs` | DiffRefs! | | +| `id` | ID! | ID of the design | +| `project` | Project! | Project associated with the design | +| `issue` | Issue! | Issue associated with the design | +| `notesCount` | Int! | Total count of user-created notes for the design | +| `filename` | String! | Filename of the design file | +| `fullPath` | String! | Full path of the design file | +| `event` | DesignVersionEvent! | Type of change made to the design at the version specified by the `atVersion` argument if supplied. Defaults to the latest version | +| `image` | String! | Image of the design | +| `diffRefs` | DiffRefs! | Diff refs of the design | ### DesignCollection | Name | Type | Description | | --- | ---- | ---------- | -| `project` | Project! | | -| `issue` | Issue! | | +| `project` | Project! | Project associated with the design collection | +| `issue` | Issue! | Issue associated with the design collection | ### DesignManagementDeletePayload @@ -142,8 +142,8 @@ The API can be explored interactively using the [GraphiQL IDE](../index.md#graph | Name | Type | Description | | --- | ---- | ---------- | -| `id` | ID! | | -| `sha` | ID! | | +| `id` | ID! | ID of the design version | +| `sha` | ID! | SHA of the design version | ### DestroyNotePayload diff --git a/doc/api/project_level_variables.md b/doc/api/project_level_variables.md index 591911bb8ec..d4bda992f7c 100644 --- a/doc/api/project_level_variables.md +++ b/doc/api/project_level_variables.md @@ -86,7 +86,6 @@ curl --request POST --header "PRIVATE-TOKEN: " "https://gitla "value": "new value", "protected": false, "variable_type": "env_var", - "protected": false, "masked": false, "environment_scope": "*" } diff --git a/doc/development/elasticsearch.md b/doc/development/elasticsearch.md index 1375bd6d56d..bd8a4e1c6d7 100644 --- a/doc/development/elasticsearch.md +++ b/doc/development/elasticsearch.md @@ -37,20 +37,6 @@ brew install elasticsearch@5.6 There is no need to install any plugins -## New repo indexer (beta) - -If you're interested on working with the new beta repo indexer, all you need to do is: - -```sh -git clone git@gitlab.com:gitlab-org/gitlab-elasticsearch-indexer.git -make -make install -``` - -this adds `gitlab-elasticsearch-indexer` to `$GOPATH/bin`, please make sure that is in your `$PATH`. After that GitLab will find it and you'll be able to enable it in the admin settings area. - -**note:** `make` will not recompile the executable unless you do `make clean` beforehand - ## Helpful rake tasks - `gitlab:elastic:test:index_size`: Tells you how much space the current index is using, as well as how many documents are in the index. diff --git a/doc/gitlab-basics/start-using-git.md b/doc/gitlab-basics/start-using-git.md index 097794d39a7..7fa84bf45bd 100644 --- a/doc/gitlab-basics/start-using-git.md +++ b/doc/gitlab-basics/start-using-git.md @@ -313,7 +313,7 @@ git merge master ### Synchronize changes in a forked repository with the upstream -[Forking a repository](../user/project/repository/forking_workflow.md lets you create +[Forking a repository](../user/project/repository/forking_workflow.md) lets you create a copy of a repository in your namespace. Changes made to your copy of the repository are not synchronized automatically with the original. Your local fork (copy) contains changes made by you only, so to keep the project diff --git a/doc/integration/elasticsearch.md b/doc/integration/elasticsearch.md index 62b3de72a3a..7d07e8f6944 100644 --- a/doc/integration/elasticsearch.md +++ b/doc/integration/elasticsearch.md @@ -40,14 +40,13 @@ Once the data is added to the database or repository and [Elasticsearch is enabled in the admin area](#enabling-elasticsearch) the search index will be updated automatically. -## Elasticsearch repository indexer (beta) +## Elasticsearch repository indexer -In order to improve Elasticsearch indexing performance, GitLab has made available a [new indexer written in Go](https://gitlab.com/gitlab-org/gitlab-elasticsearch-indexer). -This will replace the included Ruby indexer in the future but should be considered beta software for now, so there may be some bugs. +For indexing Git repository data, GitLab uses an [indexer written in Go](https://gitlab.com/gitlab-org/gitlab-elasticsearch-indexer). -The Elasticsearch Go indexer is included in Omnibus for GitLab 11.8 and newer. - -To use the new Elasticsearch indexer included in Omnibus, check the box "Use the new repository indexer (beta)" when [enabling the Elasticsearch integration](#enabling-elasticsearch). +The Go indexer was included in Omnibus GitLab 11.8 as an optional replacement to a +Ruby-based indexer. [Since GitLab v12.3](https://gitlab.com/gitlab-org/gitlab/issues/6481), +all indexing is done by the Go indexer, and the Ruby indexer is removed. If you would like to use the Elasticsearch Go indexer with a source installation or an older version of GitLab, please follow the instructions below. @@ -139,7 +138,6 @@ The following Elasticsearch settings are available: | Parameter | Description | | ----------------------------------------------------- | ----------- | | `Elasticsearch indexing` | Enables/disables Elasticsearch indexing. You may want to enable indexing but disable search in order to give the index time to be fully completed, for example. Also, keep in mind that this option doesn't have any impact on existing data, this only enables/disables background indexer which tracks data changes. So by enabling this you will not get your existing data indexed, use special rake task for that as explained in [Adding GitLab's data to the Elasticsearch index](#adding-gitlabs-data-to-the-elasticsearch-index). | -| `Use the new repository indexer (beta)` | Perform repository indexing using [GitLab Elasticsearch Indexer](https://gitlab.com/gitlab-org/gitlab-elasticsearch-indexer). | | `Search with Elasticsearch enabled` | Enables/disables using Elasticsearch in search. | | `URL` | The URL to use for connecting to Elasticsearch. Use a comma-separated list to support clustering (e.g., `http://host1, https://host2:9200`). If your Elasticsearch instance is password protected, pass the `username:password` in the URL (e.g., `http://:@:9200/`). | | `Number of Elasticsearch shards` | Elasticsearch indexes are split into multiple shards for performance reasons. In general, larger indexes need to have more shards. Changes to this value do not take effect until the index is recreated. You can read more about tradeoffs in the [Elasticsearch documentation](https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-create-index.html#create-index-settings) | diff --git a/doc/update/patch_versions.md b/doc/update/patch_versions.md index b00fc5d90cf..5aa97d82fd1 100644 --- a/doc/update/patch_versions.md +++ b/doc/update/patch_versions.md @@ -94,11 +94,9 @@ sudo -u git -H git checkout v$( [Introduced](https://gitlab.com/gitlab-org/gitlab-foss/merge_requests/22011) in GitLab 11.5. -> Became [optional](https://gitlab.com/gitlab-org/gitlab-foss/merge_requests/26565) in GitLab 11.11. +> - [Introduced](https://gitlab.com/gitlab-org/gitlab-foss/merge_requests/22011) in GitLab 11.5. +> - Became [optional](https://gitlab.com/gitlab-org/gitlab-foss/merge_requests/26565) in GitLab 11.11. You can choose to allow GitLab to manage your cluster for you. If your cluster is managed by GitLab, resources for your projects will be automatically created. See the @@ -170,6 +170,11 @@ For important information about securely configuring GitLab Runners, see Runners](../../project/clusters/add_remove_clusters.md#security-of-gitlab-runners) documentation for project-level clusters. +## More information + +For information on integrating GitLab and Kubernetes, see +[Kubernetes clusters](../../project/clusters/index.md). +