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

408 Коммитов

Автор SHA1 Сообщение Дата
Joel Maher ca3225d270
add new_open field to bug job map. (#8279)
* add new_open field to bug job map.

* Add support for bug_open field to bug_job_map when create or reopen bug.
2024-11-22 17:26:09 -08:00
Joel Maher 3fd8b1b5b3
WIP - add new_failure field to TextLogError and update when we have a new failure. (#8254) 2024-10-23 13:41:41 -07:00
Joel Maher f24ee11fb6
Allow for bugzilla management to use a minimum threshold for 'reopened bugs' (#8144) 2024-08-05 17:48:55 -07:00
Yoann Schneider 0d8335d790 N802: Function name should be lowercase 2024-03-05 16:17:10 +01:00
Yoann Schneider 1e2af20849 N803: argument name should be lowercase 2024-03-05 16:17:10 +01:00
Yoann Schneider 642cff92bf N806: variables in functions should be lowercase 2024-03-05 16:17:10 +01:00
Yoann Schneider 8028121253
Bug 1823654 - Introduce pyupgrade (#7904)
* Ruff Auto fix

* Ruff unsafe fixes auto fix

* Use builtin list instead of typing.List

---------

Co-authored-by: Sebastian Hengst <aryx.github@gmx-topmail.de>
2024-02-02 21:02:10 +01:00
Yoann Schneider cfb19a5ef8
Bug 1823654 - Mostly use double quotes (#7900)
* Enable quote style verifications from Black

* Actually exclude migrations folders
2024-01-31 16:59:20 +01:00
Bastien Abadie 1b45ad9fa7 Order in tests 2023-08-11 11:45:43 +02:00
EvaBardou b70edaa7ea New Black changes 2023-06-20 10:58:40 +02:00
Joel Maher fed927341e
support marking NEW failures as FC_id=6 (#7691)
* support marking NEW failures as FC_id=6

* change classification  ->
2023-05-16 05:41:29 -07:00
Valentin Rigal a0f5f0a81d
Update development dependencies (#7497)
* Update dev dependencies

* Remove responses match_querystring deprecation

* Fix linenumber indexes on artifact builder test samples

* Update requirements/dev.txt
2022-07-27 05:39:45 -07:00
Eva Bardou d4fe269f9f Prevent from overriding existing JobNote during mozci autoclassification 2022-06-15 18:25:32 +02:00
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