-
Notifications
You must be signed in to change notification settings - Fork 332
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
Run the link check for PRs and changes to master #1167
Conversation
Signed-off-by: Richard Wall <richard.wall@jetstack.io>
Signed-off-by: Richard Wall <richard.wall@jetstack.io>
✅ Deploy Preview for cert-manager-website ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
Signed-off-by: Richard Wall <richard.wall@jetstack.io>
Checking external links is flaky due to network and rate limiting Checking anchor links doesn't work when the anchors have been specified using `<a name` syntax. Checking /foo/bar/baz.png links doesn't work because they are served from a virtual webserver directory mapped to public/ Signed-off-by: Richard Wall <richard.wall@jetstack.io>
> ℹ️ All these checks are also run automatically for pull requests. | ||
> The results will be reported in the [checks summary](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/collaborating-on-repositories-with-code-quality-features/about-status-checks) at the bottom of your GitHub PR. | ||
> Read the [cert-manager-website-presubmits.yaml prow configuration file](https://github.com/jetstack/testing/blob/master/config/jobs/cert-manager/website/cert-manager-website-presubmits.yaml) and the [check.yaml workflow file](.github/workflows/check.yaml) for more details. | ||
|
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.
Added a couple of paragraphs about these npm scripts and a note to explain how they are run by CI.
@@ -4,19 +4,19 @@ description: '' | |||
--- | |||
|
|||
approver-policy is a cert-manager | |||
[approver](https://cert-manager.io/docs/concepts/certificaterequest/#approval) | |||
[approver](../concepts/certificaterequest.md#approval) |
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.
There were a bunch of absolute links which I converted to internal links. Probably because this content was copy - pasted from the README file of the project.
@@ -269,7 +269,7 @@ CertificateRequestPolicies against CertificateRequests for evaluation. A | |||
CertificateRequestPolicy must select, and therefore match, a CertificateRequest | |||
for it to be considered for evaluation of the request. | |||
|
|||
> ⚠️ Note that the user must still be bound by [RBAC](#Configuration) for | |||
> ⚠️ Note that the user must still be bound by [RBAC](#configuration) for |
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 link checker picked this up before I disabled the #anchor
checks.
It seems that the autogenerated markdown anchors are always lower case.
@@ -145,12 +145,12 @@ For users of Kubernetes `v1.15` we keep offering support for the `v1beta1` Kuber | |||
For this release we upgraded our logging library to `klog/v2` analog to Kubernetes `v1.19`. | |||
We also reviewed every log we write to assign it an appropriate log level. | |||
|
|||
We followed the (Kubernetes logging guidelines)[https://github.com/kubernetes/community/blob/master/contributors/devel/sig-instrumentation/logging.md]. To come up with 5 log levels ranging from `Error` (level 0) which only prints important errors to `Trace` (level 5) which can help you to know exactly what is gong on. | |||
We followed the [Kubernetes logging guidelines](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-instrumentation/logging.md). To come up with 5 log levels ranging from `Error` (level 0) which only prints important errors to `Trace` (level 5) which can help you to know exactly what is gong on. |
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.
This link was marked up incorrectly.
"pattern": "^https://developers.cloudflare.com" | ||
"description": "Ignore external links which may fail due to network flakiness and rate limits on foreign servers", | ||
"pattern": "^https?://" | ||
}, |
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.
For example
FILE: content/docs/tutorials/getting-started-aks-letsencrypt/README.md
[✖] https://www.cloudflare.com/en-gb/learning/dns/glossary/what-is-a-domain-name-registrar/
[✖] https://www.cloudflare.com/en-gb/learning/dns/dns-server-types/
[✖] clusterissuer-selfsigned.yaml
[✖] certificate.yaml
ERROR: 11 dead links found!
[✖] deployment.yaml
[✖] service.yaml
[✖] https://www.cloudflare.com/en-gb/learning/dns/dns-records/dns-cname-record/
[✖] ../../configuration/acme/dns01/azuredns/README.md
[✖] values.yaml
[✖] clusterissuer-lets-encrypt-staging.yaml
[✖] clusterissuer-lets-encrypt-production.yaml
34 links checked.
[✖] https://www.cloudflare.com/en-gb/learning/dns/glossary/what-is-a-domain-name-registrar/ → Status: 403
[✖] https://www.cloudflare.com/en-gb/learning/dns/dns-server-types/ → Status: 403
[✖] clusterissuer-selfsigned.yaml → Status: 400
@@ -1,13 +1,21 @@ | |||
{ | |||
"ignorePatterns": [ | |||
{ | |||
"pattern": "^https://github.com" | |||
"description": "Ignore root relative links to images which markdown-link-check is unable to verify", | |||
"pattern": "^/" |
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.
For example:
FILE: content/docs/troubleshooting/webhook.md
[✖] https://web.archive.org/web/20210903183221/https://serverfault.com/questions/1076563/creating-issuer-for-kubernetes-cert-manager-is-causing-404-and-500-error
[✖] #io-timeout
[✖] #context-deadline-exceeded
[✖] #gke-private-cluster
[✖] #diagram
[✖] /images/troubleshooting/webhook-pod-networking-diagram.png
48 links checked.
ERROR: 6 dead links found!
[✖] https://web.archive.org/web/20210903183221/https://serverfault.com/questions/1076563/creating-issuer-for-kubernetes-cert-manager-is-causing-404-and-500-error → Status: 0
[✖] #io-timeout → Status: 404
[✖] #context-deadline-exceeded → Status: 404
[✖] #gke-private-cluster → Status: 404
[✖] #diagram → Status: 404
[✖] /images/troubleshooting/webhook-pod-networking-diagram.png → Status: 400
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.
/lgtm
/approve
I added suggestions, but I'm not even gonna add a hold. I'm generally super concerned about developing two parallel CI pipelines, but I don't want to get in the way of progress.
link-check: | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: 16 | ||
cache: npm | ||
- run: npm ci | ||
- run: npm run markdown-link-check |
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.
suggestion (non-blocking): I think proliferating a pattern where some jobs are run in github actions and some are run in prow will lead to everything being harder to maintain in the future.
I'd rather not use github actions at all, personally, but more important than "actions vs prow" is consistency.
I don't think it's a blocker, because I don't want to get in the way of a good PR... but I think it's a concern.
|
||
```bash | ||
npm run lint | ||
``` | ||
|
||
To check the links in all pages, run [markdown-link-check](https://github.com/tcort/markdown-link-check): | ||
|
||
```bash | ||
npm run markdown-link-check | ||
``` | ||
|
||
> ℹ️ All these checks are also run automatically for pull requests. | ||
> The results will be reported in the [checks summary](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/collaborating-on-repositories-with-code-quality-features/about-status-checks) at the bottom of your GitHub PR. | ||
> Read the [cert-manager-website-presubmits.yaml prow configuration file](https://github.com/jetstack/testing/blob/master/config/jobs/cert-manager/website/cert-manager-website-presubmits.yaml) and the [check.yaml workflow file](.github/workflows/check.yaml) for more details. | ||
|
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.
suggestion (non-blocking): It would be nice to have a single script which can be run to check everything locally, and to have the CI environment call that script. Doesn't really matter though
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: SgtCoDFish, wallrj The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
There exists an
npm run markdown-link-check
script, which checks both internal markdown links and external links.I've enabled it in CI and fixed a bunch of the broken internal links that it identified.
I've disabled the anchor checking because it is not reliable, due to:
Also disabled external link checks because sites like cloudflare seem to block robot http clients.
And also because there are some broken links in the cert-manager API.
Example failures:
References: