Refactor metric embeds to ease additional embed types
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
- [-] Changelog entry
- [-] Documentation (if required)
-
Code review guidelines -
Merge request performance guidelines -
Style guides - [-] Database guides
-
Separation of EE specific content
Availability and Testing
-
Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process. - [-] Tested in all supported browsers
- [-] Informed Infrastructure department of a default or new setting change, if applicable per definition of done