Bad rst now fails the MarkdownToHtml task.

Review Request #2394 — Created June 19, 2015 and submitted

jsirois
pants
jsirois/issues/1704
1704, 1711
d83aaa5...
pants-reviews
lahosken, zundel
There is an option to turn the task failure into a logged warning, but
the underlying failures encountered by docutils while rendering rst to
html are now detected.

Tests are moved to their proper home and new coverage added for the rst
rendering.

 3rdparty/python/requirements.txt                                                      |   1 +
 build-support/bin/publish_docs.sh                                                     |   9 ++-
 src/python/pants/backend/core/tasks/BUILD                                             |   5 +-
 src/python/pants/backend/core/tasks/markdown_to_html.py                               | 181 ++++++++++++++++++++++++++++----------------------
 tests/python/pants_test/backend/core/tasks/BUILD                                      |  30 +++++++++
 tests/python/pants_test/{ => backend/core}/tasks/test_markdown_to_html.py             |  95 ++++++++++++++++++++++++++
 tests/python/pants_test/{ => backend/core}/tasks/test_markdown_to_html_integration.py |   0
 tests/python/pants_test/tasks/BUILD                                                   |  25 -------
 8 files changed, 235 insertions(+), 111 deletions(-)

I reverted Eric's CHANGELOG.rst fix and doc site generation now fails:

$ git revert -n 1cf240b11551840cd84838288c155fd412301eb5 && PANTS_DEV=1 ./build-support/bin/publish_docs.sh 
...
17:56:39 00:00   [markdown]
17:56:39 00:00     [markdown]
                   Emitted /home/jsirois/dev/3rdparty/jsirois-pants3/dist/markdown/css/codehighlight.css
17:56:39 00:00       [render].
                     Processed export.md to /home/jsirois/dev/3rdparty/jsirois-pants3/dist/markdown/html/src/python/pants/docs/export.html.
                     Processed docs.md to /home/jsirois/dev/3rdparty/jsirois-pants3/dist/markdown/html/src/python/pants/docs/docs.html.
                     Processed credits.md to /home/jsirois/dev/3rdparty/jsirois-pants3/dist/markdown/html/src/python/pants/docs/credits.html.
                     Processed howto_ask.md to /home/jsirois/dev/3rdparty/jsirois-pants3/dist/markdown/html/src/python/pants/docs/howto_ask.html.
                     Processed publish.md to /home/jsirois/dev/3rdparty/jsirois-pants3/dist/markdown/html/src/docs/publish.html.
                     Processed howto_develop.md to /home/jsirois/dev/3rdparty/jsirois-pants3/dist/markdown/html/src/python/pants/docs/howto_develop.html.
                     Processed target_addresses.md to /home/jsirois/dev/3rdparty/jsirois-pants3/dist/markdown/html/src/docs/target_addresses.html.
                     Processed internals.md to /home/jsirois/dev/3rdparty/jsirois-pants3/dist/markdown/html/src/python/pants/docs/internals.html.
                     Processed with_emacs.md to /home/jsirois/dev/3rdparty/jsirois-pants3/dist/markdown/html/src/docs/with_emacs.html.
                     Processed README.md to /home/jsirois/dev/3rdparty/jsirois-pants3/dist/markdown/html/src/python/pants/backend/python/README.html.
                     Processed setup_repo.md to /home/jsirois/dev/3rdparty/jsirois-pants3/dist/markdown/html/src/docs/setup_repo.html.
                     Processed dev_tasks_publish_extras.md to /home/jsirois/dev/3rdparty/jsirois-pants3/dist/markdown/html/src/python/pants/docs/dev_tasks_publish_extras.html.
                     Processed release.md to /home/jsirois/dev/3rdparty/jsirois-pants3/dist/markdown/html/src/python/pants/docs/release.html.
                     Processed 3rdparty.md to /home/jsirois/dev/3rdparty/jsirois-pants3/dist/markdown/html/src/docs/3rdparty.html.
                       ==== stderr ====
                       <string>:30: (ERROR/3) Unknown target name: "rb #2363 https://rbcommons.com/s/twitter/r/2363/>".

FAILURE: /home/jsirois/dev/3rdparty/jsirois-pants3/src/python/pants/CHANGELOG.rst rendered with errors.


17:56:40 00:01   [complete]
               FAILURE

Failed to generate HTML from markdown'.

CI went green here:
https://travis-ci.org/pantsbuild/pants/builds/67462274

ZU
  1. Ship It!
  2. 
      
JS
JS
  1. Note that tests/python/pants_test/backend/core/tasks/test_markdown_to_html.py displays as full green in interdiff 1-2 because I used a special diff in the initial upload (-M45%) to ensure the move was tracked.  So there are actually 0 changes to that file in diff 2.
  2. 
      
JS
LA
  1. Ship It!
  2. 
      
JS
  1. Thanks gentlemen, submitted @ https://github.com/pantsbuild/pants/commit/b794632f60f88bb665ac5ef8cab2e2e1c5c39d56
  2. 
      
JS
Review request changed

Status: Closed (submitted)

Loading...