-
Notifications
You must be signed in to change notification settings - Fork 241
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
Fix flaky broken link checker #3173
Conversation
✅ You can preview this change here:
To edit notification comments on pull requests, go to your Netlify site configuration. |
f1f8c1c
to
7e9c840
Compare
24f69c3
to
e4b596e
Compare
Moving back into draft as it's still returning exit codes but without error logs |
e4b596e
to
ab51791
Compare
ab51791
to
0e0f7f5
Compare
All passing great locally - coupla questions. The output is annoying, but auditing the errors is just a "search for 'not ok'" away, so really not a biggie imo. |
When used without `--internal` we see problems parsing external URLs when the `--source-maps` flag is also enabled Removing it just in case
0e0f7f5
to
7d3a9ab
Compare
It's cheap enough to swap reporters so I'd be keen to try If it fails, there's another option with |
Note: With I'll do some more runs with the existing |
Saving to disk before hitting the reporter appears to remove the flaky non-zero exit codes too Co-authored-by: Romaric Pascal <romaric.pascal@digital.cabinet-office.gov.uk>
1ff4d02
to
f68a012
Compare
Whoop! 🥳 If adding If things work just as well with Thanks for re-running the checks so many times 😊 |
Yeah looking good still: https://github.com/alphagov/govuk-design-system/actions/runs/6354060722/attempts/1 To confirm, exit codes are still returned on failure too: > check-links
> hyperlink --canonicalroot https://design-system.service.gov.uk/ --internal --recursive deploy/public/sitemap.xml | tee check-links.log | tap-mocha-reporter min
Guessing --root from input files: file:///home/runner/work/govuk-design-system/govuk-design-system/deploy/public/
2227 passing (39s)
8 pending
5 failing
1) load deploy/public/components/hint-colin-broke-this-link:
load deploy/public/components/hint-colin-broke-this-link
2) load deploy/public/components/error-message-colin-broke-this-link:
load deploy/public/components/error-message-colin-broke-this-link
3) load deploy/public/components/fieldset-colin-broke-this-link:
load deploy/public/components/fieldset-colin-broke-this-link
4) load deploy/public/components/label-colin-broke-this-link:
load deploy/public/components/label-colin-broke-this-link
5) load deploy/public/components/tag-colin-broke-this-link:
load deploy/public/components/tag-colin-broke-this-link |
@romaricpascal For info, Windows checks passed too (it includes EditorConfig check has failures though but I've fixed these in #3183 |
We have a very flaky
npm run check-links
script at the momentThis PR partially fixes #3113 and alphagov/govuk-frontend#4223 makes the link checker stable by:
1. Avoiding sitemap.xml parsing2. Remove flag
--source-maps
3. Remove flag--recursive
(uses glob instead)4. Replace reportertap-mocha-reporter
withtap-min
5. Saving output to disk before piping to reporter
Task output
In the past we've switched reporter to increase stability but see Munter/hyperlink#179 (comment). The best fix was to pipe to disk first, using the README suggestion in #3173 (comment)
Initially this PR bypassed the reporter entirely but output was too noisy: