[go: up one dir, main page]

Allow Kroki companion server for Mermaid

What does this MR do and why?

Fixes Allow use of external Mermaid (and possibly oth... (#498764 - closed) by allowing the Mermaid companion server for Kroki to be used to render Mermaid diagroms. If Mermaid is enabled under the Kroki settings, the configured Kroki instance will be used to render them, instead of using GitLab's built-in support.

How to set up and validate locally

  1. Check out the branch. Consider restarting your GDK for good measure.
  2. Configure Kroki with Mermaid support enabled at http://gdk.test:3000/admin/application_settings/general#js-kroki-settings, or the equivalent URL for your GDK installation. You can use the public server at https://kroki.io for testing. It should look like this:
    image
  3. Add a Mermaid diagram to a Markdown field, like an issue or MR description. This will do:
    ```mermaid
    graph TD
        A[Hello] -->|Echawwo| B(Nyonk)
    ```
  4. Save and confirm you can see the rendered diagram. It should look something like this:
    image
  5. Confirm the diagram was rendered by the configured Kroki server. If you click it, it should be a link that takes you to a page containing just the render on the server you chose in step 2.
  6. Disable the Kroki–Mermaid support by unchecking the Mermaid checkbox at step 2. You can leave Kroki on as a whole.
  7. Edit the field you entered the Mermaid diagram into and change at least one character in the whole Markdown field, such as substituting Shomk for Nyonk. This step invalidates the Markdown cache, which is necessary for the new settings to take effect.
  8. Confirm the diagram after editing was rendered by GitLab itself — it shouldn't be a link, but rather an embedded SVG in an iframe, so it won't click.

MR acceptance checklist

Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Merge request reports

Loading