Skip to content
This repository has been archived by the owner on May 13, 2024. It is now read-only.

Adding an automated check to catch broken links #116

Closed
wants to merge 1 commit into from

Conversation

MirkoBonadei
Copy link
Member

This is a proof of concept to understand if it is possible to catch broken links "at build time".

@x1ddos
Copy link
Contributor

x1ddos commented Dec 28, 2016

@MirkoBonadei what does adding .travis.yml achieve in this change?

@x1ddos
Copy link
Contributor

x1ddos commented Dec 28, 2016

We're not using Travis CI as you might have guessed from the error messages.

Also, I'm not sure what this htmlproofer does exactly. Can you elaborate?

@x1ddos x1ddos closed this Dec 28, 2016
@MirkoBonadei
Copy link
Member Author

MirkoBonadei commented Dec 28, 2016

Hi @x1ddos, my goal is to check all the links to catch broken links as soon as they break (maybe enabling a TravisCI cronjob in the future to check them once a day).

htmlproofer[1] is a tool to validate HTML, we can run it on the _site directory after a jekyll build and as you can see from the --only-4xx we are only interested in stopping the build if we spot a link which returns 4xx.

Yeah, sorry for the build, I forgot to update the Gemfile.lock.

[1] - https://github.com/gjtorikian/html-proofer

@x1ddos
Copy link
Contributor

x1ddos commented Dec 28, 2016 via email

@x1ddos
Copy link
Contributor

x1ddos commented Dec 28, 2016

Ok, I've read a bit on the html-proofer and this answers my question about external links. I also see that it's just accepts HTML as input.

Will try to incorporate it in our current CI system.

@MirkoBonadei
Copy link
Member Author

Yes, from the documentation it checks also the external links (which are the ones that are breaking the most, especially when they link to the codebase). The meaning of the cronjob is to catch the broken (external) link as soon as possible, since we cannot control the external source then it would be cool to fix the link as soon as it breaks.

I have no clue about the internals but it seems to parse the HTML generated by Jekyll and then it performs lots of checks (we can select the checks that we want).

I am not aware of something similar in jekyll.

@MirkoBonadei
Copy link
Member Author

Ok, cool. We posted at the same moment.

Thanks, let me know if you need something else.

@x1ddos
Copy link
Contributor

x1ddos commented Dec 28, 2016

Right. The thing with cron job is, who do you notify in case of build failures and how often. Or will there be someone checking the build status now and then, from time to time? (note that this site is developed completely in the open)

@x1ddos
Copy link
Contributor

x1ddos commented Dec 28, 2016

We could a new github issue created automatically for a newly broken link but I don't believe anything suitable exists. It would have to be implemented.

@MirkoBonadei
Copy link
Member Author

For others webrtc projects (samples, AppRTC, ecc...) we are setting up something similar and we send notifications to forward-webrtc-github@webrtc.org which forwards travis-ci e-mails (or cloudware in this case, please tell me the e-mail address used by the CI to send notifications so I can add it to the filter) to a mailing list[1] (I am part of that mailing list so I would be able to fix them asap).

[1] - https://groups.google.com/forum/#!forum/webrtc-github

@x1ddos
Copy link
Contributor

x1ddos commented Dec 28, 2016

Ah, that's good to know! Thanks.
Maybe to unify, I could move this project to Travis CI as well, to simplify configuration management.

@MirkoBonadei
Copy link
Member Author

Yes, it would be great so we can help with the maintenance of the build.
Please let me know if you need help in the migration.

@kthelgason kthelgason deleted the checking-broken-links-with-travis branch March 27, 2017 12:46
@x1ddos x1ddos mentioned this pull request May 2, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants