From 0254867cf0f3341fd63cc6da07290f1da91f99ef Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Tue, 7 Jul 2020 12:09:16 +0000 Subject: [PATCH] Add latest changes from gitlab-org/gitlab@master --- Gemfile | 2 +- Gemfile.lock | 4 +- .../javascripts/clusters/clusters_bundle.js | 3 +- .../remove_cluster_confirmation.vue | 19 +- .../issuable_bulk_update_actions.js | 1 + .../issuable_bulk_update_sidebar.js | 8 + .../components/dashboard_header.vue | 22 +- .../monitoring/components/refresh_button.vue | 163 +++++++++++ .../pages/groups/new/group_path_validator.js | 10 +- .../components/accessibility_issue_body.vue | 2 +- .../repository/components/breadcrumbs.vue | 12 +- .../repository/components/last_commit.vue | 14 +- .../repository/components/preview/index.vue | 8 +- .../repository/components/table/index.vue | 6 +- .../repository/components/table/row.vue | 4 +- .../repository/components/tree_content.vue | 12 +- app/assets/javascripts/repository/log_tree.js | 14 +- .../javascripts/repository/mixins/get_ref.js | 4 +- .../javascripts/repository/mixins/preload.js | 8 +- ...mit.query.graphql => commit.query.graphql} | 2 +- ...ts.query.graphql => commits.query.graphql} | 2 +- ...iles.query.graphql => files.query.graphql} | 6 +- .../queries/getProjectPath.query.graphql | 3 - ...graphql => path_last_commit.query.graphql} | 6 +- ...uery.graphql => permissions.query.graphql} | 2 +- .../queries/project_path.query.graphql | 3 + ...aphql => project_short_path.query.graphql} | 2 +- ...dme.query.graphql => readme.query.graphql} | 2 +- ...getRef.query.graphql => ref.query.graphql} | 2 +- ... => vue_file_list_lfs_badge.query.graphql} | 2 +- .../stylesheets/framework/dropdowns.scss | 8 + app/assets/stylesheets/framework/filters.scss | 6 + .../stylesheets/framework/gitlab_theme.scss | 2 +- .../stylesheets/framework/issue_box.scss | 1 + app/controllers/invites_controller.rb | 19 ++ app/finders/issues_finder.rb | 1 + app/graphql/mutations/base_mutation.rb | 2 + app/graphql/mutations/todos/mark_all_done.rb | 6 + app/graphql/mutations/todos/restore_many.rb | 8 +- app/graphql/types/commit_type.rb | 2 + app/graphql/types/tree/blob_type.rb | 2 + app/graphql/types/tree/tree_entry_type.rb | 2 + app/graphql/types/user_type.rb | 2 + app/helpers/services_helper.rb | 4 + app/helpers/todos_helper.rb | 15 +- app/models/alert_management/alert.rb | 2 + app/models/audit_event.rb | 2 +- app/models/clusters/cluster.rb | 52 +--- app/models/system_note_metadata.rb | 2 +- app/presenters/blob_presenter.rb | 4 + app/presenters/commit_presenter.rb | 4 + app/presenters/tree_entry_presenter.rb | 4 + app/presenters/user_presenter.rb | 4 + app/services/audit_event_service.rb | 1 + .../merge_requests/remove_approval_service.rb | 39 +++ app/services/system_note_service.rb | 4 + .../system_notes/merge_requests_service.rb | 8 +- .../clusters/_advanced_settings.html.haml | 4 +- app/views/invites/show.html.haml | 8 +- .../layouts/nav/sidebar/_project.html.haml | 34 ++- .../issuable/_bulk_update_sidebar.html.haml | 8 + .../204920-add-refresh-rate-btn.yml | 5 + ...mpt-to-accept-or-decline-an-invitation.yml | 5 + ...6143-show-resolved-state-in-todos-list.yml | 5 + ...or-author_name-from-auditevent-details.yml | 5 + ...nd_found_group_and_orphaned_projects-c.yml | 5 + .../unreleased/ajk-todos-return-resource.yml | 5 + ...er-application-disable-cleanup-managed.yml | 5 + changelogs/unreleased/update-rack-timeout.yml | 5 + ...23090030_add_author_name_to_audit_event.rb | 22 ++ ...t_and_found_group_and_orphaned_projects.rb | 10 + db/structure.sql | 5 +- .../monitoring/prometheus/gitlab_metrics.md | 13 + .../graphql/reference/gitlab_schema.graphql | 38 ++- doc/api/graphql/reference/gitlab_schema.json | 128 ++++++++- doc/api/graphql/reference/index.md | 10 +- doc/development/sidekiq_style_guide.md | 1 - .../wiki/img/wiki_page_diffs_v13_2.png | Bin 0 -> 53576 bytes .../project/wiki/img/wiki_page_history.png | Bin 12101 -> 13456 bytes doc/user/project/wiki/index.md | 16 +- lib/gitlab/instrumentation/redis_base.rb | 13 + .../instrumentation/redis_interceptor.rb | 7 +- lib/gitlab/kubernetes/node.rb | 78 ++++++ locale/gitlab.pot | 33 ++- spec/controllers/invites_controller_spec.rb | 39 ++- spec/features/groups_spec.rb | 29 ++ spec/features/invites_spec.rb | 260 +++++++++--------- .../services/user_activates_jira_spec.rb | 24 +- .../remove_cluster_confirmation_spec.js | 17 +- .../dashboard_template_spec.js.snap | 12 +- .../monitoring/components/dashboard_spec.js | 6 +- .../components/refresh_button_spec.js | 143 ++++++++++ .../__snapshots__/last_commit_spec.js.snap | 12 +- .../repository/components/last_commit_spec.js | 2 + .../preview/__snapshots__/index_spec.js.snap | 2 +- .../components/preview/index_spec.js | 3 + .../mutations/todos/mark_all_done_spec.rb | 3 +- .../mutations/todos/restore_many_spec.rb | 4 + spec/graphql/types/commit_type_spec.rb | 2 +- spec/graphql/types/tree/blob_type_spec.rb | 2 +- .../types/tree/tree_entry_type_spec.rb | 2 +- spec/graphql/types/user_type_spec.rb | 1 + spec/helpers/todos_helper_spec.rb | 59 ++++ .../instrumentation/redis_interceptor_spec.rb | 22 ++ spec/lib/gitlab/kubernetes/node_spec.rb | 68 +++++ ..._found_group_and_orphaned_projects_spec.rb | 63 ++++- spec/models/clusters/cluster_spec.rb | 28 +- spec/services/audit_event_service_spec.rb | 3 + .../remove_approval_service_spec.rb | 37 +++ spec/services/system_note_service_spec.rb | 10 + .../project_service_jira_context.rb | 15 + 111 files changed, 1500 insertions(+), 390 deletions(-) create mode 100644 app/assets/javascripts/monitoring/components/refresh_button.vue rename app/assets/javascripts/repository/queries/{getCommit.query.graphql => commit.query.graphql} (69%) rename app/assets/javascripts/repository/queries/{getCommits.query.graphql => commits.query.graphql} (85%) rename app/assets/javascripts/repository/queries/{getFiles.query.graphql => files.query.graphql} (95%) delete mode 100644 app/assets/javascripts/repository/queries/getProjectPath.query.graphql rename app/assets/javascripts/repository/queries/{pathLastCommit.query.graphql => path_last_commit.query.graphql} (87%) rename app/assets/javascripts/repository/queries/{getPermissions.query.graphql => permissions.query.graphql} (75%) create mode 100644 app/assets/javascripts/repository/queries/project_path.query.graphql rename app/assets/javascripts/repository/queries/{getProjectShortPath.query.graphql => project_short_path.query.graphql} (50%) rename app/assets/javascripts/repository/queries/{getReadme.query.graphql => readme.query.graphql} (57%) rename app/assets/javascripts/repository/queries/{getRef.query.graphql => ref.query.graphql} (71%) rename app/assets/javascripts/repository/queries/{getVueFileListLfsBadge.query.graphql => vue_file_list_lfs_badge.query.graphql} (50%) create mode 100644 app/services/merge_requests/remove_approval_service.rb create mode 100644 changelogs/unreleased/204920-add-refresh-rate-btn.yml create mode 100644 changelogs/unreleased/214103-remove-the-second-prompt-to-accept-or-decline-an-invitation.yml create mode 100644 changelogs/unreleased/216143-show-resolved-state-in-todos-list.yml create mode 100644 changelogs/unreleased/220318-refactor-author_name-from-auditevent-details.yml create mode 100644 changelogs/unreleased/224674-fix-update_routes_for_lost_and_found_group_and_orphaned_projects-c.yml create mode 100644 changelogs/unreleased/ajk-todos-return-resource.yml create mode 100644 changelogs/unreleased/cluster-application-disable-cleanup-managed.yml create mode 100644 changelogs/unreleased/update-rack-timeout.yml create mode 100644 db/migrate/20200623090030_add_author_name_to_audit_event.rb create mode 100644 doc/user/project/wiki/img/wiki_page_diffs_v13_2.png create mode 100644 lib/gitlab/kubernetes/node.rb create mode 100644 spec/frontend/monitoring/components/refresh_button_spec.js create mode 100644 spec/lib/gitlab/kubernetes/node_spec.rb create mode 100644 spec/services/merge_requests/remove_approval_service_spec.rb create mode 100644 spec/support/shared_contexts/project_service_jira_context.rb diff --git a/Gemfile b/Gemfile index c86874201fc..006872eaefd 100644 --- a/Gemfile +++ b/Gemfile @@ -164,6 +164,7 @@ gem 'diff_match_patch', '~> 0.1.0' # Application server gem 'rack', '~> 2.0.9' +gem 'rack-timeout', '~> 0.5.1' group :unicorn do gem 'unicorn', '~> 5.5' @@ -173,7 +174,6 @@ end group :puma do gem 'gitlab-puma', '~> 4.3.3.gitlab.2', require: false gem 'gitlab-puma_worker_killer', '~> 0.1.1.gitlab.1', require: false - gem 'rack-timeout', require: false end # State machine diff --git a/Gemfile.lock b/Gemfile.lock index 70f2dfafe3a..f68fd455352 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -817,7 +817,7 @@ GEM rack rack-test (1.1.0) rack (>= 1.0, < 3) - rack-timeout (0.5.1) + rack-timeout (0.5.2) rails (6.0.3.1) actioncable (= 6.0.3.1) actionmailbox (= 6.0.3.1) @@ -1350,7 +1350,7 @@ DEPENDENCIES rack-cors (~> 1.0.6) rack-oauth2 (~> 1.9.3) rack-proxy (~> 0.6.0) - rack-timeout + rack-timeout (~> 0.5.1) rails (~> 6.0.3.1) rails-controller-testing rails-i18n (~> 6.0) diff --git a/app/assets/javascripts/clusters/clusters_bundle.js b/app/assets/javascripts/clusters/clusters_bundle.js index f15efb2fdeb..83bdea15e62 100644 --- a/app/assets/javascripts/clusters/clusters_bundle.js +++ b/app/assets/javascripts/clusters/clusters_bundle.js @@ -222,7 +222,7 @@ export default class Clusters { initRemoveClusterActions() { const el = document.querySelector('#js-cluster-remove-actions'); if (el && el.dataset) { - const { clusterName, clusterPath } = el.dataset; + const { clusterName, clusterPath, hasManagementProject } = el.dataset; this.removeClusterAction = new Vue({ el, @@ -231,6 +231,7 @@ export default class Clusters { props: { clusterName, clusterPath, + hasManagementProject, }, }); }, diff --git a/app/assets/javascripts/clusters/components/remove_cluster_confirmation.vue b/app/assets/javascripts/clusters/components/remove_cluster_confirmation.vue index c5375cbfbdc..45f2dd48961 100644 --- a/app/assets/javascripts/clusters/components/remove_cluster_confirmation.vue +++ b/app/assets/javascripts/clusters/components/remove_cluster_confirmation.vue @@ -1,7 +1,7 @@ + + diff --git a/app/assets/javascripts/pages/groups/new/group_path_validator.js b/app/assets/javascripts/pages/groups/new/group_path_validator.js index eeaa6527431..d2684b6af59 100644 --- a/app/assets/javascripts/pages/groups/new/group_path_validator.js +++ b/app/assets/javascripts/pages/groups/new/group_path_validator.js @@ -12,6 +12,7 @@ const successMessageSelector = '.validation-success'; const pendingMessageSelector = '.validation-pending'; const unavailableMessageSelector = '.validation-error'; const suggestionsMessageSelector = '.gl-path-suggestions'; +const inputGroupSelector = '.input-group'; export default class GroupPathValidator extends InputValidator { constructor(opts = {}) { @@ -39,7 +40,7 @@ export default class GroupPathValidator extends InputValidator { static validateGroupPathInput(inputDomElement) { const groupPath = inputDomElement.value; - if (inputDomElement.checkValidity() && groupPath.length > 0) { + if (inputDomElement.checkValidity() && groupPath.length > 1) { GroupPathValidator.setMessageVisibility(inputDomElement, pendingMessageSelector); fetchGroupPathAvailability(groupPath) @@ -69,9 +70,10 @@ export default class GroupPathValidator extends InputValidator { } static setMessageVisibility(inputDomElement, messageSelector, isVisible = true) { - const messageElement = inputDomElement.parentElement.parentElement.querySelector( - messageSelector, - ); + const messageElement = inputDomElement + .closest(inputGroupSelector) + .parentElement.querySelector(messageSelector); + messageElement.classList.toggle('hide', !isVisible); } diff --git a/app/assets/javascripts/reports/accessibility_report/components/accessibility_issue_body.vue b/app/assets/javascripts/reports/accessibility_report/components/accessibility_issue_body.vue index 6e494872791..eb02714b262 100644 --- a/app/assets/javascripts/reports/accessibility_report/components/accessibility_issue_body.vue +++ b/app/assets/javascripts/reports/accessibility_report/components/accessibility_issue_body.vue @@ -55,7 +55,7 @@ export default { ) }} {{ - s__('AccessibilityReport|Learn More') + s__('AccessibilityReport|Learn more') }} {{ sprintf(s__('AccessibilityReport|Message: %{message}'), { message: issue.message }) }} diff --git a/app/assets/javascripts/repository/components/breadcrumbs.vue b/app/assets/javascripts/repository/components/breadcrumbs.vue index 45c343c3f7f..8a11c3dcafe 100644 --- a/app/assets/javascripts/repository/components/breadcrumbs.vue +++ b/app/assets/javascripts/repository/components/breadcrumbs.vue @@ -4,9 +4,9 @@ import { joinPaths, escapeFileUrl } from '~/lib/utils/url_utility'; import { __ } from '../../locale'; import Icon from '../../vue_shared/components/icon.vue'; import getRefMixin from '../mixins/get_ref'; -import getProjectShortPath from '../queries/getProjectShortPath.query.graphql'; -import getProjectPath from '../queries/getProjectPath.query.graphql'; -import getPermissions from '../queries/getPermissions.query.graphql'; +import projectShortPathQuery from '../queries/project_short_path.query.graphql'; +import projetPathQuery from '../queries/project_path.query.graphql'; +import permissionsQuery from '../queries/permissions.query.graphql'; const ROW_TYPES = { header: 'header', @@ -23,13 +23,13 @@ export default { }, apollo: { projectShortPath: { - query: getProjectShortPath, + query: projectShortPathQuery, }, projectPath: { - query: getProjectPath, + query: projetPathQuery, }, userPermissions: { - query: getPermissions, + query: permissionsQuery, variables() { return { projectPath: this.projectPath, diff --git a/app/assets/javascripts/repository/components/last_commit.vue b/app/assets/javascripts/repository/components/last_commit.vue index c5c99d56e2a..0206a61487c 100644 --- a/app/assets/javascripts/repository/components/last_commit.vue +++ b/app/assets/javascripts/repository/components/last_commit.vue @@ -8,8 +8,8 @@ import TimeagoTooltip from '../../vue_shared/components/time_ago_tooltip.vue'; import CiIcon from '../../vue_shared/components/ci_icon.vue'; import ClipboardButton from '../../vue_shared/components/clipboard_button.vue'; import getRefMixin from '../mixins/get_ref'; -import getProjectPath from '../queries/getProjectPath.query.graphql'; -import pathLastCommit from '../queries/pathLastCommit.query.graphql'; +import projectPathQuery from '../queries/project_path.query.graphql'; +import pathLastCommitQuery from '../queries/path_last_commit.query.graphql'; export default { components: { @@ -28,10 +28,10 @@ export default { mixins: [getRefMixin], apollo: { projectPath: { - query: getProjectPath, + query: projectPathQuery, }, commit: { - query: pathLastCommit, + query: pathLastCommitQuery, variables() { return { projectPath: this.projectPath, @@ -102,7 +102,7 @@ export default {