Skip to content
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

Add target for detecting broken links in documentation #1104

Merged
merged 1 commit into from
Sep 10, 2023

Conversation

rodrigc
Copy link
Contributor

@rodrigc rodrigc commented Jun 12, 2023

Solves #956

@rodrigc rodrigc force-pushed the rodrigc/fix-broken-links-3 branch from a3396c4 to a468fe4 Compare June 12, 2023 18:06
@NissesSenap
Copy link
Collaborator

This is really nice could you add this to be run during CI as well. Maybe a bit painful to run each PR. But it could be something that runs as a cronjob that runs ones a week.

Or what do you think?

It also seems like there are a few broken links already

➜ muffet --rate-limit=3 --max-connections=10 --buffer-size=8192 http://localhost:1313
http://localhost:1313/blog/
        404     https://github.com/grafana-operator/grafana-operator/edit/master/hugo/content/en/blog/_index.md
        404     https://github.com/grafana-operator/grafana-operator/tree/master/hugo/content/en/blog/_index.md
http://localhost:1313/docs/
        404     https://github.com/grafana-operator/grafana-operator/edit/master/hugo/content/en/docs/_index.md
        404     https://github.com/grafana-operator/grafana-operator/tree/master/hugo/content/en/docs/_index.md
http://localhost:1313/blog/2023/03/29/install-grafana-operator-using-flux-and-kustomize/
        404     http://grafana.127.0.0.1.nip.io
        404     https://github.com/grafana-operator/grafana-operator/edit/master/hugo/content/en/blog/kustomize-installation.md
        404     https://github.com/grafana-operator/grafana-operator/tree/master/hugo/content/en/blog/kustomize-installation.md

Either we try to ignore them in the test, or I guess we fix it.

@rodrigc
Copy link
Contributor Author

rodrigc commented Jun 12, 2023

I didn't want to add it to CI just yet, because I found while testing that if you bang github too hard,
github enforces rate limits and then you get lots of 429 errors.

There is a GH action which uses muffet which we can pull in later if we want:
https://github.com/ruzickap/action-my-broken-link-checker

@rodrigc
Copy link
Contributor Author

rodrigc commented Jun 12, 2023

I would ignore the errors for now, and just fix them on by one.

For this one:

http://grafana.127.0.0.1.nip.io

That's an example, so won't work anyways.

For these ones:

https://github.com/grafana-operator/grafana-operator/edit/master/hugo/content/en/docs/_index.md
https://github.com/grafana-operator/grafana-operator/tree/master/hugo/content/en/docs/_index.md

This is related to the values of github_repo, github_subdir, and github_branch in config.toml.
I'm not sure at the moment how to fix those.

@NissesSenap
Copy link
Collaborator

Yeah I think we should shrink the scope and ignore github.com links all together for now.

I have did similar things to did in the flux project and there it worked in one of their repos due to the limited links they had in it. But in another repo we had to ignore github.com links due to the rate limiting even happens if you have a github API token it just comes a bit later.

@NissesSenap
Copy link
Collaborator

@rodrigc as described in https://github.com/awsugcz/awsug.cz/blob/main/.github/workflows/periodic-broken-link-checks.yml it seems like all we need to do is to add --exclude=(github.com) and it should fix our issues.
Sure, we won't find broken github links, but it's a good start.

Do you have time to take a look at the PR again?

@rodrigc rodrigc force-pushed the rodrigc/fix-broken-links-3 branch 2 times, most recently from 8aba5be to 2c549d6 Compare July 11, 2023 07:50
@rodrigc
Copy link
Contributor Author

rodrigc commented Jul 11, 2023

@rodrigc as described in https://github.com/awsugcz/awsug.cz/blob/main/.github/workflows/periodic-broken-link-checks.yml it seems like all we need to do is to add --exclude=(github.com) and it should fix our issues. Sure, we won't find broken github links, but it's a good start.

Do you have time to take a look at the PR again?

@NissesSenap OK, I added --exclude

@github-actions
Copy link

github-actions bot commented Sep 9, 2023

This PR hasn't been updated for a while, marking as stale

@github-actions github-actions bot added the stale label Sep 9, 2023
Copy link
Collaborator

@NissesSenap NissesSenap left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for the delay with a review on this @rodrigc .
LGTM

@NissesSenap NissesSenap merged commit 84e6863 into grafana:master Sep 10, 2023
9 checks passed
@rodrigc rodrigc deleted the rodrigc/fix-broken-links-3 branch October 25, 2023 16:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants