-
- Notifications
You must be signed in to change notification settings - Fork 7k
Add docs validation to release process #6967
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
Conversation
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.
Hi @nezhar. This is interesting. I'd recommend adding it to the tox.ini as a new test env. As an example, take a look at:
Lines 53 to 59 in 0fd72f1
[testenv:docs] | |
basepython = python3.7 | |
skip_install = true | |
commands = mkdocs build | |
deps = | |
-rrequirements/requirements-testing.txt | |
-rrequirements/requirements-documentation.txt |
And then the travis job can be simplified to { python: "3.7", env: TOXENV=docs-links }
e31eb7c
to 8a38709
Compare I think it's probably not a good idea for our test cases to rely on making external requests. |
@tomchristie I think this is okay:
|
@tomchristie per my above comment, is it worth reconsidering this? It would have caught #7226. Well, it would require someone looking at the Travis build and noticing the failure, but it definitely improves visibility. |
My feeling is probably that it'd likely suck up more time from introducing flakiness into the build process than the value it'd add. |
That's fair, maybe we could add it as a step in the release process? Currently, the docs have 20 broken links. Should be as simple as $ mkdocs serve & $ pylinkvalidate.py -P http://localhost:8000/ |
Ah, now something like that might be a good idea yup. |
8a38709
to 32636b5
Compare Okay, I've updated the PR and fixed most of the broken links. There are a few outstanding issues though:
|
IIRC, the thought was we'd just link to the source for the old CoreAPI pages on GitHub, because at the time I couldn't find a way to put them in the docs without them appearing in the Nav bar. (We upgraded mkdocs since then, is that possible now?) I'll review when I go over the schema docs. |
Yeah - it's possible to link to the core api docs without having them in the nav. I've corrected other references to the coreapi docs where appropriate (e.g., older release notes). I guess the question for this specific case is whether whether the referenced examples are still relevant/correct and if they should be moved into the main docs or if they should remain in the outdated coreapi docs. Specifically, these examples demonstrate how to document the various handlers. e.g., class ListUsernames(APIView): def get(self, request): """ Return a list of all user names in the system. """ vs class UserList(generics.ListCreateAPIView): """ get: List all the users. post: Create a new user. """ They're linked to at the end of this section. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
d288577
to ae34ad6
Compare 9e33d43
to 8cd6df8
Compare 8cd6df8
to d666fc3
Compare d666fc3
to e45abe9
Compare I updated the PR so it can now work with GitHub Actions. The job is allowed to fail, but it will add an annotation (not sure if there is a way to signal a warning on the job as in GitLab CI): Here is an output for the broken links: https://github.com/encode/django-rest-framework/actions/runs/5848946265/job/15856739665#step:8:151
|
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.
I think we can safely merge this now
This is a way to automatically check if the documentation contains any broken links in order to avoid issues like #6928
The task is currently on
allow_failures
, but it could be added to the regular tasks in order to avoid linking to non existent pages in future.The current documentation contains 17 broken links: