Repository navigation
Fix broken links in blog posts - #697
Conversation
Signed-off-by: Daniel Frankcom <frankcom@amazon.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Priority: ⬇️ Low Merge Risk: ⚪ Minimal · up to
|
|
The site has 18 broken internal links at the time of writing. This change adds checks so new ones fail the PR that introduces them, and so existing ones are reported for cleanup during deployment. There are 2 separate checks: - Internal links to missing pages or `#anchors` are caught using [lychee](https://lychee.cli.rs/), which is also used by `valkey-glide-docs`, `valkey-developer-resources`, and `valkey-glide-csharp`. `https://valkey.io/...` links are checked against the build too. - `valkey-doc` links that `fix_links` didn't convert (still `../` or `.md`) are caught with a script added by this change. They can't be reliably caught by lychee since they can still point to a real page, just not the correct one. For example, `../clients/` on `/topics/installation/` opened `/topics/clients/` until #690. Both checks run locally against the built site, so network problems won't impact them. ### How the checks work Since the source for many of these links comes from other repos, I tried to structure this in a way that it wouldn't unduly block development/deployment in this repo. The easiest thing to do would be to block all PR merges and deployments if there are broken links, but doing that would require updating other repos before anything can be processed through this repo. That seems undesirable for low priority link breakages, which might take a long time to fix and filter through to this repo. For example, valkey-io/valkey#4845 fixes the `#attribute-type` link on `/topics/modules-api-ref/`, but `modules-api-ref.md` is only regenerated at a valkey X.Y.0 release. Blocking would hold back every deploy until then. To avoid this dependency problem, pull requests fail only when the PR itself breaks links. The check builds the base and the PR and compares them, so links already broken on `main` are listed but don't fail it. Broken links in dependency repos like `valkey-doc` will only surface during a deployment, where I've configured the failures to be visible but not block the deployment. I think this is a decent first step, as it gives visibility to breakages which were previously invisible without blocking anything. ### Current broken links I have opened PRs for most of the current link problems: - #689: 2 unconverted links on `/topics/search/` and the 2 missing pages they lead to - valkey-io/valkey-doc#502: 11 missing anchors - valkey-io/valkey#4845: 1 missing anchor, `modules-api-ref.md` needs to be regenerated after - #697: 2 internal links in blog posts ### Limits - External links aren't checked. That could be done in the future with `lychee`. - `#:~:text=` fragments aren't checked, because lychee's support was unreliable in testing. It seems like a new feature so I think this could be enabled in the future. - Failures do not block deployment. This has the upside of not blocking deployment waiting for things to be merged in other repos, but has the downside of allowing broken links to propagate to user-visible sites (as they already do now). The main aim here is to add visibility. ### Check List - [x] Commits are signed per the DCO using `--signoff` By submitting this pull request, I confirm that my contribution is made under the terms of the BSD-3-Clause License. --------- Signed-off-by: Daniel Frankcom <frankcom@amazon.com> Signed-off-by: Madelyn Olson <madelyneolson@gmail.com> Co-authored-by: Madelyn Olson <madelyneolson@gmail.com>
Description
Fixes the two broken internal links in blog posts that the link check in #694 reports:
[HGETEX]((/commands/hgetex))has doubled parentheses, so it links to/blog/hash-fields-expiration/(/commands/hgetex)./events/keyspace-2025#registerpoints at a section that was replaced by the recorded talks after the event (Update Keyspace event page with video and slides #356). This links to the event page instead.I'm not sure it makes sense to fix external links in old blog posts, but these 2 are either internally inconsistent or malformed which seems like it's worth fixing.
Issues Resolved
None filed.
Check List
--signoffBy submitting this pull request, I confirm that my contribution is made under the terms of the BSD-3-Clause License.