Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fail in CI if docs build contains logs about broken internal links #2277

Open
inglesp opened this issue Dec 5, 2024 · 0 comments
Open

Fail in CI if docs build contains logs about broken internal links #2277

inglesp opened this issue Dec 5, 2024 · 0 comments

Comments

@inglesp
Copy link
Contributor

inglesp commented Dec 5, 2024

We should use CI to prevent changes to the docs from introducing broken internal links.

There are two ways of introducing broken internal links. CI should fail if either of these are detected.

The first is by linking to a page that doesn't exist. When this happens, we see something like the following in the output:

WARNING -  Doc file 'explanation/backend-tables.md' contains a link
           '../tutorial/writing-a-dataset-definition/index.md', but the target
           'tutorial/writing-a-dataset-definition/index.md' is not found among documentation
           files.

The second is by not linking to a .md file. When this happens, we see something like the following in the output:

INFO    -  Doc file 'tutorial/more-complex-transformations/index.md' contains an unrecognized
           relative link '../../how-to/codelists/', it was left as is. Did you mean
           '../../how-to/codelists.md'?

It may be possible to configure mkdocs to return non-zero if a broken link is detected. Otherwise, we'll have to check the error messages.

A broken external link should not cause our main CI to fail, because external links may break for reasons unrelated to a PR. Instead, broken external links are checked by the weekly link checker.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant