From b646822e5253cfa239728ed0d8b96cb584fc96c1 Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Fri, 3 Jun 2022 06:10:04 +0000 Subject: [PATCH] Add latest changes from gitlab-org/gitlab@master --- .rubocop_todo/layout/argument_alignment.yml | 1 - GITALY_SERVER_VERSION | 2 +- Gemfile | 2 +- Gemfile.lock | 4 ++-- app/helpers/markup_helper.rb | 5 ++++- app/models/ci/build.rb | 2 ++ .../projects/open_issues_count_service.rb | 6 ++--- config/feature_categories.yml | 1 - .../development/slack_app_use_v2_flow.yml | 8 ------- ...5_action_monthly_active_users_sse_edit.yml | 4 +++- ...1_ide_edit_total_unique_counts_monthly.yml | 1 - .../20210216184024_g_edit_by_sse_monthly.yml | 4 +++- ...39_ide_edit_total_unique_counts_weekly.yml | 1 - .../20210216184022_g_edit_by_sse_weekly.yml | 4 +++- ...0210216180259_static_site_editor_views.yml | 4 +++- ...10216180301_static_site_editor_commits.yml | 4 +++- ...0303_static_site_editor_merge_requests.yml | 4 +++- ...groups_gitlab_slack_application_active.yml | 2 +- ...ojects_gitlab_slack_application_active.yml | 2 +- ...tances_gitlab_slack_application_active.yml | 2 +- ...riting_gitlab_slack_application_active.yml | 2 +- ...riting_gitlab_slack_application_active.yml | 2 +- ...233600_remove_sse_usage_data_from_redis.rb | 15 +++++++++++++ db/schema_migrations/20220531233600 | 1 + .../references/issue_reference_filter.rb | 8 +++++++ .../merge_request_reference_filter.rb | 16 +++----------- lib/gitlab/markdown_cache.rb | 2 +- lib/gitlab/usage_data.rb | 1 - lib/gitlab/usage_data_counters.rb | 1 - .../editor_unique_counter.rb | 9 -------- .../known_events/common.yml | 5 ----- .../static_site_editor_counter.rb | 16 -------------- spec/features/dashboard/todos/todos_spec.rb | 3 ++- .../markdown_golden_master_examples.yml | 2 +- .../references/issue_reference_filter_spec.rb | 22 +++++++++++++------ .../merge_request_reference_filter_spec.rb | 11 ++-------- .../editor_unique_counter_spec.rb | 12 ---------- .../static_site_editor_counter_spec.rb | 14 ------------ spec/lib/gitlab/usage_data_counters_spec.rb | 4 ++-- spec/lib/gitlab/usage_data_spec.rb | 10 +-------- spec/models/ci/build_spec.rb | 13 +++++++++++ 41 files changed, 100 insertions(+), 132 deletions(-) delete mode 100644 config/feature_flags/development/slack_app_use_v2_flow.yml rename config/metrics/{counts_7d => counts_all}/20210916100524_groups_gitlab_slack_application_active.yml (97%) rename config/metrics/{counts_7d => counts_all}/20210916101641_projects_gitlab_slack_application_active.yml (97%) rename config/metrics/{counts_7d => counts_all}/20210916101837_instances_gitlab_slack_application_active.yml (97%) rename config/metrics/{counts_7d => counts_all}/20210917040700_groups_inheriting_gitlab_slack_application_active.yml (97%) rename config/metrics/{counts_7d => counts_all}/20210917040956_projects_inheriting_gitlab_slack_application_active.yml (97%) create mode 100644 db/post_migrate/20220531233600_remove_sse_usage_data_from_redis.rb create mode 100644 db/schema_migrations/20220531233600 delete mode 100644 lib/gitlab/usage_data_counters/static_site_editor_counter.rb delete mode 100644 spec/lib/gitlab/usage_data_counters/static_site_editor_counter_spec.rb diff --git a/.rubocop_todo/layout/argument_alignment.yml b/.rubocop_todo/layout/argument_alignment.yml index 7ac7915b325..6cbc062aae6 100644 --- a/.rubocop_todo/layout/argument_alignment.yml +++ b/.rubocop_todo/layout/argument_alignment.yml @@ -780,7 +780,6 @@ Layout/ArgumentAlignment: - 'spec/lib/gitlab/usage/metrics/query_spec.rb' - 'spec/lib/gitlab/usage_data_counters/designs_counter_spec.rb' - 'spec/lib/gitlab/usage_data_counters/snippet_counter_spec.rb' - - 'spec/lib/gitlab/usage_data_counters/static_site_editor_counter_spec.rb' - 'spec/lib/gitlab/usage_data_counters/wiki_page_counter_spec.rb' - 'spec/lib/gitlab/usage_data_queries_spec.rb' - 'spec/lib/mattermost/session_spec.rb' diff --git a/GITALY_SERVER_VERSION b/GITALY_SERVER_VERSION index 6127f543d61..beb05183b55 100644 --- a/GITALY_SERVER_VERSION +++ b/GITALY_SERVER_VERSION @@ -1 +1 @@ -4181f9518f5a56298d6875a0fd4da1e72dabcb9f +7c2fcde23bd4a962409897adbbb71da11c6db99a diff --git a/Gemfile b/Gemfile index 50ef5283522..e13c42ed96f 100644 --- a/Gemfile +++ b/Gemfile @@ -219,7 +219,7 @@ gem 'ruby-progressbar', '~> 1.10' gem 'settingslogic', '~> 2.0.9' # Linear-time regex library for untrusted regular expressions -gem 're2', '~> 1.2.0' +gem 're2', '~> 1.4.0' # Misc diff --git a/Gemfile.lock b/Gemfile.lock index 960422fc3b0..e9c4b89d460 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1025,7 +1025,7 @@ GEM rbtree (0.4.4) rchardet (1.8.0) rdoc (6.3.2) - re2 (1.2.0) + re2 (1.4.0) recaptcha (4.13.1) json recursive-open-struct (1.1.3) @@ -1620,7 +1620,7 @@ DEPENDENCIES rainbow (~> 3.0) rbtrace (~> 0.4) rdoc (~> 6.3.2) - re2 (~> 1.2.0) + re2 (~> 1.4.0) recaptcha (~> 4.11) redis (~> 4.4.0) redis-actionpack (~> 5.2.0) diff --git a/app/helpers/markup_helper.rb b/app/helpers/markup_helper.rb index 7a4cc61af79..fd67465575b 100644 --- a/app/helpers/markup_helper.rb +++ b/app/helpers/markup_helper.rb @@ -88,7 +88,10 @@ module MarkupHelper text, tags: tags, attributes: Rails::Html::WhiteListSanitizer.allowed_attributes + - %w(style data-src data-name data-unicode-version data-iid data-project-path data-mr-title data-html) + %w( + style data-src data-name data-unicode-version data-html + data-reference-type data-project-path data-iid data-mr-title + ) ) # since tags are stripped, this can leave empty tags hanging around diff --git a/app/models/ci/build.rb b/app/models/ci/build.rb index b6f6255f552..7203d17046c 100644 --- a/app/models/ci/build.rb +++ b/app/models/ci/build.rb @@ -1083,6 +1083,8 @@ module Ci all_runtime_metadata.delete_all end + deployment&.sync_status_with(self) + Gitlab::AppLogger.info( message: 'Build doomed', class: self.class.name, diff --git a/app/services/projects/open_issues_count_service.rb b/app/services/projects/open_issues_count_service.rb index ee4d559e612..925512f31d7 100644 --- a/app/services/projects/open_issues_count_service.rb +++ b/app/services/projects/open_issues_count_service.rb @@ -63,12 +63,12 @@ module Projects # rubocop: disable CodeReuse/ActiveRecord def self.query(projects, public_only: true) - issues_filtered_by_type = Issue.opened.with_issue_type(Issue::TYPES_FOR_LIST) + open_issues = Issue.opened if public_only - issues_filtered_by_type.public_only.where(project: projects) + open_issues.public_only.where(project: projects) else - issues_filtered_by_type.where(project: projects) + open_issues.where(project: projects) end end # rubocop: enable CodeReuse/ActiveRecord diff --git a/config/feature_categories.yml b/config/feature_categories.yml index 473cf240864..354d7e40ed5 100644 --- a/config/feature_categories.yml +++ b/config/feature_categories.yml @@ -118,7 +118,6 @@ - snippets - source_code_management - static_application_security_testing -- static_site_editor - subgroups - system_access - team_planning diff --git a/config/feature_flags/development/slack_app_use_v2_flow.yml b/config/feature_flags/development/slack_app_use_v2_flow.yml deleted file mode 100644 index 2f696629cee..00000000000 --- a/config/feature_flags/development/slack_app_use_v2_flow.yml +++ /dev/null @@ -1,8 +0,0 @@ ---- -name: slack_app_use_v2_flow -introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/85726 -rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/360680 -milestone: '15.0' -type: development -group: group::integrations -default_enabled: false diff --git a/config/metrics/counts_28d/20210216180325_action_monthly_active_users_sse_edit.yml b/config/metrics/counts_28d/20210216180325_action_monthly_active_users_sse_edit.yml index eb22e82c62e..0c6421ad1fa 100644 --- a/config/metrics/counts_28d/20210216180325_action_monthly_active_users_sse_edit.yml +++ b/config/metrics/counts_28d/20210216180325_action_monthly_active_users_sse_edit.yml @@ -7,7 +7,7 @@ product_stage: create product_group: group::editor product_category: static_site_editor value_type: number -status: active +status: removed time_frame: 28d data_source: redis_hll distribution: @@ -19,3 +19,5 @@ tier: - ultimate performance_indicator_type: [] milestone: "<13.9" +milestone_removed: "15.1" +removed_by_url: "https://gitlab.com/gitlab-org/gitlab/-/merge_requests/88485" diff --git a/config/metrics/counts_28d/20210216180341_ide_edit_total_unique_counts_monthly.yml b/config/metrics/counts_28d/20210216180341_ide_edit_total_unique_counts_monthly.yml index ea357356742..35291d12239 100644 --- a/config/metrics/counts_28d/20210216180341_ide_edit_total_unique_counts_monthly.yml +++ b/config/metrics/counts_28d/20210216180341_ide_edit_total_unique_counts_monthly.yml @@ -16,7 +16,6 @@ options: - g_edit_by_web_ide - g_edit_by_sfe - g_edit_by_snippet_ide - - g_edit_by_sse distribution: - ce - ee diff --git a/config/metrics/counts_28d/20210216184024_g_edit_by_sse_monthly.yml b/config/metrics/counts_28d/20210216184024_g_edit_by_sse_monthly.yml index 1a1fbec4f8c..e4c831091da 100644 --- a/config/metrics/counts_28d/20210216184024_g_edit_by_sse_monthly.yml +++ b/config/metrics/counts_28d/20210216184024_g_edit_by_sse_monthly.yml @@ -7,7 +7,7 @@ product_stage: create product_group: group::editor product_category: static_site_editor value_type: number -status: active +status: removed time_frame: 28d data_source: redis_hll instrumentation_class: RedisHLLMetric @@ -23,3 +23,5 @@ tier: - ultimate performance_indicator_type: [] milestone: "<13.9" +milestone_removed: "15.1" +removed_by_url: "https://gitlab.com/gitlab-org/gitlab/-/merge_requests/88485" diff --git a/config/metrics/counts_7d/20210216180339_ide_edit_total_unique_counts_weekly.yml b/config/metrics/counts_7d/20210216180339_ide_edit_total_unique_counts_weekly.yml index 8e913a78a1f..00c19a06ab9 100644 --- a/config/metrics/counts_7d/20210216180339_ide_edit_total_unique_counts_weekly.yml +++ b/config/metrics/counts_7d/20210216180339_ide_edit_total_unique_counts_weekly.yml @@ -16,7 +16,6 @@ options: - g_edit_by_web_ide - g_edit_by_sfe - g_edit_by_snippet_ide - - g_edit_by_sse distribution: - ce - ee diff --git a/config/metrics/counts_7d/20210216184022_g_edit_by_sse_weekly.yml b/config/metrics/counts_7d/20210216184022_g_edit_by_sse_weekly.yml index a903ce2ceea..d0e3ac2ceb3 100644 --- a/config/metrics/counts_7d/20210216184022_g_edit_by_sse_weekly.yml +++ b/config/metrics/counts_7d/20210216184022_g_edit_by_sse_weekly.yml @@ -7,7 +7,7 @@ product_stage: create product_group: group::editor product_category: static_site_editor value_type: number -status: active +status: removed time_frame: 7d data_source: redis_hll instrumentation_class: RedisHLLMetric @@ -23,3 +23,5 @@ tier: - ultimate performance_indicator_type: [] milestone: "<13.9" +milestone_removed: "15.1" +removed_by_url: "https://gitlab.com/gitlab-org/gitlab/-/merge_requests/88485" diff --git a/config/metrics/counts_all/20210216180259_static_site_editor_views.yml b/config/metrics/counts_all/20210216180259_static_site_editor_views.yml index 35698258e53..81f65562b23 100644 --- a/config/metrics/counts_all/20210216180259_static_site_editor_views.yml +++ b/config/metrics/counts_all/20210216180259_static_site_editor_views.yml @@ -7,7 +7,7 @@ product_stage: create product_group: group::editor product_category: static_site_editor value_type: number -status: active +status: removed time_frame: all data_source: redis distribution: @@ -21,3 +21,5 @@ performance_indicator_type: - gmau - paid_gmau milestone: "<13.9" +milestone_removed: "15.1" +removed_by_url: "https://gitlab.com/gitlab-org/gitlab/-/merge_requests/88485" diff --git a/config/metrics/counts_all/20210216180301_static_site_editor_commits.yml b/config/metrics/counts_all/20210216180301_static_site_editor_commits.yml index 9f248e812f5..eef5102a070 100644 --- a/config/metrics/counts_all/20210216180301_static_site_editor_commits.yml +++ b/config/metrics/counts_all/20210216180301_static_site_editor_commits.yml @@ -7,7 +7,7 @@ product_stage: create product_group: group::editor product_category: static_site_editor value_type: number -status: active +status: removed time_frame: all data_source: redis distribution: @@ -18,3 +18,5 @@ tier: - premium - ultimate milestone: "<13.9" +milestone_removed: "15.1" +removed_by_url: "https://gitlab.com/gitlab-org/gitlab/-/merge_requests/88485" diff --git a/config/metrics/counts_all/20210216180303_static_site_editor_merge_requests.yml b/config/metrics/counts_all/20210216180303_static_site_editor_merge_requests.yml index 056c718c5eb..01f0fee9a58 100644 --- a/config/metrics/counts_all/20210216180303_static_site_editor_merge_requests.yml +++ b/config/metrics/counts_all/20210216180303_static_site_editor_merge_requests.yml @@ -7,7 +7,7 @@ product_stage: create product_group: group::editor product_category: static_site_editor value_type: number -status: active +status: removed time_frame: all data_source: redis distribution: @@ -18,3 +18,5 @@ tier: - premium - ultimate milestone: "<13.9" +milestone_removed: "15.1" +removed_by_url: "https://gitlab.com/gitlab-org/gitlab/-/merge_requests/88485" diff --git a/config/metrics/counts_7d/20210916100524_groups_gitlab_slack_application_active.yml b/config/metrics/counts_all/20210916100524_groups_gitlab_slack_application_active.yml similarity index 97% rename from config/metrics/counts_7d/20210916100524_groups_gitlab_slack_application_active.yml rename to config/metrics/counts_all/20210916100524_groups_gitlab_slack_application_active.yml index 9a23d73b136..43b71ec1c8a 100644 --- a/config/metrics/counts_7d/20210916100524_groups_gitlab_slack_application_active.yml +++ b/config/metrics/counts_all/20210916100524_groups_gitlab_slack_application_active.yml @@ -10,7 +10,7 @@ value_type: number status: active milestone: "14.3" introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/70496 -time_frame: 7d +time_frame: all data_source: database data_category: optional performance_indicator_type: [] diff --git a/config/metrics/counts_7d/20210916101641_projects_gitlab_slack_application_active.yml b/config/metrics/counts_all/20210916101641_projects_gitlab_slack_application_active.yml similarity index 97% rename from config/metrics/counts_7d/20210916101641_projects_gitlab_slack_application_active.yml rename to config/metrics/counts_all/20210916101641_projects_gitlab_slack_application_active.yml index 2d1124a5971..13954e6d01b 100644 --- a/config/metrics/counts_7d/20210916101641_projects_gitlab_slack_application_active.yml +++ b/config/metrics/counts_all/20210916101641_projects_gitlab_slack_application_active.yml @@ -10,7 +10,7 @@ value_type: number status: active milestone: "14.3" introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/70496 -time_frame: 7d +time_frame: all data_source: database data_category: optional performance_indicator_type: [] diff --git a/config/metrics/counts_7d/20210916101837_instances_gitlab_slack_application_active.yml b/config/metrics/counts_all/20210916101837_instances_gitlab_slack_application_active.yml similarity index 97% rename from config/metrics/counts_7d/20210916101837_instances_gitlab_slack_application_active.yml rename to config/metrics/counts_all/20210916101837_instances_gitlab_slack_application_active.yml index 8a04e024eba..43ea3d2d6e6 100644 --- a/config/metrics/counts_7d/20210916101837_instances_gitlab_slack_application_active.yml +++ b/config/metrics/counts_all/20210916101837_instances_gitlab_slack_application_active.yml @@ -10,7 +10,7 @@ value_type: number status: active milestone: "14.3" introduced_by_url: https://gilab.com/gitlab-org/gitlab/-/merge_requests/70496 -time_frame: 7d +time_frame: all data_source: database data_category: optional performance_indicator_type: [] diff --git a/config/metrics/counts_7d/20210917040700_groups_inheriting_gitlab_slack_application_active.yml b/config/metrics/counts_all/20210917040700_groups_inheriting_gitlab_slack_application_active.yml similarity index 97% rename from config/metrics/counts_7d/20210917040700_groups_inheriting_gitlab_slack_application_active.yml rename to config/metrics/counts_all/20210917040700_groups_inheriting_gitlab_slack_application_active.yml index 2a62c45c54a..70dc230ac85 100644 --- a/config/metrics/counts_7d/20210917040700_groups_inheriting_gitlab_slack_application_active.yml +++ b/config/metrics/counts_all/20210917040700_groups_inheriting_gitlab_slack_application_active.yml @@ -10,7 +10,7 @@ value_type: number status: active milestone: "14.3" introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/70496 -time_frame: 7d +time_frame: all data_source: database data_category: optional performance_indicator_type: [] diff --git a/config/metrics/counts_7d/20210917040956_projects_inheriting_gitlab_slack_application_active.yml b/config/metrics/counts_all/20210917040956_projects_inheriting_gitlab_slack_application_active.yml similarity index 97% rename from config/metrics/counts_7d/20210917040956_projects_inheriting_gitlab_slack_application_active.yml rename to config/metrics/counts_all/20210917040956_projects_inheriting_gitlab_slack_application_active.yml index 266670159b6..29781313d61 100644 --- a/config/metrics/counts_7d/20210917040956_projects_inheriting_gitlab_slack_application_active.yml +++ b/config/metrics/counts_all/20210917040956_projects_inheriting_gitlab_slack_application_active.yml @@ -10,7 +10,7 @@ value_type: number status: active milestone: "14.3" introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/70496 -time_frame: 7d +time_frame: all data_source: database data_category: optional performance_indicator_type: [] diff --git a/db/post_migrate/20220531233600_remove_sse_usage_data_from_redis.rb b/db/post_migrate/20220531233600_remove_sse_usage_data_from_redis.rb new file mode 100644 index 00000000000..b7b02e483df --- /dev/null +++ b/db/post_migrate/20220531233600_remove_sse_usage_data_from_redis.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class RemoveSseUsageDataFromRedis < Gitlab::Database::Migration[2.0] + disable_ddl_transaction! + + def up + Gitlab::Redis::SharedState.with { |r| r.del("USAGE_STATIC_SITE_EDITOR_VIEWS") } + Gitlab::Redis::SharedState.with { |r| r.del("USAGE_STATIC_SITE_EDITOR_COMMITS") } + Gitlab::Redis::SharedState.with { |r| r.del("USAGE_STATIC_SITE_EDITOR_MERGE_REQUESTS") } + end + + def down + # no-op + end +end diff --git a/db/schema_migrations/20220531233600 b/db/schema_migrations/20220531233600 new file mode 100644 index 00000000000..9c3ff7531bd --- /dev/null +++ b/db/schema_migrations/20220531233600 @@ -0,0 +1 @@ +10676671b1893267c3c466d74a2e9a66525df7c5706eed56afe4fdcb734211cd \ No newline at end of file diff --git a/lib/banzai/filter/references/issue_reference_filter.rb b/lib/banzai/filter/references/issue_reference_filter.rb index 337075b7ff8..b536d900a02 100644 --- a/lib/banzai/filter/references/issue_reference_filter.rb +++ b/lib/banzai/filter/references/issue_reference_filter.rb @@ -29,6 +29,14 @@ module Banzai super + design_link_extras(issue, matches.named_captures['path']) end + def reference_class(object_sym, tooltip: false) + super + end + + def data_attributes_for(text, parent, object, **data) + super.merge(project_path: parent.full_path, iid: object.iid) + end + private def additional_object_attributes(issue) diff --git a/lib/banzai/filter/references/merge_request_reference_filter.rb b/lib/banzai/filter/references/merge_request_reference_filter.rb index 6c5ad83d9ae..5bc18ee6985 100644 --- a/lib/banzai/filter/references/merge_request_reference_filter.rb +++ b/lib/banzai/filter/references/merge_request_reference_filter.rb @@ -17,12 +17,6 @@ module Banzai only_path: context[:only_path]) end - def object_link_title(object, matches) - # The method will return `nil` if object is not a commit - # allowing for properly handling the extended MR Tooltip - object_link_commit_title(object, matches) - end - def object_link_text_extras(object, matches) extras = super @@ -53,20 +47,16 @@ module Banzai .includes(target_project: :namespace) end - def reference_class(object_sym, options = {}) - super(object_sym, tooltip: false) + def reference_class(object_sym, tooltip: false) + super end def data_attributes_for(text, parent, object, **data) - super.merge(project_path: parent.full_path, iid: object.iid, mr_title: object.title) + super.merge(project_path: parent.full_path, iid: object.iid) end private - def object_link_commit_title(object, matches) - object_link_commit(object, matches)&.title - end - def object_link_commit_ref(object, matches) object_link_commit(object, matches)&.short_id end diff --git a/lib/gitlab/markdown_cache.rb b/lib/gitlab/markdown_cache.rb index 283502d90c1..09ba95666de 100644 --- a/lib/gitlab/markdown_cache.rb +++ b/lib/gitlab/markdown_cache.rb @@ -11,7 +11,7 @@ module Gitlab # this if the change to the renderer output is a new feature or a # minor bug fix. # See: https://gitlab.com/gitlab-org/gitlab/-/issues/330313 - CACHE_COMMONMARK_VERSION = 30 + CACHE_COMMONMARK_VERSION = 31 CACHE_COMMONMARK_VERSION_START = 10 BaseError = Class.new(StandardError) diff --git a/lib/gitlab/usage_data.rb b/lib/gitlab/usage_data.rb index c65bd197a14..7934cc27808 100644 --- a/lib/gitlab/usage_data.rb +++ b/lib/gitlab/usage_data.rb @@ -754,7 +754,6 @@ module Gitlab action_monthly_active_users_web_ide_edit: redis_usage_data { counter.count_web_ide_edit_actions(**date_range) }, action_monthly_active_users_sfe_edit: redis_usage_data { counter.count_sfe_edit_actions(**date_range) }, action_monthly_active_users_snippet_editor_edit: redis_usage_data { counter.count_snippet_editor_edit_actions(**date_range) }, - action_monthly_active_users_sse_edit: redis_usage_data { counter.count_sse_edit_actions(**date_range) }, action_monthly_active_users_ide_edit: redis_usage_data { counter.count_edit_using_editor(**date_range) } } end diff --git a/lib/gitlab/usage_data_counters.rb b/lib/gitlab/usage_data_counters.rb index cdcad8fdc7b..2a3dcf267c6 100644 --- a/lib/gitlab/usage_data_counters.rb +++ b/lib/gitlab/usage_data_counters.rb @@ -15,7 +15,6 @@ module Gitlab MergeRequestCounter, DesignsCounter, KubernetesAgentCounter, - StaticSiteEditorCounter, DiffsCounter, ServiceUsageDataCounter ].freeze diff --git a/lib/gitlab/usage_data_counters/editor_unique_counter.rb b/lib/gitlab/usage_data_counters/editor_unique_counter.rb index f97ebdccecf..8feb24e49ac 100644 --- a/lib/gitlab/usage_data_counters/editor_unique_counter.rb +++ b/lib/gitlab/usage_data_counters/editor_unique_counter.rb @@ -6,7 +6,6 @@ module Gitlab EDIT_BY_SNIPPET_EDITOR = 'g_edit_by_snippet_ide' EDIT_BY_SFE = 'g_edit_by_sfe' EDIT_BY_WEB_IDE = 'g_edit_by_web_ide' - EDIT_BY_SSE = 'g_edit_by_sse' EDIT_CATEGORY = 'ide_edit' EDIT_BY_LIVE_PREVIEW = 'g_edit_by_live_preview' @@ -40,14 +39,6 @@ module Gitlab count_unique(events, date_from, date_to) end - def track_sse_edit_action(author:, time: Time.zone.now) - track_unique_action(EDIT_BY_SSE, author, time) - end - - def count_sse_edit_actions(date_from:, date_to:) - count_unique(EDIT_BY_SSE, date_from, date_to) - end - def track_live_preview_edit_action(author:, time: Time.zone.now) track_unique_action(EDIT_BY_LIVE_PREVIEW, author, time) end diff --git a/lib/gitlab/usage_data_counters/known_events/common.yml b/lib/gitlab/usage_data_counters/known_events/common.yml index 448ed4c66e1..65f1f4b08fd 100644 --- a/lib/gitlab/usage_data_counters/known_events/common.yml +++ b/lib/gitlab/usage_data_counters/known_events/common.yml @@ -30,11 +30,6 @@ redis_slot: edit expiry: 29 aggregation: daily -- name: g_edit_by_sse - category: ide_edit - redis_slot: edit - expiry: 29 - aggregation: daily - name: g_edit_by_snippet_ide category: ide_edit redis_slot: edit diff --git a/lib/gitlab/usage_data_counters/static_site_editor_counter.rb b/lib/gitlab/usage_data_counters/static_site_editor_counter.rb deleted file mode 100644 index 3c5989d1e11..00000000000 --- a/lib/gitlab/usage_data_counters/static_site_editor_counter.rb +++ /dev/null @@ -1,16 +0,0 @@ -# frozen_string_literal: true - -module Gitlab - module UsageDataCounters - class StaticSiteEditorCounter < BaseCounter - KNOWN_EVENTS = %w[views commits merge_requests].freeze - PREFIX = 'static_site_editor' - - class << self - def increment_views_count - count(:views) - end - end - end - end -end diff --git a/spec/features/dashboard/todos/todos_spec.rb b/spec/features/dashboard/todos/todos_spec.rb index 04e78b59ab4..adb43d60306 100644 --- a/spec/features/dashboard/todos/todos_spec.rb +++ b/spec/features/dashboard/todos/todos_spec.rb @@ -55,7 +55,8 @@ RSpec.describe 'Dashboard Todos' do expect(link).not_to be_nil expect(link['data-iid']).to eq(referenced_mr.iid.to_s) expect(link['data-project-path']).to eq(referenced_mr.project.full_path) - expect(link['data-mr-title']).to eq(referenced_mr.title) + expect(link['title']).to eq(referenced_mr.title) + expect(link['data-reference-type']).to eq('merge_request') end end diff --git a/spec/fixtures/markdown/markdown_golden_master_examples.yml b/spec/fixtures/markdown/markdown_golden_master_examples.yml index 5847e9f2cdf..fece8e57150 100644 --- a/spec/fixtures/markdown/markdown_golden_master_examples.yml +++ b/spec/fixtures/markdown/markdown_golden_master_examples.yml @@ -750,7 +750,7 @@ markdown: |- Hi @gfm_user - thank you for reporting this bug (#1) we hope to fix it in %1.1 as part of !1 html: |- -

Hi @gfm_user - thank you for reporting this bug (#1) we hope to fix it in %1.1 as part of !1

+

Hi @gfm_user - thank you for reporting this bug (#1) we hope to fix it in %1.1 as part of !1

- name: strike markdown: |- ~~del~~ diff --git a/spec/lib/banzai/filter/references/issue_reference_filter_spec.rb b/spec/lib/banzai/filter/references/issue_reference_filter_spec.rb index c6f0e592cdf..d17deaa4736 100644 --- a/spec/lib/banzai/filter/references/issue_reference_filter_spec.rb +++ b/spec/lib/banzai/filter/references/issue_reference_filter_spec.rb @@ -93,7 +93,7 @@ RSpec.describe Banzai::Filter::References::IssueReferenceFilter do it 'includes default classes' do doc = reference_filter("Issue #{reference}") - expect(doc.css('a').first.attr('class')).to eq 'gfm gfm-issue has-tooltip' + expect(doc.css('a').first.attr('class')).to eq 'gfm gfm-issue' end it 'includes a data-project attribute' do @@ -112,6 +112,14 @@ RSpec.describe Banzai::Filter::References::IssueReferenceFilter do expect(link.attr('data-issue')).to eq issue.id.to_s end + it 'includes data attributes for issuable popover' do + doc = reference_filter("See #{reference}") + link = doc.css('a').first + + expect(link.attr('data-project-path')).to eq project.full_path + expect(link.attr('data-iid')).to eq issue.iid.to_s + end + it 'includes a data-original attribute' do doc = reference_filter("See #{reference}") link = doc.css('a').first @@ -201,7 +209,7 @@ RSpec.describe Banzai::Filter::References::IssueReferenceFilter do it 'includes default classes' do doc = reference_filter("Fixed (#{reference}.)") - expect(doc.css('a').first.attr('class')).to eq 'gfm gfm-issue has-tooltip' + expect(doc.css('a').first.attr('class')).to eq 'gfm gfm-issue' end it 'ignores invalid issue IDs on the referenced project' do @@ -253,7 +261,7 @@ RSpec.describe Banzai::Filter::References::IssueReferenceFilter do it 'includes default classes' do doc = reference_filter("Fixed (#{reference}.)") - expect(doc.css('a').first.attr('class')).to eq 'gfm gfm-issue has-tooltip' + expect(doc.css('a').first.attr('class')).to eq 'gfm gfm-issue' end it 'ignores invalid issue IDs on the referenced project' do @@ -305,7 +313,7 @@ RSpec.describe Banzai::Filter::References::IssueReferenceFilter do it 'includes default classes' do doc = reference_filter("Fixed (#{reference}.)") - expect(doc.css('a').first.attr('class')).to eq 'gfm gfm-issue has-tooltip' + expect(doc.css('a').first.attr('class')).to eq 'gfm gfm-issue' end it 'ignores invalid issue IDs on the referenced project' do @@ -347,7 +355,7 @@ RSpec.describe Banzai::Filter::References::IssueReferenceFilter do it 'includes default classes' do doc = reference_filter("Fixed (#{reference}.)") - expect(doc.css('a').first.attr('class')).to eq 'gfm gfm-issue has-tooltip' + expect(doc.css('a').first.attr('class')).to eq 'gfm gfm-issue' end end @@ -378,7 +386,7 @@ RSpec.describe Banzai::Filter::References::IssueReferenceFilter do it 'includes default classes' do doc = reference_filter("Fixed (#{reference_link}.)") - expect(doc.css('a').first.attr('class')).to eq 'gfm gfm-issue has-tooltip' + expect(doc.css('a').first.attr('class')).to eq 'gfm gfm-issue' end end @@ -409,7 +417,7 @@ RSpec.describe Banzai::Filter::References::IssueReferenceFilter do it 'includes default classes' do doc = reference_filter("Fixed (#{reference_link}.)") - expect(doc.css('a').first.attr('class')).to eq 'gfm gfm-issue has-tooltip' + expect(doc.css('a').first.attr('class')).to eq 'gfm gfm-issue' end end diff --git a/spec/lib/banzai/filter/references/merge_request_reference_filter_spec.rb b/spec/lib/banzai/filter/references/merge_request_reference_filter_spec.rb index e5809ac6949..42e8cf1c857 100644 --- a/spec/lib/banzai/filter/references/merge_request_reference_filter_spec.rb +++ b/spec/lib/banzai/filter/references/merge_request_reference_filter_spec.rb @@ -77,9 +77,9 @@ RSpec.describe Banzai::Filter::References::MergeRequestReferenceFilter do expect(reference_filter(act).to_html).to eq exp end - it 'has no title' do + it 'has the MR title in the title attribute' do doc = reference_filter("Merge #{reference}") - expect(doc.css('a').first.attr('title')).to eq "" + expect(doc.css('a').first.attr('title')).to eq(merge.title) end it 'escapes the title attribute' do @@ -169,7 +169,6 @@ RSpec.describe Banzai::Filter::References::MergeRequestReferenceFilter do expect(link.attr('data-project')).to eq project2.id.to_s expect(link.attr('data-project-path')).to eq project2.full_path expect(link.attr('data-iid')).to eq merge.iid.to_s - expect(link.attr('data-mr-title')).to eq merge.title end it 'ignores invalid merge IDs on the referenced project' do @@ -273,12 +272,6 @@ RSpec.describe Banzai::Filter::References::MergeRequestReferenceFilter do expect(doc.text).to eq("See #{mr.to_reference(full: true)} (#{commit.short_id})") end - it 'has valid title attribute' do - doc = reference_filter("See #{reference}") - - expect(doc.css('a').first.attr('title')).to eq(commit.title) - end - it 'ignores invalid commit short_ids on link text' do invalidate_commit_reference = urls.project_merge_request_url(mr.project, mr) + "/diffs?commit_id=12345678" diff --git a/spec/lib/gitlab/usage_data_counters/editor_unique_counter_spec.rb b/spec/lib/gitlab/usage_data_counters/editor_unique_counter_spec.rb index 9aecb8f8b25..dbc34681660 100644 --- a/spec/lib/gitlab/usage_data_counters/editor_unique_counter_spec.rb +++ b/spec/lib/gitlab/usage_data_counters/editor_unique_counter_spec.rb @@ -66,18 +66,6 @@ RSpec.describe Gitlab::UsageDataCounters::EditorUniqueCounter, :clean_gitlab_red end end - context 'for SSE edit actions' do - it_behaves_like 'tracks and counts action' do - def track_action(params) - described_class.track_sse_edit_action(**params) - end - - def count_unique(params) - described_class.count_sse_edit_actions(**params) - end - end - end - it 'can return the count of actions per user deduplicated' do described_class.track_web_ide_edit_action(author: user1) described_class.track_live_preview_edit_action(author: user1) diff --git a/spec/lib/gitlab/usage_data_counters/static_site_editor_counter_spec.rb b/spec/lib/gitlab/usage_data_counters/static_site_editor_counter_spec.rb deleted file mode 100644 index 1bf5dad1c9f..00000000000 --- a/spec/lib/gitlab/usage_data_counters/static_site_editor_counter_spec.rb +++ /dev/null @@ -1,14 +0,0 @@ -# frozen_string_literal: true - -require 'spec_helper' - -RSpec.describe Gitlab::UsageDataCounters::StaticSiteEditorCounter do - it_behaves_like 'a redis usage counter', 'StaticSiteEditor', :views - it_behaves_like 'a redis usage counter', 'StaticSiteEditor', :commits - it_behaves_like 'a redis usage counter', 'StaticSiteEditor', :merge_requests - - it_behaves_like 'a redis usage counter with totals', :static_site_editor, - views: 3, - commits: 4, - merge_requests: 5 -end diff --git a/spec/lib/gitlab/usage_data_counters_spec.rb b/spec/lib/gitlab/usage_data_counters_spec.rb index 379a2cb778d..0696b375eb5 100644 --- a/spec/lib/gitlab/usage_data_counters_spec.rb +++ b/spec/lib/gitlab/usage_data_counters_spec.rb @@ -13,10 +13,10 @@ RSpec.describe Gitlab::UsageDataCounters do describe '.count' do subject { described_class.count(event_name) } - let(:event_name) { 'static_site_editor_views' } + let(:event_name) { 'web_ide_views' } it 'increases a view counter' do - expect(Gitlab::UsageDataCounters::StaticSiteEditorCounter).to receive(:count).with('views') + expect(Gitlab::UsageDataCounters::WebIdeCounter).to receive(:count).with('views') subject end diff --git a/spec/lib/gitlab/usage_data_spec.rb b/spec/lib/gitlab/usage_data_spec.rb index e6586a773a4..9d7f464756d 100644 --- a/spec/lib/gitlab/usage_data_spec.rb +++ b/spec/lib/gitlab/usage_data_spec.rb @@ -754,7 +754,6 @@ RSpec.describe Gitlab::UsageData, :aggregate_failures do it { is_expected.to include(:kubernetes_agent_gitops_sync) } it { is_expected.to include(:kubernetes_agent_k8s_api_proxy_request) } - it { is_expected.to include(:static_site_editor_views) } it { is_expected.to include(:package_events_i_package_pull_package) } it { is_expected.to include(:package_events_i_package_delete_package_by_user) } it { is_expected.to include(:package_events_i_package_conan_push_package) } @@ -1187,12 +1186,6 @@ RSpec.describe Gitlab::UsageData, :aggregate_failures do counter.track_web_ide_edit_action(author: user3, time: time - 3.days) counter.track_snippet_editor_edit_action(author: user3) - - counter.track_sse_edit_action(author: user1) - counter.track_sse_edit_action(author: user1) - counter.track_sse_edit_action(author: user2) - counter.track_sse_edit_action(author: user3) - counter.track_sse_edit_action(author: user2, time: time - 3.days) end it 'returns the distinct count of user actions within the specified time period' do @@ -1205,8 +1198,7 @@ RSpec.describe Gitlab::UsageData, :aggregate_failures do action_monthly_active_users_web_ide_edit: 2, action_monthly_active_users_sfe_edit: 2, action_monthly_active_users_snippet_editor_edit: 2, - action_monthly_active_users_ide_edit: 3, - action_monthly_active_users_sse_edit: 3 + action_monthly_active_users_ide_edit: 3 } ) end diff --git a/spec/models/ci/build_spec.rb b/spec/models/ci/build_spec.rb index 74bbe1c50ca..bdad18fa659 100644 --- a/spec/models/ci/build_spec.rb +++ b/spec/models/ci/build_spec.rb @@ -5462,6 +5462,19 @@ RSpec.describe Ci::Build do subject end + context 'with deployment' do + let(:environment) { create(:environment) } + let(:build) { create(:ci_build, :with_deployment, environment: environment.name, pipeline: pipeline) } + + it 'updates the deployment status', :aggregate_failures do + expect(build.deployment).to receive(:sync_status_with).with(build).and_call_original + + subject + + expect(build.deployment.reload.status).to eq("failed") + end + end + context 'with queued builds' do let(:traits) { [:queued] }