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

395 Коммитов

Автор SHA1 Сообщение Дата
EvaBardou 2c4ed9f341
Support production/testing mozci environments in ClassificationLoader regex (#7419)
Co-authored-by: Eva Bardou <ebardou@teklia.com>
2022-04-13 15:34:03 +02:00
EvaBardou 00cd6a9187
Bug 1754464 - Store some failures classification from mozci as FailureClassification (#7406)
* Add a step to autoclassify some intermittent jobs during mozci ingestion

* Add error handling

* Link the Bugzilla single tracking bug during autoclassification

* Small fixes related to Bastien's review

* Proper logic for autoclassification Bugzilla bug linking

* Nit

Co-authored-by: Eva Bardou <ebardou@teklia.com>
2022-03-23 09:20:44 -07:00
EvaBardou 32679c1f5a
Bug 1746622 - Listen to mozci classification pulse messages and save results in Treeherder database (#7356)
* Listen to mozci classification pulse messages and save results in Treeherder database

* Nits and suggestions

* Fix tests

* Revert changes

* Add unit tests + Fix review related code snippets

* Nit

* Add a dedicated command to listen to mozci classification pulse messages

Co-authored-by: Eva Bardou <ebardou@teklia.com>
2022-02-07 09:27:51 -08:00
Aki Sasaki 228750c577
remove references to mozilla-releng-blobs (#7279) 2022-01-05 14:46:53 +00:00
Sebastian Hengst f8d0556fe3
Bug 1422706 - reopen incomplete bugs used for classifications (#7323) 2021-12-17 11:31:54 +00:00
Sebastian Hengst 54be39dc7f
Bug 1719848 - search for test file name during generation of bug suggestions must match it at the start of the file name (#7206)
There are short or common test file names like 001.html. When Treeherder tries
to generate bug suggestions for that, it searches the intermittent bugs for
001.html in the summary which also matches other-test-001.html. If too many
bugs are returned (>20), Treeherder won't suggest any bugs.

By matching on path boundaries (/, \), whitespace () and list separators (,),
the other test files won't be matched. Because adding these rules to the SQL
query yields a slower method than filtering the wrong positive bugs out
afterwards, the latter method gets applied. This keeps the risk the SQL query
will not return all matches (limited at 50 lines) and has to be reevaluated if
it turns into an issue.
2021-07-13 17:33:26 -07:00
Sarah Clements 0b4602c8a3
Improvements to ingesting data locally - doc and docker changes (#7134)
* Update docker-shared-user for pulse_url and add PROJECTS_TO_INGEST to backend container
* Update docs to make them clearer
* Fix exception caught in pytest.raises
2021-05-13 14:20:07 -07:00
ionutgoldan 735ee594af
Bug 1570906 - Don't alert on Tier 3 perf jobs
* parameterize ingestion test with job tier
* provide slight refactors on test code
* refactor complex alerting conditions
* split alert generation (test) scenarios in happy/unhappy paths
* address some PyCharm inspection warnings
2021-03-24 09:03:59 +02:00
Cameron Dawson 26f955d319
Bump mozci, taskcluster and adr (#6932) 2020-12-22 16:52:24 -08:00
ionutgoldan 727e05b31b
Bug 1671893 - Convert from int timestamp (#6816) 2020-10-19 10:15:06 -07:00
ionutgoldan 7b863dcb41
Bug 1654496 - Ingest and present perf test information generated by multi commit builds 2020-10-08 09:38:58 +03:00
Cameron Dawson 1250108abe
Upgrade pip dev packages (#6742)
* Upgrade pip dev packages
* Fix formatting with black
2020-08-31 11:01:43 -07:00
Armen Zambrano 59fbd290a8
Bug 1656036 - Polish logic to ignore ingestion of tasks (#6672)
* Bug 1656036 - Polish logic to ignore ingestion of tasks
* Fix tests for cb162057aa
2020-07-30 11:29:22 -04:00
Sarah Clements 507881a7b8
Remove step parser v3 (#6634)
* remove StepParser and switch to ErrorParser
* remove writes to TextLogStep from artifact.py
* remove buildbot ref in builders
* replace TextLogStep model in DetailsPanel, SimilarJobsTab and logviewer App
* cleanup DetailsPanel
* remove old log parsing tests and update others
* add logging to error_summary.py
* add parse max error lines limit to ErrorParser
* fix in similar jobs tab for Bug 1652869
2020-07-17 10:28:01 -07:00
Armen Zambrano G 7430583ff7 Revert "Bug 1633041 - Remove step parser v2 (#6611)"
This reverts commit 1d1be59d29.
2020-07-16 09:35:52 -04:00
Sarah Clements 1d1be59d29
Bug 1633041 - Remove step parser v2 (#6611)
* remove StepParser and stop storing steps in TextLogStep
* remove more buildbot references 
* replace TextLogStep model in DetailsPanel and logviewer App
* remove old log parsing tests and update other tests
* add logging to error_summary.py
2020-07-14 10:57:09 -07:00
Sarah Clements bed22bf0da
Revert "Bug 1633041 - Remove step parser and TextLogStep table (#6546)" (#6598)
This reverts commit 7d3d8ae902.
2020-07-09 11:04:04 -07:00
Sarah Clements 7d3d8ae902
Bug 1633041 - Remove step parser and TextLogStep table (#6546)
* remove StepParser and stop storing steps
* replace TextLogStepModel in the UI with text-log-errors API
* remove old references to buildbot
* update and cleanup tests
2020-07-08 14:57:40 -07:00
Sarah Clements d251842d30
Bug 1633041 - Add Job to TextLogError and create backfill command (#6575)
* rename builds-4h to live_backing_log
* add foreign key to Job on TextLogError table
* remove TextLogErrorViewset and test
* add management command to backfill job ids and update artifact.py
2020-07-07 11:55:07 -07:00
Cameron Dawson 60fa75d4ee
Bug 1646753 - Increase size of job_type.name field (#6539) 2020-06-23 16:34:53 -07:00
Sarah Clements 8f0c3a771f
Bug 1342296 - remove job detail table (#6427)
* remove JobDetail API and UI usage
* remove JobDetailModel
* update treeherder client
* update tests
2020-05-19 17:11:54 -07:00
Sarah Clements d598ad4544
Bug 1603249 - Remove job artifacts storage and TinderboxPrint parsing (#6349)
* remove artifact storage in the job loader
* remove BuildbotJobArtifactBuilder and TinderboxPrint parser
* update pulse-job schema and tests
2020-05-07 09:54:06 -07:00
Armen Zambrano 368c112266
Apply black formating to the whole repo (#6332)
* Automatic black fixes
* Add conflicting rule exceptions between black and flake8
2020-04-21 10:35:59 -04:00
Sarah Clements 77bf3ab9a2
Bug 1603249 - Use taskcluster API to fetch artifacts in UI (#6242)
This is part 1 of this bug and only makes changes to how JobDetails API
is used in the UI to retrieve uploaded artifacts. It updates ReplicatesGraph,
DetailsPanel, UnsupportedJob and LogViewer App. Adds helpers and updates tests.
2020-04-03 11:38:27 -07: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
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
ionutgoldan a50bd4f731 Bug 1587393 - Provide backend support for tagging performance signatures (#5532) 2019-11-15 08:43:58 -05: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
octavian-negru c0d49d8c7e Bug 1584936 - Ingest available measurement units 2019-10-10 14:24:36 +03: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
Armen Zambrano f184dc058e Bug 1553565 - Try different runs for the Gecko decision task (#4996) 2019-05-22 14:01:19 -07:00
Ed Morley 5f21ad4a79
Bug 1526911 - Close performance-artifact.json after opening it (#4707)
Fixes:

```
ResourceWarning: unclosed file <_io.TextIOWrapper name=
    'schemas/performance-artifact.json' mode='r' encoding='UTF-8'>
```
2019-02-27 19:56:33 +00:00
Ed Morley d726fe7313 Bug 1530267 - Remove __future_ imports
Since they are a no-op on Python 3.
2019-02-25 20:39:03 +00:00
Ed Morley 7060eef007
Bug 1527020 - Travis: Enable unit tests under Python 3 (#4619)
To help prevent regressions whilst the remaining xfailed tests are fixed.
2019-02-11 20:31:20 +00:00
Ed Morley 8b678c9758 Bug 1453967 - Add tests to ensure job/perf hashes remain consistent 2019-02-11 17:55:26 +00:00
Ed Morley 7f3e41f712
Bug 1526763 - Remove `.encode()` from test_load_non_ascii_textlog_errors (#4617)
Since by design `.encode()` returns bytes, whereas the test should be using
a string. The goal of the encode seems to have been to handle unicode
correctly, however that's now achieved via the use of:
`from __future__ import unicode_literals`

Fixes the following exception under Python 3:
`TypeError: Object of type bytes is not JSON serializable`
2019-02-11 17:51:48 +00:00
Ed Morley 35c9fd9fd8 Bug 1513486 - Simplify _taskcluster_runnable_jobs()
The `decision_task_id` parameter has been removed since it's no longer used.
2019-02-08 18:53:58 +00:00
Simon Sapin 84d92b43e4 Bug 1513715 - Support associating a "repository" with multiple GitHub branches (#4371)
* Add a test for a multi-branch repository
* Disable servo-try-taskcluster
2018-12-18 14:12:56 -08:00
Simon Sapin dbfc2afcbf Fix import of force-pushes from github (#4284)
When `git push -f` is used, the "base" commit of the github push event
is whatever was previously in that branch.
That commit is likely not part of the history of the new branch,
so using the "List commits" API will not allow to find it
as a starting point.
Instead, if the API did not force pagination, we’d get the entire
repository history!

Using the "Compare two commits" API instead lets GitHub’s server
figure out which commits reachable from the new branch
that were not before, which is exactly the set of commits we need
to be "part of a push".
2018-11-16 12:36:05 -08:00
ionutgoldan 9168eba8e8 Bug 1431085 - Increase max length of PerformanceSignature.extra_options (#4238) 2018-11-14 09:22:11 +00: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 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
George Hickman 9d29a26309 Replace uses of some_queryset.all()[0] with some_queryset.first() 2018-08-14 09:25:24 +01:00
Ed Morley 1b52b07728
Bug 1445325 - Stop mirroring classifications to OrangeFactor (#3677)
Now that consumers of OrangeFactor have been switched to the new
intermittent failures view UI/API, we can stop submitting failure
classifications to OrangeFactor's Elasticsearch instance.
2018-08-03 00:16:35 +02:00
Ed Morley e0a9fe9bbf Bug 1113235 - Move custom ETL exceptions to their own module
This helps avoid circular import errors in the next commit (via the
`treeherder/workers/task.py` import of `MissingPushException`.
2018-07-31 20:06:40 +02:00
George Hickman c8b114105c Pull ETL settings into appropriate modules 2018-07-02 13:22:18 +01:00
ionutgoldan 6becf445a3 Bug 1443777 - Bug links from old alert summaries are broken (#3560)
Make issue_tracker column non nullable and fix broken tests
2018-05-23 11:13:51 -04:00