-
-
Notifications
You must be signed in to change notification settings - Fork 553
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 link_checker #1347
add link_checker #1347
Conversation
55d3c15
to
28c1de6
Compare
Codecov Report
@@ Coverage Diff @@
## develop #1347 +/- ##
========================================
Coverage 98.15% 98.15%
========================================
Files 272 272
Lines 15577 15577
========================================
Hits 15289 15289
Misses 288 288 Continue to review full report at Codecov.
|
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.
Thanks @priyanshuone6 ! Did you run this locally (adding a known broken link) to check whether it does pick up broken links? I am slightly surprised that there aren't any broken links, though of course it's possible that we got lucky
.github/workflows/link_checker.yml
Outdated
use-quiet-mode: 'yes' | ||
use-verbose-mode: 'yes' |
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.
these two options seem contradictory?
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.
Nevermind, I read the link you shared now. Can you leave quiet mode off so that we can check each file has been checked?
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.
You are right, they both are quite contradictory, I'll remove the quiet mode.
I tried to test this workflow locally by using nketos/act and found that when I try to pass more than one extension in |
I tried using https://github.com/urlstechie/urlchecker-action and found it to be better. It works with different file formats like |
Ok great. Would be good to also test the notebooks ( |
Thanks @priyanshuone6 , I tried that workflow on my fork and I noticed the output from url_checker doesn't display colors, see https://github.com/tlestang/PyBaMM/runs/1782502527?check_suite_focus=true Another thing is that urls embedded links in SVG inside notebooks are picked up, but with a trailing backslash.
Could you maybe specify the |
This seems to be working now with a manageable number of broken links reported. Weirdly, some of the broken links seem to work fine, so I don't know why URL-checker is reporting they are broken. Let me know if you need help finding working links to replace the broken ones with |
You can ignore the failing benchmarks test. @tlestang can we exclude that test when it comes from a fork? |
Some urls starting with https://github.com/pybamm-team/PyBaMM/pull/ in |
Yes, perhaps the way to go is to only run the url check on the cron job. The odds of someone adding a broken link are very low, what usually happens is a link changes and we don't update it because (until now) there was no automatic way of checking all the links. That way, you can also increase the timeout and it doesn't matter if the cron job takes a while. I wouldn't be totally against excluding However, there are some links here that are actually broken and need to be fixed before this branch can be merged. Most of them are from changes to pybamm branch names or file structure and it should be fairly easy to find where the file is now (e.g. control+p in VSCode) |
@tinosulzer Could you please help me with these broken links |
First one should point here: https://pybamm.readthedocs.io/en/latest/source/models/lead_acid/higher_order.html |
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.
Thanks! If all the broken links are fixed (can't see the test now) then I am happy to merge once the other tests pass
I have changed the |
@all-contributors add @priyanshuone6 for tests |
@tinosulzer I've put up a pull request to add @priyanshuone6! 🎉 |
Description
Added workflow to test urls in the docs
Referred this
Testing
Tested this workflow locally using nektos/act
Fixes #719
Type of change
Please add a line in the relevant section of CHANGELOG.md to document the change (include PR #) - note reverse order of PR #s. If necessary, also add to the list of breaking changes.
Key checklist:
$ flake8
$ python run-tests.py --unit
$ cd docs
and then$ make clean; make html
You can run all three at once, using
$ python run-tests.py --quick
.Further checks: