From 63324f9cfd863cda2f717835efc933cdd5ade792 Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Wed, 21 Oct 2020 15:10:28 +0000 Subject: [PATCH] Add latest changes from gitlab-org/gitlab@master --- .rubocop_todo.yml | 30 +-- .../add_extra_tokens_for_merge_requests.js | 15 +- .../filtered_search/dropdown_operator.js | 5 +- .../filtered_search_dropdown.js | 6 +- .../filtered_search_dropdown_manager.js | 14 +- .../account/components/update_username.vue | 44 ++-- .../resolvers/ci/runner_setup_resolver.rb | 60 +++++ app/graphql/types/ci/runner_setup_type.rb | 15 ++ app/graphql/types/query_type.rb | 4 + .../229674-update-change-username-modal.yml | 5 + .../unreleased/mb_rails_save_bang_fix5.yml | 5 + .../ph-233486-removeDraftIsNotFilter.yml | 5 + .../graphql/reference/gitlab_schema.graphql | 46 +++- doc/api/graphql/reference/gitlab_schema.json | 124 +++++++++- doc/api/graphql/reference/index.md | 7 + .../blueprints/image_resizing/index.md | 73 ++++++ doc/ci/environments/index.md | 36 ++- doc/ci/pipelines/index.md | 21 ++ doc/user/application_security/dast/index.md | 18 +- .../application_security/sast/analyzers.md | 8 +- doc/user/project/issues/index.md | 2 +- locale/gitlab.pot | 3 + .../user_filters_by_draft_spec.rb | 31 +++ spec/features/profile_spec.rb | 4 +- spec/features/profiles/account_spec.rb | 4 +- .../components/update_username_spec.js | 232 ++++++++---------- .../ci/runner_setup_resolver_spec.rb | 86 +++++++ .../types/ci/runner_setup_type_spec.rb | 16 ++ spec/graphql/types/query_type_spec.rb | 8 + ...er_registry_authentication_service_spec.rb | 2 +- spec/services/auto_merge/base_service_spec.rb | 2 +- spec/services/auto_merge_service_spec.rb | 2 +- spec/services/clusters/update_service_spec.rb | 4 +- .../generate_image_versions_service_spec.rb | 2 +- .../discussions/resolve_service_spec.rb | 4 +- .../draft_notes/destroy_service_spec.rb | 4 +- spec/services/emails/confirm_service_spec.rb | 2 +- spec/services/groups/destroy_service_spec.rb | 2 +- .../import_export/import_service_spec.rb | 6 +- spec/services/labels/promote_service_spec.rb | 8 +- spec/services/notes/create_service_spec.rb | 4 +- .../build_service_spec.rb | 4 +- spec/services/notification_service_spec.rb | 30 +-- .../conan/create_package_file_service_spec.rb | 2 +- .../reset_project_cache_service_spec.rb | 2 +- .../change_milestone_service_spec.rb | 2 +- spec/services/system_hooks_service_spec.rb | 2 +- spec/services/system_note_service_spec.rb | 4 +- .../system_notes/issuables_service_spec.rb | 8 +- spec/services/todo_service_spec.rb | 26 +- .../confidential_issue_service_spec.rb | 2 +- spec/services/users/destroy_service_spec.rb | 4 +- .../users/repair_ldap_blocked_service_spec.rb | 2 +- .../verify_pages_domain_service_spec.rb | 2 +- spec/sidekiq/cron/job_gem_dependency_spec.rb | 2 +- vendor/gitignore/C++.gitignore | 0 vendor/gitignore/Java.gitignore | 0 57 files changed, 755 insertions(+), 306 deletions(-) create mode 100644 app/graphql/resolvers/ci/runner_setup_resolver.rb create mode 100644 app/graphql/types/ci/runner_setup_type.rb create mode 100644 changelogs/unreleased/229674-update-change-username-modal.yml create mode 100644 changelogs/unreleased/mb_rails_save_bang_fix5.yml create mode 100644 changelogs/unreleased/ph-233486-removeDraftIsNotFilter.yml create mode 100644 doc/architecture/blueprints/image_resizing/index.md create mode 100644 spec/features/merge_requests/user_filters_by_draft_spec.rb create mode 100644 spec/graphql/resolvers/ci/runner_setup_resolver_spec.rb create mode 100644 spec/graphql/types/ci/runner_setup_type_spec.rb mode change 100755 => 100644 vendor/gitignore/C++.gitignore mode change 100755 => 100644 vendor/gitignore/Java.gitignore diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index ab5047096f3..d7df1264fe3 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -1125,33 +1125,6 @@ Rails/SaveBang: - 'spec/requests/api/labels_spec.rb' - 'spec/requests/api/project_import_spec.rb' - 'spec/requests/projects/cycle_analytics_events_spec.rb' - - 'spec/services/auth/container_registry_authentication_service_spec.rb' - - 'spec/services/auto_merge/base_service_spec.rb' - - 'spec/services/auto_merge_service_spec.rb' - - 'spec/services/clusters/update_service_spec.rb' - - 'spec/services/deployments/after_create_service_spec.rb' - - 'spec/services/design_management/generate_image_versions_service_spec.rb' - - 'spec/services/discussions/resolve_service_spec.rb' - - 'spec/services/draft_notes/destroy_service_spec.rb' - - 'spec/services/emails/confirm_service_spec.rb' - - 'spec/services/groups/destroy_service_spec.rb' - - 'spec/services/groups/import_export/import_service_spec.rb' - - 'spec/services/labels/promote_service_spec.rb' - - 'spec/services/notes/create_service_spec.rb' - - 'spec/services/notification_recipients/build_service_spec.rb' - - 'spec/services/notification_service_spec.rb' - - 'spec/services/packages/conan/create_package_file_service_spec.rb' - - 'spec/services/reset_project_cache_service_spec.rb' - - 'spec/services/resource_events/change_milestone_service_spec.rb' - - 'spec/services/system_hooks_service_spec.rb' - - 'spec/services/system_note_service_spec.rb' - - 'spec/services/system_notes/issuables_service_spec.rb' - - 'spec/services/todo_service_spec.rb' - - 'spec/services/todos/destroy/confidential_issue_service_spec.rb' - - 'spec/services/users/destroy_service_spec.rb' - - 'spec/services/users/repair_ldap_blocked_service_spec.rb' - - 'spec/services/verify_pages_domain_service_spec.rb' - - 'spec/sidekiq/cron/job_gem_dependency_spec.rb' # Offense count: 187 # Cop supports --auto-correct. @@ -1269,11 +1242,10 @@ RSpec/TimecopTravel: - 'spec/workers/concerns/reenqueuer_spec.rb' - 'spec/lib/gitlab/analytics/cycle_analytics/median_spec.rb' -# Offense count: 43 +# Offense count: 21 Graphql/IDType: Exclude: - 'ee/app/graphql/ee/mutations/issues/update.rb' - - 'ee/app/graphql/ee/types/boards/board_issue_input_base_type.rb' - 'ee/app/graphql/mutations/iterations/update.rb' - 'ee/app/graphql/resolvers/iterations_resolver.rb' - 'app/graphql/mutations/boards/issues/issue_move_list.rb' diff --git a/app/assets/javascripts/filtered_search/add_extra_tokens_for_merge_requests.js b/app/assets/javascripts/filtered_search/add_extra_tokens_for_merge_requests.js index 51077296e20..6f5aef54cef 100644 --- a/app/assets/javascripts/filtered_search/add_extra_tokens_for_merge_requests.js +++ b/app/assets/javascripts/filtered_search/add_extra_tokens_for_merge_requests.js @@ -12,6 +12,7 @@ export default (IssuableTokenKeys, disableTargetBranchFilter = false) => { tag: __('Yes or No'), lowercaseValueOnSubmit: true, capitalizeTokenValue: true, + hideNotEqual: true, }, conditions: [ { @@ -30,20 +31,6 @@ export default (IssuableTokenKeys, disableTargetBranchFilter = false) => { value: __('No'), operator: '=', }, - { - url: 'not[wip]=yes', - replacementUrl: 'not[draft]=yes', - tokenKey: 'draft', - value: __('Yes'), - operator: '!=', - }, - { - url: 'not[wip]=no', - replacementUrl: 'not[draft]=no', - tokenKey: 'draft', - value: __('No'), - operator: '!=', - }, ], }; diff --git a/app/assets/javascripts/filtered_search/dropdown_operator.js b/app/assets/javascripts/filtered_search/dropdown_operator.js index 1bbd33b6258..8fee3385de1 100644 --- a/app/assets/javascripts/filtered_search/dropdown_operator.js +++ b/app/assets/javascripts/filtered_search/dropdown_operator.js @@ -39,7 +39,7 @@ export default class DropdownOperator extends FilteredSearchDropdown { this.dispatchInputEvent(); } - renderContent(forceShowList = false) { + renderContent(forceShowList = false, dropdownName = '') { const dropdownData = [ { tag: 'equal', @@ -48,8 +48,9 @@ export default class DropdownOperator extends FilteredSearchDropdown { help: __('is'), }, ]; + const dropdownToken = this.tokenKeys.searchByKey(dropdownName.toLowerCase()); - if (gon.features?.notIssuableQueries) { + if (gon.features?.notIssuableQueries && !dropdownToken?.hideNotEqual) { dropdownData.push({ tag: 'not-equal', type: 'string', diff --git a/app/assets/javascripts/filtered_search/filtered_search_dropdown.js b/app/assets/javascripts/filtered_search/filtered_search_dropdown.js index f7ce2ea01e0..8626e1a3d18 100644 --- a/app/assets/javascripts/filtered_search/filtered_search_dropdown.js +++ b/app/assets/javascripts/filtered_search/filtered_search_dropdown.js @@ -83,16 +83,16 @@ export default class FilteredSearchDropdown { } } - render(forceRenderContent = false, forceShowList = false) { + render(forceRenderContent = false, forceShowList = false, hideNotEqual = false) { this.setAsDropdown(); const currentHook = this.getCurrentHook(); const firstTimeInitialized = currentHook === null; if (firstTimeInitialized || forceRenderContent) { - this.renderContent(forceShowList); + this.renderContent(forceShowList, hideNotEqual); } else if (currentHook.list.list.id !== this.dropdown.id) { - this.renderContent(forceShowList); + this.renderContent(forceShowList, hideNotEqual); } } diff --git a/app/assets/javascripts/filtered_search/filtered_search_dropdown_manager.js b/app/assets/javascripts/filtered_search/filtered_search_dropdown_manager.js index 762383f5a1d..055ed384011 100644 --- a/app/assets/javascripts/filtered_search/filtered_search_dropdown_manager.js +++ b/app/assets/javascripts/filtered_search/filtered_search_dropdown_manager.js @@ -107,7 +107,7 @@ export default class FilteredSearchDropdownManager { this.mapping[key].reference.setOffset(offset); } - load(key, firstLoad = false) { + load(key, firstLoad = false, dropdownKey = '') { const mappingKey = this.mapping[key]; const glClass = mappingKey.gl; const { element } = mappingKey; @@ -141,12 +141,12 @@ export default class FilteredSearchDropdownManager { } this.updateDropdownOffset(key); - mappingKey.reference.render(firstLoad, forceShowList); + mappingKey.reference.render(firstLoad, forceShowList, dropdownKey); this.currentDropdown = key; } - loadDropdown(dropdownName = '') { + loadDropdown(dropdownName = '', dropdownKey = '') { let firstLoad = false; if (!this.droplab) { @@ -155,7 +155,7 @@ export default class FilteredSearchDropdownManager { } if (dropdownName === DROPDOWN_TYPE.operator) { - this.load(dropdownName, firstLoad); + this.load(dropdownName, firstLoad, dropdownKey); return; } @@ -167,7 +167,7 @@ export default class FilteredSearchDropdownManager { if (shouldOpenFilterDropdown || shouldOpenHintDropdown) { const key = match && match.key ? match.key : DROPDOWN_TYPE.hint; - this.load(key, firstLoad); + this.load(key, firstLoad, dropdownKey); } } @@ -200,11 +200,11 @@ export default class FilteredSearchDropdownManager { dropdownToOpen = hasOperator && lastOperatorToken ? dropdownName : DROPDOWN_TYPE.operator; } - this.loadDropdown(dropdownToOpen); + this.loadDropdown(dropdownToOpen, dropdownName); } else if (lastToken) { const lastOperator = FilteredSearchVisualTokens.getLastTokenOperator(); // Token has been initialized into an object because it has a value - this.loadDropdown(lastOperator ? lastToken.key : DROPDOWN_TYPE.operator); + this.loadDropdown(lastOperator ? lastToken.key : DROPDOWN_TYPE.operator, lastToken.key); } else { this.loadDropdown(DROPDOWN_TYPE.hint); } diff --git a/app/assets/javascripts/profile/account/components/update_username.vue b/app/assets/javascripts/profile/account/components/update_username.vue index 200e5ba255f..5feac7485ad 100644 --- a/app/assets/javascripts/profile/account/components/update_username.vue +++ b/app/assets/javascripts/profile/account/components/update_username.vue @@ -1,17 +1,19 @@