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
--HG--
extra : rebase_source : e56885092c12eb8cc76e5e7300f938be566e3e5a
extra : intermediate-source : 8509af1e135177a93460270b27f263c10a62d996
extra : source : 71b4f32caf209fe9dffc340c0b8ccb51ac79c7de
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
--HG--
extra : rebase_source : 7fee832145189be882db0f0ca057eda6158e0492
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
--HG--
extra : rebase_source : 29d840c65acec794749edfda0e47193806f387f4
extra : source : 5a758defcf2f1a17de851e703388469300789ac5
We try to keep mach_commands.py files as minimal as possible.
MozReview-Commit-ID: I4kvZtDjqGd
--HG--
extra : rebase_source : 7b0af45661fc2a8b0b906a569aa95df7d3e0513b
By using mozpack, we get deterministic archives. This also makes the
task command simpler.
MozReview-Commit-ID: EPI7tuGQuso
--HG--
extra : rebase_source : babcbf3d5607480321106b40eaa4598c0faee188
An upcoming commit will want to put something outside the
format-specific output directory.
MozReview-Commit-ID: 2kYDREddpN
--HG--
extra : rebase_source : 28454f71b3abbd094048edb568b4f5e8d50881d8
I didn't fix all violations in this file. Something is better than
nothing.
MozReview-Commit-ID: BDdWhJfkPVk
--HG--
extra : rebase_source : caa0a5908c2cb37b8cbb1c5ee004d43e3a0b883a
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
--HG--
extra : rebase_source : f1131abc8cd639251e085c8ebf776827a6b831ed
extra : amend_source : b2b0cb253c7f6e90fdd710c2c788877411bd9e1d
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
--HG--
extra : rebase_source : c3ef4ec15ecd4fa0ec0b5af7aacddfa8d6dd90e0
extra : source : 19f92c04608cec275dab73e8acad5141de8a5c44
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
--HG--
extra : rebase_source : d2881d6ee093d0f0c87880ba63b451fb0e54415e
extra : amend_source : 6a34a633daab264863a668aca801ce4a4ffb782b
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
--HG--
extra : commitid : EP5vOiGxJM7
extra : rebase_source : e6a8c4c44ccf45eb3a570d6e0575999c72465fec
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
--HG--
extra : commitid : IOguvvudLzw
extra : rebase_source : c53788d259c7f69be997426227778820ec99dd26
extra : amend_source : 5fa5069d1c7c8d5d93fefb56563af9bd28286b90
This removes ambiguity as to which modules are being imported, making
import slightly faster as Python doesn't need to test so many
directories for file presence.
All files should already be using absolute imports because mach command
modules aren't imported to the package they belong to: they instead
belong to the "mach" package. So relative imports shouldn't have been
used.
--HG--
extra : commitid : 6tFME1KKfTD
extra : rebase_source : 78728f82f5487281620e00c2a8004cd5e1968087
Previously, code for staging the Sphinx documentation from moz.build
metadata lived in a mach command and in the moztreedocs module. This
patch moves the invocation to the Sphinx extension.
When the code is part of the Sphinx extension, it will run when executed
with sphinx-build. This is a prerequisite to getting RTD working, since
sphinx-build is the only supported entrypoint for generating
documentation there.
With this patch, we can now invoke sphinx-build to build the
documentation. The `mach build-docs` command is no longer needed.
--HG--
extra : rebase_source : 86e76c7d598ffa23dae858254eecedbdd12706a4
extra : histedit_source : 1826aa5ddfafdff62847cc293d1f0950b236caac
In order for Sphinx documentation to work with Read The Docs, we need
the code for scanning the build config for Sphinx documentation to live
in an importable module. This patch moves some code from the
|build-docs| mach command into an importable module.
--HG--
extra : rebase_source : 263972d1415419c59c25058ca2cb90b3c31eda89
extra : histedit_source : e120aa117c63d54f6b293ae63d9bd1338ea0e808
Ever since Sphinx variable reading operates at the AST level (bug
1071012), we don't technically need a fully configured environment in
order to generate the documentation!
This patch stubs out the config environment object with a fake one that
provides the only needed context to generate the Sphinx docs. This
allows us to build the Sphinx docs on a fresh clone of the tree with no
configure and with no object directory.
--HG--
extra : rebase_source : f44513f01706391a5932a20c1437fcc8697611cd
Read the Docs has a lovely Sphinx theme that beats the pants off the
built-in and default theme. And since it looks like MDN's Sphinx theme
is dead in the water, this gets us a nice UI win until the MDN theme
comes back from the dead.
--HG--
extra : rebase_source : b4f92cf8263843d3118a85a7d9b59b98d5dd0613
The in-tree Sphinx docs have been broken since bug 1041941 because
processing moz.build files outside their context doesn't work.
Specifically, templates aren't loaded (because this information usually
comes from a parent moz.build file). A new execution mode is needed.
I tried to implement a proper execution mode. However, I kept running
into walls. While we should strive for a proper execution mode, this can
be a follow-up, tracked in bug 1058359.
This patch implements extraction of Sphinx variables from ast walking.
It is extremely low-level and definitely a one-off. But it solves the
problem at hand: |mach build-docs| will work after this patch is
applied.
--HG--
extra : rebase_source : abd0a91a3efb24d3adfa19f4cd281ce5fd6d0915
extra : amend_source : c1b4f79224bab55e65a8c2b0f3103475281416c1