- Adds a new "infrastructure" section to the docs, which describes
architecture, administration and troubleshooting (fixes bug 1165259).
- Adds code comments to any deployment-related files in the repository.
- Adds documentation for the various ways in which users can access
Treeherder data (fixes bug 1335172).
- Reorganises the structure of some of the existing non-infrastructure
docs, to make the documentation easier to navigate.
This makes Heroku/Vagrant use Python 3.6.8 instead of Python 2.7, and
inverts the versions used in the Travis testing matrix - leaving all
unit tests running against Python 2.7 to make it easier to roll back
if needs be. The Vagrant provision script and Heroku Python buildpack will
automatically detect the changed Python version and purge the existing
installation/site-packages prior to installing the new version.
We're using Python 3.6 rather than 3.7, since latest Celery/Kombu do not
yet support Python 3.7 (and we're on an older version anyway; bug 1337717).
Bug 1529243 is filed for updating to Python 3.7 later.
Also remove all Karma support and update the docs to only mention ``Jest``.
One of the test files was testing some AngularJS filters. I converted these
tests to test the equivalent helper functions.
Switches from Sphinx to MkDocs, since it:
* supports Markdown natively without requiring hacks like `eval_rst`
* validates inline links, ensuring that they are not broken
* has a more pleasant live-reloading dev-server
* supports the nicer looking mkdocs-material theme
* is a third of the size of Sphinx (including deps)
The theme change is now possible since Read the Docs have just started
supporting use of custom themes (previously they would override the theme
and use `readthedocs` theme regardless).
Currently Prettier is used via the ESLint integration, which only supports
JS/JSX and not the other filetypes Prettier is able to format.
For now these additional filetypes are excluded by `.prettierignore`
entries, however these will be removed/fixes applied in later commits.
Neutrino controls our frontend linting, transpilation, source-maps,
testing, dev-server and optimisation of production builds.
Highlights of the upgrade are:
* Major version updates to the individual tools within (such as webpack,
Babel and ESLint), significantly improving performance, fixing
transpilation/minification correctness bugs, adding support for newer
ECMAScript features, and increasing linter coverage.
* Hot reloading in the dev server now works for all entry-points and not
just the jobs view, shortening the feedback cycle.
* Reduced bundle size due to webpack 4's tree shaking, scope hoisting,
automatic shared/vendor code chunk splitting (no need for the manually
maintained 'vendor' list).
* CSS is now extracted out of JS, which improves performance, reduces
bundle size and prevents the initial white flash of un-styled content.
* Support for dynamic imports/code splitting (needed for bug 1502192).
* Support for Jest via a new Jest preset (unblocks bug 1364045).
* Support for public class field declarations (unblocks bug 1480166).
* Improved source-maps (increases the quality of production exception
trace-backs and fixes several debugger breakpoint bugs).
* Reduced amount of custom configuration required for our fairly complex
frontend needs, reducing maintenance burden and allowing for easier
future Neutrino upgrades.
In addition this PR:
* Fixes the WhiteNoise `immutable_file_test()` regex, so that it now
correctly enables browser caching of images, fonts and source maps.
* Enables webpack-dev-server's overlay feature, which displays any
compilation errors in the browser, saving having to switch back
to the console (this can be enabled for warnings too if desired).
* Enables webpack-dev-server's automatic browser-opening feature,
which saves having to manually navigate to `localhost:5000` after
running `yarn start`.
* Switches Karma tests to run Firefox in headless mode, reducing the
workflow disruption when running `yarn test`.
* Uses the new webpack `performance` option to enable maximum asset
file size thresholds, to help prevent bundle-size regressions.
* Rewrites the `package.json` script commands so that they now work
correctly on Windows, even when setting environment variables.
Performance comparison:
* Local `yarn build`:
- Cached: 2m34s -> 23s
- Uncached: 2m34s -> 58s
* Local `yarn start`:
- Cached: 34.5s -> 13.6s
- Uncached: 34.5s -> 31.3s
* Local `yarn test`
- Cached: 61.5s -> 19.8s
- Uncached: 61.5s -> 22.0s
* Local `yarn lint`
- Cached: 3.8s -> 1.8s
- Uncached: 13.7s -> 13.4s
* Travis end-to-end time:
9 minutes -> 6 minutes
* Heroku deploy end-to-end time:
14 minutes -> 9 minutes
The Python 3 sub-job runs more than just linters, so the old name
was not correct. The comments have been removed since they mostly
duplicate the name in `env`.
* Adds a `rabbitmq-server` install step, since it's no longer
installed in the image by default.
* Removes the MySQL 5.7 install step, since Ubuntu 16.04's default
MySQL is now 5.7 rather than 5.6.
* Adjusts which services are manually started to account for changes
in which are enabled by default in the new image.
This enables `DeprecationWarnings` for things that Python 2 knows
are not compatible with Python 3. The `error` entry in the pytest
`filterwarnings` setting ensures these will be surfaced as Exceptions
and so result in test failures.
See:
https://docs.python.org/2/using/cmdline.html#cmdoption-3
The removal of `sorted()` from `test_bug_job_map_api.py` is to fix:
`DeprecationWarning: dict inequality comparisons not supported in 3.x`
This merges the three separate non-selenium Python test jobs into
one, reducing the overall job count from 7 to 5. This helps avoid
hitting Travis concurrency limits, that delay starting the selenium
job (which is the long pole for the end to end time).
The pytest run would normally ensure that the migrations succeed and
that none are missing. However the unit tests currently fail due to
bug 1428362, so this provides equivalent coverage in the meantime.
By design, Travis runs all commands in `scripts` even if earlier ones
fail. However in the case of the selenium tests, they are expected
to fail if `yarn build` failed, so running them regardless only makes
the log output harder to follow. Moving `yarn build` to `before_script`
means the job will instead be aborted prior to running the tests.
Since the node minor/patch versions are reliable enough that it's
not worth the hassle of pinning to an exact version. This only
affects Heroku/Travis, since Vagrant was already always using the
latest 8 series release via the APT repo.
This effectively upgrades node on Heroku/Travis from 8.9.0 to 8.9.1,
since it's the latest release at the moment:
https://github.com/nodejs/node/blob/master/doc/changelogs/CHANGELOG_V8.md#8.9.1
The yarn version specifier has been adjusted to use the `.x` format,
which gives the same end result as the caret range, given Heroku
doesn't cache binaries from one build to the next (only `node_modules`).
This:
* reduces duplication
* opens the door to sharing functionality with `vagrant/setup.sh`
* will make it easier to visualise the Travis bootstrap process
when moving both Travis and Vagrant to a unified Docker environment.