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

CICD: Linkspector #3439

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

Conversation

cafferata
Copy link
Collaborator

@cafferata cafferata commented Feb 15, 2025

Originally posted by @imlonghao:

There are also GitHub Actions github-action-markdown-link-check and action-linkspector, maybe we can add one of those to verify docs links changed in PRP.

This GitHub pull request adds linkspector.

Current state of the check command (after apply of #3437, #3438):

npx linkspector check
🚫 documentation/opinions.md, #opinion-3-dnsconfig.js-are-not-zonefiles , 404, 76, Cannot find section: #opinion-3-dnsconfig.js-are-not-zonefiles in file: documentation/opinions.md.
🚫 documentation/index.md, examples.md#macro-to-for-repeated-records , 404, 25, Cannot find section: #macro-to-for-repeated-records in file: /Users/jeffrey/jcid/repositories/dnscontrol/documentation/examples.md.
🚫 documentation/adding-new-rtypes.md, SUMMARY.md#domain-modifiers , 404, 303, Cannot find section: #domain-modifiers in file: /Users/jeffrey/jcid/repositories/dnscontrol/documentation/SUMMARY.md.
🚫 documentation/adding-new-rtypes.md, SUMMARY.md#service-provider-specific , 404, 303, Cannot find section: #service-provider-specific in file: /Users/jeffrey/jcid/repositories/dnscontrol/documentation/SUMMARY.md.
🚫 documentation/adding-new-rtypes.md, SUMMARY.md#record-modifiers , 404, 303, Cannot find section: #record-modifiers in file: /Users/jeffrey/jcid/repositories/dnscontrol/documentation/SUMMARY.md.
🚫 documentation/provider/rwth.md, https://noc-portal.rz.rwth-aachen.de/dns-admin/en/api_tokens , null, 4, net::ERR_CONNECTION_REFUSED at https://noc-portal.rz.rwth-aachen.de/dns-admin/en/api_tokens
🚫 documentation/provider/namedotcom.md, https://www.name.com/reseller/apply , 404, 71, null
🚫 documentation/provider/cloudflareapi.md, https://support.cloudflare.com/hc/en-us/articles/200167836-Managing-API-Tokens-and-Keys , 404, 57, null
🚫 documentation/language-reference/top-level-functions/REV.md, ../domain/PTR.md , 404, 81, Cannot find: ../domain/PTR.md
🚫 documentation/language-reference/domain-modifiers/PTR.md, ../global/D_EXTEND.md , 404, 98, Cannot find: ../global/D_EXTEND.md
🚫 documentation/language-reference/domain-modifiers/CF_TEMP_REDIRECT.md, ../provider/cloudflareapi.md , 404, 18, Cannot find: ../provider/cloudflareapi.md
🚫 documentation/language-reference/domain-modifiers/CF_REDIRECT.md, ../provider/cloudflareapi.md , 404, 18, Cannot find: ../provider/cloudflareapi.md
🚫 documentation/language-reference/domain-modifiers/AKAMAICDN.md, https://blogs.akamai.com/2019/08/fast-dns-zone-apex-mapping-dnssec.html , null, 14, net::ERR_NAME_NOT_RESOLVED at https://blogs.akamai.com/2019/08/fast-dns-zone-apex-mapping-dnssec.html

For me it is already an added value to merge so that this tool can be used as a reference during (documentation) refactorings. I would like to propose to fix these last violations before including linkspector in GitHub actions.

@cafferata cafferata mentioned this pull request Feb 15, 2025
19 tasks
@tlimoncelli
Copy link
Contributor

Hmm.... I seem to be doing something wrong:

$ git checkout -b cafferata-cicd/linkspector main
$ git pull https://github.com/cafferata/dnscontrol.git cicd/linkspector
$ git merge main --
Merge made by the 'ort' strategy.
$ npx linkspector check
npm ERR! code E404
npm ERR! 404 Not Found - GET https://registry.npmjs.org/linkspector - Not found
npm ERR! 404 
npm ERR! 404  'linkspector@*' is not in this registry.
npm ERR! 404 
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/tlimoncelli/.npm/_logs/2025-02-17T13_54_51_941Z-debug-0.log
$ 

@tlimoncelli
Copy link
Contributor

Ah, I see my problem. I need to add:

npm install -g @umbrelladocs/linkspector

Now I get similar results:

$ npx linkspector check
⠙ Checking documentation/writing-providers.md...
🚫 documentation/opinions.md, #opinion-3-dnsconfig.js-are-not-zonefiles , 404, 76, Cannot find section: #opinion-3-dnsconfig.js-are-not-zonefiles in file: documentation/opinions.md.
🚫 documentation/index.md, examples.md#macro-to-for-repeated-records , 404, 25, Cannot find section: #macro-to-for-repeated-records in file: /Users/tlimoncelli/git/dnscontrol/documentation/examples.md.
🚫 documentation/adding-new-rtypes.md, SUMMARY.md#domain-modifiers , 404, 303, Cannot find section: #domain-modifiers in file: /Users/tlimoncelli/git/dnscontrol/documentation/SUMMARY.md.
🚫 documentation/adding-new-rtypes.md, SUMMARY.md#service-provider-specific , 404, 303, Cannot find section: #service-provider-specific in file: /Users/tlimoncelli/git/dnscontrol/documentation/SUMMARY.md.
🚫 documentation/adding-new-rtypes.md, SUMMARY.md#record-modifiers , 404, 303, Cannot find section: #record-modifiers in file: /Users/tlimoncelli/git/dnscontrol/documentation/SUMMARY.md.
🚫 documentation/provider/rwth.md, https://noc-portal.rz.rwth-aachen.de/dns-admin/en/api_tokens , null, 4, net::ERR_CONNECTION_REFUSED at https://noc-portal.rz.rwth-aachen.de/dns-admin/en/api_tokens
🚫 documentation/provider/namedotcom.md, https://www.name.com/reseller/apply , 404, 71, null
⠧ Checking documentation/provider/autodns.md...

@tlimoncelli
Copy link
Contributor

(I'm easily the winner of the "Most Likely To Add a Broken Link" award. I really appreciate automating this kind of check.)

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.

2 participants