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

360 Коммитов

Автор SHA1 Сообщение Дата
Armen Zambrano a49979c5fb
docs: Update info for creating MySql users (#6484) 2020-06-03 13:40:17 -04:00
Armen Zambrano 030b2547dc
docs: Drop info about submitting data via Pulse (#6448) 2020-05-27 08:25:45 -04:00
Armen Zambrano b684475684
docs: Instruction on how to delete data for a project (#6449) 2020-05-22 17:07:28 -04:00
Kimberly Sereduck 08af433cac
specificed that a .env file must first be created (#6428)
Co-authored-by: Kimberly <ksereduck@mozilla.com>
2020-05-18 11:05:35 -07:00
Armen Zambrano 5ca21043df
Make poetry the default method for generating the docs (#6424)
This makes sure that serving the documentation via poetry does not regress
and we have a single way of generating them.

Setting the build backend in `pyproject.toml` makes `pip` to use `poetry` to install the dependencies. By doing so, readthedocs will be able to install the required dependencies to generate the docs (since they don't support poetry directly).
2020-05-15 15:12:35 -04:00
Shubhank Saxena 1892968e10
Document Tox as a requirement for running tests (#6338) 2020-04-22 11:15:44 -04:00
Armen Zambrano 857d72bff1
Move poetry configuration for docs to the top level (#6306)
There were some issues with the original instructions using poetry
for serving the docs.
2020-04-14 01:29:53 -04:00
Cameron Dawson 63646ad34e
Bug 1629139 - Update Pulse Docs and allow skip of ingestion (#6295) 2020-04-13 10:47:07 -07:00
Sarah Clements ca001cb46e
Update docs with grant access (#6276) 2020-04-13 09:45:50 -07:00
Kyle Lahnakoski 53a806d3cc
Test integrate black (#6277)
* Configuration for black

* changes congiguration

* change pyproject's directory

* add files to be excluded and skip string normalization

* removed isort from pre-commit

* remove version locks for black

* fix

* remove all isort

* update requirements

Co-authored-by: SuyashSalampuria <suyash546@gmail.com>
Co-authored-by: Kyle Lahnakoski <kyle@lahnakoski.com>
2020-04-08 14:47:37 -04:00
Cameron Dawson a31426bce0
Bug 1611334 - Remove support for GraphQL (#6235)
Co-authored-by: Kyle Lahnakoski <kyle@lahnakoski.com>
2020-04-07 17:36:57 -04:00
Suyash Salampuria d300d2424f
Merge ingest_push into ingest management command (#6197) 2020-04-07 16:38:53 -04:00
Shubham Kumar 10a2040774 Add markdownlint pre-commit hook and fixed docs
We also add it as part of the Travis execution.
2020-04-07 09:41:54 -04:00
Sarah Clements 29ffbe0ae2
Revert "Run markdown checks in Travis and add it as a pre-commit hook (#6236)" (#6269)
This reverts commit bf67e894b7.
2020-04-03 16:41:16 -04:00
Shubham Kumar bf67e894b7
Run markdown checks in Travis and add it as a pre-commit hook (#6236)
Closes #6185 

- Add markdownlint default rules
- Add `pre-commit` in `dev.txt` with proper hashing required when running Travis
- Add hook in `.pre-commit-config.yaml`
- Refer [here](https://github.com/igorshubovych/markdownlint-cli) for documentation
2020-04-03 09:50:26 -04:00
Kyle Lahnakoski 0fe0362759
Use pip-tools for requirements (#6140)
* update imports, add pip-tools

* first compiled output

* add *.in files (copy of *.txt)

* common.txt from master

* update *.in

* allow upgrade on big-query requirements.txt

* run --upgrade

* example upgrade

* docs

* fix install order

* show how to slim requirements/common.in

* isort

* slim common.in

* isort

* run pip-compile

* fix formatting

* ensure requirements/common.txt is installed last

Co-authored-by: Kyle Lahnakoski <kyle@lahnakoski.com>
2020-04-01 08:15:15 -04:00
Armen Zambrano a3a50d4ccd
Travis: Run Python tests outside of Docker container (#5943)
* Add Travis job to run Python tests outside of Docker
* `runtests.sh` is renamed to `runchecks.sh` and it does not run Python tests
* `manage.py check --deploy` was duplicated in Travis
* Update testing documentation
* Remove `-bb` since it is not needed since Python 3.5
2020-03-20 14:58:11 -04:00
Sarah Clements fbd8c4cc23
Enable pdb in a docker container (#6159)
Add config changes to docker-compose file to support pdb and update docs
2020-03-19 11:07:31 -07:00
Armen Zambrano 24194441aa
Bug 1509181 - Github ingestion: Ingest pushes in the right order (#6070)
Git based projects can list pushes in the UI incorrectly. This can be caused by commits having been ammended on a PR or merges of old commits.

Using the committer's date (the date when the PR gets merged) instead of the author's date to determine push time fixes the sorting problem.

This change also includes:
* Support for manual ingestion of Git pushes
* Support for ingesting the latest commits for a repo
* Script to compare pushes between Treeherder instances

## Script to compare pushes between Treeherder instances

`compare_pushes.py` compares the last 50 pushes of various projects for different Treeherder instances. The output generates links to each instance and revision to visually compare.

```console
% ./misc/compare_pushes.py --projects android-components,fenix,reference-browser,servo-master,servo-auto,servo-try
Comparing android-components against production.
Comparing fenix against production.
Comparing reference-browser against production.
{"values_changed": {"root['push_timestamp']": {"new_value": 1582580346, "old_value": 1582581477}}}
https://treeherder.allizom.org/#/jobs?repo=reference-browser&revision=547a18b97534b237fa87bd22650f342836014c4e
https://treeherder.mozilla.org/#/jobs?repo=reference-browser&revision=547a18b97534b237fa87bd22650f342836014c4e
Comparing servo-master against production.
Comparing servo-auto against production.
Comparing servo-try against production.
```
2020-03-10 14:29:07 -04:00
Shubhank Saxena 4a3472cddf
Docs: Polish pre-commit section (#6113)
Co-authored-by: Armen Zambrano <armenzg@users.noreply.github.com>
2020-03-10 11:37:04 -04:00
Shubhank Saxena 6e309c67e2
Use poetry to generate docs (#6067) 2020-03-09 13:58:01 -04:00
ionutgoldan d6fbb10458
Bug 1544367 - Update the full-stack development section of TH 2020-03-06 11:53:09 +02:00
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