Skip to content

Add catch during manual yaml front matter editing

Derek Knox requested to merge 250343-yaml-try-catch into master

What does this MR do?

It:

  1. Prevents yaml exceptions in the console during mid-edit of the yaml settings
  2. It falls back to the last valid yaml front matter (if applicable) if the rare scenario below occurs:
    • user enters Markdown mode
    • user enters invalid front matter (someKey vs. someKey: with a requred value)
    • user switches to WYSIWYG mode

Without handling this #2 rare scenario, the front matter could be lost (technically overwritten w/undefined)

Screenshots

Before: yaml-exception-before

v2 After (current solution): front-matter-valid

v1 After (old solution): yaml-exception-after

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

Related to #250343 (closed)

Edited by Derek Knox

Merge request reports

Loading