Skip to content

Add error checking for GLFM config files

What does this MR do and why?

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

Adds error checking for GLFM manually-curated input specification config files.

This will catch errors when inserting new example header sections that are not at the last/end position, or other reorganization of the specification examples, but forgetting to update the config files with the corresponding new renumbered example names.

The files being validated are documented at the bottom of the "Input Specification Files" section of the guide: https://docs.gitlab.com/ee/development/gitlab_flavored_markdown/specification_guide/#input-specification-files.

For information on how these config files are used in the process of updating the specification, see the guide docs on the update-specification.rb script.

Allow for empty config files

  • As part of this MR, a bug was found that would cause an error if any of these config files was empty. That has also been fixed.

Documentation updates

There needs to be documentation updates to reflect the changes in this MR. However, they would currently conflict with the changes from this other open MR: Update GLFM docs for official specification vs ... (!98493 - merged).

So, we will defer and complete the documentation updates in a separate MR, after !98493 (merged) is merged.

There is a task to capture this docs action item in the "Documentation Tasks" section of the tracking issue: #361241 (closed)

References

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

How to set up and validate locally

  1. Add an invalid config name entry to one of the three files (glfm_specification/input/gitlab_flavored_markdown/glfm_example_*.yml)
  2. Re-run scripts/glfm/update-example-snapshots.rb, and see that an appropriate error message is printed.
  3. Delete the invalid entry, and verify that entries starting with 00_ can be added without error.
  4. Repeat for each of the three files.

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

Loading