From 9c6578ed4e0bc92cd838ef96d978df54403e9609 Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Wed, 21 Apr 2021 15:09:35 +0000 Subject: [PATCH] Add latest changes from gitlab-org/gitlab@master --- .gitignore | 1 + .solargraph.yml.example | 16 + Gemfile | 1 + Gemfile.lock | 20 + .../pages/projects/snippets/show/index.js | 8 + .../components/graph/graph_component.vue | 13 +- .../graph/graph_component_wrapper.vue | 7 + .../components/graph/graph_view_selector.vue | 135 +++-- .../graph/linked_pipelines_column.vue | 5 + .../components/graph_shared/links_layer.vue | 48 +- .../projects/snippets_controller.rb | 4 + .../mutations/boards/lists/base_update.rb | 40 ++ app/graphql/mutations/boards/lists/update.rb | 22 +- app/helpers/application_settings_helper.rb | 6 + app/helpers/snippets_helper.rb | 6 + app/models/application_setting.rb | 16 + .../application_setting_implementation.rb | 6 + .../project_services/confluence_service.rb | 10 +- app/models/wiki.rb | 11 +- .../application_settings/_abuse.html.haml | 6 +- .../_package_registry_limits.html.haml | 37 ++ .../application_settings/network.html.haml | 11 + .../admin/requests_profiles/index.html.haml | 6 +- app/views/projects/snippets/show.html.haml | 2 +- .../shared/milestones/_sidebar.html.haml | 4 +- .../cleanup_container_repository_worker.rb | 171 ++++-- ...26-fj-enable-new-wiki-destroy-page-RPC.yml | 5 + ...xternalize-strings-in-_abuse-html-haml.yml | 5 + ...s-in-requests_profiles-index-html-haml.yml | 5 + .../ci_job_token_delete_registry_images.yml | 5 + .../debian_architectures_unneeded_index.yml | 5 + .../feat-package_registry_rate_limit.yml | 5 + .../unreleased/gl-badge-milestone-sidebar.yml | 5 + .../ui-text-confluence-integration.yml | 5 + .../development/ci_job_token_scope.yml | 8 + .../gitaly_replace_wiki_delete_page.yml | 8 - .../pipeline_graph_layers_view.yml | 4 +- ...4_add_throttle_package_registry_columns.rb | 14 + ...oup_architectures_distribution_id_index.rb | 19 + ...ect_architectures_distribution_id_index.rb | 19 + db/schema_migrations/20210317123054 | 1 + db/schema_migrations/20210419090412 | 1 + db/schema_migrations/20210419090542 | 1 + db/structure.sql | 10 +- doc/administration/instance_limits.md | 9 + doc/administration/packages/index.md | 6 + doc/api/README.md | 1 + doc/api/container_registry.md | 22 +- doc/api/graphql/reference/index.md | 10 + doc/development/contributing/style_guides.md | 3 + doc/development/developing_with_solargraph.md | 28 + doc/security/rate_limits.md | 1 + doc/user/admin_area/settings/index.md | 1 + .../settings/package_registry_rate_limits.md | 33 ++ .../settings/user_and_ip_rate_limits.md | 2 + doc/user/clusters/agent/index.md | 2 +- lib/api/debian_group_packages.rb | 2 +- lib/api/helpers.rb | 10 + lib/api/project_container_repositories.rb | 1 + lib/gitlab/git/wiki.rb | 10 - lib/gitlab/gitaly_client/wiki_service.rb | 10 - lib/gitlab/metrics/subscribers/rack_attack.rb | 3 +- lib/gitlab/rack_attack.rb | 38 +- lib/gitlab/rack_attack/request.rb | 55 ++ lib/gitlab/regex.rb | 2 + lib/gitlab/throttle.rb | 14 + lib/gitlab/usage_data.rb | 14 +- lib/gitlab/usage_data_non_sql_metrics.rb | 11 +- lib/gitlab/usage_data_queries.rb | 36 +- lib/gitlab/utils/usage_data.rb | 48 +- locale/gitlab.pot | 57 +- .../pipelines/graph/graph_component_spec.js | 1 + .../graph/graph_component_wrapper_spec.js | 56 +- .../graph/graph_view_selector_spec.js | 124 ++++ .../graph/linked_pipelines_column_spec.js | 1 + .../graph_shared/links_layer_spec.js | 88 +-- .../vue_shared/components/commit_spec.js | 30 +- .../filtered_search_bar/mock_data.js | 2 +- .../tokens/branch_token_spec.js | 2 +- .../mutations/boards/lists/update_spec.rb | 56 +- spec/lib/api/helpers_spec.rb | 98 ++++ spec/lib/gitlab/git/wiki_spec.rb | 16 - spec/lib/gitlab/regex_spec.rb | 130 +++++ spec/lib/gitlab/usage_data_queries_spec.rb | 8 + spec/models/application_setting_spec.rb | 4 + .../api/debian_group_packages_spec.rb | 20 +- .../mutations/boards/lists/update_spec.rb | 40 +- .../project_container_repositories_spec.rb | 529 +++++++++++------- spec/requests/rack_attack_global_spec.rb | 186 +++++- .../update_service_spec.rb | 26 + spec/services/git/wiki_push_service_spec.rb | 8 +- .../boards/update_list_shared_examples.rb | 48 ++ .../models/wiki_shared_examples.rb | 50 +- .../boards/update_list_shared_examples.rb | 43 ++ .../requests/rack_attack_shared_examples.rb | 5 +- ...leanup_container_repository_worker_spec.rb | 217 +++---- ...container_expiration_policy_worker_spec.rb | 12 +- 97 files changed, 2121 insertions(+), 845 deletions(-) create mode 100644 .solargraph.yml.example create mode 100644 app/graphql/mutations/boards/lists/base_update.rb create mode 100644 app/views/admin/application_settings/_package_registry_limits.html.haml create mode 100644 changelogs/unreleased/325526-fj-enable-new-wiki-destroy-page-RPC.yml create mode 100644 changelogs/unreleased/Externalize-strings-in-_abuse-html-haml.yml create mode 100644 changelogs/unreleased/Externalize-strings-in-requests_profiles-index-html-haml.yml create mode 100644 changelogs/unreleased/ci_job_token_delete_registry_images.yml create mode 100644 changelogs/unreleased/debian_architectures_unneeded_index.yml create mode 100644 changelogs/unreleased/feat-package_registry_rate_limit.yml create mode 100644 changelogs/unreleased/gl-badge-milestone-sidebar.yml create mode 100644 changelogs/unreleased/ui-text-confluence-integration.yml create mode 100644 config/feature_flags/development/ci_job_token_scope.yml delete mode 100644 config/feature_flags/development/gitaly_replace_wiki_delete_page.yml create mode 100644 db/migrate/20210317123054_add_throttle_package_registry_columns.rb create mode 100644 db/migrate/20210419090412_remove_debian_group_architectures_distribution_id_index.rb create mode 100644 db/migrate/20210419090542_remove_debian_project_architectures_distribution_id_index.rb create mode 100644 db/schema_migrations/20210317123054 create mode 100644 db/schema_migrations/20210419090412 create mode 100644 db/schema_migrations/20210419090542 create mode 100644 doc/development/developing_with_solargraph.md create mode 100644 doc/user/admin_area/settings/package_registry_rate_limits.md create mode 100644 spec/frontend/pipelines/graph/graph_view_selector_spec.js create mode 100644 spec/support/shared_examples/graphql/mutations/boards/update_list_shared_examples.rb create mode 100644 spec/support/shared_examples/requests/api/graphql/mutations/boards/update_list_shared_examples.rb diff --git a/.gitignore b/.gitignore index 388718898e4..9d9730bf406 100644 --- a/.gitignore +++ b/.gitignore @@ -105,3 +105,4 @@ ee/changelogs/unreleased-ee tags.lock tags.temp .stylelintcache +.solargraph.yml diff --git a/.solargraph.yml.example b/.solargraph.yml.example new file mode 100644 index 00000000000..ff8225eb73c --- /dev/null +++ b/.solargraph.yml.example @@ -0,0 +1,16 @@ +--- +include: +- "**/*.rb" +exclude: +- "**/spec/**/*" +- qa/qa/specs/features/**/* +- vendor/**/* +- ".bundle/**/*" +require: [] +domains: [] +reporters: +- rubocop +- require_not_found +require_paths: [] +plugins: [] +max_files: 15000 diff --git a/Gemfile b/Gemfile index 556b40317a7..bca5b1607b6 100644 --- a/Gemfile +++ b/Gemfile @@ -346,6 +346,7 @@ end group :development do gem 'lefthook', '~> 0.7.0', require: false + gem 'solargraph', '~> 0.40.4', require: false gem 'letter_opener_web', '~> 1.4.0' diff --git a/Gemfile.lock b/Gemfile.lock index 358d58cf566..4fac86a77e5 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -133,10 +133,12 @@ GEM net-http-persistent (~> 4.0) nokogiri (~> 1.11.0.rc2) babosa (1.0.2) + backport (1.1.2) base32 (0.3.2) batch-loader (2.0.1) bcrypt (3.1.16) bcrypt_pbkdf (1.0.0) + benchmark (0.1.1) benchmark-ips (2.3.0) benchmark-memory (0.1.2) memory_profiler (~> 0.9) @@ -306,6 +308,7 @@ GEM dry-equalizer (~> 0.3) dry-inflector (~> 0.1, >= 0.1.2) dry-logic (~> 1.0, >= 1.0.2) + e2mmap (0.1.0) ecma-re-validator (0.2.1) regexp_parser (~> 1.2) ed25519 (1.2.4) @@ -633,6 +636,7 @@ GEM jaeger-client (1.1.0) opentracing (~> 0.3) thrift + jaro_winkler (1.5.4) jira-ruby (2.1.4) activesupport atlassian-jwt @@ -1194,6 +1198,20 @@ GEM slop (3.6.0) snowplow-tracker (0.6.1) contracts (~> 0.7, <= 0.11) + solargraph (0.40.4) + backport (~> 1.1) + benchmark + bundler (>= 1.17.2) + e2mmap + jaro_winkler (~> 1.5) + kramdown (~> 2.3) + kramdown-parser-gfm (~> 1.1) + parser (~> 3.0) + reverse_markdown (>= 1.0.5, < 3) + rubocop (>= 0.52) + thor (~> 1.0) + tilt (~> 2.0) + yard (~> 0.9, >= 0.9.24) spring (2.1.1) spring-commands-rspec (1.0.4) spring (>= 0.9.1) @@ -1334,6 +1352,7 @@ GEM xpath (3.2.0) nokogiri (~> 1.8) yajl-ruby (1.4.1) + yard (0.9.26) zeitwerk (2.4.2) PLATFORMS @@ -1587,6 +1606,7 @@ DEPENDENCIES simplecov-cobertura (~> 1.3.1) slack-messenger (~> 2.3.4) snowplow-tracker (~> 0.6.1) + solargraph (~> 0.40.4) spring (~> 2.1.0) spring-commands-rspec (~> 1.0.4) sprockets (~> 3.7.0) diff --git a/app/assets/javascripts/pages/projects/snippets/show/index.js b/app/assets/javascripts/pages/projects/snippets/show/index.js index f955a41e18a..c719601ee0b 100644 --- a/app/assets/javascripts/pages/projects/snippets/show/index.js +++ b/app/assets/javascripts/pages/projects/snippets/show/index.js @@ -1 +1,9 @@ import '~/snippet/snippet_show'; + +const awardEmojiEl = document.getElementById('js-vue-awards-block'); + +if (awardEmojiEl) { + import('~/emoji/awards_app') + .then((m) => m.default(awardEmojiEl)) + .catch(() => {}); +} diff --git a/app/assets/javascripts/pipelines/components/graph/graph_component.vue b/app/assets/javascripts/pipelines/components/graph/graph_component.vue index 63048777724..47505093140 100644 --- a/app/assets/javascripts/pipelines/components/graph/graph_component.vue +++ b/app/assets/javascripts/pipelines/components/graph/graph_component.vue @@ -25,6 +25,10 @@ export default { type: Object, required: true, }, + showLinks: { + type: Boolean, + required: true, + }, viewType: { type: String, required: true, @@ -91,8 +95,8 @@ export default { collectMetrics: true, }; }, - shouldHideLinks() { - return this.isStageView; + showJobLinks() { + return !this.isStageView && this.showLinks; }, shouldShowStageName() { return !this.isStageView; @@ -188,6 +192,7 @@ export default { :config-paths="configPaths" :linked-pipelines="upstreamPipelines" :column-title="__('Upstream')" + :show-links="showJobLinks" :type="$options.pipelineTypeConstants.UPSTREAM" :view-type="viewType" @error="onError" @@ -202,9 +207,8 @@ export default { :container-measurements="measurements" :highlighted-job="hoveredJobName" :metrics-config="metricsConfig" - :never-show-links="shouldHideLinks" + :show-links="showJobLinks" :view-type="viewType" - default-link-color="gl-stroke-transparent" @error="onError" @highlightedJobsChange="updateHighlightedJobs" > @@ -234,6 +238,7 @@ export default { :config-paths="configPaths" :linked-pipelines="downstreamPipelines" :column-title="__('Downstream')" + :show-links="showJobLinks" :type="$options.pipelineTypeConstants.DOWNSTREAM" :view-type="viewType" @downstreamHovered="setSourceJob" diff --git a/app/assets/javascripts/pipelines/components/graph/graph_component_wrapper.vue b/app/assets/javascripts/pipelines/components/graph/graph_component_wrapper.vue index 0bc6d883245..bff5d3ccdab 100644 --- a/app/assets/javascripts/pipelines/components/graph/graph_component_wrapper.vue +++ b/app/assets/javascripts/pipelines/components/graph/graph_component_wrapper.vue @@ -48,6 +48,7 @@ export default { pipeline: null, pipelineLayers: null, showAlert: false, + showLinks: false, }; }, errorTexts: { @@ -182,6 +183,9 @@ export default { } }, /* eslint-enable @gitlab/require-i18n-strings */ + updateShowLinksState(val) { + this.showLinks = val; + }, updateViewType(type) { this.currentViewType = type; }, @@ -202,7 +206,9 @@ export default { @@ -211,6 +217,7 @@ export default { :config-paths="configPaths" :pipeline="pipeline" :pipeline-layers="getPipelineLayers()" + :show-links="showLinks" :view-type="currentViewType" @error="reportFailure" @refreshPipelineGraph="refreshPipelineGraph" diff --git a/app/assets/javascripts/pipelines/components/graph/graph_view_selector.vue b/app/assets/javascripts/pipelines/components/graph/graph_view_selector.vue index f33e6290e37..bc038dde21c 100644 --- a/app/assets/javascripts/pipelines/components/graph/graph_view_selector.vue +++ b/app/assets/javascripts/pipelines/components/graph/graph_view_selector.vue @@ -1,17 +1,20 @@ diff --git a/app/assets/javascripts/pipelines/components/graph/linked_pipelines_column.vue b/app/assets/javascripts/pipelines/components/graph/linked_pipelines_column.vue index 7f772e35e55..89ca6f43abc 100644 --- a/app/assets/javascripts/pipelines/components/graph/linked_pipelines_column.vue +++ b/app/assets/javascripts/pipelines/components/graph/linked_pipelines_column.vue @@ -32,6 +32,10 @@ export default { type: Array, required: true, }, + showLinks: { + type: Boolean, + required: true, + }, type: { type: String, required: true, @@ -217,6 +221,7 @@ export default { :config-paths="configPaths" :pipeline="currentPipeline" :pipeline-layers="getPipelineLayers(pipeline.id)" + :show-links="showLinks" :is-linked-pipeline="true" :view-type="viewType" /> diff --git a/app/assets/javascripts/pipelines/components/graph_shared/links_layer.vue b/app/assets/javascripts/pipelines/components/graph_shared/links_layer.vue index 8dbab245f44..83843de8085 100644 --- a/app/assets/javascripts/pipelines/components/graph_shared/links_layer.vue +++ b/app/assets/javascripts/pipelines/components/graph_shared/links_layer.vue @@ -1,5 +1,4 @@