Bug 1395752 - Define and use sparse profile for Sphinx docs; r?dustin draft
authorGregory Szorc <gps@mozilla.com>
Tue, 22 Aug 2017 22:25:38 -0700
changeset 656997 b057980beff2b5032ce29086888419e9e4248014
parent 656976 13d241d08912be31884f9d0d0e805b25343d6c0a
child 729307 31afb0b385d887a4620b48dbd8cd6ccfc23e7e9e
push id77398
push usergszorc@mozilla.com
push dateThu, 31 Aug 2017 23:35:00 +0000
reviewersdustin
bugs1395752
milestone57.0a1
Bug 1395752 - Define and use sparse profile for Sphinx docs; r?dustin The Sphinx documentation only needs access to a relatively small number of files in the repo in order to be generated. It is a good candidate for using sparse profiles. This commit defines and uses a "sphinx-docs" sparse profile containing only the files relevant to Sphinx documentation generation. There are some quirks with the profile: * All moz.build files are included. This bloats the profile by >1000 files. Worse, it realizes directories that have no business being realized. This clutters the checkout and makes it harder to find things. There is a moz.build reader that knows how to retrive file data from Mercurial. We could use that. This feels like follow-up fodder. * All mach_commands.py files are included. `mach help` says you can do things that you aren't able to do in the sparse checkout. There isn't a good way to add all *.py files while excluding mach_commands.py files. We /could/ do it with regular expressions. But those are slow. Let's leave it as is for now and come up with a better solution later. MozReview-Commit-ID: 7yiqGGE1nAh
build/sparse-profiles/sphinx-docs
taskcluster/ci/source-test/doc.yml
new file mode 100644
--- /dev/null
+++ b/build/sparse-profiles/sphinx-docs
@@ -0,0 +1,17 @@
+%include build/sparse-profiles/mach
+
+[include]
+# Code for generating docs.
+glob:tools/docs/**
+
+# Potential docs sources
+glob:**/*.rst
+
+# Python API docs.
+glob:**/*.py
+
+# moz.build files are read to discover location of docs.
+glob:**/moz.build
+
+# Read to set the version of the docs.
+path:config/milestone.txt
--- a/taskcluster/ci/source-test/doc.yml
+++ b/taskcluster/ci/source-test/doc.yml
@@ -13,16 +13,17 @@ doc-generate:
             - type: file
               name: public/docs.tar.gz
               path: /builds/worker/checkouts/gecko/docs-out/main.tar.gz
     run:
         using: run-task
         command: >
             cd /builds/worker/checkouts/gecko &&
             ./mach doc --outdir docs-out --no-open --archive
+        sparse-profile: sphinx-docs
     when:
         files-changed:
             - '**/*.py'
             - '**/*.rst'
             - 'tools/docs/**'
 
 doc-upload:
     description: Generate and upload the Sphinx documentation
@@ -35,15 +36,16 @@ doc-upload:
     worker-type: aws-provisioner-v1/gecko-t-linux-xlarge
     worker:
         docker-image: {in-tree: "lint"}
         max-run-time: 1800
         taskcluster-proxy: true
     run:
         using: run-task
         command: cd /builds/worker/checkouts/gecko && ./mach doc --upload --no-open
+        sparse-profile: sphinx-docs
     scopes:
         - secrets:get:project/releng/gecko/build/level-{level}/gecko-docs-upload
     when:
         files-changed:
             - '**/*.py'
             - '**/*.rst'
             - 'tools/docs/**'