From 3ca896b640def57a58485def308748b2fccbd0bb Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Tue, 23 May 2023 18:08:27 +0000 Subject: Add latest changes from gitlab-org/gitlab@master --- .gitlab/CODEOWNERS | 2 +- .gitlab/ci/qa-common/main.gitlab-ci.yml | 2 +- .gitlab/ci/review-apps/qa.gitlab-ci.yml | 46 ++--- .gitlab/ci/review.gitlab-ci.yml | 29 ++- .../Service Ping reporting and monitoring.md | 6 +- .rubocop_todo/layout/argument_alignment.yml | 12 -- GITLAB_SHELL_VERSION | 2 +- Gemfile | 2 +- Gemfile.checksum | 10 +- Gemfile.lock | 4 +- .../javascripts/blob/components/table_contents.vue | 5 - .../boards/components/board_list_header.vue | 10 - .../components/available_agents_dropdown.vue | 3 - .../components/design_notes/design_reply_form.vue | 2 +- .../javascripts/diffs/components/diff_file.vue | 3 + .../diffs/components/diff_line_note_form.vue | 1 + app/assets/javascripts/diffs/store/actions.js | 20 ++ .../environments/components/edit_environment.vue | 41 ++++ .../mutations/update_environment.mutation.graphql | 9 + .../components/grafana_integration.vue | 131 ------------- .../javascripts/grafana_integration/index.js | 17 -- .../grafana_integration/store/actions.js | 44 ----- .../javascripts/grafana_integration/store/index.js | 16 -- .../grafana_integration/store/mutation_types.js | 3 - .../grafana_integration/store/mutations.js | 13 -- .../javascripts/grafana_integration/store/state.js | 8 - .../show/components/task_list_item_actions.vue | 6 - .../javascripts/notes/components/note_actions.vue | 12 -- .../javascripts/notes/components/note_form.vue | 7 +- .../components/form_group/dashboard_timezone.vue | 60 ------ .../components/form_group/external_dashboard.vue | 48 ----- .../components/metrics_settings.vue | 55 ------ app/assets/javascripts/operation_settings/index.js | 17 -- .../operation_settings/store/actions.js | 41 ---- .../javascripts/operation_settings/store/index.js | 16 -- .../operation_settings/store/mutation_types.js | 2 - .../operation_settings/store/mutations.js | 10 - .../javascripts/operation_settings/store/state.js | 10 - .../projects/settings/operations/show/index.js | 4 - .../super_sidebar/components/create_menu.vue | 5 - .../super_sidebar/components/help_center.vue | 10 +- .../super_sidebar/components/user_menu.vue | 1 + .../vue_shared/components/markdown/header.vue | 1 + .../components/work_item_award_emoji.vue | 18 +- .../graphql/award_emoji.fragment.graphql | 1 + app/assets/stylesheets/framework/diffs.scss | 2 +- app/controllers/admin/users_controller.rb | 2 +- app/controllers/concerns/web_ide_csp.rb | 34 ++-- .../projects/environments_controller.rb | 4 + app/models/abuse_report.rb | 15 +- app/models/project_import_data.rb | 12 +- app/models/project_team.rb | 16 +- app/models/prometheus_alert.rb | 2 +- app/models/release.rb | 6 +- app/models/releases/source.rb | 8 +- app/models/remote_mirror.rb | 18 +- app/models/repository.rb | 33 ++-- app/models/resource_timebox_event.rb | 5 +- app/models/terraform/state.rb | 2 +- app/models/time_tracking/timelog_category.rb | 6 +- app/models/user.rb | 6 +- .../json_schemas/abuse_report_evidence.json | 107 +++++++++++ app/views/clusters/clusters/_banner.html.haml | 4 +- .../clusters/clusters/_deprecation_alert.html.haml | 2 +- .../clusters/_gcp_signup_offer_banner.html.haml | 4 +- .../projects/_blank_state_welcome.html.haml | 2 +- app/views/devise/sessions/_new_ldap.html.haml | 2 +- app/views/devise/shared/_error_messages.html.haml | 2 +- app/views/devise/shared/_omniauth_box.html.haml | 2 +- app/views/explore/projects/_filter.html.haml | 2 +- app/views/import/shared/_errors.html.haml | 2 +- .../header/_registration_enabled_callout.html.haml | 4 +- app/views/layouts/terms.html.haml | 4 +- app/views/profiles/accounts/show.html.haml | 4 +- app/views/profiles/active_sessions/index.html.haml | 2 +- app/views/profiles/chat_names/new.html.haml | 6 +- app/views/profiles/keys/_key_details.html.haml | 8 +- app/views/profiles/notifications/show.html.haml | 2 +- app/views/profiles/two_factor_auths/show.html.haml | 6 +- .../projects/mirrors/_branch_filter.html.haml | 15 +- .../operations/_grafana_integration.html.haml | 2 - .../operations/_metrics_dashboard.html.haml | 5 - .../projects/settings/operations/show.html.haml | 7 - .../shared/_create_protected_branch.html.haml | 6 +- app/views/registrations/welcome/show.html.haml | 2 +- .../development/add_validation_for_push_rules.yml | 8 + .../environment_settings_to_graphql.yml | 8 + .../fix_dora_deployment_frequency_calculation.yml | 8 - danger/roulette/Dangerfile | 2 +- .../20230517182802_add_fields_to_abuse_reports.rb | 30 +++ ...add_foreign_key_constraints_to_abuse_reports.rb | 20 ++ ...dd_foreign_key_to_abuse_reports_for_assignee.rb | 20 ++ ...new_async_index_table_name_length_constraint.rb | 15 ++ ...ate_async_index_table_name_length_constraint.rb | 13 ++ ...old_async_index_table_name_length_constraint.rb | 20 ++ db/schema_migrations/20230517182802 | 1 + db/schema_migrations/20230517182958 | 1 + db/schema_migrations/20230517183403 | 1 + db/schema_migrations/20230523073455 | 1 + db/schema_migrations/20230523074248 | 1 + db/schema_migrations/20230523074517 | 1 + db/structure.sql | 19 +- .../monitoring/prometheus/gitlab_metrics.md | 6 +- .../clickhouse_ingestion_pipeline/index.md | 4 +- doc/development/code_review.md | 2 +- doc/development/database_review.md | 2 +- doc/development/documentation/topic_types/index.md | 27 +-- doc/development/feature_development.md | 4 +- doc/development/service_ping/implement.md | 4 +- doc/development/service_ping/index.md | 6 +- doc/development/service_ping/metrics_dictionary.md | 4 +- .../service_ping/metrics_instrumentation.md | 2 +- doc/development/service_ping/metrics_lifecycle.md | 6 +- .../service_ping/performance_indicator_metrics.md | 4 +- doc/development/service_ping/review_guidelines.md | 4 +- doc/development/service_ping/troubleshooting.md | 6 +- doc/development/snowplow/index.md | 6 +- doc/development/snowplow/infrastructure.md | 12 +- doc/development/snowplow/review_guidelines.md | 2 +- doc/development/snowplow/troubleshooting.md | 4 +- doc/user/admin_area/settings/usage_statistics.md | 2 +- doc/user/group/manage.md | 4 +- .../database/async_indexes/postgres_async_index.rb | 24 ++- lib/gitlab/database/load_balancing/host.rb | 40 ++-- locale/gitlab.pot | 63 ++---- package.json | 2 +- scripts/utils.sh | 7 - spec/controllers/admin/users_controller_spec.rb | 2 +- spec/factories/abuse_reports.rb | 22 +++ .../issues/user_sorts_issue_comments_spec.rb | 1 - .../projects/settings/monitor_settings_spec.rb | 26 --- .../features/projects/work_items/work_item_spec.rb | 2 + .../components/abuse_report_actions_spec.js | 4 +- .../components/available_agents_dropwdown_spec.js | 1 - .../__snapshots__/design_note_spec.js.snap | 20 +- .../components/design_notes/design_note_spec.js | 9 +- .../frontend/environments/edit_environment_spec.js | 174 ++++++++++++----- .../__snapshots__/grafana_integration_spec.js.snap | 110 ----------- .../components/grafana_integration_spec.js | 119 ------------ .../grafana_integration/store/mutations_spec.js | 35 ---- .../show/components/task_list_item_actions_spec.js | 5 +- .../frontend/notes/components/note_actions_spec.js | 5 - .../components/metrics_settings_spec.js | 214 --------------------- .../operation_settings/store/mutations_spec.js | 29 --- .../super_sidebar/components/create_menu_spec.js | 12 +- .../super_sidebar/components/help_center_spec.js | 17 -- .../components/markdown/markdown_editor_spec.js | 25 ++- .../components/work_item_award_emoji_spec.js | 89 ++++++++- spec/frontend/work_items/mock_data.js | 2 + .../async_indexes/postgres_async_index_spec.rb | 40 +++- .../gitlab/database/load_balancing/host_spec.rb | 15 +- ...sync_index_table_name_length_constraint_spec.rb | 64 ++++++ spec/models/abuse_report_spec.rb | 54 +++++- spec/models/user_spec.rb | 5 +- spec/requests/ide_controller_spec.rb | 21 +- .../requests/web_ide/remote_ide_controller_spec.rb | 19 +- .../helpers/content_security_policy_helpers.rb | 18 ++ .../features/work_items_shared_examples.rb | 44 +++-- tooling/danger/analytics_instrumentation.rb | 2 +- .../src/components/DynamicScroller.vue | 24 +-- yarn.lock | 8 +- 161 files changed, 1164 insertions(+), 1627 deletions(-) create mode 100644 app/assets/javascripts/environments/graphql/mutations/update_environment.mutation.graphql delete mode 100644 app/assets/javascripts/grafana_integration/components/grafana_integration.vue delete mode 100644 app/assets/javascripts/grafana_integration/index.js delete mode 100644 app/assets/javascripts/grafana_integration/store/actions.js delete mode 100644 app/assets/javascripts/grafana_integration/store/index.js delete mode 100644 app/assets/javascripts/grafana_integration/store/mutation_types.js delete mode 100644 app/assets/javascripts/grafana_integration/store/mutations.js delete mode 100644 app/assets/javascripts/grafana_integration/store/state.js delete mode 100644 app/assets/javascripts/operation_settings/components/form_group/dashboard_timezone.vue delete mode 100644 app/assets/javascripts/operation_settings/components/form_group/external_dashboard.vue delete mode 100644 app/assets/javascripts/operation_settings/components/metrics_settings.vue delete mode 100644 app/assets/javascripts/operation_settings/index.js delete mode 100644 app/assets/javascripts/operation_settings/store/actions.js delete mode 100644 app/assets/javascripts/operation_settings/store/index.js delete mode 100644 app/assets/javascripts/operation_settings/store/mutation_types.js delete mode 100644 app/assets/javascripts/operation_settings/store/mutations.js delete mode 100644 app/assets/javascripts/operation_settings/store/state.js create mode 100644 app/validators/json_schemas/abuse_report_evidence.json delete mode 100644 app/views/projects/settings/operations/_grafana_integration.html.haml delete mode 100644 app/views/projects/settings/operations/_metrics_dashboard.html.haml create mode 100644 config/feature_flags/development/add_validation_for_push_rules.yml create mode 100644 config/feature_flags/development/environment_settings_to_graphql.yml delete mode 100644 config/feature_flags/development/fix_dora_deployment_frequency_calculation.yml create mode 100644 db/migrate/20230517182802_add_fields_to_abuse_reports.rb create mode 100644 db/migrate/20230517182958_add_foreign_key_constraints_to_abuse_reports.rb create mode 100644 db/migrate/20230517183403_add_foreign_key_to_abuse_reports_for_assignee.rb create mode 100644 db/migrate/20230523073455_add_new_async_index_table_name_length_constraint.rb create mode 100644 db/migrate/20230523074248_validate_async_index_table_name_length_constraint.rb create mode 100644 db/migrate/20230523074517_remove_old_async_index_table_name_length_constraint.rb create mode 100644 db/schema_migrations/20230517182802 create mode 100644 db/schema_migrations/20230517182958 create mode 100644 db/schema_migrations/20230517183403 create mode 100644 db/schema_migrations/20230523073455 create mode 100644 db/schema_migrations/20230523074248 create mode 100644 db/schema_migrations/20230523074517 delete mode 100644 spec/frontend/grafana_integration/components/__snapshots__/grafana_integration_spec.js.snap delete mode 100644 spec/frontend/grafana_integration/components/grafana_integration_spec.js delete mode 100644 spec/frontend/grafana_integration/store/mutations_spec.js delete mode 100644 spec/frontend/operation_settings/components/metrics_settings_spec.js delete mode 100644 spec/frontend/operation_settings/store/mutations_spec.js create mode 100644 spec/migrations/remove_old_async_index_table_name_length_constraint_spec.rb diff --git a/.gitlab/CODEOWNERS b/.gitlab/CODEOWNERS index 46258bf6b7b..0face29d47d 100644 --- a/.gitlab/CODEOWNERS +++ b/.gitlab/CODEOWNERS @@ -279,7 +279,7 @@ Dangerfile /ee/app/assets/javascripts/vue_shared/components/customizable_dashboard/panels_base.vue /ee/app/assets/javascripts/product_analytics/ -^[Analytics Instrumentation] @gitlab-org/analytics-section/product-intelligence/engineers +^[Analytics Instrumentation] @gitlab-org/analytics-section/analytics-instrumentation/engineers /ee/lib/gitlab/usage_data_counters/ /ee/lib/ee/gitlab/usage_data.rb /lib/gitlab/usage_data.rb diff --git a/.gitlab/ci/qa-common/main.gitlab-ci.yml b/.gitlab/ci/qa-common/main.gitlab-ci.yml index 1576ddaee7d..44942fe8112 100644 --- a/.gitlab/ci/qa-common/main.gitlab-ci.yml +++ b/.gitlab/ci/qa-common/main.gitlab-ci.yml @@ -6,7 +6,7 @@ workflow: include: - project: gitlab-org/quality/pipeline-common - ref: 5.2.2 + ref: 5.3.0 file: - /ci/base.gitlab-ci.yml - /ci/allure-report.yml diff --git a/.gitlab/ci/review-apps/qa.gitlab-ci.yml b/.gitlab/ci/review-apps/qa.gitlab-ci.yml index bbf8493b12a..ccbdfd3c298 100644 --- a/.gitlab/ci/review-apps/qa.gitlab-ci.yml +++ b/.gitlab/ci/review-apps/qa.gitlab-ci.yml @@ -1,10 +1,5 @@ include: - - project: gitlab-org/quality/pipeline-common - ref: 5.1.1 - file: - - /ci/base.gitlab-ci.yml - - /ci/allure-report.yml - - /ci/knapsack-report.yml + - local: .gitlab/ci/qa-common/main.gitlab-ci.yml - template: Verify/Browser-Performance.gitlab-ci.yml .test-variables: @@ -21,7 +16,7 @@ include: .bundle-base: extends: - .qa-cache - image: ${REGISTRY_HOST}/${REGISTRY_GROUP}/gitlab-build-images/debian-${DEBIAN_VERSION}-ruby-${RUBY_VERSION}:bundler-2.3 + - .ruby-image before_script: - cd qa && bundle install @@ -75,8 +70,6 @@ review-qa-smoke: - .rules:qa-smoke variables: QA_SCENARIO: Test::Instance::Smoke - QA_RUN_TYPE: review-qa-smoke - retry: 1 review-qa-blocking: extends: @@ -84,7 +77,6 @@ review-qa-blocking: - .rules:qa-blocking variables: QA_SCENARIO: Test::Instance::ReviewBlocking - QA_RUN_TYPE: review-qa-blocking retry: 1 review-qa-blocking-parallel: extends: @@ -98,7 +90,6 @@ review-qa-non-blocking: - .rules:qa-non-blocking variables: QA_SCENARIO: Test::Instance::ReviewNonBlocking - QA_RUN_TYPE: review-qa-non-blocking when: manual allow_failure: true review-qa-non-blocking-parallel: @@ -118,18 +109,12 @@ browser_performance: e2e-test-report: extends: - - .generate-allure-report-base + - .e2e-test-report - .rules:prepare-report stage: post-qa variables: - ALLURE_JOB_NAME: e2e-review-qa - ALLURE_PROJECT_PATH: $CI_PROJECT_PATH ALLURE_RESULTS_GLOB: qa/tmp/allure-results - ALLURE_MERGE_REQUEST_IID: $CI_MERGE_REQUEST_IID - GITLAB_AUTH_TOKEN: $PROJECT_TOKEN_FOR_CI_SCRIPTS_API_USAGE - GIT_STRATEGY: none - allow_failure: true - when: always + ALLURE_JOB_NAME: $QA_RUN_TYPE upload-knapsack-report: extends: @@ -145,38 +130,29 @@ delete-test-resources: - .rules:prepare-report stage: post-qa variables: - QA_TEST_RESOURCES_FILE_PATTERN: $CI_PROJECT_DIR/qa/tmp/test-resources-*.json GITLAB_QA_ACCESS_TOKEN: $REVIEW_APPS_ROOT_TOKEN script: - export GITLAB_ADDRESS="$QA_GITLAB_URL" - - bundle exec rake "test_resources:delete[$QA_TEST_RESOURCES_FILE_PATTERN]" + - bundle exec rake "test_resources:delete[$CI_PROJECT_DIR/qa/tmp/test-resources-*.json]" allow_failure: true - when: always notify-slack: extends: - - .notify-slack-qa - - .qa-cache + - .notify-slack - .rules:main-run stage: post-qa variables: + QA_RSPEC_XML_FILE_PATTERN: ${CI_PROJECT_DIR}/qa/tmp/rspec-*.xml RUN_WITH_BUNDLE: "true" - QA_PATH: qa - ALLURE_JOB_NAME: e2e-review-qa - SLACK_ICON_EMOJI: ci_failing - STATUS_SYM: ☠️ - STATUS: failed - TYPE: "(review-app) " + ALLURE_JOB_NAME: $QA_RUN_TYPE when: on_failure - script: - - bundle exec prepare-stage-reports --input-files "${CI_PROJECT_DIR}/qa/tmp/rspec-*.xml" - - !reference [.notify-slack-qa, script] export-test-metrics: extends: + - .export-test-metrics - .bundle-base - .rules:main-run stage: post-qa + variables: + QA_METRICS_REPORT_FILE_PATTERN: tmp/test-metrics-*.json when: always - script: - - bundle exec rake "ci:export_test_metrics[tmp/test-metrics-*.json]" diff --git a/.gitlab/ci/review.gitlab-ci.yml b/.gitlab/ci/review.gitlab-ci.yml index 9d1d86b2696..c3f14011c5b 100644 --- a/.gitlab/ci/review.gitlab-ci.yml +++ b/.gitlab/ci/review.gitlab-ci.yml @@ -101,36 +101,33 @@ start-review-app-pipeline: SCHEDULE_TYPE: $SCHEDULE_TYPE DAST_RUN: $DAST_RUN SKIP_MESSAGE: Skipping review-app due to mr containing only quarantine changes! + QA_RUN_TYPE: e2e-review-qa trigger: strategy: depend include: - artifact: review-app-pipeline.yml job: e2e-test-pipeline-generate +include: + - project: gitlab-org/quality/pipeline-common + ref: 5.2.2 + file: + - /ci/danger-review.yml + danger-review: extends: - .default-retry - .ruby-node-cache - .review:rules:danger - stage: test - needs: [] + image: "${DEFAULT_CI_IMAGE}" before_script: - source scripts/utils.sh - bundle_install_script "--with danger" - yarn_install_script - script: - # ${DANGER_DANGERFILE} is used by Jihulab for customizing danger support: https://jihulab.com/gitlab-cn/gitlab/-/blob/main-jh/jh/.gitlab-ci.yml - - > - if [ -z "$DANGER_GITLAB_API_TOKEN" ]; then - run_timed_command danger_as_local - else - danger_id=$(echo -n ${DANGER_GITLAB_API_TOKEN} | md5sum | awk '{print $1}' | cut -c5-10) - run_timed_command "bundle exec danger --fail-on-errors=true --verbose --danger_id=\"${danger_id}\" --dangerfile=\"${DANGER_DANGERFILE:-Dangerfile}\"" - fi danger-review-local: - extends: - - danger-review - - .review:rules:danger-local - script: - - run_timed_command danger_as_local + extends: danger-review + before_script: + - !reference ["danger-review", "before_script"] + # We unset DANGER_GITLAB_API_TOKEN so that Danger will run as local from `danger-review:script` + - unset DANGER_GITLAB_API_TOKEN diff --git a/.gitlab/issue_templates/Service Ping reporting and monitoring.md b/.gitlab/issue_templates/Service Ping reporting and monitoring.md index baa384a8aa2..d8d93ee73c4 100644 --- a/.gitlab/issue_templates/Service Ping reporting and monitoring.md +++ b/.gitlab/issue_templates/Service Ping reporting and monitoring.md @@ -1,6 +1,6 @@ - + -The [Product Intelligence group](https://about.gitlab.com/handbook/engineering/development/analytics/product-intelligence/) runs manual reporting of ServicePing for GitLab.com on a weekly basis. This issue: +The [Analytics Instrumentation group](https://about.gitlab.com/handbook/engineering/development/analytics/analytics-instrumentation/) runs manual reporting of ServicePing for GitLab.com on a weekly basis. This issue: - Captures the work required to complete the reporting process,. - Captures the follow-up tasks that are focused on metrics performance verification. @@ -123,7 +123,7 @@ If you get mentioned, check the failing metric and open an optimization issue. /confidential -/label ~"group::product intelligence" ~"devops::analytics" ~backend ~"section::analytics" ~"Category:Service Ping" +/label ~"group::analytics instrumentation" ~"devops::analytics" ~backend ~"section::analytics" ~"Category:Service Ping" /epic https://gitlab.com/groups/gitlab-org/-/epics/6000 /weight 5 /title Monitor and Generate GitLab.com Service Ping diff --git a/.rubocop_todo/layout/argument_alignment.yml b/.rubocop_todo/layout/argument_alignment.yml index b74cb450320..765de6db997 100644 --- a/.rubocop_todo/layout/argument_alignment.yml +++ b/.rubocop_todo/layout/argument_alignment.yml @@ -528,18 +528,6 @@ Layout/ArgumentAlignment: - 'app/models/pages_domain_acme_order.rb' - 'app/models/project.rb' - 'app/models/project_feature.rb' - - 'app/models/project_import_data.rb' - - 'app/models/project_team.rb' - - 'app/models/prometheus_alert.rb' - - 'app/models/release.rb' - - 'app/models/releases/source.rb' - - 'app/models/remote_mirror.rb' - - 'app/models/repository.rb' - - 'app/models/resource_timebox_event.rb' - - 'app/models/service_desk_setting.rb' - - 'app/models/terraform/state.rb' - - 'app/models/time_tracking/timelog_category.rb' - - 'app/models/u2f_registration.rb' - 'app/services/compare_service.rb' - 'app/services/concerns/rate_limited_service.rb' - 'app/services/design_management/copy_design_collection/copy_service.rb' diff --git a/GITLAB_SHELL_VERSION b/GITLAB_SHELL_VERSION index a3eb5a03fa6..0edfba1c6f4 100644 --- a/GITLAB_SHELL_VERSION +++ b/GITLAB_SHELL_VERSION @@ -1 +1 @@ -14.20.0 +14.21.0 diff --git a/Gemfile b/Gemfile index e6f99f56b25..b50baa992a1 100644 --- a/Gemfile +++ b/Gemfile @@ -362,7 +362,7 @@ gem 'snowplow-tracker', '~> 0.8.0' # Metrics gem 'webrick', '~> 1.8.1', require: false -gem 'prometheus-client-mmap', '~> 0.23', require: 'prometheus/client' +gem 'prometheus-client-mmap', '~> 0.24', require: 'prometheus/client' gem 'warning', '~> 1.3.0' diff --git a/Gemfile.checksum b/Gemfile.checksum index 63e4d83f50c..f6f50484232 100644 --- a/Gemfile.checksum +++ b/Gemfile.checksum @@ -452,11 +452,11 @@ {"name":"premailer","version":"1.16.0","platform":"ruby","checksum":"03e4402c448e6bae13fb5f6301a8bde4f3508e1bff90ae7c0972c7be94694786"}, {"name":"premailer-rails","version":"1.10.3","platform":"ruby","checksum":"7cdcb97027866f7a81c490c6d15ada7f39666b5f6375f0821b7e97e0483b112f"}, {"name":"proc_to_ast","version":"0.1.0","platform":"ruby","checksum":"92a73fa66e2250a83f8589f818b0751bcf227c68f85916202df7af85082f8691"}, -{"name":"prometheus-client-mmap","version":"0.23.1","platform":"aarch64-linux","checksum":"4091121090d1d44747b3d09f2dbd5fdd61e274d557b8ed98b06c65cdd006d174"}, -{"name":"prometheus-client-mmap","version":"0.23.1","platform":"arm64-darwin","checksum":"fa54f230631852392b38cba1ad396c0472cb9f088eef563d0c381b19b1333855"}, -{"name":"prometheus-client-mmap","version":"0.23.1","platform":"ruby","checksum":"48545f23217a5e85ca79fa8c2563711e319debdae46ddbd6348ff37f48029c40"}, -{"name":"prometheus-client-mmap","version":"0.23.1","platform":"x86_64-darwin","checksum":"99b56f4017f0a1a062914da253c613b9957bfabf5b38af5012e3d8515ed49555"}, -{"name":"prometheus-client-mmap","version":"0.23.1","platform":"x86_64-linux","checksum":"624da747dbb97e0d88be1f2ba5ae5253941fc85dea875845f5b4c7a2c95ee032"}, +{"name":"prometheus-client-mmap","version":"0.24.3","platform":"aarch64-linux","checksum":"e9e05922724a1caa2788dd32567ec9e3e95607fb32f8eb95bb95884061a3042e"}, +{"name":"prometheus-client-mmap","version":"0.24.3","platform":"arm64-darwin","checksum":"6b618db676f7286de80c1ffdc52d931fc474e470c34d652e38d74b46953955b8"}, +{"name":"prometheus-client-mmap","version":"0.24.3","platform":"ruby","checksum":"014542ebeb7b9187427c0d431fe5bcab9b07d293a25e61182a92e79cc95dde34"}, +{"name":"prometheus-client-mmap","version":"0.24.3","platform":"x86_64-darwin","checksum":"4fde644acbd01e149edda9c47746dca0dc9610951fc793a22989a069670cfe5c"}, +{"name":"prometheus-client-mmap","version":"0.24.3","platform":"x86_64-linux","checksum":"981dbaadfccb8652feac7fce7a129464274140dbb7603f5e5060b8536387eaa1"}, {"name":"pry","version":"0.14.2","platform":"java","checksum":"fd780670977ba04ff7ee32dabd4d02fe4bf02e977afe8809832d5dca1412862e"}, {"name":"pry","version":"0.14.2","platform":"ruby","checksum":"c4fe54efedaca1d351280b45b8849af363184696fcac1c72e0415f9bdac4334d"}, {"name":"pry-byebug","version":"3.10.1","platform":"ruby","checksum":"c8f975c32255bfdb29e151f5532130be64ff3d0042dc858d0907e849125581f8"}, diff --git a/Gemfile.lock b/Gemfile.lock index 857f0fe3a03..fe45768cdf9 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1145,7 +1145,7 @@ GEM coderay parser unparser - prometheus-client-mmap (0.23.1) + prometheus-client-mmap (0.24.3) rb_sys (~> 0.9) pry (0.14.2) coderay (~> 1.1) @@ -1859,7 +1859,7 @@ DEPENDENCIES pg_query (~> 2.2, >= 2.2.1) png_quantizator (~> 0.2.1) premailer-rails (~> 1.10.3) - prometheus-client-mmap (~> 0.23) + prometheus-client-mmap (~> 0.24) pry-byebug pry-rails (~> 0.3.9) pry-shell (~> 0.6.1) diff --git a/app/assets/javascripts/blob/components/table_contents.vue b/app/assets/javascripts/blob/components/table_contents.vue index 28e81b83713..ee8bd23f844 100644 --- a/app/assets/javascripts/blob/components/table_contents.vue +++ b/app/assets/javascripts/blob/components/table_contents.vue @@ -42,9 +42,6 @@ export default { } }, methods: { - close() { - this.$refs.disclosureDropdown?.close(); - }, generateHeaders() { const BASE_PADDING = 16; const headers = [...this.blobViewer.querySelectorAll('h1,h2,h3,h4,h5,h6')]; @@ -72,10 +69,8 @@ export default { diff --git a/app/assets/javascripts/boards/components/board_list_header.vue b/app/assets/javascripts/boards/components/board_list_header.vue index 1b711feb686..8e8d397549e 100644 --- a/app/assets/javascripts/boards/components/board_list_header.vue +++ b/app/assets/javascripts/boards/components/board_list_header.vue @@ -258,9 +258,6 @@ export default { }, methods: { ...mapActions(['updateList', 'setActiveId', 'toggleListCollapsed']), - closeListActions() { - this.$refs.headerListActions?.close(); - }, openSidebarSettings() { if (this.activeId === inactiveId) { sidebarEventHub.$emit('sidebar.closeAll'); @@ -277,8 +274,6 @@ export default { } this.track('click_button', { label: 'list_settings' }); - - this.closeListActions(); }, showScopedLabels(label) { return this.scopedLabelsAvailable && isScopedLabel(label); @@ -292,13 +287,9 @@ export default { } else { eventHub.$emit(`${toggleFormEventPrefix.issue}${this.list.id}`); } - - this.closeListActions(); }, showNewEpicForm() { eventHub.$emit(`${toggleFormEventPrefix.epic}${this.list.id}`); - - this.closeListActions(); }, toggleExpanded() { const collapsed = !this.list.collapsed; @@ -532,7 +523,6 @@ export default { { if (!this.noteUpdateDirty) { - this.autosaveDiscussion.reset(); + this.autosaveDiscussion?.reset(); } }); }, diff --git a/app/assets/javascripts/diffs/components/diff_file.vue b/app/assets/javascripts/diffs/components/diff_file.vue index 64a7c047cb4..596381f1de4 100644 --- a/app/assets/javascripts/diffs/components/diff_file.vue +++ b/app/assets/javascripts/diffs/components/diff_file.vue @@ -187,6 +187,9 @@ export default { 'file.file_hash': { handler: function hashChangeWatch(newHash, oldHash) { if ( + this.viewDiffsFileByFile && + !this.isCollapsed && + !this.glFeatures.singleFileFileByFile && newHash && oldHash && !this.hasDiff && diff --git a/app/assets/javascripts/diffs/components/diff_line_note_form.vue b/app/assets/javascripts/diffs/components/diff_line_note_form.vue index 43ba527dad8..9ddf5b51c9a 100644 --- a/app/assets/javascripts/diffs/components/diff_line_note_form.vue +++ b/app/assets/javascripts/diffs/components/diff_line_note_form.vue @@ -240,6 +240,7 @@ export default { :show-suggest-popover="showSuggestPopover" :save-button-title="__('Comment')" :autosave-key="autosaveKey" + :autofocus="false" class="diff-comment-form gl-mt-3" @handleFormUpdateAddToReview="addToReview" @cancelForm="handleCancelCommentForm" diff --git a/app/assets/javascripts/diffs/store/actions.js b/app/assets/javascripts/diffs/store/actions.js index 30c34e9a5be..9fd816b971b 100644 --- a/app/assets/javascripts/diffs/store/actions.js +++ b/app/assets/javascripts/diffs/store/actions.js @@ -461,6 +461,26 @@ export const setParallelDiffViewType = ({ commit }) => { export const showCommentForm = ({ commit }, { lineCode, fileHash }) => { commit(types.TOGGLE_LINE_HAS_FORM, { lineCode, fileHash, hasForm: true }); + + // The comment form for diffs gets focussed differently due to the way the virtual scroller + // works. If we focus the comment form on mount and the comment form gets removed and then + // added again the page will scroll in unexpected ways + setTimeout(() => { + const el = document.querySelector(`[data-line-code="${lineCode}"] textarea`); + + if (!el) return; + + const { bottom } = el.getBoundingClientRect(); + const overflowBottom = bottom - window.innerHeight; + + // Prevent the browser scrolling for us + // We handle the scrolling to not break the diffs virtual scroller + el.focus({ preventScroll: true }); + + if (overflowBottom > 0) { + window.scrollBy(0, Math.floor(Math.abs(overflowBottom)) + 150); + } + }); }; export const cancelCommentForm = ({ commit }, { lineCode, fileHash }) => { diff --git a/app/assets/javascripts/environments/components/edit_environment.vue b/app/assets/javascripts/environments/components/edit_environment.vue index 91145db10e2..c835cab6175 100644 --- a/app/assets/javascripts/environments/components/edit_environment.vue +++ b/app/assets/javascripts/environments/components/edit_environment.vue @@ -3,7 +3,9 @@ import { GlLoadingIcon } from '@gitlab/ui'; import { createAlert } from '~/alert'; import axios from '~/lib/utils/axios_utils'; import { visitUrl } from '~/lib/utils/url_utility'; +import glFeatureFlagsMixin from '~/vue_shared/mixins/gl_feature_flags_mixin'; import getEnvironment from '../graphql/queries/environment.query.graphql'; +import updateEnvironment from '../graphql/mutations/update_environment.mutation.graphql'; import EnvironmentForm from './environment_form.vue'; export default { @@ -11,6 +13,7 @@ export default { GlLoadingIcon, EnvironmentForm, }, + mixins: [glFeatureFlagsMixin()], inject: ['projectEnvironmentsPath', 'updateEnvironmentPath', 'projectPath', 'environmentName'], apollo: { environment: { @@ -42,6 +45,44 @@ export default { this.formEnvironment = environment; }, onSubmit() { + if (this.glFeatures?.environmentSettingsToGraphql) { + this.updateWithGraphql(); + } else { + this.updateWithAxios(); + } + }, + async updateWithGraphql() { + this.loading = true; + try { + const { data } = await this.$apollo.mutate({ + mutation: updateEnvironment, + variables: { + input: { + id: this.formEnvironment.id, + externalUrl: this.formEnvironment.externalUrl, + }, + }, + }); + + const { errors } = data.environmentUpdate; + + if (errors.length > 0) { + throw new Error(errors[0]?.message ?? errors[0]); + } + + const { path } = data.environmentUpdate.environment; + + if (path) { + visitUrl(path); + } + } catch (error) { + const { message } = error; + createAlert({ message }); + } finally { + this.loading = false; + } + }, + updateWithAxios() { this.loading = true; axios .put(this.updateEnvironmentPath, { diff --git a/app/assets/javascripts/environments/graphql/mutations/update_environment.mutation.graphql b/app/assets/javascripts/environments/graphql/mutations/update_environment.mutation.graphql new file mode 100644 index 00000000000..9ea0e3609cb --- /dev/null +++ b/app/assets/javascripts/environments/graphql/mutations/update_environment.mutation.graphql @@ -0,0 +1,9 @@ +mutation updateEnvironment($input: EnvironmentUpdateInput!) { + environmentUpdate(input: $input) { + environment { + id + path + } + errors + } +} diff --git a/app/assets/javascripts/grafana_integration/components/grafana_integration.vue b/app/assets/javascripts/grafana_integration/components/grafana_integration.vue deleted file mode 100644 index 3911201457f..00000000000 --- a/app/assets/javascripts/grafana_integration/components/grafana_integration.vue +++ /dev/null @@ -1,131 +0,0 @@ - - - diff --git a/app/assets/javascripts/grafana_integration/index.js b/app/assets/javascripts/grafana_integration/index.js deleted file mode 100644 index 9ade29dae69..00000000000 --- a/app/assets/javascripts/grafana_integration/index.js +++ /dev/null @@ -1,17 +0,0 @@ -import Vue from 'vue'; -import GrafanaIntegration from './components/grafana_integration.vue'; -import store from './store'; - -export default () => { - const el = document.querySelector('.js-grafana-integration'); - - if (!el) return false; - - return new Vue({ - el, - store: store(el.dataset), - render(createElement) { - return createElement(GrafanaIntegration); - }, - }); -}; diff --git a/app/assets/javascripts/grafana_integration/store/actions.js b/app/assets/javascripts/grafana_integration/store/actions.js deleted file mode 100644 index 76e21f09719..00000000000 --- a/app/assets/javascripts/grafana_integration/store/actions.js +++ /dev/null @@ -1,44 +0,0 @@ -import { createAlert } from '~/alert'; -import axios from '~/lib/utils/axios_utils'; -import { refreshCurrentPage } from '~/lib/utils/url_utility'; -import { __ } from '~/locale'; -import * as mutationTypes from './mutation_types'; - -export const setGrafanaUrl = ({ commit }, url) => commit(mutationTypes.SET_GRAFANA_URL, url); - -export const setGrafanaToken = ({ commit }, token) => - commit(mutationTypes.SET_GRAFANA_TOKEN, token); - -export const setGrafanaEnabled = ({ commit }, enabled) => - commit(mutationTypes.SET_GRAFANA_ENABLED, enabled); - -export const updateGrafanaIntegration = ({ state, dispatch }) => - axios - .patch(state.operationsSettingsEndpoint, { - project: { - grafana_integration_attributes: { - grafana_url: state.grafanaUrl, - token: state.grafanaToken, - enabled: state.grafanaEnabled, - }, - }, - }) - .then(() => dispatch('receiveGrafanaIntegrationUpdateSuccess')) - .catch((error) => dispatch('receiveGrafanaIntegrationUpdateError', error)); - -export const receiveGrafanaIntegrationUpdateSuccess = () => { - /** - * The operations_controller currently handles successful requests - * by creating an alert banner message to notify the user. - */ - refreshCurrentPage(); -}; - -export const receiveGrafanaIntegrationUpdateError = (_, error) => { - const { response } = error; - const message = response.data && response.data.message ? response.data.message : ''; - - createAlert({ - message: `${__('There was an error saving your changes.')} ${message}`, - }); -}; diff --git a/app/assets/javascripts/grafana_integration/store/index.js b/app/assets/javascripts/grafana_integration/store/index.js deleted file mode 100644 index a11bd8089fd..00000000000 --- a/app/assets/javascripts/grafana_integration/store/index.js +++ /dev/null @@ -1,16 +0,0 @@ -import Vue from 'vue'; -import Vuex from 'vuex'; -import * as actions from './actions'; -import mutations from './mutations'; -import createState from './state'; - -Vue.use(Vuex); - -export const createStore = (initialState) => - new Vuex.Store({ - state: createState(initialState), - actions, - mutations, - }); - -export default createStore; diff --git a/app/assets/javascripts/grafana_integration/store/mutation_types.js b/app/assets/javascripts/grafana_integration/store/mutation_types.js deleted file mode 100644 index 314c3a4039a..00000000000 --- a/app/assets/javascripts/grafana_integration/store/mutation_types.js +++ /dev/null @@ -1,3 +0,0 @@ -export const SET_GRAFANA_URL = 'SET_GRAFANA_URL'; -export const SET_GRAFANA_TOKEN = 'SET_GRAFANA_TOKEN'; -export const SET_GRAFANA_ENABLED = 'SET_GRAFANA_ENABLED'; diff --git a/app/assets/javascripts/grafana_integration/store/mutations.js b/app/assets/javascripts/grafana_integration/store/mutations.js deleted file mode 100644 index 0992030d404..00000000000 --- a/app/assets/javascripts/grafana_integration/store/mutations.js +++ /dev/null @@ -1,13 +0,0 @@ -import * as types from './mutation_types'; - -export default { - [types.SET_GRAFANA_URL](state, url) { - state.grafanaUrl = url; - }, - [types.SET_GRAFANA_TOKEN](state, token) { - state.grafanaToken = token; - }, - [types.SET_GRAFANA_ENABLED](state, enabled) { - state.grafanaEnabled = enabled; - }, -}; diff --git a/app/assets/javascripts/grafana_integration/store/state.js b/app/assets/javascripts/grafana_integration/store/state.js deleted file mode 100644 index a912eb58327..00000000000 --- a/app/assets/javascripts/grafana_integration/store/state.js +++ /dev/null @@ -1,8 +0,0 @@ -import { parseBoolean } from '~/lib/utils/common_utils'; - -export default (initialState = {}) => ({ - operationsSettingsEndpoint: initialState.operationsSettingsEndpoint, - grafanaToken: initialState.grafanaIntegrationToken || '', - grafanaUrl: initialState.grafanaIntegrationUrl || '', - grafanaEnabled: parseBoolean(initialState.grafanaIntegrationEnabled) || false, -}); diff --git a/app/assets/javascripts/issues/show/components/task_list_item_actions.vue b/app/assets/javascripts/issues/show/components/task_list_item_actions.vue index 5160903c762..64b916caddb 100644 --- a/app/assets/javascripts/issues/show/components/task_list_item_actions.vue +++ b/app/assets/javascripts/issues/show/components/task_list_item_actions.vue @@ -17,14 +17,9 @@ export default { methods: { convertToTask() { eventHub.$emit('convert-task-list-item', this.$el.closest('li').dataset.sourcepos); - this.closeDropdown(); }, deleteTaskListItem() { eventHub.$emit('delete-task-list-item', this.$el.closest('li').dataset.sourcepos); - this.closeDropdown(); - }, - closeDropdown() { - this.$refs.dropdown.close(); }, }, }; @@ -33,7 +28,6 @@ export default {