Commit Graph
93 Commits
Author SHA1 Message Date
Edwin Gao 125e118583 Bug 1559975 - fix python2 linter error for tools/docs r=ahal
Differential Revision: https://phabricator.services.mozilla.com/D37777
2019-07-19 14:45:24 +00:00
Andrew Halberstadt e16895aeb7 Bug 1563797 - Use 'backports.shutil_which' instead of 'which' across the tree r=Callek
Differential Revision: https://phabricator.services.mozilla.com/D37097
2019-07-11 14:03:39 +00:00
championshuttler d816b99b9a Bug 1564799 - Use sphinx.util.logging instead of app.info(). r=ahal
Differential Revision: https://phabricator.services.mozilla.com/D37539
2019-07-11 08:41:25 +00:00
Andrew Halberstadt 1fc0238c36 Bug 1556460 - [docs] Use compatible-release operator instead of * in tools/docs/Pipenv, r=davehunt
Using compatible release means that we will pick up minor updates to these
packages. Dependencies (i.e things not explicitly listed in the Pipfile), may
have their major versions updated as long as the package that uses them lists
it as compatible.

This will also allow us to update our dependencies' major/minor versions one at
a time. Using '*', Pipenv does not have any way of updating only a single
package at a time (that I could find).

Differential Revision: https://phabricator.services.mozilla.com/D33555
2019-06-06 08:13:47 +00:00
Andrew Halberstadt bb2dd75c84 Bug 1484691 - [doc] Don't add doctrees nested under other doctrees to the root index r=nalexander
Currently, it's possible to nest doctrees underneath one another by doing this:

    SPHINX_TREES['foo'] = 'docs'
    SPHINX_TREES['foo/bar'] = 'bar/docs'

(note: the 'bar' doctree doesn't need to be a subdir of foo and can be defined
in a completely separate moz.build)

Doing this means that the docs in 'bar' will be nested underneath the docs in
'foo' when sphinx-build ultimately runs.

This allows us to add 'bar' to foo's index, essentially making bar a subdoc of
foo.  The problem is that we also add bar's docs to the root index here:
https://searchfox.org/mozilla-central/rev/dac799c9f4e9f5f05c1071cba94f2522aa31f7eb/tools/docs/moztreedocs/__init__.py#133

The result is that the main landing page for firefox-source-docs is a big long
list of random unrelated topics. There is no organization or cohesion. By
excluding subdocs from the main index, we can start to move pages around into
some kind of organization that makes sense.

Actually moving those docs will be a lot of work, but at least this will give
us the ability.

Differential Revision: https://phabricator.services.mozilla.com/D16869
2019-01-18 20:10:18 +00:00
Mike Cooper f96583c1e8 Bug 1479127 - Add featuregate library r=mossop,firefox-build-system-reviewers,mshal
Differential Revision: https://phabricator.services.mozilla.com/D5175
2019-01-09 20:01:52 +00:00
Brindusan Cristian ac6c9bdcd0 Backed out changeset 7e107869b00d (bug 1479127) for bc failures on browser_all_files_referenced.js. 2019-01-09 21:20:01 +02:00
Mike Cooper 48a0ce2c0d Bug 1479127 - Add featuregate library r=mossop,firefox-build-system-reviewers,mshal
Differential Revision: https://phabricator.services.mozilla.com/D5175
2019-01-09 16:15:59 +00:00
Andrew Halberstadt 756cea9dde Bug 1517238 - [docs] Fix AttributeError: 'module' object has no attribute 'DirEntry' when running |mach doc|, r=davehunt
This was happening because one of the modules sphinx generates apidocs for
started depending on scandir and our in-tree vendored copy of scandir doesn't
have the C module built. I'm still not sure why this is failing though (scandir
is supposed to fall-back to ctypes if the C module doesn't exist).

Either way, adding scandir to tools/docs/Pipfile works around the problem.

Differential Revision: https://phabricator.services.mozilla.com/D15571
2019-01-02 15:31:26 +00:00
Andrew Halberstadt 256198898d Bug 1474746 - [docs] Normalize keys from MOZ_SPHINX_TREES; r=gps
This will allow developers to use '.' as the key, e.g:
MOZ_SPHINX_TREES['.'] = 'docs'

This will give consumers the ability to remove redundancies from
their urls. For example, the telemetry docs currently have:
MOZ_SPHINX_TREES['telemetry'] = 'docs'

This results in a url like:
https://firefox-source-docs.mozilla.org/main/latest/toolkit/components/telemetry/telemetry/index.html

If they changed their key to '.' instead, the new url would become:
https://firefox-source-docs.mozilla.org/main/latest/toolkit/components/telemetry/index.html

Depends on D2079.

Differential Revision: https://phabricator.services.mozilla.com/D2080
2018-07-11 16:01:21 +00:00
Andrew Halberstadt 418b1df853 Bug 1474746 - [docs] Fix firefox-source-docs url regression by removing redundant "docs" directory; r=gps
This fixes a regression from bug 1454640 where urls had an extra 'docs' path inserted into them, e.g:
toolkit/components/telemetry/telemetry/index.html

became:
toolkit/components/telemetry/docs/telemetry/index.html

Differential Revision: https://phabricator.services.mozilla.com/D2079
2018-07-11 14:52:33 +00:00
Andrew Halberstadt 4a20366fb3 Bug 1437526 - [docs] Upgrade doc dependencies to their latest versions, r=davehunt
This upgrades sphinx to version 1.7.5, which contained a couple backwards
incompatible changes that needed fixing.

This also leaves sphinx-js at version 2.1 as upgrading that to 2.5 seems to
introduce an intermittent in the Doc task.

MozReview-Commit-ID: FRUTcXs5yzb
2018-06-01 10:19:01 -04:00
Tom Prince b7deed877d No bug: [source-docs] Log the file being uploaded; r=gps
Differential Revision: https://phabricator.services.mozilla.com/D1479
2018-06-01 18:13:08 +00:00
Andrew Halberstadt 77005be55b Bug 1458461 - [docs] Use pipenv to manage |mach doc| python environment, r=davehunt
MozReview-Commit-ID: HOEnaoIy9dD
2018-05-30 14:57:58 -04:00
Andrew Halberstadt f6d872bb6b Bug 1464327 - [docs] Fix doc uploading by removing trailing comma, r=gps
This was changing the project from "main" -> ("main",) which was causing the DocUp
task to upload to urls like:
"('main',)/62.0/_sources/..."

MozReview-Commit-ID: 1bL9nqiAEFE
2018-05-28 08:44:08 -04:00
Andrew Halberstadt 8f4c0091b1 Bug 1454640 - [docs] Lazy load the package and version properties r=mshal on a CLOSED TREE
We no longer store the docs under a project name (since all the docs are now
built using the root conf.py). This mean the name and version are only used for
packaging and uploading, which typically is only used in CI.

This allows us to lazy load the package name and version, so we only read the
conf.py when we need to.

MozReview-Commit-ID: DV5Jxrbskoh
2018-04-18 17:31:10 -04:00
Andrew Halberstadt b805ca9fd6 Bug 1454640 - [docs] Always build docs with the tools/docs/conf.py r=mshal
Previously, running |mach doc <subtree>| would use whatever conf.py file
happened to live in the subtree. For example, running:

./mach doc tools/lint

Would build with tools/lint/docs/conf.py. This is bad because it means the
generated docs will look different from the docs that eventually will be
published to firefox-source-docs.mozilla.com.

This patch makes sure we always use tools/docs/conf.py for building, even when
only generating a subtree.

Furthermore, this sets things up such that when you modify a file, only the
subtree containing the modified file will be re-generated.  This cuts down
rebuild times from ~2 minutes to ~20 seconds.

There is one caveat. When rebuilding a subtree, the index of other trees will
be overwritten in that particular subtree. I couldn't figure out anyway around
this. This tradeoff for *much* faster rebuild times seems worth it.

MozReview-Commit-ID: Ly88mvHKpo7
2018-04-18 17:18:11 -04:00
Andrew Halberstadt d223115e80 Bug 1454640 - [mozbuild] Ability to find sphinx variables relevant to a given path r=mshal
The current mechanism for reading SPHINX variables assumes we always want to
read metadata for the entire tree. Now that we have the ability to rebuild
specific subtrees, this assumption is false.

This patch allows us to specify a path that find_sphinx_variables can use to
filter down the set of moz.build variables it will traverse, yielding only
moz.builds that could potentially impact the specified path.

MozReview-Commit-ID: ALrCFLFgMLH
2018-04-17 11:51:37 -04:00
Andrew Halberstadt 40002bff85 Bug 1454640 - [docs] Memoize the result of processing sphinx moz.build variables r=mshal
Now that we can rebuild docs with the liveserver, there are some optimizations
we should make. One of those is processing the sphinx moz.build variables. This
patch makes sure we don't re-process moz.build if we've already done so in a
previous rebuild.

MozReview-Commit-ID: 2AIr1KeAPQV
2018-04-18 15:01:10 -04:00
Andrew Halberstadt d05ffbeb74 Bug 1454640 - [docs] Use a single SphinxManager instance across all rebuilds r=mshal
In the mozbuild.sphinx extension, we create a new SphinxManager instance each
time. However this isn't ideal now that we can rebuild the docs within the same
interpreter using the livereload server.

This makes use of a singleton so that we can share state not only between
multiple invocations of sphinx-build, but also with the mach command. This will
be taken advantage of more heavily in future commits in this series.

MozReview-Commit-ID: 7ERYeN5BPeI
2018-04-18 12:56:55 -04:00
Andrew Halberstadt 979610c8eb Bug 1454640 - [moztreedocs] Move 'create_tarball' into a package submodule r=mshal
These two functions are typically only used by CI for packaging/uploading the
documentation. This is a minor re-organiztion for clarity.

MozReview-Commit-ID: 62UhQhSSkOs
2018-04-18 12:17:44 -04:00
Coroiu Cristina 65f7d51f42 Backed out 6 changesets (bug 1454640) for bustage at build/src/security/manager/ssl/nsNSSComponent.cpp on a CLOSED TREE
Backed out changeset d03f75986f62 (bug 1454640)
Backed out changeset 47fc3e223867 (bug 1454640)
Backed out changeset 22f2dc60e6d8 (bug 1454640)
Backed out changeset 30b4083534b5 (bug 1454640)
Backed out changeset 8309212d820b (bug 1454640)
Backed out changeset 9942d2df3719 (bug 1454640)
2018-05-10 23:12:38 +03:00
Andrew Halberstadt 3e857c7aa4 Bug 1454640 - [docs] Lazy load the package and version properties r=mshal
We no longer store the docs under a project name (since all the docs are now
built using the root conf.py). This mean the name and version are only used for
packaging and uploading, which typically is only used in CI.

This allows us to lazy load the package name and version, so we only read the
conf.py when we need to.

MozReview-Commit-ID: DV5Jxrbskoh
2018-04-18 17:31:10 -04:00
Andrew Halberstadt 910974fbcf Bug 1454640 - [docs] Always build docs with the tools/docs/conf.py r=mshal
Previously, running |mach doc <subtree>| would use whatever conf.py file
happened to live in the subtree. For example, running:

./mach doc tools/lint

Would build with tools/lint/docs/conf.py. This is bad because it means the
generated docs will look different from the docs that eventually will be
published to firefox-source-docs.mozilla.com.

This patch makes sure we always use tools/docs/conf.py for building, even when
only generating a subtree.

Furthermore, this sets things up such that when you modify a file, only the
subtree containing the modified file will be re-generated.  This cuts down
rebuild times from ~2 minutes to ~20 seconds.

There is one caveat. When rebuilding a subtree, the index of other trees will
be overwritten in that particular subtree. I couldn't figure out anyway around
this. This tradeoff for *much* faster rebuild times seems worth it.

MozReview-Commit-ID: Ly88mvHKpo7
2018-04-18 17:18:11 -04:00
Andrew Halberstadt 5e61d06dc8 Bug 1454640 - [mozbuild] Ability to find sphinx variables relevant to a given path r=mshal
The current mechanism for reading SPHINX variables assumes we always want to
read metadata for the entire tree. Now that we have the ability to rebuild
specific subtrees, this assumption is false.

This patch allows us to specify a path that find_sphinx_variables can use to
filter down the set of moz.build variables it will traverse, yielding only
moz.builds that could potentially impact the specified path.

MozReview-Commit-ID: ALrCFLFgMLH
2018-04-17 11:51:37 -04:00
Andrew Halberstadt 691aaa5b96 Bug 1454640 - [docs] Memoize the result of processing sphinx moz.build variables r=mshal
Now that we can rebuild docs with the liveserver, there are some optimizations
we should make. One of those is processing the sphinx moz.build variables. This
patch makes sure we don't re-process moz.build if we've already done so in a
previous rebuild.

MozReview-Commit-ID: 2AIr1KeAPQV
2018-04-18 15:01:10 -04:00
Andrew Halberstadt 1910ca2ae8 Bug 1454640 - [docs] Use a single SphinxManager instance across all rebuilds r=mshal
In the mozbuild.sphinx extension, we create a new SphinxManager instance each
time. However this isn't ideal now that we can rebuild the docs within the same
interpreter using the livereload server.

This makes use of a singleton so that we can share state not only between
multiple invocations of sphinx-build, but also with the mach command. This will
be taken advantage of more heavily in future commits in this series.

MozReview-Commit-ID: 7ERYeN5BPeI
2018-04-18 12:56:55 -04:00
Andrew Halberstadt fb75cbd056 Bug 1454640 - [moztreedocs] Move 'create_tarball' into a package submodule r=mshal
These two functions are typically only used by CI for packaging/uploading the
documentation. This is a minor re-organiztion for clarity.

MozReview-Commit-ID: 62UhQhSSkOs
2018-04-18 12:17:44 -04:00
Dorel Luca 8a98dcc45c Backed out 11 changesets (bug 1437593) for Doc linting failure. CLOSED TREE
Backed out changeset 0f3dbbd73ed4 (bug 1437593)
Backed out changeset 64c84cf90e8b (bug 1437593)
Backed out changeset 36c66615886f (bug 1437593)
Backed out changeset dfafbe7770ad (bug 1437593)
Backed out changeset 900f32450a74 (bug 1437593)
Backed out changeset d6fe456bb39c (bug 1437593)
Backed out changeset 4842e4b68d82 (bug 1437593)
Backed out changeset e024b3d775fd (bug 1437593)
Backed out changeset ce9e3951357a (bug 1437593)
Backed out changeset afaeac146ff8 (bug 1437593)
Backed out changeset 88954bcf6ca2 (bug 1437593)
2018-04-28 12:02:02 +03:00
Dave Hunt 36a83818d5 Bug 1437593 - Use pipenv for |mach doc| environment; r=ted
MozReview-Commit-ID: Ek2XnJRsDFI
2018-03-27 13:10:05 +01:00
Gurzau Raul 4eed939e67 Backed out 11 changesets (bug 1437593) for SpiderMonkey failures on a CLOSED TREE
Backed out changeset e4b2357330b4 (bug 1437593)
Backed out changeset 8cb34c11ad45 (bug 1437593)
Backed out changeset ab27411c53c2 (bug 1437593)
Backed out changeset c90a0961f52a (bug 1437593)
Backed out changeset 60114a93b6b1 (bug 1437593)
Backed out changeset d12eec17c51c (bug 1437593)
Backed out changeset 2f83246cb0b1 (bug 1437593)
Backed out changeset 19b7273e375c (bug 1437593)
Backed out changeset cf026c071b73 (bug 1437593)
Backed out changeset c7fa833eff1d (bug 1437593)
Backed out changeset 828caab5032d (bug 1437593)
2018-04-27 02:20:39 +03:00
Dave Hunt 109f99923a Bug 1437593 - Use pipenv for |mach doc| environment; r=ted
MozReview-Commit-ID: Ek2XnJRsDFI
2018-03-27 13:10:05 +01:00
Andrew Halberstadt 9cc9d19506 Bug 1410424 - [docs] Support live reloading with |mach doc| r=mshal
This changes the default to opening a livereload webserver after doc generation
(as opposed to opening the index file). Any changes to the specified path will
result in a rebuild and refresh of the browser.

For example, if you run:

    ./mach doc tools/lint

The linting docs will be built, served and opened in a browser. Modifying any
file under 'tools/lint/docs' will refresh the browser with your changes.

To disable this behaviour and simply open the index file, you can pass in
'--no-serve'. The '--no-open' flag will continue to work (both with http and
the file system).

One caveat to this patch is that when generating the root docs (by running
|mach doc|), we don't watch all possible doc paths (just the root one under
'tools/docs/'). This will probably be fixed in the follow-up bug 1454640.

MozReview-Commit-ID: FQecuePM0zZ
2018-04-06 10:52:56 -04:00
Andrew Halberstadt bb9120f412 Bug 1410424 - [docs] Remove ability to specify multiple doc paths at the same time r=mshal
This removes the ability to specify multiple doc paths at the same time with
|mach doc|. We will be changing the default from opening index files to serving
the documentation with a webserver. Supporting multiple doc roots would mean
spinning up multiple servers in different threads.

This would add a lot of complexity for a feature which I don't think is very
useful. It's very rare that one would need to edit more than one doc location
at the same time. And if this is ever needed, the developer can just build the
entire doctree (by running |mach doc|) or run |mach doc <path>| in multiple
different terminals.

MozReview-Commit-ID: GXEZJSgLpgF
2018-04-06 10:30:31 -04:00
Andrew Halberstadt a7822f165d Bug 1410424 - [mozbuild] Add a 'quiet' argument to VirtualenvManager.install_pip_requirements r=mshal
Some requirements.txt are very large and result in a lot of package already
installed messages. Would be nice to hide this.

MozReview-Commit-ID: FQecuePM0zZ
2018-04-06 10:23:49 -04:00
Kris Maglione 989e072b55 Bug 1372406: Follow-up: Add missing source directory to docs config. r=bustage
MozReview-Commit-ID: 5fb1OBnItRS
2018-03-28 12:23:15 -07:00
Sylvestre Ledru 9fb84f2db2 Bug 1438839 - Fix the remaining flake8 issues by hand r=ahal
MozReview-Commit-ID: Fv1MZIpCL8Z
2018-03-15 11:34:03 +01:00
Sylvestre Ledru 07a3b4e48c Bug 1438839 - autopep8 -i --max-line-length 99 on the tools/ r=ahal
MozReview-Commit-ID: KSKbctxjxl0
2018-03-15 11:32:42 +01:00
Andreas Tolfsen 410366e20c Bug 1441019 - Add testing/marionette to js_source_path. r=gps,nalexander
MozReview-Commit-ID: Lvj7zbnzpLR
2018-02-22 16:32:49 +00:00
Andrew Halberstadt ee53dc7ae0 Bug 1437484 - Pin and hash all requirements for |mach doc|, r=gps
Previously we weren't explicitly installing sphinx. Instead, the 'sphinx-js'
package had a dependency on 'sphinx<2.0'. This caused errors when sphinx
released their backwards incompatible version 1.7.

This patch pins sphinx==1.6.7 and adds all other dependencies to the same
requirements.txt (with hashes).

Upgrading to sphinx==1.7 will happen in a follow-up.

MozReview-Commit-ID: 28fKI7T4vfa
2018-02-12 09:36:12 -05:00
Nick Alexander f75fd4f784 Bug 1435424 - Remove doxygen support from the build system. r=gps
This is ancient and the team that used it (gfx) is no longer using it.

MozReview-Commit-ID: HrDgmAU9QeW
2018-02-02 14:24:18 -08:00
Andrew Swan 97a1f212b5 Bug 1423425 Initial draft of WebExtensions API documentation r=bsilverberg
MozReview-Commit-ID: EwcE881XGfp
2017-12-05 18:54:34 -08:00
Andrew Swan 0ecab931ea Bug 1423425 Let sphinx-js read .js files r=erik
MozReview-Commit-ID: LfL3CG6L4Ss
2017-12-05 18:53:59 -08:00
Cosmin Sabou e0a5c2495c Backed out 3 changesets (bug 1423425) for frequent browser chrome failures r=backout on a CLOSED TREE
Backed out changeset c3ac950b0b8a (bug 1423425)
Backed out changeset d64fd69a4b88 (bug 1423425)
Backed out changeset 04017639642a (bug 1423425)
2017-12-16 02:45:41 +02:00
Andrew Swan 6fe1eb5e6d Bug 1423425 Initial draft of WebExtensions API documentation r=bsilverberg
MozReview-Commit-ID: EwcE881XGfp
2017-12-05 18:54:34 -08:00
Andrew Swan 732740bce8 Bug 1423425 Let sphinx-js read .js files r=erik
MozReview-Commit-ID: LfL3CG6L4Ss
2017-12-05 18:53:59 -08:00
Andrew Halberstadt 27ef72e8eb Bug 1419772 - [docs] Enable the sphinx.ext.napoleon extension, r=gps
This enables sphinx to parse both the google and numpy style docstring
formats which tend to be more human readable than the default sphinx
format.

See:
http://www.sphinx-doc.org/en/stable/ext/napoleon.html

MozReview-Commit-ID: REmZ4IoUG8
2017-11-22 10:17:12 -05:00
Tom Prince e8581cc0af Bug 1402154: Allow specifying an absolute path to mount sphinx docs. r=gps
MozReview-Commit-ID: 8OLCtwg8zXc
2017-11-20 11:56:52 -07:00
Robert Helmer 84d15ac50d Bug 1389341 - start generating jsdoc for AddonManager API r=kmag
MozReview-Commit-ID: IpREaXBIMbq
2017-09-14 13:18:11 -07:00
Robert Helmer d289dba01d Bug 1389341 - add basic support for sphinx-js to mach doc r=gps
MozReview-Commit-ID: FIzWD8tnjYi
2017-09-14 13:17:09 -07:00