From c6af94ea4ea649171ff930b6bf94c73a5d03edb9 Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Mon, 19 Apr 2021 12:09:04 +0000 Subject: [PATCH] Add latest changes from gitlab-org/gitlab@master --- .rubocop_manual_todo.yml | 27 -- Gemfile | 3 +- Gemfile.lock | 6 +- Rakefile | 2 + .../batch_comments/mixins/resolved_status.js | 8 +- .../invite_member/init_invite_member_modal.js | 5 +- .../notes/components/note_form.vue | 2 +- .../editor/ci_config_merged_preview.vue | 76 ++---- .../components/pipeline_editor_tabs.vue | 46 +++- .../components/ui/editor_tab.vue | 66 ++++- .../notification/pipeline_notification.vue | 90 +++++++ .../pipeline_graph/pipeline_graph.vue | 50 +--- .../dismiss_pipeline_notification.graphql | 5 + .../queries/get_user_callouts.query.graphql | 13 + .../pipelines/pipeline_details_bundle.js | 10 + .../pipeline_details_notification.js | 29 +++ .../javascripts/sidebar/mount_sidebar.js | 5 +- .../stylesheets/_page_specific_files.scss | 1 - app/assets/stylesheets/pages/runners.scss | 13 - app/controllers/projects/issues_controller.rb | 1 + app/models/project_feature.rb | 2 +- app/models/todo.rb | 14 + app/services/todo_service.rb | 12 +- .../users/update_todo_count_cache_service.rb | 34 +++ app/views/ci/variables/_index.html.haml | 2 +- .../devise/mailer/password_change.html.haml | 9 +- .../devise/mailer/password_change.text.erb | 8 +- app/views/devise/passwords/edit.html.haml | 16 +- app/views/devise/sessions/new.html.haml | 2 +- .../devise/sessions/two_factor.html.haml | 10 +- app/views/projects/pipelines/show.html.haml | 1 + bin/sidekiq-cluster | 1 + ...-invalid-ci-state-in-authoring-section.yml | 5 + ...5_enable_projects_post_creation_worker.yml | 5 + ...ze-stings-in-password_change-html-haml.yml | 5 + ...ze-strings-in-passwords-edit-html-haml.yml | 5 + ...lize-strings-in-sessions-new-html-haml.yml | 5 + ...rings-in-sessions-two_factor-html-haml.yml | 5 + .../bulk-update-user-todos-count-cache.yml | 5 + ...e-searchQueryService-paramter-optional.yml | 5 + .../unreleased/mr-thread-comment-button.yml | 5 + .../ntepluhina-assignees-feature-flag.yml | 5 + changelogs/unreleased/remove_epics_index.yml | 5 + .../tor-defect-single-quote-escapes.yml | 5 + .../development/issue_assignees_widget.yml | 8 + .../projects_post_creation_worker.yml | 2 +- .../20210216175602_installation_type.yml | 4 +- .../20210216174829_smtp_server.yml | 9 +- ...move_index_epics_on_group_id_from_epics.rb | 17 ++ db/schema_migrations/20210415144538 | 1 + db/structure.sql | 2 - doc/api/graphql/reference/index.md | 1 + doc/development/usage_ping/dictionary.md | 4 +- .../admin_area/custom_project_templates.md | 2 +- doc/user/group/custom_project_templates.md | 2 +- lib/api/concerns/packages/nuget_endpoints.rb | 2 +- .../authorize/connection_filter_extension.rb | 2 + lib/gitlab/sidekiq_cluster/cli.rb | 14 +- lib/gitlab/sidekiq_config/cli_methods.rb | 90 ++----- lib/gitlab/sidekiq_config/worker_matcher.rb | 86 +++++++ lib/tasks/brakeman.rake | 13 - lib/tasks/gitlab/test.rake | 17 -- lib/tasks/test.rake | 13 +- locale/gitlab.pot | 50 +++- spec/features/issues/issue_sidebar_spec.rb | 240 ++++++++++++------ spec/features/issues/user_edits_issue_spec.rb | 194 ++++++++++---- .../settings/forked_project_settings_spec.rb | 3 +- spec/features/projects_spec.rb | 20 -- .../notes/components/note_actions_spec.js | 16 ++ .../editor/ci_config_merged_preview_spec.js | 21 +- .../components/pipeline_editor_tabs_spec.js | 24 ++ .../components/ui/editor_tab_spec.js | 57 ++++- .../pipeline_notification_spec.js | 79 ++++++ .../pipeline_graph/pipeline_graph_spec.js | 29 +-- spec/graphql/features/authorization_spec.rb | 20 ++ .../namespace_projects_resolver_spec.rb | 2 +- spec/knapsack_env.rb | 37 +-- spec/lib/gitlab/sidekiq_cluster/cli_spec.rb | 2 +- .../gitlab/sidekiq_config/cli_methods_spec.rb | 84 +----- .../sidekiq_config/worker_matcher_spec.rb | 129 ++++++++++ spec/models/todo_spec.rb | 16 ++ .../requests/api/nuget_group_packages_spec.rb | 4 +- spec/services/todo_service_spec.rb | 18 +- .../update_todo_count_cache_service_spec.rb | 61 +++++ .../api/nuget_endpoints_shared_examples.rb | 2 +- workhorse/internal/upload/rewrite.go | 10 +- 86 files changed, 1361 insertions(+), 675 deletions(-) create mode 100644 app/assets/javascripts/pipelines/components/notification/pipeline_notification.vue create mode 100644 app/assets/javascripts/pipelines/graphql/mutations/dismiss_pipeline_notification.graphql create mode 100644 app/assets/javascripts/pipelines/graphql/queries/get_user_callouts.query.graphql create mode 100644 app/assets/javascripts/pipelines/pipeline_details_notification.js delete mode 100644 app/assets/stylesheets/pages/runners.scss create mode 100644 app/services/users/update_todo_count_cache_service.rb create mode 100644 changelogs/unreleased/321100-centralize-invalid-ci-state-in-authoring-section.yml create mode 100644 changelogs/unreleased/326665_enable_projects_post_creation_worker.yml create mode 100644 changelogs/unreleased/Externalize-stings-in-password_change-html-haml.yml create mode 100644 changelogs/unreleased/Externalize-strings-in-passwords-edit-html-haml.yml create mode 100644 changelogs/unreleased/Externalize-strings-in-sessions-new-html-haml.yml create mode 100644 changelogs/unreleased/Externalize-strings-in-sessions-two_factor-html-haml.yml create mode 100644 changelogs/unreleased/bulk-update-user-todos-count-cache.yml create mode 100644 changelogs/unreleased/issue-325831-make-searchQueryService-paramter-optional.yml create mode 100644 changelogs/unreleased/mr-thread-comment-button.yml create mode 100644 changelogs/unreleased/ntepluhina-assignees-feature-flag.yml create mode 100644 changelogs/unreleased/remove_epics_index.yml create mode 100644 changelogs/unreleased/tor-defect-single-quote-escapes.yml create mode 100644 config/feature_flags/development/issue_assignees_widget.yml rename config/metrics/{counts_all => settings}/20210216174829_smtp_server.yml (68%) create mode 100644 db/migrate/20210415144538_remove_index_epics_on_group_id_from_epics.rb create mode 100644 db/schema_migrations/20210415144538 create mode 100644 lib/gitlab/sidekiq_config/worker_matcher.rb delete mode 100644 lib/tasks/brakeman.rake delete mode 100644 lib/tasks/gitlab/test.rake create mode 100644 spec/frontend/pipelines/notification/pipeline_notification_spec.js create mode 100644 spec/lib/gitlab/sidekiq_config/worker_matcher_spec.rb create mode 100644 spec/services/users/update_todo_count_cache_service_spec.rb diff --git a/.rubocop_manual_todo.yml b/.rubocop_manual_todo.yml index 185bbb36e60..c4e37e6c42f 100644 --- a/.rubocop_manual_todo.yml +++ b/.rubocop_manual_todo.yml @@ -2911,33 +2911,6 @@ Gitlab/NamespacedClass: - 'spec/tasks/gitlab/task_helpers_spec.rb' - 'spec/uploaders/object_storage_spec.rb' -# WIP: https://gitlab.com/gitlab-org/gitlab/-/issues/322739 -Style/HashTransformation: - Exclude: - - 'ee/app/models/ee/ci/build.rb' - - 'ee/app/models/productivity_analytics.rb' - - 'ee/app/models/sca/license_compliance.rb' - - 'ee/app/services/security/store_report_service.rb' - - 'ee/lib/ee/gitlab/auth/ldap/sync/group.rb' - - 'ee/lib/ee/gitlab/usage_data.rb' - - 'ee/lib/gitlab/custom_file_templates.rb' - - 'ee/spec/elastic_integration/global_search_spec.rb' - - 'ee/spec/lib/ee/gitlab/application_context_spec.rb' - - 'spec/lib/atlassian/jira_connect/serializers/pull_request_entity_spec.rb' - - 'spec/lib/gitlab/ci/status/composite_spec.rb' - - 'spec/lib/gitlab/conflict/file_spec.rb' - - 'spec/lib/gitlab/import_export/project/tree_restorer_spec.rb' - - 'spec/models/concerns/featurable_spec.rb' - - 'spec/models/event_spec.rb' - - 'spec/models/packages/dependency_spec.rb' - - 'spec/requests/api/graphql/project/alert_management/alert/assignees_spec.rb' - - 'spec/requests/api/graphql/project/alert_management/alert/notes_spec.rb' - - 'spec/requests/api/graphql/project/alert_management/alert/todos_spec.rb' - - 'spec/requests/api/projects_spec.rb' - - 'spec/support/helpers/graphql_helpers.rb' - - 'spec/support/import_export/project_tree_expectations.rb' - - 'spec/support/shared_contexts/services/projects/container_repository/delete_tags_service_shared_context.rb' - Style/ClassEqualityComparison: Exclude: - spec/lib/peek/views/active_record_spec.rb diff --git a/Gemfile b/Gemfile index ca9a3443639..876bcfaabf9 100644 --- a/Gemfile +++ b/Gemfile @@ -342,7 +342,6 @@ group :metrics do end group :development do - gem 'brakeman', '~> 4.10.0', require: false gem 'lefthook', '~> 0.7.0', require: false gem 'letter_opener_web', '~> 1.4.0' @@ -383,7 +382,7 @@ group :development, :test do gem 'benchmark-ips', '~> 2.3.0', require: false - gem 'knapsack', '~> 1.17' + gem 'knapsack', '~> 1.21.1' gem 'crystalball', '~> 0.7.0', require: false gem 'simple_po_parser', '~> 1.1.2', require: false diff --git a/Gemfile.lock b/Gemfile.lock index 4ad1c2420a0..19fad573b63 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -151,7 +151,6 @@ GEM bootstrap_form (4.2.0) actionpack (>= 5.0) activemodel (>= 5.0) - brakeman (4.10.1) browser (4.2.0) builder (3.2.4) bullet (6.1.3) @@ -672,7 +671,7 @@ GEM kaminari-core (= 1.2.1) kaminari-core (1.2.1) kgio (2.11.3) - knapsack (1.17.0) + knapsack (1.21.1) rake kramdown (2.3.1) rexml @@ -1369,7 +1368,6 @@ DEPENDENCIES better_errors (~> 2.9.0) bootsnap (~> 1.4.6) bootstrap_form (~> 4.2.0) - brakeman (~> 4.10.0) browser (~> 4.2) bullet (~> 6.1.3) bundler-audit (~> 0.7.0.1) @@ -1476,7 +1474,7 @@ DEPENDENCIES json_schemer (~> 0.2.12) jwt (~> 2.1.0) kaminari (~> 1.0) - knapsack (~> 1.17) + knapsack (~> 1.21.1) kramdown (~> 2.3.1) kubeclient (~> 4.9.1) lefthook (~> 0.7.0) diff --git a/Rakefile b/Rakefile index 445542e5c00..eb2f158972d 100755 --- a/Rakefile +++ b/Rakefile @@ -4,6 +4,8 @@ # Add your own tasks in files placed in lib/tasks ending in .rake, # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake. +Rake::TaskManager.record_task_metadata = true + require File.expand_path('config/application', __dir__) relative_url_conf = File.expand_path('config/initializers/relative_url', __dir__) diff --git a/app/assets/javascripts/batch_comments/mixins/resolved_status.js b/app/assets/javascripts/batch_comments/mixins/resolved_status.js index 85bdf6b7a36..bec360e3b2e 100644 --- a/app/assets/javascripts/batch_comments/mixins/resolved_status.js +++ b/app/assets/javascripts/batch_comments/mixins/resolved_status.js @@ -50,12 +50,18 @@ export default { return this.resolveDiscussion ? 'is-resolving-discussion' : 'is-unresolving-discussion'; }, resolveButtonTitle() { + const escapeParameters = false; + if (this.isDraft || this.discussionId) return this.resolvedStatusMessage; let title = __('Resolve thread'); if (this.resolvedBy) { - title = sprintf(__('Resolved by %{name}'), { name: this.resolvedBy.name }); + title = sprintf( + __('Resolved by %{name}'), + { name: this.resolvedBy.name }, + escapeParameters, + ); } return title; diff --git a/app/assets/javascripts/invite_member/init_invite_member_modal.js b/app/assets/javascripts/invite_member/init_invite_member_modal.js index 108f636ee3e..a50d31c9e7a 100644 --- a/app/assets/javascripts/invite_member/init_invite_member_modal.js +++ b/app/assets/javascripts/invite_member/init_invite_member_modal.js @@ -5,10 +5,13 @@ import InviteMemberModal from './components/invite_member_modal.vue'; Vue.use(GlToast); +const isAssigneesWidgetShown = + (isInIssuePage() || isInDesignPage()) && gon.features.issueAssigneesWidget; + export default function initInviteMembersModal() { const el = document.querySelector('.js-invite-member-modal'); - if (!el || isInDesignPage() || isInIssuePage()) { + if (!el || isAssigneesWidgetShown) { return false; } diff --git a/app/assets/javascripts/notes/components/note_form.vue b/app/assets/javascripts/notes/components/note_form.vue index a25862a587b..a70bac94b71 100644 --- a/app/assets/javascripts/notes/components/note_form.vue +++ b/app/assets/javascripts/notes/components/note_form.vue @@ -390,7 +390,7 @@ export default { -import { GlAlert, GlIcon } from '@gitlab/ui'; +import { GlIcon } from '@gitlab/ui'; import { uniqueId } from 'lodash'; -import { __, s__ } from '~/locale'; -import { DEFAULT, INVALID_CI_CONFIG } from '~/pipelines/constants'; +import { s__ } from '~/locale'; import EditorLite from '~/vue_shared/components/editor_lite.vue'; export default { i18n: { viewOnlyMessage: s__('Pipelines|Merged YAML is view only'), }, - errorTexts: { - [INVALID_CI_CONFIG]: __('Your CI configuration file is invalid.'), - [DEFAULT]: __('An unknown error occurred.'), - }, components: { EditorLite, - GlAlert, GlIcon, }, inject: ['ciConfigPath'], props: { - isValid: { - type: Boolean, - required: true, - }, ciConfigData: { type: Object, required: true, @@ -35,66 +25,30 @@ export default { }; }, computed: { - failure() { - switch (this.failureType) { - case INVALID_CI_CONFIG: - return this.$options.errorTexts[INVALID_CI_CONFIG]; - default: - return this.$options.errorTexts[DEFAULT]; - } - }, fileGlobalId() { return `${this.ciConfigPath}-${uniqueId()}`; }, - hasError() { - return this.failureType; - }, mergedYaml() { return this.ciConfigData.mergedYaml; }, }, - watch: { - ciConfigData: { - immediate: true, - handler() { - if (!this.isValid) { - this.reportFailure(INVALID_CI_CONFIG); - } else if (this.hasError) { - this.resetFailure(); - } - }, - }, - }, - methods: { - reportFailure(errorType) { - this.failureType = errorType; - }, - resetFailure() { - this.failureType = null; - }, - }, }; diff --git a/app/assets/javascripts/pipeline_editor/components/pipeline_editor_tabs.vue b/app/assets/javascripts/pipeline_editor/components/pipeline_editor_tabs.vue index 760d395ff2c..5acb3355b23 100644 --- a/app/assets/javascripts/pipeline_editor/components/pipeline_editor_tabs.vue +++ b/app/assets/javascripts/pipeline_editor/components/pipeline_editor_tabs.vue @@ -1,11 +1,13 @@ diff --git a/app/assets/javascripts/pipelines/components/notification/pipeline_notification.vue b/app/assets/javascripts/pipelines/components/notification/pipeline_notification.vue new file mode 100644 index 00000000000..6982586ab12 --- /dev/null +++ b/app/assets/javascripts/pipelines/components/notification/pipeline_notification.vue @@ -0,0 +1,90 @@ + + diff --git a/app/assets/javascripts/pipelines/components/pipeline_graph/pipeline_graph.vue b/app/assets/javascripts/pipelines/components/pipeline_graph/pipeline_graph.vue index 1f8c4a9aa8b..3ba0d7d0120 100644 --- a/app/assets/javascripts/pipelines/components/pipeline_graph/pipeline_graph.vue +++ b/app/assets/javascripts/pipelines/components/pipeline_graph/pipeline_graph.vue @@ -1,8 +1,7 @@