-
-
Notifications
You must be signed in to change notification settings - Fork 20
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
CI: Add link checker to avoid 404s going live, merge CI docs into one to simplify #259
Comments
adding to v3.11 to help streamline product documentation |
Doing a bit more research on this, it looks like muffet and htmltest are waaaay faster. Here's a full test of localhost (and a few other domains snuck in there like youtube) using
Just over 10 seconds - w00t! A lot better than just under 3 minutes with Researching some more, I found a project Hue that wrote about using Muffet to reduce 404s in their Hugo based project. They have another write up on how they use this same technique in Circle CI in GH Actions. From there we can see their I'm still totally open as to which we deploy, but it seems that |
Me again! There's some really great discussion about hugo implementing link checking feature natively. It is, unfortunately, blocked by another issue which was initially slated for release in Jul of '19 but then kept on getting delayed for almost 20 milestones, and most recently got delayed two days ago to 0.75. If any of us know Go and want to contribute, there's ample opportunity! Also, it's noteworthy that hugo chose |
Great research @mrjones-plip ! It sounds like we shouldn't wait for a Hugo implementation, and that htmltest and muffet are roughly equivalent, so I suggest going with whichever is easier. If the Hue write up makes muffet easy, then go for that! |
currently blocked by #260 - we can't have a build with broken links if we're gonna push a link check live, now can we ;) |
Oh, fun times! @abbyad and @garethbowen - while doing some bulk clean up in #260, the first item to fix is on the markdown guide page it's supposedly missing the curl -v --silent https://www.markdownguide.org/extended-syntax 2>&1 | grep '"tables'
# this space intentionally blank It'll come as no surprise that the site is using ye ol' JavaScript to inject this in the tables <h2 id="tables"> Aside from the fact I'm old and didn't know that both The OCD nerd in me wants use to check everything so this docs ship sales true and pure, but maybe we need to be more lax on deck. Thoughts? Without any feedback I'll likely implement something like a |
Is that to exclude checking links on the doc site page, or exclude specific target URLs? |
I'm envisioning it'd be to exclude specific target URLs. So that might be look like this, in increasing granularity, applying site wide any where these links appear in our docs: github.com
subdomain.github.com/subdir
https://github.com/medic/medic-os#user-content-service-management-scripts this whole ID thing getting more and more complicated. While working some more on #260, I see that github has those super handy hover to show the ID on the h2-h5 links. So on this page you can click <h2><a id="user-content-service-management-scripts" class="anchor" aria-hidden="true" href="#service-management-scripts"></a>Service Management Scripts</h2> So GH does a JS slight of hand to get it to work with Edit - I found out you can preface any GH id with What a rabbit hole - I thought this was gonna be a quick win ;) |
Feel free to solve the simplest problems first (MVP styles). We can gradually improve the link checking over time to add more value but don't let the complexity of checking anchors stop you from shipping checks on other types! ie: get the quick win now, and raise issues to get the slow wins later. |
Awesome feedback for a KISS approach @garethbowen - much thanks! |
…for master, add test alerts to my own private channel #259
…int to master, removing todos #259
w00t! code complete on this, just need to finalize the PR and consider go live, roll back and testing for QA/review. Very nicely in one Here's the most recent passing build from GH Actions:
|
Co-authored-by: Marc Abbyad <[email protected]>
Co-authored-by: Marc Abbyad <[email protected]>
Add Link Checker
While working #239, some images were accidentally pushed live that were broken (404). A system that programmatically checked that all images, and possibly all links, do not 404 would have avoided this. Because we're using hugo's
ref
andrelref
, we shouldn't ever have broken links between pages. However, this checking does not account 404s for:![GitHub Logo](/images/logo.png)
{{- $image := resources.Get “images/logo.jpg” -}}
[contribute](/contribute/docs)
[forum](https://forum.communityhealthtoolkit.org/)
We should deploy a solution that accounts for all of these. If hugo can be extended so it can check links in the dev environment, that'd be ideal. Otherwise if GH Actions can do this on commit in CI, that'd likely be the logical place. Beyond that, a GH Action that can run once a day to check the live site for 404's and alert/create an issue on failure could work as well.
Some notes about what's been discussed researched:
{{< figure src="image.png" >}}
) doesn't break the build locally if you have a 404 imageref
orrelref
as thesrc
of an image doesn't work (only.md
docs resolve)linkchecker
CLI app in the past to do this ad hoc.Merge CI docs
Right now we have both
ci.yml
andbuild-any.branch.yml
docs that both get run for every commit. We can merge these by using conditionals. We should so this so all the complexity of a link checker is just in one file, instead of duplicated in two.The text was updated successfully, but these errors were encountered: