Skip to content

Refactor metric embeds to ease additional embed types

Sarah Yasonik requested to merge sy-clean-gfm-filter-examples into master

What does this MR do?

With #119016 (closed) and #40997 (closed), there will be two new EE GFM metrics filters. To ease the addition of these filters, this MR has the following changes:

  • Moves inline_metrics_redactor_filter_spec.rb redactor tests into shared examples (to allow the new EE test to easily take advantage of them)
  • Makes the xpath search in inline_metrics_filter.rb more specific, to prevent the logic in this class from running needlessly (as the current xpath search in this file will match the url formats as both embed types)
  • Refactors permissions management in inline_metrics_redactor_filter.rb to allow for easier overrides and additions in a new EE file
  • Refactors gfm_pipeline.rb to allow for easier overrides in the corresponding EE file
  • Moves examples for both metrics filters into shared examples

Screenshots

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Merge request reports