From f2fd07aa1c0bfb732b80c3d028cd23c91547991c Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Fri, 4 Nov 2022 12:10:55 +0000 Subject: [PATCH] Add latest changes from gitlab-org/gitlab@master --- .rubocop.yml | 4 + .rubocop_todo/layout/line_length.yml | 1 - .rubocop_todo/rails/negate_include.yml | 14 +- .rubocop_todo/rails/where_exists.yml | 44 ----- GITALY_SERVER_VERSION | 2 +- .../boards/components/board_app.vue | 4 +- .../boards/components/board_content.vue | 77 ++++++++- app/assets/javascripts/boards/index.js | 2 + .../issuable_bulk_update_sidebar.js | 4 +- .../pipelines/components/dag/dag.vue | 4 +- .../pipelines/components/pipeline_tabs.vue | 62 ++++--- app/assets/javascripts/pipelines/constants.js | 3 +- .../pipelines/pipeline_details_bundle.js | 10 +- .../javascripts/pipelines/pipeline_tabs.js | 15 +- app/assets/javascripts/pipelines/routes.js | 20 +++ app/assets/javascripts/pipelines/utils.js | 17 +- .../bulk_update_milestone_dropdown.vue | 75 +++++++++ .../sidebar/components/sidebar_dropdown.vue | 12 +- app/assets/javascripts/sidebar/constants.js | 11 +- .../javascripts/sidebar/mount_sidebar.js | 26 +++ app/controllers/groups/boards_controller.rb | 1 + app/controllers/projects/boards_controller.rb | 1 + .../projects/pipelines_controller.rb | 22 +-- app/helpers/projects/pipeline_helper.rb | 1 + .../alert_management/http_integration.rb | 3 +- app/models/application_setting.rb | 8 - app/serializers/project_import_entity.rb | 10 +- .../application_settings/general.html.haml | 1 + .../service_usage_data.html.haml | 2 +- app/views/projects/branches/index.html.haml | 2 +- app/views/projects/pipelines/show.html.haml | 2 +- .../issuable/_bulk_update_sidebar.html.haml | 2 +- .../development/apollo_boards.yml | 8 + ...able_new_sentry_clientside_integration.yml | 8 + ...able_old_sentry_clientside_integration.yml | 8 + .../development/search_index_curation.yml | 8 + config/open_api.yml | 2 + ...42_remove_users_foreign_key_to_projects.rb | 15 ++ db/schema_migrations/20221104094042 | 1 + db/structure.sql | 3 - doc/administration/index.md | 3 - .../gitlab_rails_cheat_sheet.md | 94 +---------- doc/administration/troubleshooting/index.md | 8 +- doc/subscriptions/gitlab_com/index.md | 24 +++ lib/api/api.rb | 2 +- lib/api/entities/basic_project_details.rb | 21 ++- .../entities/basic_repository_storage_move.rb | 10 +- lib/api/entities/project.rb | 158 +++++++++--------- lib/api/entities/project_group_link.rb | 6 +- lib/api/entities/project_identity.rb | 11 +- .../entities/project_repository_storage.rb | 10 +- lib/api/import_github.rb | 22 ++- lib/gitlab/database/migration_helpers.rb | 14 ++ .../index_helpers.rb | 2 +- lib/gitlab/database/postgres_partition.rb | 14 ++ lib/gitlab/gon_helper.rb | 9 +- locale/gitlab.pot | 64 +++++-- .../gitlab_migration_large_project_spec.rb | 15 +- .../projects/pipelines_controller_spec.rb | 52 ++---- spec/db/schema_spec.rb | 2 +- spec/features/boards/board_filters_spec.rb | 1 + spec/features/boards/boards_spec.rb | 35 ++-- spec/features/boards/issue_ordering_spec.rb | 1 + spec/features/boards/sidebar_labels_spec.rb | 1 + spec/features/boards/sidebar_spec.rb | 1 + .../boards/user_adds_lists_to_board_spec.rb | 1 + .../features/boards/user_visits_board_spec.rb | 3 + spec/features/groups/board_sidebar_spec.rb | 1 + .../incidents/user_views_incident_spec.rb | 60 ++++--- .../user_bulk_edits_issues_labels_spec.rb | 2 +- .../issues/user_bulk_edits_issues_spec.rb | 4 +- .../merge_requests/user_mass_updates_spec.rb | 2 +- .../boards/components/board_app_spec.js | 1 + .../boards/components/board_content_spec.js | 44 ++++- spec/frontend/boards/mock_data.js | 23 +++ .../components/pipeline_tabs_spec.js | 26 +-- .../pipelines/pipeline_graph/utils_spec.js | 17 +- spec/frontend/pipelines/pipeline_tabs_spec.js | 32 +--- .../bulk_update_milestone_dropdown_spec.js | 74 ++++++++ spec/helpers/projects/pipeline_helper_spec.rb | 1 + .../gitlab/database/migration_helpers_spec.rb | 66 ++++++++ .../index_helpers_spec.rb | 9 +- .../database/postgres_partition_spec.rb | 32 ++++ spec/lib/gitlab/gon_helper_spec.rb | 66 ++++++++ .../alert_management/http_integration_spec.rb | 9 +- spec/support/rspec_order_todo.yml | 1 - .../multiple_issue_boards_shared_examples.rb | 2 + ...and_scoped_issue_boards_shared_examples.rb | 1 + workhorse/internal/upstream/routes.go | 2 + workhorse/upload_test.go | 2 + 90 files changed, 1064 insertions(+), 512 deletions(-) delete mode 100644 .rubocop_todo/rails/where_exists.yml create mode 100644 app/assets/javascripts/pipelines/routes.js create mode 100644 app/assets/javascripts/sidebar/components/milestone/bulk_update_milestone_dropdown.vue create mode 100644 config/feature_flags/development/apollo_boards.yml create mode 100644 config/feature_flags/development/enable_new_sentry_clientside_integration.yml create mode 100644 config/feature_flags/development/enable_old_sentry_clientside_integration.yml create mode 100644 config/feature_flags/development/search_index_curation.yml create mode 100644 db/migrate/20221104094042_remove_users_foreign_key_to_projects.rb create mode 100644 db/schema_migrations/20221104094042 create mode 100644 spec/frontend/sidebar/components/milestone/bulk_update_milestone_dropdown_spec.js diff --git a/.rubocop.yml b/.rubocop.yml index 3ae3ce89be0..ad5bb5e9a13 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -308,6 +308,10 @@ Rails/RakeEnvironment: # Context on why it's disabled: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/93419#note_1048223982 Enabled: false +# See https://gitlab.com/gitlab-org/gitlab/-/merge_requests/96675#note_1094403693 +Rails/WhereExists: + Enabled: false + # GitLab ################################################################### Gitlab/ModuleWithInstanceVariables: diff --git a/.rubocop_todo/layout/line_length.yml b/.rubocop_todo/layout/line_length.yml index d8d493b4731..ee095512645 100644 --- a/.rubocop_todo/layout/line_length.yml +++ b/.rubocop_todo/layout/line_length.yml @@ -3920,7 +3920,6 @@ Layout/LineLength: - 'spec/features/groups/settings/repository_spec.rb' - 'spec/features/groups_spec.rb' - 'spec/features/ide/static_object_external_storage_csp_spec.rb' - - 'spec/features/incidents/user_views_incident_spec.rb' - 'spec/features/invites_spec.rb' - 'spec/features/issuables/issuable_list_spec.rb' - 'spec/features/issuables/markdown_references/internal_references_spec.rb' diff --git a/.rubocop_todo/rails/negate_include.yml b/.rubocop_todo/rails/negate_include.yml index 7bf78b82b60..c3f9ac25e7e 100644 --- a/.rubocop_todo/rails/negate_include.yml +++ b/.rubocop_todo/rails/negate_include.yml @@ -1,30 +1,28 @@ --- # Cop supports --auto-correct. Rails/NegateInclude: - # Offense count: 65 - # Temporarily disabled due to too many offenses - Enabled: false + Details: grace period Exclude: - 'app/finders/projects_finder.rb' - 'app/helpers/application_settings_helper.rb' - 'app/helpers/projects_helper.rb' - 'app/helpers/tree_helper.rb' - - 'app/models/concerns/timebox.rb' - 'app/models/integrations/chat_message/pipeline_message.rb' + - 'app/models/integrations/field.rb' - 'app/models/label.rb' - 'app/models/merge_request.rb' + - 'app/models/milestone.rb' - 'app/services/todo_service.rb' + - 'app/services/work_items/parent_links/create_service.rb' - 'config/application.rb' - 'config/initializers/1_settings.rb' - 'danger/roulette/Dangerfile' - 'ee/app/finders/security/pipeline_vulnerabilities_finder.rb' - - 'ee/app/models/ee/epic.rb' - 'ee/app/models/ee/vulnerability.rb' - 'ee/app/services/epic_issues/create_service.rb' - 'ee/app/services/security/ingestion/tasks/ingest_remediations.rb' - 'ee/app/services/security/security_orchestration_policies/validate_policy_service.rb' - 'lib/api/maven_packages.rb' - - 'lib/generators/gitlab/usage_metric_generator.rb' - 'lib/gitlab/background_migration/legacy_upload_mover.rb' - 'lib/gitlab/ci/build/rules/rule/clause/exists.rb' - 'lib/gitlab/ci/parsers/coverage/sax_document.rb' @@ -38,11 +36,10 @@ Rails/NegateInclude: - 'lib/gitlab/task_helpers.rb' - 'lib/gitlab/url_blocker.rb' - 'lib/gitlab_edition.rb' + - 'qa/qa/page/merge_request/show.rb' - 'qa/qa/runtime/ip_address.rb' - 'qa/qa/support/run.rb' - 'qa/qa/tools/delete_test_users.rb' - - 'qa/qa/vendor/jenkins/page/configure_job.rb' - - 'qa/qa/vendor/jenkins/page/last_job_console.rb' - 'rubocop/cop/gitlab/feature_available_usage.rb' - 'rubocop/cop/graphql/id_type.rb' - 'rubocop/cop/migration/add_reference.rb' @@ -56,3 +53,4 @@ Rails/NegateInclude: - 'spec/support/matchers/pushed_frontend_feature_flags_matcher.rb' - 'spec/support/shared_contexts/markdown_golden_master_shared_examples.rb' - 'spec/uploaders/object_storage_spec.rb' + - 'tooling/danger/specs.rb' diff --git a/.rubocop_todo/rails/where_exists.yml b/.rubocop_todo/rails/where_exists.yml deleted file mode 100644 index 77722549722..00000000000 --- a/.rubocop_todo/rails/where_exists.yml +++ /dev/null @@ -1,44 +0,0 @@ ---- -# Cop supports --auto-correct. -Rails/WhereExists: - # Offense count: 48 - # Temporarily disabled due to too many offenses - Enabled: false - Exclude: - - 'app/models/application_setting/term.rb' - - 'app/models/ci/pipeline_artifact.rb' - - 'app/models/ci/ref.rb' - - 'app/models/clusters/agent.rb' - - 'app/models/concerns/has_wiki.rb' - - 'app/models/concerns/noteable.rb' - - 'app/models/container_repository.rb' - - 'app/models/design_management/design.rb' - - 'app/models/group.rb' - - 'app/models/group_deploy_token.rb' - - 'app/models/label.rb' - - 'app/models/lfs_object.rb' - - 'app/models/merge_request_diff.rb' - - 'app/models/namespace.rb' - - 'app/models/project.rb' - - 'app/models/protected_branch/push_access_level.rb' - - 'app/services/projects/transfer_service.rb' - - 'app/services/todos/destroy/unauthorized_features_service.rb' - - 'db/migrate/20210422195929_create_elastic_reindexing_slices.rb' - - 'ee/app/models/approval_merge_request_rule_source.rb' - - 'ee/app/models/concerns/ee/protected_ref_access.rb' - - 'ee/app/models/ee/epic.rb' - - 'ee/app/models/ee/group_member.rb' - - 'ee/app/models/ee/milestone_release.rb' - - 'ee/app/models/geo_node.rb' - - 'ee/app/models/merge_requests/external_status_check.rb' - - 'ee/app/models/merge_train.rb' - - 'ee/app/workers/concerns/elastic/indexing_control.rb' - - 'lib/gitlab/auth.rb' - - 'lib/gitlab/checks/matching_merge_request.rb' - - 'lib/gitlab/database/partitioning/detached_partition_dropper.rb' - - 'spec/lib/bulk_imports/projects/pipelines/snippets_repository_pipeline_spec.rb' - - 'spec/migrations/recreate_index_security_ci_builds_on_name_and_id_parser_features_spec.rb' - - 'spec/migrations/recreate_index_security_ci_builds_on_name_and_id_parser_with_new_features_spec.rb' - - 'spec/models/user_spec.rb' - - 'spec/services/clusters/cleanup/service_account_service_spec.rb' - - 'spec/services/clusters/destroy_service_spec.rb' diff --git a/GITALY_SERVER_VERSION b/GITALY_SERVER_VERSION index 8b4dcdffca0..47ff9d7c870 100644 --- a/GITALY_SERVER_VERSION +++ b/GITALY_SERVER_VERSION @@ -1 +1 @@ -b55578ec476e8bc8ecd9775ee7e9960b52e0f6e0 +f75740430e51520d3edcd22065285cec050d2b74 diff --git a/app/assets/javascripts/boards/components/board_app.vue b/app/assets/javascripts/boards/components/board_app.vue index af753151be8..1335a3b108b 100644 --- a/app/assets/javascripts/boards/components/board_app.vue +++ b/app/assets/javascripts/boards/components/board_app.vue @@ -11,7 +11,7 @@ export default { BoardSettingsSidebar, BoardTopBar, }, - inject: ['disabled'], + inject: ['disabled', 'fullBoardId'], computed: { ...mapGetters(['isSidebarOpen']), }, @@ -27,7 +27,7 @@ export default { diff --git a/app/assets/javascripts/boards/components/board_content.vue b/app/assets/javascripts/boards/components/board_content.vue index 0d2e49c966f..9230513ff93 100644 --- a/app/assets/javascripts/boards/components/board_content.vue +++ b/app/assets/javascripts/boards/components/board_content.vue @@ -3,12 +3,24 @@ import { GlAlert } from '@gitlab/ui'; import { sortBy, throttle } from 'lodash'; import Draggable from 'vuedraggable'; import { mapState, mapGetters, mapActions } from 'vuex'; +import { s__ } from '~/locale'; +import { formatBoardLists } from 'ee_else_ce/boards/boards_util'; import BoardAddNewColumn from 'ee_else_ce/boards/components/board_add_new_column.vue'; import { defaultSortableOptions } from '~/sortable/constants'; -import { DraggableItemTypes } from '../constants'; +import { + DraggableItemTypes, + issuableTypes, + BoardType, + listsQuery, +} from 'ee_else_ce/boards/constants'; import BoardColumn from './board_column.vue'; export default { + i18n: { + fetchError: s__( + 'Boards|An error occurred while fetching the board lists. Please reload the page.', + ), + }, draggableItemTypes: DraggableItemTypes, components: { BoardAddNewColumn, @@ -19,26 +31,76 @@ export default { EpicsSwimlanes: () => import('ee_component/boards/components/epics_swimlanes.vue'), GlAlert, }, - inject: ['canAdminList'], + inject: ['canAdminList', 'boardType', 'fullPath', 'issuableType', 'isApolloBoard'], props: { disabled: { type: Boolean, required: true, }, + boardId: { + type: String, + required: true, + }, }, data() { return { boardHeight: null, + boardListsApollo: {}, + apolloError: null, + updatedBoardId: this.boardId, }; }, + apollo: { + boardListsApollo: { + query() { + return listsQuery[this.issuableType].query; + }, + variables() { + return this.queryVariables; + }, + skip() { + return !this.isApolloBoard; + }, + update(data) { + const { lists } = data[this.boardType].board; + return formatBoardLists(lists); + }, + result() { + // this allows us to delay fetching lists when we switch a board to fetch the actual board lists + // instead of fetching lists for the "previous" board + this.updatedBoardId = this.boardId; + }, + error() { + this.apolloError = this.$options.i18n.fetchError; + }, + }, + }, computed: { ...mapState(['boardLists', 'error', 'addColumnForm']), - ...mapGetters(['isSwimlanesOn', 'isEpicBoard', 'isIssueBoard']), + ...mapGetters(['isSwimlanesOn']), + isIssueBoard() { + return this.issuableType === issuableTypes.issue; + }, + isEpicBoard() { + return this.issuableType === issuableTypes.epic; + }, addColumnFormVisible() { return this.addColumnForm?.visible; }, + queryVariables() { + return { + ...(this.isIssueBoard && { + isGroup: this.boardType === BoardType.group, + isProject: this.boardType === BoardType.project, + }), + fullPath: this.fullPath, + boardId: this.boardId, + filterParams: this.filterParams, + }; + }, boardListsToUse() { - return sortBy([...Object.values(this.boardLists)], 'position'); + const lists = this.isApolloBoard ? this.boardListsApollo : this.boardLists; + return sortBy([...Object.values(lists)], 'position'); }, canDragColumns() { return this.canAdminList; @@ -59,6 +121,9 @@ export default { return this.canDragColumns ? options : {}; }, + errorToDisplay() { + return this.isApolloBoard ? this.apolloError : this.error; + }, }, mounted() { this.setBoardHeight(); @@ -88,8 +153,8 @@ export default {