From b4ec3d0ebd62eb1341690df0cb4956c35f6e1ad5 Mon Sep 17 00:00:00 2001 From: Boden R Date: Thu, 21 Sep 2017 13:45:59 -0600 Subject: [PATCH] add api ref and doc link validation to release This patch adds a linkcheck target to our tox.ini that validates URLs in both our doc and api-ref html. In addition the release checklist is updated to suggest this should be done prior to releasing. Partial-Bug: #1716005 Change-Id: I48b4dde3ffd1902a31bf6f352b7143d4c15f3443 --- api-ref/source/conf.py | 7 +++++++ doc/source/conf.py | 7 +++++++ doc/source/contributor/releasing.rst | 4 ++++ tox.ini | 8 ++++++++ 4 files changed, 26 insertions(+) diff --git a/api-ref/source/conf.py b/api-ref/source/conf.py index 163eec44a..536cafdf4 100644 --- a/api-ref/source/conf.py +++ b/api-ref/source/conf.py @@ -228,3 +228,10 @@ latex_documents = [ # If false, no module index is generated. # latex_use_modindex = True + +linkcheck_anchors_ignore = [ + # skip gerrit anchors + '\/q\/.*', + 'q\,.*', + '\/c\/.*' +] diff --git a/doc/source/conf.py b/doc/source/conf.py index da812c871..dc4ea76d0 100755 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -233,3 +233,10 @@ html_last_updated_fmt = '%Y-%m-%d %H:%M' repository_name = 'openstack/neutron-lib' bug_project = 'neutron' bug_tag = 'doc' + +linkcheck_anchors_ignore = [ + # skip gerrit anchors + '\/q\/.*', + 'q\,.*', + '\/c\/.*' +] diff --git a/doc/source/contributor/releasing.rst b/doc/source/contributor/releasing.rst index 3e2ae00ea..0815ec6a8 100644 --- a/doc/source/contributor/releasing.rst +++ b/doc/source/contributor/releasing.rst @@ -29,3 +29,7 @@ dashboard can give you a glimpse into the sanity of the integration between neutron-lib and the Stadium projects, and can be considered the quick check before going ahead with a full blown sentinel patch. Periodic failures can be debugged by viewing the `periodic logs `_ + +In addition, both the API reference as well as the project docs should be +validated to ensure there are no dead links. To do so run +``tox -e linkcheck`` and address the errors. diff --git a/tox.ini b/tox.ini index b68c06e76..370cb7e56 100644 --- a/tox.ini +++ b/tox.ini @@ -41,6 +41,14 @@ commands = rm -rf api-ref/build sphinx-build -W -b html -d api-ref/build/doctrees api-ref/source api-ref/build/html +[testenv:linkcheck] +whitelist_externals = rm +commands = + rm -rf api-ref/build + sphinx-build -W -b linkcheck api-ref/source api-ref/build/linkcheck + rm -rf doc/build + sphinx-build -W -b linkcheck doc/source doc/build/linkcheck + [testenv:debug] commands = oslo_debug_helper -t neutron_lib/tests/unit {posargs}