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
-
Implementation -
Add status entries flagging unimplemented WYSIWYG examples as discussed in this comment: !92507 (comment 1068201678) -
Add new EE spec to scripts/glfm/run-snapshot-tests.sh
-
Update documentation in https://docs.gitlab.com/ee/development/gitlab_flavored_markdown/specification_guide/#input-specification-files as explained above.
How to set up and validate locally
- Re-run
scripts/glfm/update-example-snapshots.rb
, and see that there are no files modified. - Verify that the newly added markdown examples use the proper context and URLs based on the context.
- Run
scripts/glfm/update-example-snapshots.rb
,spec/requests/api/markdown_snapshot_spec.rb
andee/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.
-
I have evaluated the MR acceptance checklist for this MR.