Skip to content

Commit

Permalink
Bug 1395752 - Define and use sparse profile for Sphinx docs; r=dustin
Browse files Browse the repository at this point in the history
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

--HG--
extra : rebase_source : c148040ea3618e8bfdd369b6f48fc60c6d179285
extra : source : b76e2f6204b20de137f2566dff8121ff3abe5760
  • Loading branch information
indygreg committed Aug 23, 2017
1 parent dd24896 commit 7be30dd
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
17 changes: 17 additions & 0 deletions build/sparse-profiles/sphinx-docs
Original file line number Diff line number Diff line change
@@ -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
2 changes: 2 additions & 0 deletions taskcluster/ci/source-test/doc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ doc-generate:
command: >
cd /builds/worker/checkouts/gecko &&
./mach doc --outdir docs-out --no-open --archive
sparse-profile: sphinx-docs
when:
files-changed:
- '**/*.py'
Expand All @@ -40,6 +41,7 @@ doc-upload:
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:
Expand Down

0 comments on commit 7be30dd

Please sign in to comment.