Commit Graph

60 Commits

Author SHA1 Message Date
Sylvestre Ledru
199a0f463c Bug 1601578 - mach - doc environment with python 3 r=ahal,firefox-build-system-reviewers,chmanchester
Differential Revision: https://phabricator.services.mozilla.com/D55937
2019-12-17 19:17:43 +00:00
Razvan Maries
8b627b4c78 Backed out 5 changesets (bug 1601612, bug 1601578) for Lint failure. CLOSED TREE
Backed out changeset c5b62adb19f1 (bug 1601612)
Backed out changeset 67431d96c78f (bug 1601612)
Backed out changeset 22099810071a (bug 1601612)
Backed out changeset 457049dcb9b4 (bug 1601612)
Backed out changeset 45277ab0d639 (bug 1601578)
2019-12-17 09:49:51 +02:00
Sylvestre Ledru
18cd269259 Bug 1601612 - Ride along: When a sphinx error is found, dump it r=ahal
Depends on D55960

Differential Revision: https://phabricator.services.mozilla.com/D56168
2019-12-15 16:26:43 +00:00
Sylvestre Ledru
969074c88c Bug 1601578 - mach - doc environment with python 3 r=ahal,firefox-build-system-reviewers,chmanchester
Differential Revision: https://phabricator.services.mozilla.com/D55937
2019-12-17 01:30:41 +00:00
Molly Howell
4347e75b48 Bug 1599142 - Fix several Windows compatibility issues in documentation generation. r=ahal,froydnj
This patch addresses the following issues which prevent building the
documentation on a Windows system:

1. check_jsdoc attempts to launch a file by the name of jsdoc using
   subprocess.check_output(). But, the file jsdoc is a Bash script,
   so it can't be launched this way on Windows. We should find the
   correct file name to use instead (likely jsdoc.cmd).
2. The Windows CopyFile API will fail if the destination directory does
   not exist. The procedure that creates the staging directory for Sphinx
   attempts to use this API before any directories are created, so most calls
   to it fail and most files don't get staged. These errors are ignored, so
   the result is that Sphinx succeeds in generating a set of documentation
   that is mostly empty.
3. Several instances where manually constructed paths that contain both back
   and forward slashes are compared to or otherwise used with normalized paths,
   resulting in incorrect behaviors.

Differential Revision: https://phabricator.services.mozilla.com/D54549
2019-12-05 17:04:17 +00:00
Sylvestre Ledru
49760af62c Bug 1594866 - doc: rename redirects.yml to config.yml r=ahal
Differential Revision: https://phabricator.services.mozilla.com/D52243
2019-11-07 21:33:24 +00:00
Andrew Halberstadt
3d7ab97714 Bug 1592964 = [docs] Error out if we detect anything but jsdoc==3.5, r=sylvestre
More modern versions of jsdoc fail due to bug 1556460.

Differential Revision: https://phabricator.services.mozilla.com/D52014
2019-11-06 19:55:50 +00:00
Sylvestre Ledru
bd90df2bea Bug 1593420 - Fix a sphinx warning: sphinx.build_main has moved r=ahal
Differential Revision: https://phabricator.services.mozilla.com/D51495
2019-11-05 07:31:08 +00:00
Sylvestre Ledru
6139eb813b Bug 1592964 - Detail the minimal version of jsdoc expected r=ahal
Differential Revision: https://phabricator.services.mozilla.com/D51265
2019-11-02 08:19:46 +00:00
Jonathan Watt
9419f67be3 Bug 1591118. Make 'mach doc' provide a clearer error message when jsdoc is missing. r=ahal
Differential Revision: https://phabricator.services.mozilla.com/D50485
2019-10-24 21:38:28 +00:00
Andrew Halberstadt
b4c0278ea9 Bug 1569472 - Fix flake8 error in tools/docs/mach_commands.py r=championshuttler
Differential Revision: https://phabricator.services.mozilla.com/D42371
2019-08-16 20:33:04 +00:00
championshuttler
b1ea7e4a96 Bug 1527363 - Add ability to specify redirects. r=ahal
Differential Revision: https://phabricator.services.mozilla.com/D41548
2019-08-16 19:58:44 +00:00
championshuttler
5f31a2b422 Bug 1460678 - Improve mach doc performance, use sphinx's -J argument. r=ahal
Differential Revision: https://phabricator.services.mozilla.com/D41058
2019-08-13 13:18: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
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
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
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
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
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
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
Maja Frydrychowicz
23c57c6ad2 Bug 1411430 - Support markdown in Sphinx docs; r=gps
MozReview-Commit-ID: IdRuC4AFarq
2017-10-23 09:59:31 -04:00
Gregory Szorc
42620b1f15 Bug 1390693 - Upload docs to project and version specific locations; r=dustin
Previously, we uploaded the main Firefox tree docs to /.

In reality, there are multiple Sphinx projects in the repo. In
addition, it is sometimes desirable to access docs for an older
version of Firefox.

In this commit, we add support for specifying the S3 key prefix
for uploads. Then we change the upload code to upload to multiple
locations:

* <project>/latest (always)
* <project>/<version> (if a version is defined in the Sphinx config)
* / (for the main Sphinx docs project)

For the Firefox docs, ``version`` corresponds to a sanitized value from
``milestone.txt``. Currently, it resolves to ``57.0``.

While we're here, we add support for declaring an alternate project
name in the Sphinx conf.py file. If ``moz_project_name`` is defined,
we use that as the project name. For Firefox, we set it to ``main``.
This means our paths (local and uploaded) are now ``main`` instead of
``Mozilla_Source_Tree_Docs``. That's much more pleasant.

MozReview-Commit-ID: 8Gl6l2m6uU4
2017-08-24 11:12:21 -07:00
Gregory Szorc
5d9da31a1f Bug 1390693 - Fold mach doc-upload into mach doc; r=dustin
We now have an --upload flag to control whether upload is performed.

We don't inline it because we want to maintain a "firewall" between
regular docs and all the extra packages and imports needed for S3.

MozReview-Commit-ID: DVKhsS545gp
2017-08-24 11:31:54 -07:00
Gregory Szorc
9441405713 Bug 1390693 - Use distribution_files() for finding files to upload; r=dustin
Instead of doing the file finding inside s3_upload(), the function now
takes the output of distribution_files().

The new code is much simpler.

MozReview-Commit-ID: 43i2Alvyu5i
2017-08-24 11:07:10 -07:00
Gregory Szorc
aa4cabec87 Bug 1390693 - Move S3 upload logic to standalone module; r=dustin
We try to keep mach_commands.py files as minimal as possible.

MozReview-Commit-ID: I4kvZtDjqGd
2017-08-24 10:49:28 -07:00
Gregory Szorc
f0bff41c54 Bug 1390693 - Generate docs archive within mach command; r=dustin
By using mozpack, we get deterministic archives. This also makes the
task command simpler.

MozReview-Commit-ID: EPI7tuGQuso
2017-08-24 10:37:53 -07:00
Gregory Szorc
473e00f97d Bug 1390693 - Use separate variable for the base output directory; r=dustin
An upcoming commit will want to put something outside the
format-specific output directory.

MozReview-Commit-ID: 2kYDREddpN
2017-08-24 10:31:41 -07:00
Gregory Szorc
9ce5d46cfd Bug 1390693 - Indent code to make linter happy; r=dustin
I didn't fix all violations in this file. Something is better than
nothing.

MozReview-Commit-ID: BDdWhJfkPVk
2017-08-24 10:11:55 -07:00
Dustin J. Mitchell
34258f751c Bug 1382729: allow uploading docs at all levels; r=gps
The upload now uses MOZ_SCM_LEVEL to determine which secret and bucket to
upload to, so it can potentially run at any level.

This also modifies task descriptions to allow {level} in scopes, and updates
try syntax to allow `-j doc-upload` even though run-on-tasks says it doesn't
run on try by default.

MozReview-Commit-ID: Dm27TGPa7IM
2017-08-08 19:13:05 +00:00
Dustin J. Mitchell
228f6911be Bug 1382729: Upload documentation to S3 automatically; r=gps
This uses credentials stored in the Taskcluster secret service. The task should
only run on mozilla-central to avoid confusion between branches.

MozReview-Commit-ID: 31XfTg0sCht
2017-07-28 18:32:04 +00:00
Dustin J. Mitchell
5e51991c2c Backed out changeset 19f92c04608c for breaking try pushes a=bustage
MozReview-Commit-ID: FowbO5T9aUl
2017-07-31 16:04:01 +00:00
Dustin J. Mitchell
69cd6fca06 Bug 1382729: Upload documentation to S3 automatically; r=gps
This uses credentials stored in the Taskcluster secret service. The task should
only run on mozilla-central to avoid confusion between branches.

MozReview-Commit-ID: 31XfTg0sCht
2017-07-28 18:32:04 +00:00
Carsten "Tomcat" Book
5ba717bd52 Backed out changeset 200da85932e9 (bug 1230862) for valgrind perma failures 2016-02-10 11:04:50 +01:00
Julien Pagès
8c54a35567 Bug 1230862 - Remove mozhttpd. r=wlach 2016-02-09 03:26:43 +01:00
Andreas Tolfsen
ecf92f380d Bug 1223459: Serve documentation over HTTP in mach doc
Introduces new flag --http [ADDRESS] that spins up an HTTPD serving
`outdir'.  By default it will spin up a server on 0.0.0.0:6666.

r=ahal
2015-11-10 20:37:38 +00:00
Andrew Halberstadt
3db94658ce Bug 1220789 - Generalize |mach build-doc| for any arbitrary sphinx projects; rename to |mach doc|, r=gps
Now, running |mach doc <path/to/project>| will generate the sphinx based docs of the project and open them
in the default browser. Mulitple doc paths can be supplied at a time. E.g:
./mach doc testing/mozbase
2015-11-03 15:39:50 -05:00