Add Lychee to Markdown linting image for link checking
What does this MR do and why?
For: technical-writing#979 (closed), before we can use Lychee to check for broken links, we need a Docker image with the checker.
There are alternatives to this including:
- Using a component: https://gitlab.com/gitlab-org/technical-writing-group/markdown-link-check.
- Pulling Lychee into every job we want to check links on.
However, the method of loading up an Docker image with Lychee represents an MVC as we continue discussing how we want to approach Docker images in the future: #1758.
How to set up and validate locally
Numbered steps to set up and validate the change are strongly suggested.
-
Configure a local GitLab Docs environment: https://gitlab.com/gitlab-org/gitlab-docs/-/blob/main/doc/setup.md. -
To build the Docker image, run: docker buildx build --file dockerfiles/gitlab-docs-lint-markdown.Dockerfile . --platform=linux/amd64 --build-arg="ALPINE_VERSION=3.19" --build-arg="VALE_VERSION=3.4.1" --build-arg="MARKDOWNLINT2_VERSION=0.13.0" --build-arg="LYCHEE_VERSION=0.14.3"
. -
Load the Docker image with: docker run --rm -it --platform=linux/amd64 <image SHA> bash
-
To ensure that the Docker image can still support probably the most challenging job (https://gitlab.com/gitlab-org/gitlab/-/blob/55dd94a4c1c49303caf3a53dc756c46fcb9c7003/.gitlab/ci/docs.gitlab-ci.yml#L63), in the running Docker container: -
Run git clone https://gitlab.com/gitlab-org/gitlab.git
. -
Run cd gitlab
. -
Run source ./scripts/utils.sh && yarn_install_script && install_gitlab_gem
(which feels like a very heavy process) -
Run scripts/lint-doc.sh
. -
Run scripts/lint/check_mermaid.mjs
. -
Run any other process you feel you should.
-
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.
-
I have evaluated the MR acceptance checklist for this merge request.
Edited by Evan Read