-
Notifications
You must be signed in to change notification settings - Fork 1.7k
preprocess/links: fail for invalid links #2277
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
base: master
Are you sure you want to change the base?
Conversation
Before, `mdbook` would continue processing even when errors, such as invalid links, are encountered. Moreover, it would exit with a `0` return code. Such behavior is unexpected and leads to confusion when run in CI. Now, when links that don't point to existing files are encounter and error is returned which yields to `mdbook` exiting with an error code. The change in behavior has revealed that some tests were run with invalid links.
Took this branch for a spin, and worked well: my existing mdbook docroot with broken links threw an error, as I'd expected. After patching the include, no more errors. I support this change being merged. |
Hi 👋 , will this be merged? |
<!-- Reference any GitHub issues resolved by this PR --> Closes #2756 ## Introduced changes <!-- A brief description of the changes --> Add a script which exits with code 1 in case when there are errors when running `mdbook build`. This should be ofc done on mdbook's project side, however it hasn't been addressed yet (rust-lang/mdBook#2277). Example run with broken docs url: https://github.com/foundry-rs/starknet-foundry/actions/runs/12329947653/job/34414855443 ## Checklist <!-- Make sure all of these are complete --> - [x] Linked relevant issue - [x] Updated relevant documentation - [x] Added relevant tests - [x] Performed self-review of the code - [x] Added changes to `CHANGELOG.md`
- Adds some dialog docs (in conjunction with dialog samples microsoft/teams.ts#175) - Our mdbook build/serve step wasn't failing if links were broken. The error would be printed, but it wouldn't fail. rust-lang/mdBook#2277. I improved the script so that it watched for the `[ERROR]` string and failed if it saw it.
☔ The latest upstream changes (possibly #2681) made this pull request unmergeable. Please resolve the merge conflicts. |
Thank you @rustbot. Because the maintainer has ignored this PR even though he has acknowledged the issue I have little motivation to put more effort in vain. |
Before,
mdbook
would continue processing even when errors, such as invalid links, are encountered. Moreover, it would exit with a0
return code. Such behavior is unexpected and leads to confusion when run in CI.Now, when links that don't point to existing files are encounter and error is returned which yields to
mdbook
exiting with an error code. The change in behavior has revealed that some tests were run with invalid links.Closes #1094