Fix regular expressions for determining if links are internal
What does this MR do and why?
We use a regular expression to determine if we need to rewrite a link to a .md
file as .html
in this Nanoc filter, and also in our compile Rules.
Unfortunately these checks can match false positives on internal pages that start with the string http
, such as http_routing_service.md
(see gitlab!152956 (merged)).
The result of this is that our link tests fail because these links do not get rewritten, and the rendered links point to /ee/architecture/blueprints/cells/http_routing_service.md
, which indeed does not exist.
This MR adjusts the regular expressions to consider a link external if it starts with http://
or https://
rather than just http
. This should more accurately match external URLs.
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. -
Update docs content source projects: make update-all-docs-projects
-
In your ../gitlab
directory, check out this branch:origin/move-http-routing-service
-
Wipe any old builds and compile the site: make clean && make compile
-
Run the link test in gitlab-docs
:parallel time bundle exec nanoc check ::: internal_links
The link check should no longer flag pages that reference http_routing_service.md
.
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.