hashicorp / hashicorp/web-unified-docs
Bug: incorrect and confusing Link Checker reports
Nobody has claimed this yet.
- Dominant language
- MDX
- Stars
- 87
- Forks
- 275
- Avg merge
- 3d 18h
- Merged PRs (30d)
- 199
Description
Consider this Link Checker comment in one of the PRs: #564
Errors in content/terraform/v1.3.x/docs/language/style.mdx
It says the "/terraform/language/settings/backends/configuration" link is broken in the "content/terraform/v1.3.x/docs/language/style.mdx" file, but it's not how the links on the website work.
On the actual website, if you are viewing the "Style Guide" page in its v1.3.x version, all the links on that page are prefixed with v1.3.x while the Link Checker ignores the version and checks the link against the latest version (i.e. no version in the URL at all).
For example, when viewing "/terraform/language/v1.3.x/style", the "backend configuration" is linked to "/terraform/language/v1.3.x/settings/backends/configuration" which is valid (i.e. 200 OK):
...but Link Checker was checking it against /terraform/language/settings/backends/configuration (no version in the URL) which is 404 Not Found because the link has changed in newer versions.
Naturally, in order to make Link Checker happy, I'd go and do a find-replace all links in the repo with /terraform/language/backend which is the updated link in the newer Terraform version. While Link Checker becomes happy and reports all ✅, I've broken the link for v1.3.x ❌
Expected behaviour
Link Checker should prefix all the links in content/terraform/<VERSION>/docs/... with <VERSION> (if <VERSION> is not the latest version) and NOT check them against the latest version.
If <VERSION> is the latest version in the docs, it should check against both <VERSION> and latest version (not <VERSION> in the URL).
I hope I was able to report it in an easy-to-understand way, but let me know if the issue is still not clear.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the Link Checker report from PR #564 and the versioned file content/terraform/v1.3.x/docs/language/style.mdx. Trace how links from versioned content are resolved, then verify that non-latest versions use their version prefix and latest-version content is checked in both forms.
Written by the indexing model from the issue text.
Assessment
- Domain
- documentation, tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100