Граф коммитов

388 Коммитов

Автор SHA1 Сообщение Дата
Shubhank Saxena 205871c75a
Add pre-commit flake8/isort checks (#6058)
After setting up the pre-commit hooks you will get `flake8` and `isort` checks.

Co-authored-by: Armen Zambrano <armenzg@users.noreply.github.com>
2020-02-28 09:39:18 -05:00
Armen Zambrano 395237e732
Bug 1509181 - Fix ingestion of GitHub pushes (#6065)
Github based projects can list pushes in the UI incorrectly. This is caused by commits that have been ammended.

This code change switches to grab the push time from the `timestamp` field of the head commit from the Pulse event rather that Github's APIs. This fixes the problem of push sorting.

Note, that the field `timestamp` only exists in the Push event that the Pulse message contains. This field can be seen in the `events` API, however, that API contains all sorts of events and holds a maximum of 300 events.

This change also includes partial support for manual ingestion of Git pushes.
2020-02-28 09:10:52 -05:00
Cameron Dawson c7d873eda8
Bug 1617734 - Push health ui a11y improvements (#6059)
* CSS Cleanup
* Use darker-info and darker-secondary for a11y
* Put Parent Push metric at end of list and clean it up
* Add a `scrollToLine` when clicking/expanding metric names
2020-02-27 10:01:46 -08:00
Armen Zambrano G 15b4d4d92b Revert "Bug 1509181 - Fix ingestion of GitHub pushes + manual ingestion support (#6019)"
This reverts commit b41f68286d.
2020-02-25 15:25:04 -05:00
Armen Zambrano b41f68286d
Bug 1509181 - Fix ingestion of GitHub pushes + manual ingestion support (#6019)
Git based projects can list pushes in the UI incorrectly. This is caused by commits that have been ammended.

This code change switches to use the `timestamp` field of head commit to determine push time rather a commit's authorship date. This fixes the problem of push sorting.

This change also includes support for manual ingestion of Git pushes.
2020-02-24 12:20:50 -05:00
Mellina Yonashiro 785e591b78
Add style for darker colors (#5959)
Add style specs in case darker-secondary and darker-info color props are used in other reactstrap components in the future. Update docs and reorganize these classes in the stylesheet.
2020-02-18 16:17:01 -08:00
Armen Zambrano 9104004ee1
SETA improvements (#6002)
* Properly configure LOGGING_LEVEL

`LOGGING_LEVEL` was being cast down to False rather than "INFO" or "DEBUG".
There were no fallouts from it but it was preventing setting the right logging
level for the Docker container or the Heroku Review Apps.

* Validate preseed entries and fail if issues are found

Without validation some invalid data job priorities would be inserted into the table. No issues
would be noticed for SETA since the web API sanitizes the data before presenting it.
2020-02-18 11:51:53 -05:00
Mellina Yonashiro 84d1f0ea2f
Documentation Update - Accessibility page (#5920)
Include section on general practices and color and style modifications, and resources.
2020-02-07 12:44:51 -08:00
Kyle Lahnakoski d05b42cf80
Bug 1610347 - Extract jobs/perf/alert to BigQuery (#5839)
https://github.com/mozilla/treeherder/pull/5839 for details
2020-02-06 13:16:26 -05:00
Armen Zambrano 168e19ccfc
Migrations are automatically applied (#5857)
This section was confusing for a contributor since it does not actually work (The MySql container is not ready) and the Django migrations are now automatically applied when running `docker-compose up`.
2020-02-03 11:28:47 -05:00
Armen Zambrano cea5c06fc7
SETA related changes (#5851)
* Development Docker container to initialize data

`docker-compose up` will now initialize the data for the local database.
This will also include initializing SETA's data.

* Change SETA's logging level and preseed information

The preseed information was all for Buildbot
The logging level changes is in preparation for when production switching to INFO messages instead of WARNING

* Docker container to log INFO messages instead of DEBUG messages

`LOGGING_LEVEL` is now set for the Docker container and it sets the logging
to `INFO` instead of `DEBUG`. The Django app will still be initialize in
debug mode but the default logging will be informative messages.

You can still log debugging messages by setting `LOGGING_LEVEL=DEBUG` before
initializing the Docker container.
2020-01-22 14:28:18 -05:00
Armen Zambrano 47107d199a
Manual ingestion improvements (#5799)
Manual ingestion improvements

* Disable eager consumption
* Determine Gecko decision task id automatically
* Shorthand for some parameters
2020-01-07 16:50:14 -05:00
Armen Zambrano ebfbd849d6
Bug 1599192 - Improve documentation for ingesting data locally (#5711) 2019-12-10 08:41:10 -05:00
Sarah Clements 73c6902974 Update doc section for replica access to include new tables (#5690) 2019-11-28 10:05:53 -05:00
Armen Zambrano G 37c96d328d Allow using PULSE_URL to define push_sources and task_sources
Defining PULSE_TASK_SOURCES and PULSE_PUSH_SOURCES is a bit of a nightmare
because `app.json` is a Json file and using double and single quotes for a
value in the file is impossible.
2019-11-12 09:09:10 -05:00
Sarah Clements 23bba817fa
Tc migration prep part2 (#5615)
rootUrl changes to repository fixture, add new rooturls to connect-src,
remove header in make_request, update docs, and update backend urls
2019-11-08 12:57:00 -08:00
Armen Zambrano G 62f953625f Revert "Bug 1593869 - prep for Taskcluster migration (#5604)"
This reverts commit 2ccfe7f6da.
2019-11-08 10:51:00 -05:00
Sarah Clements 2ccfe7f6da
Bug 1593869 - prep for Taskcluster migration (#5604)
- update repositories fixture with new tc_root_urls for firefox-ci and community-ci

- update getRunnableJobsUrl and RunnableJobModel to access currentRepo and tc_root_url;
refactor getInspectTaskUrl and JobInfo component to have currentRepo prop

- add new rooturls to connect-src, update rooturl for seta, update docs and
remove header in make_request,
2019-11-07 13:58:47 -08:00
Dustin J. Mitchell 5684321c50 Bug 1574651 - ingest from multiple rabbitmq servers (#5399)
* Bug 1574651 - remove unused JobConsumer and related code

The `update_pulse_test_fixtures` management command listens for job
messages, so is of no use anymore.

* Bug 1574651 - refactor pulse listening to support multiple AMQP servers

This looks forward to supporting ingesting jobs and tasks from multiple
Taskcluster depoyments, each of which is on its own AMQP server (or, at
least, a vhost).

* Bug 1574651 - pass rootUrl from pulse to celery, verify against repository

When jobs and pushes are loaded, the repo's root URL is known.  This
just serves to ensure that the rootUrl for the repo and the rootUrl for
the event match up.

* Bug 1574651 - use root_url from message to make in-job URLs
* Bug 1574651 - update ingest-and-push-tasks to take --root-url
2019-10-10 16:53:18 -07:00
Armen Zambrano G 1cf294d9e7 Update docs to create user MySql access 2019-09-11 14:01:29 -04:00
Cameron Dawson a88ce26ffa another case 2019-08-26 15:06:12 -07:00
Cameron Dawson a712a6e392 Add a manual Smoke-Test suite 2019-08-26 15:06:12 -07:00
Armen Zambrano G 9de99b4711 Bug 1395254 - Consume Taskcluster Pulse messages from standard queue exchanges
Currently, Treeherder consumes Pulse messages from an intermediary service called `taskcluster-treeherder`.
Such service needs to be shut down and its functionality imported into Treeherder.

In order to do this we need to switch to the standard Taskcluster exchanges as defined in here:
https://docs.taskcluster.net/docs/reference/platform/queue/exchanges

On a first pass we are only including the code from `taskcluster-treeherder` without changing
much of Treeherder's code. The code is translated from Javascript to Python and only some minor
code changes were done to reduce the difficulty on porting the code without introducing bugs.
Internally, on this first pass, we will still have an intermediary data structure representing
what `taskcluster-treeherder` is emitting, however, we will stop consuming the messages
from it and be able to shut it down.

Instead of consuming from one single exchange we will be consuming multiple ones. Each one representing
a different kind of task (e.g. pending vs running).

In order to test this change you need to open 5 terminal windows and follow these steps:

* On the first window run `docker-compose up`
* On the next three windows `export PULSE_URL="amqp://foo:bar@pulse.mozilla.org:5671/?ssl=1"` and run the following commands:
      * `docker-compose run -e PULSE_URL backend ./manage.py pulse_listener_jobs`
      * `docker-compose run -e PULSE_URL backend ./manage.py pulse_listener_tasks`
      * `docker-compose run -e PULSE_URL backend ./manage.py pulse_listener_pushes`
* On the last window run `docker-compose run backend celery -A treeherder worker -B --concurrency 5`
* Open on your browser `http://localhost:5000`

This is just a summary from [the docs](https://treeherder.readthedocs.io/pulseload.html).

= ETL management commands =
This change also introduces two ETL management command that can be executed like this:

== Ingest push and tasks ==

This script can ingest into Treeherder all tasks associated to a push.
It uses Python's asyncio to speed up the ingestion of tasks.

```bash
./manage.py ingest_push_and_tasks
```

== Update Pulse test fixtures ==

```bash
./manage.py update_pulse_test_fixtures
```

This command will read 100 Taskcluster Pulse messages, process them and store them as test fixtures
under these two files: `tests/sample_data/pulse_consumer/taskcluster_{jobs,metadata}.json`

Following this work would be to get rid of the intermediary job representation ([bug 1560596](https://bugzilla.mozilla.org/show_bug.cgi?id=1560596) which will
clean up some of the code and some of the old tests.

= Extra script =
Script that permits comparing pushes from two different Treeherder instances.

```
usage: Compare a push from a Treeherder instance to the production instance.
       [-h] [--host HOST] --revision REVISION [--project PROJECT]

optional arguments:
  -h, --help           show this help message and exit
  --host HOST          Host to compare. It defaults to localhost
  --revision REVISION  Revision to compare
  --project PROJECT    Project to compare. It defaults to mozilla-central
```

= Other changes =

Other changes included:

* Import `taskcluster-treeherder`'s validation to ensure we're not fed garbage.
* Change `yaml.load(f)` for `yaml.load(f, Loader=yaml.FullLoader)`. Read [this](https://github.com/yaml/pyyaml/wiki/PyYAML-yaml.load(input)-Deprecation) for details
* Introduce `taskcluster` and `taskcluster-urls` as dependencies
* The test `test_retry_missing_revision_never_succeeds` makes no sense because
we make Json validation on the Pulse message
2019-07-29 09:42:57 -04:00
Armen Zambrano G 7f04a91af7 Revert "Bug 1395254 - Consume Taskcluster jobs from standard queue exchanges (#5042)"
This reverts commit 75dc375a93.
2019-07-23 16:24:13 -04:00
Armen Zambrano 75dc375a93
Bug 1395254 - Consume Taskcluster jobs from standard queue exchanges (#5042)
* Bug 1395254 - Consume Taskcluster Pulse messages from standard queue exchanges

Currently, Treeherder consumes Pulse messages from an intermediary service called `taskcluster-treeherder`.
Such service needs to be shut down and its functionality imported into Treeherder.

In order to do this we need to switch to the standard Taskcluster exchanges as defined in here:
https://docs.taskcluster.net/docs/reference/platform/queue/exchanges

On a first pass we are only including the code from `taskcluster-treeherder` without changing
much of Treeherder's code. The code is translated from Javascript to Python and only some minor
code changes were done to reduce the difficulty on porting the code without introducing bugs.
Internally, on this first pass, we will still have an intermediary data structure representing
what `taskcluster-treeherder` is emitting, however, we will stop consuming the messages
from it and be able to shut it down.

Instead of consuming from one single exchange we will be consuming multiple ones. Each one representing
a different kind of task (e.g. pending vs running).

In order to test this change you need to open 4 terminal windows and follow these steps:

* On the first two windows `export PULSE_URL="amqp://foo:bar@pulse.mozilla.org:5671/?ssl=1"` and run the following commands:
  * `docker-compose run -e PULSE_URL backend ./manage.py pulse_listener_jobs`
  * `docker-compose run -e PULSE_URL backend ./manage.py pulse_listener_pushes`
* On the third window run `docker-compose run backend celery -A treeherder worker -B --concurrency 5`
* On the last window run `docker-compose up`
* Open on your browser `http://localhost:5000`

This is just a summary from [the docs](https://treeherder.readthedocs.io/pulseload.html).

= ETL management commands =
This change also introduces two ETL management command that can be executed like this:

== Ingest push and tasks ==

This script can ingest into Treeherder all tasks associated to a push.
It uses Python's asyncio to speed up the ingestion of tasks.

```bash
./manage.py ingest_push_and_tasks
```

== Update Pulse test fixtures ==

```bash
./manage.py update_pulse_test_fixtures
```

This command will read 100 Taskcluster Pulse messages, process them and store them as test fixtures
under these two files: `tests/sample_data/pulse_consumer/taskcluster_{jobs,metadata}.json`

Following this work would be to get rid of the intermediary job representation ([bug 1560596](https://bugzilla.mozilla.org/show_bug.cgi?id=1560596) which will
clean up some of the code and some of the old tests.

= Other changes =

Other changes included:

* Import `taskcluster-treeherder`'s validation to ensure we're not fed garbage.
* Change `yaml.load(f)` for `yaml.load(f, Loader=yaml.FullLoader)`. Read [this](https://github.com/yaml/pyyaml/wiki/PyYAML-yaml.load(input)-Deprecation) for details
* Introduce `taskcluster` and `taskcluster-urls` as dependencies
* The test `test_retry_missing_revision_never_succeeds` makes no sense because
we make Json validation on the Pulse message
2019-07-23 13:14:18 -04:00
Cameron Dawson facd5aa72b Split out the /docs automated test section and enhance it a bit 2019-07-19 15:02:35 -07:00
Cameron Dawson 58eacd7aea
Bug 1560007 - Discontinue use of fxtesteng repos and pulse exchange (#5138) 2019-07-12 12:34:50 -07:00
Armen Zambrano deaf8c850c Bug 1169263 - Switch from Vagrant to docker-compose (#4901)
* Change permissions for docker/entrypoint.sh
* Allow using Django in localhost
* Documentation changes
Allow running shellcheck tests
Use docker-compose for the Selenium tests
Install docs updates
Switch to yarn cache instead of npm
Install UI dependencies
* Add ability to override DATABASE_URL and use a .env file
2019-05-16 14:56:02 -07:00
Cameron Dawson 3267f191bb
Bug 1056865 - Add support for custom env file in Vagrant that is ignored by git (#4857) 2019-04-04 12:18:48 -07:00
Ed Morley 6945c4c471
Bug 1165259 - Add infrastructure documentation (#4766)
- 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.
2019-03-11 21:39:34 +00:00
Ed Morley 5e729a389f Bug 1530206 - Rename read_pulse_* to pulse_listener_*
To make it clearer that the commands are listening to Pulse, as opposed
to the processing/storing of pulse data that occurs later.
2019-02-27 07:12:33 +00:00
Ed Morley 2961c74a60 Bug 1530206 - Rename store_pulse_resultsets to store_pulse_pushes
Leaving behind the old queue/task for now so that any tasks in it at the
time of deployment can be completed.
2019-02-27 07:12:33 +00:00
Ed Morley cd826ef6d9 Bug 1530206 - Remove the bin/run_* scripts
Since they are out of sync with `Procfile` and long term are best replaced
with one of the solutions in bug 1318020.

The development setup instructions have been updated to stop recommending
gunicorn, since Django's runserver is more appropriate for beginners
(and I'm pretty sure the memory leaks seen previously no longer occur).
2019-02-27 07:12:33 +00:00
Ed Morley d9de41bf4b
Bug 1270157 - Convert the report-only CSP header to the real thing (#4687)
The latest policy used in the report-only header has been working well
on production (the violation reports logged to New Relic are only from
scripts injected by browser addons), so we're ready to start enforcing
the policy by using the real `Content-Security-Policy` header name.

NB: When features are added in the future, PR authors and reviewers will
need to remember to update the policy if needed (for example to add domains
to the `connect-src` directive). The CSP header is not enabled when using
`webpack-dev-server` (it would break dev source maps and react-hot-loader)
so if in doubt test locally (using `yarn build` and serving via Django
runserver) or on prototype first.

See:
https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP
https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy
2019-02-25 19:47:45 +00:00
Ed Morley 86b7b32fd1 Bug 1527868 - Vagrant/Travis: Remove Elasticsearch server
To ensure the CI and local environments match stage/production (where
Elasticsearch is not configured) and don't run differing code-paths due
to the various `ELASTICSEARCH_URL` conditionals used in auto-classify.

At such time when work on the fuzzy auto-classify matcher continues,
this can be reverted.
2019-02-14 21:10:21 +00:00
Cameron Dawson deb71d65e0 Bug 1364045 - Convert all unit tests to Jest (#4603)
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.
2019-02-12 07:49:50 +00:00
Ed Morley a9aa1d5a27 Bug 1513486 - Remove /runnable_jobs/ API
Since it's only used by the frontend as a fallback for when it cannot
find a non-gzipped version of `runnable-jobs.json`, and enough time has
now passed for all jobs to have that file.
2019-02-08 18:53:58 +00:00
Ed Morley 65287fed30
Bug 1466084 - Docs: Switch to MkDocs and Material theme (#4565)
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).
2019-02-06 19:34:08 +00:00
Ed Morley 67e5b540ee
Docs: Update read-only replica GRANTs (#4509)
Generated using the approach documented at the end of the page:
https://treeherder.readthedocs.io/admin.html#direct-database-access

Follow-up to #3613 and #4015.
2019-01-28 12:11:19 +00:00
Ed Morley 2d787000bd Bug 1522101 - Use Prettier to format Markdown 2019-01-23 20:19:04 +00:00
Ed Morley e583700cb1 Bug 1522101 - Use `prettier --check` to validate formatting
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.
2019-01-23 20:19:04 +00:00
KWierso 608019de94 Bug 1520355 - Update docs/testcases.md (#4462) 2019-01-23 10:57:10 -08:00
Cameron Dawson 5e8377a3ff
Bug 1364045 - Introduce Jest unit tests (#4369) 2018-12-13 08:24:52 -08:00
Ed Morley 3decefed0b
Clean up the location of generated output directories (#4289)
So that their purposes are clearer and it's easier to differentiate
between generated content and files committed to the repository.

* Neutrino build: `build/` -> `.build/`
* Sphinx build: `_build/` -> `.build-docs/`
* Django collectstatic: `treeherder/static/` -> `.django-static/`
2018-11-16 19:18:18 +00:00
Ed Morley 65b7f4ab45
Bug 1507172 - Use Prettier for formatting JS/JSX (#4276)
Since it's more reliable (and strict) at code formatting than ESLint.
We use it via an ESLint plugin, and so disable the style-related AirBnB
preset rules, leaving the AirBnB guide to handle only correctness and
best practices rules.

It's highly encouraged to use an IDE integration or Git commit hook
to run Prettier (or `yarn lint --fix`) automatically. See:
* https://prettier.io/docs/en/editors.html
* https://prettier.io/docs/en/precommit.html

We may consider enabling a git commit hook out of the box (using eg
Husky) in the future, however they have previously been known to
interfere with partial-staging workflows, so would need to test the
fixes they have made for them thoroughly first.

In future PRs we may also want to start formatting JSON/CSS/Markdown
using Prettier too.
2018-11-16 08:28:34 +00:00
Ed Morley 4db0cfa973
Bug 1507406 - ESLint: Enforce more strict import style (#4279)
Imports must now be grouped like so (with newlines between each):

```
// "external" modules
import _ from 'lodash';
import chalk from 'chalk';

// modules from a "parent" directory
import foo from '../foo';
import qux from '../../foo/qux';

// "sibling" modules from the same or a sibling's directory
import bar from './bar';
import baz from './bar/baz';
```

The `import/order` rule has auto-fix support, so any errors can be
resolved using `yarn lint --fix`.

See:
https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/order.md
2018-11-16 08:07:49 +00:00
Ed Morley 565ae4c13e
Bug 1364894 - Upgrade from Neutrino 4 to 9 (#4216)
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
2018-11-02 18:48:28 +00:00
Ed Morley 597bb4146e
Bug 1502306 - Make it easier to run Selenium tests (#4194)
* Enables the display of skipped test/expected fail reasons, in
  the pytest summary.
* Skips the Selenium tests with a clear reason message, unless the
  built UI is found (preventing the annoying/confusing test timeouts).
* Removes the disabling of the `pytest-html` and `pytest-metadata`
  plugins, since they are required when passing the `--html` option
  to generate an HTML report.
* Updates the docs to mention `yarn build` and `--html`.
2018-10-29 17:07:38 +00:00
Sarah Clements 12ff3a64f0
Bug 1166905 - Combine UI and server docs (#4083) 2018-10-09 12:38:30 -07:00
Ed Morley 55cf146ef1
Bug 1281821 - Docs: Correct Pulse environment variable references (#4097)
To account for the changes in #3948.
2018-10-04 12:08:04 +01:00
Ed Morley 445766d958
Bug 1443251 - Remove support for buildbot job ingestion (#4087)
The buildapi celerybeat tasks were disabled previously in #4007, so
these tasks are unused.
2018-10-02 11:07:27 +01:00
Ed Morley ecf4c4e33a
Bug 1349182 - Remove support for submitting jobs via the REST API (#4075)
Now that autophone and AWFY have migrated to Taskcluster, there are
no more submitters of jobs to the REST API (confirmed via New Relic
Insights). As such, this deprecated data ingestion method can now be
removed, along with support for API Hawk auth, API POST throttling
and `treeherder-client` job submission capability.

After this lands we'll need to manually drop the `credentials` table.
2018-09-28 02:17:48 +01:00
Ed Morley ffaa2e4b2a
Bug 1443251 - Remove runnable jobs support for buildbot (#4071)
Runnable jobs for buildbot were calculated via a celerybeat task
(that was disabled in #4007) and the results stored in the
`runnable_jobs` table. This can all be removed now that buildbot is
EOL, since the remaining support for Taskcluster runnable jobs does
not use that celery task/Django model.
2018-09-27 19:15:47 +01:00
Sarah Clements feb12ac6af
Ui documentation update
Add info on javascript and css libraries in code style section of docs.
2018-09-17 20:03:06 -07:00
George Hickman 0c84435659 Convert the Pulse Job configuration into a list of strings 2018-08-28 14:01:49 +01:00
George Hickman 425350fb2b Bug 1281821 - Convert Pulse push configuration into a list
We don't currently change the push ingestion sources in any of our envs
(prod, staging, prototype, test, dev) from their defaults.  This
hardcodes those unchanging values and documents where to change them
should an engineer need to.
2018-08-24 10:46:06 +01:00
George Hickman 078133f906
Remove the pulse destinations configuration (#3931)
They don't provide much benefit as per:
https://github.com/mozilla/treeherder/pull/3863#discussion_r207983587
2018-08-23 18:55:33 +01:00
Ed Morley 3da4738649
Revert "Remove the pulse destinations configuration" (#3927)
This reverts commit 1728dd306c (#3884), due to:

```
Pulse warning: queue "queue/treeherder-staging/jobs" is overgrowing

Warning: your queue "queue/treeherder-staging/jobs" on exchange "could not be determined" is
overgrowing (4083 ready messages, 4083 total messages).
...
```
2018-08-15 21:00:00 +02:00
George Hickman 1728dd306c Remove the pulse destinations configuration
They don't provide much benefit as per:
https://github.com/mozilla/treeherder/pull/3863#discussion_r207983587
2018-08-15 19:04:59 +01:00
George Hickman fb99e98c4f Bug 1281821 - Split PULSE_DATA_INGESTION_SOURCES into three separate settings 2018-08-07 09:51:40 +01:00
George Hickman 6e7b1efac3 Bug 1281821 - Rename PULSE_URI -> PULSE_URL to match other config vars 2018-08-07 09:51:40 +01:00
George Hickman cc4bfa47f6 Bug 1281821 - Use PULSE_URI instead of PULSE_DATA_INGESTION_CONFIG 2018-08-07 09:51:40 +01:00
George Hickman ca2f8515a3 Bug 1069249 - Explain how to view DB inside a Vagrant VM 2018-08-01 12:30:42 +01:00
Ed Morley eeff0a6fb4 Bug 1466084 - Docs: Convert markup from reST to markdown
Markdown guide for reference:
https://daringfireball.net/projects/markdown/syntax

For the existing Sphinx `.. note::`s, there isn't an exact equivalent
until we switch to mkdocs (which has the `Admonition` extension), so
I've left as reStructuredText and wrapped them with an `eval_rst`
code block for now, rather than switching to HTML. See:
https://recommonmark.readthedocs.io/en/latest/auto_structify.html#embed-restructuredtext
2018-07-30 20:49:01 +02:00
Ed Morley 71c1124784 Bug 1466084 - Docs: Change file extensions from .rst to .md
Renaming as a separate commit since otherwise Git was struggling to
identify the renames, making the diff harder to review.

`index.rst` has been left unchanged, since we still want to use the
`toctree` directive for now.
2018-07-30 20:49:01 +02:00
Ed Morley 33f0464101 Bug 1466084 - Docs: Add Sphinx markdown support
We want to switch from reStructuredText to Markdown, since:
* it's more user-friendly
* it is used in multiple places on GitHub, so people are more familiar
  with it / context switching between the two is annoying
* the disadvantages of markdown typically raised as reasons to prefer
  reST either don't apply to our use-case, or are no longer accurate
  with recent tooling/extensions
* switching means we can also later start using mkdocs (which doesn't
  support reST) instead of Sphinx. That change has been kept separate
  to reduce the size of the PR, and to make the comparison between
  the two more fair.

See:
https://docs.readthedocs.io/en/latest/getting_started.html#in-markdown
https://recommonmark.readthedocs.io/en/latest/index.html
2018-07-30 20:49:01 +02:00
Ed Morley 7f5e7c0643 Bug 1478711 - Docs: Fix SETA typos 2018-07-26 18:24:57 +02:00
Ed Morley bcffd1ce3e Bug 1478711 - Docs: Correct out of date UI testing advice
* The tests can now be run inside the VM.
* There is no longer a coverage report output.
2018-07-26 18:24:57 +02:00
Ed Morley 78c2c57fc9 Bug 1478711 - Docs: Fix navigation links
Previously the mixture of heading types was confusing the RTD theme,
causing the navigation sidebar to display at the top level not just
the page links, but links to subsections within those pages too.
The subsection names taken out of context were pretty confusing,
making it hard to navigate the docs.
2018-07-26 18:24:57 +02:00
Ed Morley 6419d2b61c
Bug 1421327 - Docs: Remove out of date/redundant pages (#3834)
The architecture pages are significantly out of date and so have
been removed until such time as new ones are created (this will be
simpler once Buildbot/REST API support is removed later this year).

In addition, the deployment page duplicated the UI installation page.
2018-07-26 17:43:23 +02:00
George Hickman 1cce79f59b Move docs Makefile up to project root and build docs there 2018-07-23 12:58:04 +01:00
Cameron Dawson 15721f009c
Bug 1450022 - Convert the rest of Details Panel to ReactJS (#3621) 2018-06-13 15:40:38 -07:00
Ed Morley 70e9cdc91d
Bug 1420941 - Docs: Encourage users to run Vagrant provision (#3539)
The `--provision` flag is unnecessary for new instances, since Vagrant
runs `provision` as part of the initial `up` regardless. However by
including `--provision` in the suggested command, it will mean
returning contributors will re-run provision when they re-use the
same steps.

An alternative approach would be to mark the provision block in
`Vagrantfile` as `run: "always"`, however that would slow down the
`vagrant up` of core developers too (by 40s), with no way to opt-out.
2018-05-14 11:04:17 +01:00
Ed Morley 55654a1195
Bug 1363722 - Allow login to work in all development workflows (#3534)
Previously it was not possible to test features that required an
authenticated user when:
* using `yarn start` with Vagrant (bug 1363722), which meant slower
  watch builds
* pointing the UI at the prod/stage API (bug 1317752), which was
  extremely limiting

Now login works in all environments, since the frontend no longer uses a
URL prefix, but instead webpack-dev-server proxies non-webpack URLs to
the chosen `BACKEND_DOMAIN` - avoiding cross-domain issues. Cookies are
rewritten to remove any `secure` directive (which is set on production),
so that they can still be read from HTTP localhost. The `Referer` has to
also be changed to stop Django's CSRF checks from rejecting request.

The slower "build into `dist` and watch" mode is therefore no longer
necessary, so `yarn start:local` instead invokes webpack-dev-server just
like `yarn start` - and the `local-watch.js` workaround has been
removed.

Support for the "publish to GitHub with hardcoded `SERVICE_DOMAIN`"
workflow has been dropped, since it was already rarely used and there is
no way to make it support login.

The API domain environment variable was renamed to `BACKEND_DOMAIN` to
avoid potential confusion given it no longer behaves the same as
`SERVICE_DOMAIN` used to.

NB: For full stack Vagrant workflows users must now connect to port
*5000* on localhost, not 8000.
2018-05-10 17:58:04 +01:00
Cameron Dawson 454cde322d
Bug 1330702 - Improve the Pulse ingestion docs (#3377) 2018-04-03 17:07:07 -07:00
Ed Morley bd870cf8ce
Bug 1441493 - Use rel="noopener" for all target != null links (#3275)
This helps prevent:
https://www.owasp.org/index.php/Reverse_Tabnabbing

We're not also using `noreferrer`, since most browsers now support
`noopener` (https://caniuse.com/#search=noopener) and the link targets
are all Mozilla properties where the referrer may be useful.

The auth.js `window.open()` has not been changed, since the login
callback makes use of `window.opener`.
2018-02-27 19:17:42 +00:00
ionutgoldan bab66d8066 Bug 1428032 - Docs: Grant visibility for new issue_tracker table (#3266) 2018-02-26 11:00:41 +00:00
Ed Morley 0aec43a139
Bug 1357476 - Replace django-rest-swagger with native d-r-f docs (#3230)
Now that django-rest-framework supports interactive docs natively,
we no longer need to use the additional django-rest-swagger package:
http://www.django-rest-framework.org/topics/3.6-announcement/#interactive-api-documentation
http://www.django-rest-framework.org/topics/documenting-your-api/

This significantly reduces the number of static files that have to
be processed, reducing the time taken for `collectstatic` (which is
run on every deployment and takes a while due to Brotli compression)
by 70%.
2018-02-16 10:21:21 +00:00
Jonathan French 7247ea20b7 Bug 1429988 - Minor updates for local pulse ingestion 2018-02-13 09:23:19 -08:00
Ed Morley 0397e82f0e
Bug 1435998 - Fix/enable eslint 'strict' (#3198)
With ES6, the `'use strict'` directives are unnecessary:
https://eslint.org/docs/rules/strict

The directives have been left in the Neutrino configs, since they
are used by node directly, which doesn't yet support ES6 modules.
2018-02-12 16:51:36 +00:00
Ed Morley 9ef378f043
Bug 1433011 - Remove UI for requesting/managing Hawk credentials (#3166)
Since REST API data submission is deprecated in favour of Pulse.
The credentials app now only contains the model and migration.
2018-01-30 23:37:42 +00:00
Ed Morley f74e37f7a9 Bug 1434307 - Docs: Fix `REQUIRE SSL` SQL deprecation warnings
Now that we're using MySQL 5.7, we can specify `REQUIRE SSL` on the
`CREATE USER` statement, rather than having to do so on the individual
GRANTs. Compare:
https://dev.mysql.com/doc/refman/5.6/en/create-user.html
https://dev.mysql.com/doc/refman/5.7/en/create-user.html

Prevents:
```
1 warning(s): 1287 Using GRANT statement to modify existing user's
properties other than privileges is deprecated and will be removed
in future release. Use ALTER USER statement for this operation.
```
2018-01-30 16:49:14 +00:00
Ed Morley 925ea48229 Bug 1434307 - Docs: Update read-only replica GRANTs
Generated using the approach documented at the end of the page:
https://treeherder.readthedocs.io/admin.html#direct-database-access

The changes are required since bug 1373008 added the `group` and
`group_failure_lines` tables and #2532 removed `text_log_summary`
and `text_log_summary_line`.
2018-01-30 16:49:14 +00:00
Ed Morley bc0ca97102
Bug 1419965 - Remove the estimated job time remaining backend (#2990)
The UI has already been removed. This cleans up the data ingestion
and removes the `JobDuration` model, however leaves the `running_eta`
field on the `Job` model for the next time that table is touched (since
the table is large, so altering the schema would likely require
downtime).
2017-12-04 22:09:38 +00:00
Ed Morley 1e2ce7fd23
Bug 1419168 - Add a .gitattributes file to force Linux line endings (#2997)
This prevents `$'\r': command not found` bash errors caused by CRLFs
when Windows hosts have suboptimal global Git configurations, meaning
one less thing that can go wrong / that needs documenting.

See:
https://help.github.com/articles/dealing-with-line-endings/
https://git-scm.com/docs/gitattributes
https://github.com/alexkaratarakis/gitattributes/blob/master/Web.gitattributes
2017-11-28 21:51:59 +00:00
Ed Morley 331a39bff2 Bug 1421241 - Docs: Add livehtml to the Makefile help text 2017-11-28 16:56:45 +00:00
Ed Morley 8b6743456e Bug 1413975 - Docs: Remove redundant configuration from conf.py
Most of the existing config (generated by `sphinx-quickstart`) was
either commented out, identical to the defaults or else for build
modes we do not use - and only end up making the config hard to read.
2017-11-28 16:56:45 +00:00
Ed Morley 644b0d900f Bug 1413975 - Docs: Disable unused Sphinx extensions
This means less to both install and run at build time, hopefully
speeding up the build and reducing the chance of races/locking issues.
2017-11-28 16:56:45 +00:00
Ed Morley f16d33efba Bug 1366043 - Docs: Remove misleading version of 'prototype'
Since otherwise the page titles contain the word 'prototype':
`- Treeherder prototype documentation`
2017-11-28 16:56:45 +00:00
Ed Morley 86e1402369 Bug 1421241 - Docs: Improve error shown when Sphinx not installed 2017-11-28 16:56:45 +00:00
Ed Morley 194e3e3be5 Bug 1421241 - Docs: Improve livehtml mode and recommend it
* Removes the unnecessary initial `make html`, since sphinx-autobuild
performs the initial build itself.
* Enables `--poll` watch mode, since file change detection otherwise
doesn't work in Vagrant.
* Updates the docs to recommend the livereload web server over the
one-off build when working on docs locally.
2017-11-28 16:56:45 +00:00
Ed Morley 607007d7e8 Bug 1421241 - Docs: Reduce nesting of build output directory
Since there is only ever one build type, so the nested directory is
unnecessary and makes it more annoying to find the built assets.
2017-11-28 16:56:45 +00:00
Ed Morley b7e6db1f94 Bug 1421241 - Docs: Remove unused Makefile targets
We don't use any of the other build modes:
http://www.sphinx-doc.org/en/stable/builders.html#builders
2017-11-28 16:56:45 +00:00
Ed Morley c02da51d84 Bug 1420891 - Docs: Fix broken or redirecting links
As found by running `make -C docs linkcheck`.
2017-11-28 16:56:45 +00:00
Ed Morley 7bca4d8e97 Bug 1420891 - Docs: Enable strict & 'nit-picky' mode when building
So that the build fails if there are any warnings:
http://www.sphinx-doc.org/en/stable/invocation.html#invocation-of-sphinx-build
2017-11-28 16:56:45 +00:00
Ed Morley 269bc37aff Bug 1420891 - Docs: Fix strict mode warnings
The build previously contained warnings like:
```
docs/rest_api.rst:144: WARNING: Title underline too short.
docs/admin.rst:18: WARNING: Could not lex literal_block as "sql". Highlighting skipped.
WARNING: html_static_path entry u'.../docs/_static' does not exist
```
2017-11-28 16:56:45 +00:00
Ed Morley f7f38ef4d0
Bug 1257602 - Remove support for revision_hash (#2983)
Now that no submissions are using revision_hash, it can be removed.
This removes everything but the model field, which will be handled
later.

I've removed revision_hash from the Pulse jobs schema without bumping
the version, which wouldn't normally be ok, but no one is still using
it, and I'd rather have explicit failures later than if we left the
schema unchanged.
2017-11-28 00:09:17 +00:00
Ed Morley 626edb59ad
Bug 1419167 - Vagrant: Remove unnecessary MSYS SSH pre-requisite (#2966)
Since recent Vagrant now bundles its own SSH client.
2017-11-20 22:54:18 +00:00
Ed Morley 3f5ef6b352 Bug 1418956 - Set yarn's no-bin-links option via .yarnrc
To save having to pass it each time when using `yarn {install,add}`.
2017-11-20 18:59:26 +00:00
Ed Morley 5d1b99fa79 Bug 1416257 - Docs: Clarify which node/yarn version should be used
Since for people installing node/yarn on their own (outside the
Vagrant environment) it can be confusing to work out which version is
appropriate, given node always has both an LTS and current release.
2017-11-20 18:59:26 +00:00