Skip to content

Match both metrics and metrics dashboard embeds in entirety

Sarah Yasonik requested to merge sy-fix-transient-embed-again into master

What does this MR do?

Metrics embeds in GFM based on urls of format metrics_dashboard_project_environment_url and metrics_project_environment_url are meant to be supported. Currently, Gitlab::Metrics::Dashboard::Url#metrics_regex only half-way supports the metrics_dashboard route. It matches the route, but not up through any of the query params.

This was highlighted by #195739 (closed), which introduced an automatically generated embed which relies on the metrics_dashboard route with query params (even though I meant it to work with the metrics version).

But updating the regex rather than the utilized route, either can be used interchangeably as intended, while any automatically generated embeds remain valid.

Screenshots

Using /metrics_dashboard Using /metrics
Screen_Shot_2020-04-17_at_7.04.41_PM Screen_Shot_2020-04-17_at_7.04.48_PM

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Security

If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:

  • Label as security and @ mention @gitlab-com/gl-security/appsec
  • The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
  • Security reports checked/validated by a reviewer from the AppSec team
Edited by Sarah Yasonik

Merge request reports