Skip to content

A03. Add metadata support to GLFM example snapshot specs

What does this MR do and why?

Related: Tracking Issue: Implement GLFM scripts per the ... (#361241 - closed)

Introduces glfm_specification/input/gitlab_flavored_markdown/glfm_example_metadata.yml file to track EE requirements and API endpoint overrides for example snapshots.

  • Allows API endpoint overrides such as preview_markdown to be specified for examples. These result in markdown being rendered differently depending on the endpoint used, and we want to be able to have thorough coverage of these various scenarios for the ongoing Content Editor WYSIWYG feature development.
  • Allows specifying if EE is required to run an example
  • Adds examples of all supported preview_markdown endpoints: groups, projects, snippets, and wikis
  • Adds an example of an EE-only example test.
  • Changes HEREDOC handling based on review feedback

The API endpoint determines the context which is used for the markdown rendering.

This MR should also include documentation updates to add docs for glfm_specification/input/gitlab_flavored_markdown/glfm_example_metadata.yml to the Input Specification Files section

See the GLFM Specification Guide development documentation for much more context on all of this work: https://docs.gitlab.com/ee/development/gitlab_flavored_markdown/specification_guide

Tasks

How to set up and validate locally

  1. Re-run scripts/glfm/update-example-snapshots.rb, and see that there are no files modified.
  2. Verify that the newly added markdown examples use the proper context and URLs based on the context.
  3. Run scripts/glfm/update-example-snapshots.rb, spec/requests/api/markdown_snapshot_spec.rb and ee/spec/requests/api/markdown_snapshot_spec.rb, and ensure there are no failures.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Chad Woolley

Merge request reports