Skip to content

Allows build to fail if JSON docs fail to generate. - #2122

Merged
daspecster merged 1 commit into
googleapis:masterfrom
daspecster:fix-rtd-builds
Aug 18, 2016
Merged

Allows build to fail if JSON docs fail to generate.#2122
daspecster merged 1 commit into
googleapis:masterfrom
daspecster:fix-rtd-builds

Conversation

@daspecster

Copy link
Copy Markdown
Contributor

@dhermes what do you think of moving the documentation generation to after_success?

Fixes#2121

@daspecsterdaspecster added type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. docs labels Aug 18, 2016
@googlebotgooglebot added the cla: yes This human has signed the Contributor License Agreement. label Aug 18, 2016
@dhermes

Copy link
Copy Markdown
Contributor

If you put it in after_success it won't fail the build if there's a problem

@daspecster

Copy link
Copy Markdown
ContributorAuthor

@dhermes switched them back around. If I understand correctly though, even if the unittests fail, the docs will still get deployed. I don't know if that's the best case.

@dhermes

Copy link
Copy Markdown
Contributor

I don't know if that's the best case.

It's not. Are you deploying on PRs or just merges?

@dhermes

Copy link
Copy Markdown
Contributor

You'll have to apply the **kwargs fix from #2071

@daspecster

Copy link
Copy Markdown
ContributorAuthor

Yup, thanks!

@dhermes

Copy link
Copy Markdown
Contributor

I assume / hope the Yup wasn't for "Are you deploying on PRs or just merges?"

@daspecster

Copy link
Copy Markdown
ContributorAuthor

Apparently it is! I'm fixing that right now.

@dhermes

Copy link
Copy Markdown
Contributor

Oy

@daspecster

daspecster commented Aug 18, 2016

Copy link
Copy Markdown
ContributorAuthor

How does tox -e docs deploy to RTD? Is that just from the READTHEDOCS envar?

Update: nm I see the docs-rtd now.

@dhermes

Copy link
Copy Markdown
Contributor

It doesn't, https://readthedocs.org/projects/gcloud-python/ looks for commits to master and triggers a build.

The relevant file was scripts/update_docs.sh before you implemented the new docs env

@daspecster

Copy link
Copy Markdown
ContributorAuthor

A while ago, I made a separate script for the JSON docs, update_json_docs.sh. Travis is calling that now instead of tox -e json-docs directly.

@dhermes

Copy link
Copy Markdown
Contributor

Looking at https://github.com/GoogleCloudPlatform/gcloud-python/commits/master/.travis.yml it looks like tox already does this (#2016)

@daspecster

Copy link
Copy Markdown
ContributorAuthor

I guess I had more coffee in me back then.

@dhermes

Copy link
Copy Markdown
Contributor

It doesn't look like update_json_docs.sh checks if the docs build during a PR

@daspecster

daspecster commented Aug 18, 2016

Copy link
Copy Markdown
ContributorAuthor

That should run it every time, or were there some cases that you didn't want the docs to build? Also, should I have it build the RTD docs with tox -e docs?

I added that line as well.

Comment threadscripts/update_json_docs.sh Outdated
}

# Run this to verifiy that the docs build successfully.
tox -e docs

This comment was marked as spam.

This comment was marked as spam.

@dhermes

Copy link
Copy Markdown
Contributor

tox -e docs has been changed by you (previously) to update_json_docs.sh, which now calls tox -e docs, thus creating an infinite recursion.

tox -e docs-rtd makes sure the docs actually build with Sphinx (which is the concern)

@daspecster

daspecster commented Aug 18, 2016

Copy link
Copy Markdown
ContributorAuthor

I didn't change tox -e docs, I added tox -e json-docs.

[testenv:docs]
https://github.com/GoogleCloudPlatform/gcloud-python/blob/master/tox.ini#L67

[testenv:json-docs]
https://github.com/GoogleCloudPlatform/gcloud-python/blob/master/tox.ini#L79

So I think it should be ok?

Except for my refactor now failing.

generate_json_docs.py: error: argument --tag: expected one argument

@daspecster

Copy link
Copy Markdown
ContributorAuthor

Comment threadscripts/update_json_docs.sh Outdated
buildDocs $TRAVIS_BRANCH

if [ "${TRAVIS_BRANCH}" == "master" ] && [ "${TRAVIS_PULL_REQUEST}" == "false" ]; then
buildDocs $TRAVIS_BRANCH

This comment was marked as spam.

This comment was marked as spam.

Comment threadscripts/update_json_docs.sh Outdated
}

# Run this to verifiy that the docs build successfully.
buildDocs $TRAVIS_BRANCH

This comment was marked as spam.

Comment threadscripts/update_json_docs.sh Outdated
if [[ ! -z ${TRAVIS_TAG} ]]; then
DOC_VERSION = $TRAVIS_TAG
else
DOC_VERSION = $TRAVIS_BRANCH

This comment was marked as spam.

@dhermes

Copy link
Copy Markdown
Contributor

@daspecster This LGTM except for the tiny nit about using ${...}. Please squash and rename the PR to actually state what is happening

@dhermes

Copy link
Copy Markdown
Contributor

You can merge once you've fixed the nit and Travis goes green, no need to check with me

@daspecsterdaspecster changed the title Add RTD doc build, and move to after_success.Allows build to fail if JSON docs fail to generate.Aug 18, 2016
@daspecster
daspecster merged commit 78ba81e into googleapis:masterAug 18, 2016
@dhermesdhermes mentioned this pull request Sep 19, 2016
@daspecster
daspecster deleted the fix-rtd-builds branch January 24, 2017 15:18
parthea pushed a commit that referenced this pull request Apr 1, 2026
Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla: yesThis human has signed the Contributor License Agreement.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@daspecster@dhermes@googlebot