Skip to content

ci: Break CI build on broken links, ommitted files #95

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

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

qmonnet
Copy link
Member

@qmonnet qmonnet commented Apr 3, 2025

Mkdocs is able to detect broken links or files ommitted from the "nav" configuration, etc. By default, it reports them at the "INFO" level. Instead, we can have "mkdocs build" report them as warnings. To do so, we follow the documentation's "recommended settings for most sites (maximal strictness)" (see docs)

Once "mkdocs build" emits warnings for these issues, we can use the strict mode (-s|--strict) to have the build error out if anything looks wrong. Let's use this in CI to detect broken links, for example.

Warning

Doesn't pass CI yet, because we currently have a few broken links in the API reference. See githedgehog/fabric#809.

Mkdocs is able to detect broken links or files ommitted from the "nav"
configuration, etc. By default, it reports them at the "INFO" level.
Instead, we can have "mkdocs build" report them as warnings. To do so,
we follow the documentation's "recommended settings for most sites
(maximal strictness)" (see link).

Once "mkdocs build" emits warnings for these issues, we can use the
strict mode (-s|--strict) to have the build error out if anything looks
wrong. Let's use this in CI to detect broken links, for example.

Link: https://www.mkdocs.org/user-guide/configuration/#validation
Signed-off-by: Quentin Monnet <qmo@qmon.net>
@mrbojangles3
Copy link
Contributor

I brought this up to @Frostman since he is looking at modifying this area of the code / docs.

@Frostman
Copy link
Member

that looks super useful, is it possible to ignore the files with generated docs to not wait for fixing it?

@qmonnet
Copy link
Member Author

qmonnet commented Apr 15, 2025

that looks super useful, is it possible to ignore the files with generated docs to not wait for fixing it?

I don't think there is an easy way to selectively disable validation for specific files, at least I couldn't find any.

There are few broken links in right now, only 4 as far as I remember, so maybe not too hard to fix. I looked into it some time ago, see githedgehog/fabric#809 for more context.

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

Successfully merging this pull request may close these issues.

3 participants