-
Notifications
You must be signed in to change notification settings - Fork 139
docs: add link validation tasks #1889
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: main
Are you sure you want to change the base?
Conversation
Summary of ChangesHello @markstur, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly enhances the documentation quality by integrating automated link validation into the CI pipeline. It introduces distinct tasks for verifying both internal and external links, leveraging Mintlify for internal checks and the Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Ignored Files
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request introduces link validation for the documentation, which is a great addition for maintaining its quality. It adds two new scripts: one for internal links using mintlify and another for external links using markdown-link-check.
My review includes a couple of suggestions:
- A correction in the
markdown-link-checkconfiguration to properly handle rate-limiting errors. - A performance improvement for the external link checking script.
I also noticed that a new transitive dependency, whatwg-encoding@3.1.1, is deprecated. This is not a critical issue and is likely outside of your direct control, but it's something to be aware of for future dependency updates.
Overall, the changes are well-structured and address an important maintenance aspect.
docs/.markdown-link-check.json
Outdated
| "retryOn429": true, | ||
| "retryCount": 3, | ||
| "fallbackRetryDelay": "30s", | ||
| "aliveStatusCodes": [200, 206, 301, 302, 307, 308, 403, 429] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The status code 429 (Too Many Requests) should be removed from aliveStatusCodes. Since retryOn429 is set to true, the link checker will automatically retry on this status code. If it still fails with a 429 after all retries, it should be treated as a failure, not a success. The markdown-link-check documentation explicitly states that 429 is not needed in aliveStatusCodes when retryOn429 is enabled.
Additionally, while including 403 (Forbidden) can help reduce false positives from sites that block automated checkers, it might also mask genuinely broken or access-restricted links. It would be better to apply this status code only to specific domains known to cause issues if possible.
| "aliveStatusCodes": [200, 206, 301, 302, 307, 308, 403, 429] | |
| "aliveStatusCodes": [200, 206, 301, 302, 307, 308, 403] |
docs/package.json
Outdated
| "update-openapi": "wget localhost:8333/api/v1/openapi.json -O api-reference/openapi.json" | ||
| "update-openapi": "wget localhost:8333/api/v1/openapi.json -O api-reference/openapi.json", | ||
| "check:links": "mintlify broken-links", | ||
| "check:links:external": "find . -type f \\( -name '*.md' -o -name '*.mdx' \\) -not -path './node_modules/*' -print0 | xargs -0 -I {} pnpm exec markdown-link-check --config .markdown-link-check.json --quiet {}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The check:links:external script invokes markdown-link-check for each file individually, which can be inefficient as it starts a new process for every markdown file. You can improve performance by passing all found files to a single markdown-link-check command using xargs without the -I {} option. This will process all files in one go.
| "check:links:external": "find . -type f \\( -name '*.md' -o -name '*.mdx' \\) -not -path './node_modules/*' -print0 | xargs -0 -I {} pnpm exec markdown-link-check --config .markdown-link-check.json --quiet {}" | |
| "check:links:external": "find . -type f \\( -name '*.md' -o -name '*.mdx' \\) -not -path './node_modules/*' -print0 | xargs -0 pnpm exec markdown-link-check --config .markdown-link-check.json --quiet" |
Add docs:ci:check:links to use mintlify to test internal links. Add docs:ci:check:links:external to test external links with markdown-link-check. Currently avoiding the docs:check prefix because we have broken links that cause errors on commit. After doc links are fixed and ci passes, these could be renamed to docs:check (but maybe too slow). Signed-off-by: Mark Sturdevant <mark.sturdevant@ibm.com>
Remove alive status coded 429 because retryOn429 is enabled. Improve performance by processing files in one markdown-link-check. Signed-off-by: Mark Sturdevant <mark.sturdevant@ibm.com>
|
I fixed internal links and added validation in main, so that part is covered. (Sorry for work duplication, I saw the issue, thought it will be a quick one and didn't notice the assignment.) External link validation could still be valuable, especially when cross linking to our other repos, but I'm afraid that it could create weird situations if it was part of the main commit checks -- build breaking for external reasons, basically. It'd probably work better if it instead ran in a separate job every day and sent an email / made an issue if there's something broken? |
Summary
Add docs:ci:check:links to use mintlify to test internal links. Add docs:ci:check:links:external to test external links with markdown-link-check.
Currently avoiding the docs:check prefix because we have broken links that cause errors on commit. After doc links are fixed and ci passes, these could be renamed to docs:check (but maybe too slow).
Linked Issues
Fixes #1880
Documentation