Skip to content

Add migration for alerts

Sarah German requested to merge migrate-alert-boxes into main

What does this MR do and why?

Migrates alert boxes to shortcode format.

This covers these alert types: note, warning, flag, disclaimer. We are deprecating the info alert type, and the details alert type is a separate issue.

The disclaimer alert has some special handling as we now populate that text from a template rather than having writers copy/paste it from the style guide.

See https://gitlab-org.gitlab.io/technical-writing-group/gitlab-docs-hugo/shortcodes/#alert-boxes for examples of the new format.

Closes #9 (closed).

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

  1. Configure a local GitLab Docs environment: https://gitlab.com/gitlab-org/technical-writing-group/gitlab-docs-hugo/-/blob/main/doc/setup.md and checkout this branch, migrate-alert-boxes
  2. Pull down fresh docs, but don't run migrations yet: REMOVE_BEFORE_CLONE=true go run cmd/gldocs/main.go clone (clone script is unchanged)
  3. Run just the alert migration against the GitLab docs: go run cmd/gldocs/main.go migrate alerts ../gitlab/doc
    • You should see ~3 warnings about invalid disclaimer content.
  4. Look at the diff. Alerts are now in the new format: git -C ../gitlab/doc diff
    • Indention should be unchanged.
  5. Pull down fresh docs again and run the end-to-end clone + migrate: REMOVE_BEFORE_CLONE=true make clone-docs-projects
  6. Run make view and visit a few pages with alert boxes, such as:

Merge request 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 Sarah German

Merge request reports