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

1745 Коммитов

Автор SHA1 Сообщение Дата
ionutgoldan c7c5672939
Bug 1571403 - Add assignee field to alert summary table 2019-08-23 17:40:29 +03:00
Armen Zambrano 03a3fd82e8
Merge pull request #5310 from mozilla/disable_test
Disable test_clear_filter because it times out too often preventing d…
2019-08-22 09:10:34 -04:00
Armen Zambrano G 90c3d98cf3 Disable no-unused-vars for few lines 2019-08-21 16:16:45 -04:00
Cameron Dawson 6581c84289 Fix retriggers and add new jobs 2019-08-21 12:02:26 -07:00
Cameron Dawson 9f37dc3343 Bug 1331399 - Reduce payload size and memory footprint of job data
This fixes the issues with retriggering and add-new-jobs that the
original PR introduced.  It also adds a few unit tests to catch
this potential mistake in the future.

This reverts commit ffd871ae34.
2019-08-21 12:02:26 -07:00
Cameron Dawson 8ad1b1fec0 Bug 1572095 - Fix commit/revision links after changing repo 2019-08-16 15:30:35 -07:00
Cameron Dawson ffd871ae34 Revert "Bug 1331399 - Trim job data that we store"
This reverts commit 613d7f0172.
2019-08-14 11:58:40 -07:00
Cameron Dawson 613d7f0172 Bug 1331399 - Trim job data that we store 2019-08-13 14:45:21 -07:00
Cameron Dawson c58badbe60 Bug 1510280 - Convert PinnedJobs context to Redux 2019-08-12 14:08:49 -07:00
Cameron Dawson f408887675
Bug 1572255 - Fix set top and bottom of range links (#5253) 2019-08-08 12:19:23 -07:00
Armen Zambrano G 879918708a Switch from `jest-dom` to `@testing-library/jest-dom`
`jest-dom` has moved to `@testing-library/jest-dom`. Please uninstall jest-dom and install `@testing-library/jest-dom` instead,
or use an older version of `jest-dom`. If you do upgrade to `@testing-library/jest-dom`, make sure to update your usage of `jest-dom`
to use `@testing-library/jest-dom/extend-expect` rather than simply `jest-dom/extend-expect`. Learn more about this change here:
https://github.com/testing-library/dom-testing-library/issues/260 Thanks!
2019-08-08 10:10:16 -04:00
Alexandru Irimovici fd7f541076 Bug 1553719 - Trim revision id for compare chooser 2019-08-07 09:48:19 +03:00
Cameron Dawson 5d4ca44e7d
Rename details selectedJob to selectedJobFull (#5230)
* Rename details panel ``selectedJob`` to ``selectedJobFull``

The job that's passed in the DetailsPanel has a bunch of extra fields
that are not in the normal downloaded list of jobs.  So I wanted to
depict that ``selectedJob`` is not the same thing as what you see
in the DetailsPanel.

* Stop using Redux where not necessary

I was using Redux to assign the selectedJob in a few details
classes when I should have just passed it where it was needed.

* New addAggregateFields function

Instead of using a more heavy weight JobModel for each job,
we just persist some fields that were getting constantly calculated
over and over.  This was especially true during filtering and re-rendering.

* Remove some cruft leftover from Buildbot.
2019-08-06 12:10:33 -07:00
ionutgoldan a5df8a966b
Bug 1346567 - Re enable Perfherder data cycler 2019-08-02 16:04:24 +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
Cameron Dawson 9181ff4b94 Bug 1510280 - Convert Pushes context to Redux 2019-07-22 15:46:17 -07:00
Sarah Clements 067980486e
Perf summary api change (#5140)
Modify performance/summary endpoint to accommodate perfherder graphing needs:
* modify logic so signature query param does not filter on parent_signature__isnull
and add all_data param to return performance data as a list of objects with additional
data like PerformanceDatum
* add condition to all_data and return revision, repo name and repository_id
* accept multiple signatures
* make startday and endday optional if interval is provided
2019-07-12 12:12:44 -07:00
Kohei Yoshino db26ab5c7b Bug 1531759 - Modify treeherder's bugfiler to set bug type as 'defect' (#5132) 2019-07-10 14:00:15 -07:00
Cameron Dawson 5993dea2dc
Cleanup tests/ui folder (#5120) 2019-07-05 09:48:22 -07:00
Cameron Dawson fe5e808729
Mark perfherder test skipped due to unexplained failing (#5121) 2019-07-03 18:37:54 -07:00
Sarah Clements 44463206f9 install newly scoped testing library 2019-06-21 14:21:31 -07:00
Sarah Clements 0cab1eafcc
Bug 1519991 - Convert graphs chooser controller to React (#5053)
Create TestDataModal component with redesigned layout; refactor FilterInput to use debounce for on-the-go filtering.
2019-06-15 17:16:32 -07:00
Cameron Dawson d982fb2060
Bug 1438555 - Fix 'n' after classifying going to top failure (#5063) 2019-06-14 11:41:02 -07:00
Sarah Clements c12ca9a8fa
Bug 1558752 - Fix alert summary checkbox on Perfherder alerts view (#5061)
Fix alert summary checkbox functionality for when one alert is deselected; add another test to cover this scenario.
2019-06-12 16:22:51 -07:00
KWierso 15c2d1973d Bug 1552250 - Make autoland the default repo (#5051)
Most landings these days are going to autoland rather than
mozilla-inbound, so lets default to showing autoland if no repo is
specified.
2019-06-10 15:39:58 -07:00
Sarah Clements cfde588e43
Bug 1523710 - Convert alerts view to react (#5005)
replace all angular partials and controllers with react components;
write tests for filters and different alert functionality
2019-06-03 11:53:44 -07:00
KWierso 2e5c8deb5f Bug 1555864 - Fix bugfiler's use of bugzilla's product/component search (#5020)
Bugfiler used an undocumented bugzilla api to search for
product/component pairs, and bugzilla recently moved the api endpoint,
breaking the bug filer. This patch points to the correct endpoint.
2019-05-30 17:06:29 -07:00
Armen Zambrano f184dc058e Bug 1553565 - Try different runs for the Gecko decision task (#4996) 2019-05-22 14:01:19 -07:00
Cameron Dawson 80476fd951
Bug 1550273 - Remove tests from need investigation that are classified (#4953) 2019-05-09 12:54:02 -07:00
Sebastian Hengst 622b43638d Bug 1546171 - Do not set priority for intermittent failure bugs which are crashes (#4928) 2019-05-07 09:16:21 -07:00
ionutgoldan cb09eee985
Bug 1536040 - Measure time-to-bug 2019-05-07 17:26:52 +03:00
Cameron Dawson dbe14844ea
Fix circular dependency in JobModel/PushModel (#4929) 2019-04-30 15:15:15 -07:00
Eric Rahm 254d42956a Bug 1544149 - Use markdown in the bug filer (#4888)
This updates the bug filer to use markdown in the bugzilla bug
description. It adds bolded labels to the `Filed by` entry and any URLs
specified. Addtionally the comment is surrounded in a code fence so
that long lines aren't wrapped and lines that also happen to have
markdown formatting in them are ignored.

Example output:

**Filed by:** foo [@] bar.com
**Parsed log:** http://.../parsed.log.html
**Full log:** http://.../full.log.html

---

```
[task 2019-03-06T03:54:26.459Z] 03:54:26 INFO - TEST-FAIL...
[task 2019-03-06T03:54:26.460Z] 03:54:26 INFO - INFO | LeakSanitize
...
```
2019-04-26 14:07:31 -07:00
Joel Maher 93938771fe Bug 1547238 - SETA - mark new jobs as low priority. r=camd (#4917) 2019-04-26 09:06:35 -07:00
Sarah Clements adffcc2c24
Perfherder - modify AlertSummary serializer (#4908)
return revision, prev_push_revision and push_timestamp
2019-04-24 11:34:18 -07:00
ionutgoldan 33eeaeb7db
Bug 1532995 - Provide tests for compare replicates 2019-04-23 15:14:10 +03:00
Cameron Dawson c23fafb518
Revert "Bug 1346567 - Make dedicated cyclers" (#4854)
This reverts commit fa533ff25a.

Ends up there's a bug with this change. The plan is for @ionutgoldan to create a new PR with just the migration and model change for PerformanceDatum which we can deploy. Then he can re-implement his code changes from this PR and we'll already be done with the lengthy migration to add the index.
2019-04-02 15:28:57 -07:00
ionutgoldan fa533ff25a
Bug 1346567 - Make dedicated cyclers
Add index to performance_datum.push_timestamp field
Add more expire parameters for Perfherder data cycler
Don't keep perf data indefinitely
Have a debugger which logs even on production
2019-04-01 17:45:08 +03:00
Sarah Clements 1f6809a751
Bug 1509216 - Convert Perfherder compare and comparesubtests views to react (#4811)
Move compare files to new directory, set up validation HOC and
create components for compare view and compare subtests views
2019-03-25 18:54:53 -07:00
Cameron Dawson 1baaabd54d
Bug 1521157 - Group by classifications (#4812) 2019-03-25 09:44:05 -07:00
Cameron Dawson 71e887326c
Bug 1521157 - Have Push Health prototype return live data (#4787)
This has some of the logic for detecting intermittents.  But it is
still a work in progress.  It only does some of the detection
so far.
2019-03-15 17:44:13 -07:00
dependabot[bot] c355983fe5 Bump isort from 4.3.10 to 4.3.12 in /requirements (#4760)
Bumps [isort](https://github.com/timothycrosley/isort) from 4.3.10 to 4.3.12.
- [Release notes](https://github.com/timothycrosley/isort/releases)
- [Changelog](https://github.com/timothycrosley/isort/blob/develop/CHANGELOG.md)
- [Commits](https://github.com/timothycrosley/isort/commits)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-03-06 14:54:00 -08:00
Cameron Dawson 200eef2779 Bug 1531243 - Fix ESLint rule jsx-a11y/anchor-is-valid 2019-03-06 10:32:26 -08:00
ionutgoldan 54ed00a305
Bug 1519290 - Convert compare replicates view to React 2019-03-06 11:40:52 +02:00
ionutgoldan b0d1ed28e0 Bug 1532230 - Disable nudge feature (#4750)
Disable nudge buttons and add a tooltip explaining that it's been disabled.
2019-03-05 18:27:48 -08:00
Sebastian Hengst e84b3cd430 Bug 1530966 - Increase threshold for suggested bugs to be recent to 365 days (#4716) 2019-03-05 06:55:16 +00:00
ionutgoldan 9c64eafc60 Bug 1521025 - Add extra timestamp fields on perf alerts (#4600)
* Bug 1521025 - Configure timestamps on endpoints
Add new fields to PerformanceAlert and PerformanceAlertSummary models. Override update methods in corresponding serializers to update specific fields. Add new component tests and update summaries only at endpoint level.
2019-03-01 09:51:27 -08:00
Ed Morley 0809a5bd57
Bug 1337717 - Update to newer Celery, Kombu, py-amqp and billiard (#4722)
Updating in one go, since the Celery 4 release only supports the newer
versions of its dependencies and vice versa.

Of note, this fixes the unhelpful connection error messages shown when
in fact there was an authentication problem, and brings Celery/Kombu
support for Python 3.7. It's also likely that this will fix the pulse
listener hang seen in bug 1529404.

The new Celery release has renamed a number of the settings.
Most changes were performed by running:

```
celery upgrade settings treeherder/config/settings.py --django
celery upgrade settings tests/settings.py --django
```

The Django integration in celery.py has been cleaned up by following:
https://celery.readthedocs.io/en/latest/django/first-steps-with-django.html

The bug being hit that caused this to be reverted back in #2119/bug 1333079
was due to Celery 4 no longer supporting calling `apply_async()`
with just the `routing_key` - it now has to be called with either just
the `queue`, or else both the `routing_key` and `queue`, otherwise the task
ends up in the `default` queue. Sadly this isn't mentioned in the Celery
breaking changes list - I'll file an upstream issue shortly.

Changes:

http://docs.celeryproject.org/en/master/history/whatsnew-4.0.html
http://docs.celeryproject.org/en/master/changelog.html#rc1
https://github.com/celery/celery/compare/v3.1.26...v4.3.0rc1

http://docs.celeryproject.org/projects/kombu/en/stable/changelog.html#version-4-3-0
https://github.com/celery/kombu/compare/v3.0.37...v4.3.0

https://amqp.readthedocs.io/en/stable/changelog.html
https://github.com/celery/py-amqp/compare/v1.4.9...v2.4.1

https://github.com/celery/billiard/blob/v3.6.0/CHANGES.txt
https://github.com/celery/billiard/compare/v3.3.0.23...v3.6.0
2019-02-28 19:52:22 +00:00
Ed Morley c3f0d31cb1
Bug 1530586 - Auth: Remove legacy header support (#4704)
Since enough time has passed since #4697 (bug 1529223) landed for people
to refresh any existing Treeherder UI tabs (that will have still been
using the old header names/values).
2019-02-27 21:10:21 +00: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 8aa5d30cad
Bug 1506805 - Convert job-view and userguide to react-fontawesome (#4710)
This is the second part to the Font Awesome conversion started in #4556.

After this PR, all that is left is the Perfherder parts, which can be
converted from the inline HTML style SVG+JS to using
`@fortawesome/react-fontawesome` as part of the React conversion.
2019-02-27 17:58:55 +00:00
Ed Morley 5986749757
Bug 1530602 - Adjust Content-Security-Policy to fix ajv.compile() (#4703)
Unfortunately the "Custom Actions" usage of `ajv.compile()` requires that
the `script-src` CSP directive contain `'unsafe-eval'`, otherwise the
whole feature breaks.

Using `'unsafe-eval'` defeats much of the point of CSP, so it should be
removed as soon as possible. Bug 1530607 is filed to track.
2019-02-26 08:04:53 +00:00
Ed Morley 4704764a89 Bug 1530267 - Remove explicit class inheritance from `object`
Since with Python 3 all classes inherit from it by default.
2019-02-25 20:39:03 +00:00
Ed Morley 248733bc69 Bug 1530267 - Remove use of six.iteritems() 2019-02-25 20:39:03 +00:00
Ed Morley e3e17266e6 Bug 1530267 - Remove use of Django's `smart_text` 2019-02-25 20:39:03 +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 ca99c3cca8 Bug 1529223 - Auth: Rename `IdToken` header to `Id-Token`
For consistency with the other headers (and seeing as we already have
to have a fallback for `ExpiresAt`, we can remove both later at the
same time).
2019-02-25 20:16:59 +00:00
Ed Morley e643b8e4e7 Bug 1529223 - Auth: Use seconds not milliseconds for expiration handling
Previously the frontend would calculate the access token expiry timestamp
in milliseconds and pass it to the `/login/` API via an `ExpiresAt` header.
The backend would then convert both the Id Token's `exp` and current time
to milliseconds, when calculating the earliest expiry. The result then
had to be converted back to seconds for use with Django's session
`.set_expiry()`.

It is instead much simpler to leave everything in seconds, since none of
the Auth0-provided inputs were in milliseconds to start with, so there is
no loss of precision, just fewer conversions required. Timestamps are also
more commonly in seconds, so use of seconds is less surprising.

After this is deployed there will initially be users who have old frontend
pages open that are still sending the expiry as milliseconds. In order to
be able to differentiate between new and old clients, the header has been
renamed to `Access-Token-Expires-At` (which also makes it clearer as to
what the expiry is for, given there is also an Id Token expiry), and a
temporary fall-back added to the backend that can be removed after a few
days has passed.
2019-02-25 20:16:59 +00:00
Ed Morley 6c05a78eb4 Bug 1529223 - Auth: Gracefully handle invalid Id Tokens
Rather than returning an HTTP 500.
2019-02-25 20:16:59 +00:00
Ed Morley f99d181b2e Bug 1529223 - Auth: Gracefully handle missing IdToken header
Rather than returning an HTTP 500.
2019-02-25 20:16:59 +00:00
Ed Morley 8a0c34ca0b Bug 1529223 - Auth: Simplify handling of the Authorization header
And add more tests.
2019-02-25 20:16:59 +00:00
Ed Morley b7f7530845 Bug 1529223 - Auth: Correctly set Django session expiry for new users
Since previously the session length was only set for returning users.
The tests have been updated to now cover both cases.
2019-02-25 20:16:59 +00:00
Ed Morley 55943cac98 Bug 1529223 - Tests: Merge test_backends.py into test_auth.py
Since `test_get_username_from_userinfo` is a little too narrowly-scoped
and would be better as an API test. It has been combined with two other
tests in `test_auth.py` to give a more representative workflow test.
2019-02-25 20:16:59 +00:00
Ed Morley aec7b5bde7 Bug 1529223 - Tests: Move test_existing_email_create_user to test_auth.py
Since it's testing using the API so doesn't belong in test_backends.py.
The test has also been rewritten to be clearer about what it's checking.
2019-02-25 20:16:59 +00:00
Ed Morley 48a4c1a0b3 Bug 1529223 - Tests: Clean up user fixtures
Since:
* They don't need to use the slower `transactional_db` fixture that has
  advanced transaction-inspecting support.
* They don't need to add a request finalizer, since the `db` fixture
  cleans up the User during test teardown automatically.
* `User` does not need to be imported locally.

This speeds up `test_auth.py` by 4x.
2019-02-25 20:16:59 +00:00
Ed Morley 8253f9991b Bug 1529223 - Tests: Correct name/description for test_login_no_email
Since the name/description references the pre-auth0 implementation that
was removed in #3144. The `test_user` fixture has also been removed,
since it is not required for the test to run (the error referenced in
the comment no longer occurs).
2019-02-25 20:16:59 +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 52d6017c5b
Bug 1295997 - Skip parsing logs whose compressed size exceeds 5MB (#4700)
Occasionally failing build/test runs can fail in such a way that results
in a significant amount of log spam and therefore log files that are
hundreds of MB in size each. This can cause log parsing backlogs,
particularly when many jobs on the same push fail in such a way.

The log parser now checks the `Content-Length` of log files prior to
streaming them, and skips the download/parse if it exceeds the set
threshold. The frontend has been adjusted to display an appropriate
message explaining why the parsed log is not available.

The threshold has been set to 5MB, since:
* the 99th percentile of download size on New Relic was ~2.8MB:
  https://insights.newrelic.com/accounts/677903/dashboards/339080
* `Content-Length` is the size of the log prior to decompression, and
  the chronic logspam cases have been known to have compression ratios
  of 20-50x, which would translate to an uncompressed size limit of
  up to 250MB (which is already much larger than buildbot's former 50MB
  uncompressed size limit).
2019-02-25 19:04:38 +00:00
Sarah Clements 5a47eca3c3
Add tests for Perfherder's compare table using react-testing-library (#4647) 2019-02-24 15:37:11 -08:00
Ed Morley ecabd76f96
Bug 1453837 - Use correct value for id token expiry in auth tests (#4667)
The id token payload contains an `exp` property, which is an integer
representing the number of seconds past the epoch at which the id token
expires.

However the mocked value in our authentication tests was the string `'500'`,
which is neither the correct data type, nor a timestamp. This meant that
during tests only, the `min(accesstoken_exp_in_ms, idtoken_exp_in_ms)`
in `AuthBackend.authenticate()` was comparing an int and a string, which
under Python 3 results in:

`TypeError: '<' not supported between instances of 'str' and 'int'`

A later bug/PR will refactor the auth backend to fix issues unrelated to
Python 3 compatibility and add more test coverage.
2019-02-22 13:50:01 +00:00
Ed Morley 7833ba2bb7 Bug 1270157 - Update the report-only CSP header
Makes the following changes to the initial header added in #4678:

1) Adds a `frame-src` directive

Whilst the Auth0 domain is already whitelisted in `connect-src` allowing
initial logins to work, Auth0.js renewals are performed in an iframe, so
need both the auth0 domain and `'self'` (for the `/login.html` callback)
to be permitted via `frame-src`.

2) Adds https://taskcluster-artifacts.net to `connect-src`

Since some requests to `queue.taskcluster.net` redirect to it (eg for the
"Add new jobs" feature), and for redirects both the original and new domain
need whitelisting.

3) Adds `'report-sample'` to `script-src` and `style-src`, which makes
the browser send JS/CSS samples for any violations of the "inline" rules,
making it easier to debug collected CSP violation reports.
2019-02-22 12:17:33 +00:00
ionutgoldan d7e3f7636d
Bug 1529270 - Rename alert summaries last_updated field to created 2019-02-22 11:31:15 +02:00
Ed Morley 5b7209be29
Bug 1270157 - Add a report-only CSP header and report collection API (#4678)
This adds a `Content-Security-Policy-Report-Only` header for static assets
served by WhiteNoise (such as our frontend), which includes a first pass
at a possible policy that should work for Treeherder.

The header also includes a `report-uri` directive, which points at a newly
added API for collecting CSP violation reports. Reports are logged as
warnings (so will appear in Papertrail) and sent to New Relic as a custom
event. This will allow us to see whether the policy would block valid
requests, so we can refine it prior to converting to the real (ie blocks
things) `Content-Security-Policy` header.

The addition of `ng-csp` to `perf.html` is to enable AngularJS's ngCSP
feature, which turns off use of `eval()` and automatic stylesheet
injection, so that the policy directives `unsafe-eval` and
`unsafe-inline` don't have to be used. This requires us to then manually
import the AngularJS stylesheet to include the styles that would have
previously been injected:
https://docs.angularjs.org/api/ng/directive/ngCsp

See:
https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP
https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy
https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy-Report-Only
2019-02-22 06:48:12 +00:00
Ed Morley 4fe1fa89fb
Bug 1528833 - Remove obsolete TreeherderClient methods (#4662)
* `get_resultsets()` has been deprecated for some time
* the other methods being removed are for API endpoints that no longer
  exist after #3222 (bug 1437968)
2019-02-20 06:53:26 +00:00
Ed Morley f6ecbdd8b6
Bug 1528811 - Remove job-collection related classes from thclient (#4661)
These were formerly used when submitting job data using the Python client
(support for which was removed in bug 1349182), and in `buildapi.py` as
part of buildbot ingestion (until #4087 / bug 1443251).

This removes the final usages in our tests so we can drop them entirely.
2019-02-20 06:49:54 +00:00
Ed Morley 681cc6d54f Bug 1527868 - Update tests to handle Elasticsearch not being configured
Whilst Treeherder itself correctly handled `ELASTICSEARCH_URL` not being
set, the tests were dependant on the availability of Elasticsearch.
2019-02-14 21:10:21 +00:00
Ed Morley e1ebb72c1d Bug 1526743 - Clean up log parsing test utilities
Previously any exceptions raised whilst loading the expected output JSON
fixtures were suppressed, which made debugging the Python 3 test failures
harder than needs be.

The reason failures were suppressed was to allow the test to continue far
enough that the actual output could be saved to the fixture when creating
new tests. However reordering `do_test()` has the same effect without the
need for the `load_exp()` try-except handling.
2019-02-12 20:00:16 +00:00
Ed Morley 4bdf9f9101 Bug 1526743 - Explicitly .decode() streamed log lines
Since the `request` package's `iter_lines()` returns bytes by default.

We cannot pass `decode_unicode=True` to `iter_lines()` since it splits on
Unicode newlines (which can exist in test message output), so instead we
manually `.decode()` each line before parsing it.

Fixes the following exception under Python 3:
`TypeError: a bytes-like object is required, not 'str'`

The test utility `load_exp()` had to be modified to no longer use append
mode when opening the expected output JSON files, in order to fix:
`json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)`
2019-02-12 20:00:16 +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 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 468bbd1df4
Bug 1526764 - Make test_intermittents_commenter pass under Python 3 (#4615)
* Switches from `.iteritems()` to `.items()` in the Jinja template.
* Removes an assert from `test_intermittents_commenter` that is redundant
  (due to `match_querystring=True`) and non-deterministic across Python
  versions (due to the query string params being affected by dict order).
2019-02-11 17:51:15 +00:00
Ed Morley 4eafa613ab
Bug 1526682 - Remove Python 3 incompatible usage of filter() (#4606)
Python 3's `filter()` now return iterators rather than list/..., so must
be cast back to a `list()` if used in contexts where an iterator is not
supported. However in this case `first` fulfils the goal more cleanly.

Fixes:
`TypeError: 'filter' object is not subscriptable`
2019-02-11 15:16:04 +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
Ed Morley 9c3985a2e7 Bug 1513486 - Flatten list_runnable_jobs() return value
None of the callers use anything but the `results` property, so the other
properties have been removed.
2019-02-08 18:53:58 +00:00
Ed Morley 6483b387c8 Bug 1513486 - Remove RunnableJobsClient
Since it's never called with the `task_id` parameter, and when the task ID
is not set, the return value is identical to calling `list_runnable_jobs`
directly.
2019-02-08 18:53:58 +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
Cameron Dawson 9498ac526a Bug 1364045 - Convert the groups unit tests to Jest 2019-02-07 17:08:16 -08:00
Sebastian Hengst dd3e0f33a1 Bug 1523772 - Add 'regression' keyword to new bugs filed with bugfiler (#4541) 2019-02-01 18:46:14 +00:00
Cameron Dawson 30bcd440c4
Bug 1306707 - Search for push without startswith when 40 chars (#4534) 2019-02-01 10:43:58 -08:00
Cameron Dawson c32f673bfc
Switch front-end to use /push/ endpoint (#4514) 2019-01-29 09:33:22 -08:00
Cameron Dawson 646e716a6a
Bug 1364045 - Convert the revisions unit tests to Jest (#4495) 2019-01-28 09:41:59 -08:00
Ed Morley fdb62a6243 Bug 1522101 - Use two-space indent when generating sample data JSON
So that future generated JSON sample data matches the Prettier style.
2019-01-23 20:19:04 +00:00
Ed Morley 4cfdae3f41 Bug 1522101 - Use Prettier to format JSON 2019-01-23 20:19:04 +00:00
KWierso 62b8879bcd Bug 1519139 - Add "#[markdown(off)]" to bugfiler comments (#4468)
Bugzilla recently started parsing markdown in bug comments. This was
causing some issues for bugs filed with Treeherder's bug filer because
text was unintentionally being parsed as markdown.

This patch just adds a "#[markdown(off)]" to the beginning of the
comment field, which lets the comment escape being parsed as markdown.
2019-01-18 09:24:08 +00:00
Cameron Dawson 7a48bbc575
Bug 1493833 - Fix ESLint errors with import/no-cycle (#4451) 2019-01-14 08:30:51 -08:00
Sarah Clements fbb60958cd
Bug 1505796 - improve perfherder compare performance (#4414)
create new endoint `performance/summary/` and update queries
in compare and compare subtest controllers
2019-01-11 09:47:05 -08:00
Cameron Dawson 33921b52fd
Bug 1514668 - Use shared LogoMenu across IFV and Perfherder (#4435)
Also convert LogoMenu.jsx to Reactstrap dropdown and use it in IFV navbar
2019-01-10 10:15:56 -08:00
Hassan Ali 45b2493d06 Bug 1518608 - Recognize FirefoxAccount logins (#4436) 2019-01-09 15:43:01 +00:00
Kartikaya Gupta (kats) d40959ee53 Bug 1512676 - Match some bash startup errors from run-task as errors lines (#4434) 2019-01-08 19:16:09 +00:00
pyup.io bot 1ed4969df6 Update pytest to 4.1.0 (#4427)
And use 'match' instead of 'message' with pytest.raises(), since the
former is actually what we should have been using all along.

See:
https://github.com/pytest-dev/pytest/issues/3974
2019-01-08 11:04:57 +00:00
Kartikaya Gupta (kats) ebe9db4b7c Bug 1517264 - Treat wrench jobs as reftests. (#4412)
Wrench jobs are a job type for the standalone WebRender test suite, and
run reftests as part of the job. Having reftest-ish things like the
reftest analyzer links for these jobs is desirable.
2019-01-03 09:42:15 -08:00
pyup.io bot a726b5ee28 Update redis to 3.0.1 (#4310)
And explicitly disable redis-py TLS validation to restore the validation
behaviour back to how it was with redis-py v2, since Heroku Redis uses
self-signed certificates so connections to it will fail if validation
is enabled. This resolves the issue seen in bug 1510000.
2019-01-03 10:33:37 +00:00
Cameron Dawson 6eeff4bafe
Bug 1513601 - Fix/enable ESLint 'react/button-has-type' (#4377)
Also make tests less brittle
2018-12-18 14:22:32 -08: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
Ed Morley 0009e7fa50 Bug 1514720 - Stop using jasmine-jquery JSON fixtures support
Since it's unnecessary given that we now have the ability to import JSON
directly, and the current usage is causing ESLint warnings like:

```
warning: Illegal usage of jasmine global (jest/no-jasmine-globals) at tests/ui/unit/context/pushes.tests.jsx:15:5:
  13 |
  14 |   beforeEach(() => {
> 15 |     jasmine.getJSONFixtures().fixturesPath = 'base/tests/ui/mock';
     |     ^
  16 |
  17 |     fetchMock.get(
  18 |       getProjectUrl('/resultset/?full=true&count=10', repoName),
```

This means the only `jasmine-jquery` feature we're now using is the
`toHaveLength` matcher, so use of `jasmine-jquery` can be dropped entirely
once the tests are migrated to Jest, which supports `toHaveLength`
natively.
2018-12-17 20:11:57 +00:00
Cameron Dawson 5e8377a3ff
Bug 1364045 - Introduce Jest unit tests (#4369) 2018-12-13 08:24:52 -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
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
Cameron Dawson a9c2dedf0a
Bug 1506424 - Fix logic to unselect job by clicking open areas (#4269) 2018-11-14 08:27:46 -08:00
ionutgoldan 9168eba8e8 Bug 1431085 - Increase max length of PerformanceSignature.extra_options (#4238) 2018-11-14 09:22:11 +00:00
Ed Morley 70e15b8334 Bug 1505758 - Fix/enable ESLint 'prefer-arrow-callback'
https://eslint.org/docs/rules/prefer-arrow-callback
2018-11-08 16:27:37 +00:00
Ed Morley ec87836e3b Bug 1505758 - Fix/enable ESLint 'prefer-destructuring'
https://eslint.org/docs/rules/prefer-destructuring
2018-11-08 16:27:37 +00:00
Ed Morley dd0165c0e0 Bug 1505758 - Fix/enable ESLint 'no-restricted-globals'
https://eslint.org/docs/rules/no-restricted-globals
2018-11-08 16:27:37 +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
Florin Strugariu 9b01377881 Bug 1470473 - Add more Perfherder Selenium tests (#4195) 2018-10-31 19:44:31 +00:00
Sarah Clements f1aab1596b
Bug 1495429 - change IFV table sorting (#4178)
Remove API pagination and serve all results to client so table
sorting is completely client-side.
2018-10-29 12:18:37 -07: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
Ed Morley 974c9c2c5f
Bug 1502288 - Update flake8, pycodestyle and pyflakes (#4192)
* Switches from the `ignore` setting to the new `extend_ignore`, which
  doesn't overwrite the default ignore list, meaning we no longer have
  to duplicate it ourselves.
* Remove the rarely used `[pycodestyle]` config section, since it's
  only used when using tools like autopep8, which should really learn
  to use the `[flake8]` section themselves.
* Enables the previously ignored F403 and F405 rules, adding `# noqa`
  entries to instances that we do not wish to fix.
* Adjust max line length down to 100, since we already disable the
  `E501: line too long` rule, making the length mostly redundant
  other than in IDEs, where it's probably good to show a warning if
  exceeding 100 characters.
* Fixes:
```
treeherder/intermittents_commenter/commenter.py:202:10:
  W605 invalid escape sequence '\['
treeherder/intermittents_commenter/commenter.py:202:24:
  W605 invalid escape sequence '\]'
treeherder/webapp/graphql/schema.py:7:1:
  F403 'from treeherder.model.models import *' used; unable to detect undefined names
```

Closes #4177.
Refs #3425.
Refs #3565.
2018-10-29 09:44:34 +00:00
Cameron Dawson 3c07a53692
Bug 1450041 - Convert angular events to CustomEvent (#4166)
* Convert event selectNextTab
* Convert event saveClassification
* Convert event jobsClassified
* Convert event deleteClassification
* Convert event openLogviewer
* Convert event autoclassifyIgnore
2018-10-19 17:13:01 -07:00
Cameron Dawson 49368ca7ff
Bug 1450024 - Convert Notifications to ReactJS (#4132) 2018-10-12 17:16:20 -07:00
Cameron Dawson 01c3c73703
Bug 1450041 - Convert job dup and count to properties (#4119) 2018-10-10 08:39:00 -07:00
Cameron Dawson 68f6001822
Bug 1450040 - Replace ThResultSetStore with Pushes context (#4102)
* Switch from using job.result_set_id to job.push_id
* Switch to using template strings for aggregateIds
* Fix notification where selected job not in push range
* Fix push status notifications(watching) to use safe React lifecycle method
* Fix some lodash _ imports to specific file imports
* Remove last usage of globalFilterChanged event
* Rename usage internal to PushJobs from "platforms" to "filteredPlatforms"

This takes what ThResultSetStore used to do and moves it to a React Context
called "Pushes.jsx" and into the "Push.jsx" component to manage
its own jobs.
2018-10-09 11:50:43 -07:00
renovate[bot] bb39a9dbd1 Update dependency fetch-mock to v7 (#4065) 2018-10-02 09:39:34 -07:00
Cameron Dawson 1b0eb3bbe8
Bug 1494667 - Fix selecting job within count on page load (#4081) 2018-10-02 08:31:28 -07: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
Cameron Dawson 8644c1160f Fix warning in JobGroup tests (#4070) 2018-09-26 19:07:57 +01:00
Ed Morley 05a421c0e2
Bug 1364894 - Fix ESLint issues found by Neutrino 9 (#4056)
This pre-emptively fixes the issues found by the newer ESLint and
ESLint plugins that come with Neutrino 9 - in order to reduce the
size of the Neutrino 9 PR.
2018-09-24 17:59:14 +01:00
Cameron Dawson 46568ce088 Move the constants.js file to /helpers 2018-09-21 13:09:46 -07:00
Ed Morley eae4fa006f
Bug 1492462 - Remove retrigger/cancel APIs and pulse publisher (#4042)
Since as of #3980 (bug 1470622) the frontend no longer calls the
`/retrigger/` `/cancel/` or `/cancel_all/` Treeherder APIs.

Whilst looking at the pulse related fixtures, I spotted that the
`mock_message_broker` fixture was already unused.
2018-09-21 17:39:03 +01:00
Sarah Clements 149d01ac1c
Bug 1491133 - Optimize intermittents commenter (#4031)
Refactor get_bug_stats and alt_bug_stats and optimize queries.
Create helper to batch fetch_bug_details queries. Update test.
2018-09-17 19:52:12 -07:00
Cameron Dawson d19f0a791c
Bug 1490967 - Fix filtering with uppercase email address (#4032) 2018-09-14 13:08:52 -07:00
Cameron Dawson edbc680937 Bug 1488869 - Convert all usages of angular location window.location 2018-09-06 14:18:37 -07:00
George Hickman 63226ddc3c Replace BugJobMap.objects.create() with BugJobMap.create()
Whenever we create a BugJobMap with a User we want to update its Job's
best FailureClassification's Bug number with the one the BugJobMap was
created with.  This keeps the autoclassify data (FailureClassification)
in sync with BugJobMap.

However, doing this via an overridden `.save()` effectively hides the
functionality from anyone reading through the code.  Since the
`.update_autoclassification_bug()` method is only called from that one
place this moves all the functionality into the classmethod `.create()`.
This makes it explicit that creating a BugJobMap involves more than a
simple DB row creation.
2018-09-06 16:41:48 +01:00
Cameron Dawson 0d535214c8 Tidy up job-view folder 2018-09-06 08:25:35 -07:00
pyup.io bot 2647b998aa Update pytest to 3.8.0 (#3989)
* Update pytest from 3.7.4 to 3.8.0

* Fix django.core.urlresolvers deprecation warnings

The new version of pytest now correctly catches warnings that occur
within tests/fixtures, which has unearthed new Deprecation warnings
that need fixing to prevent test failures.

Prevents:
```
RemovedInDjango20Warning: Importing from django.core.urlresolvers is
deprecated in favor of django.urls.
```
2018-09-06 15:37:17 +01:00
Cameron Dawson 5406ebb45c
Bug 1450033 - Convert Job Filtering component to ReactJS (#3971) 2018-09-04 12:25:42 -07:00
ionutgoldan a0c1b607de Bug 1468172 - Introduce nudge functionality for perf alerts (#3671) 2018-08-28 22:27:15 +01:00
George Hickman 703c1dde62 Abstract pulse message reading into a configurable function
Since testing Django management commands involves running them and
checking the log output this provides us with a way to test message
reading functionality while also reducing those scripts down to a simple
configuration.
2018-08-28 14:01:49 +01:00
George Hickman 6faff4fcc9 Allow creation of Pulse Exchanges and return bound Exchange objects 2018-08-28 14:01:49 +01:00
George Hickman 3e92d05eef Make it explicit we're mirroring the Pulse connection for tests 2018-08-28 14:01:49 +01:00
Cameron Dawson 3af1db6b2c Bug 1485090 - Convert ResultSet Model to ReactJS 2018-08-27 09:01:14 -07:00
George Hickman 4825058830 Bug 1483231 - Remove the PULSE_EXCHANGE_NAMESPACE configuration option 2018-08-24 14:46:31 +01:00
George Hickman 27cb0bc4d7
Move Pulse Publishing to Pulse Service (#3919)
The PulsePublisher class was built for extensibility, providing lots of hooks
for customisation.  However we only had one subclass in use since its
introduction: TreeherderPublisher.  This reduces the concrete class into a
single function which publishes the given message.  In doing so all
configurability has been removed, since it was unused.
2018-08-24 14:09:14 +01:00
George Hickman d6a1efa4f7 Make construction of the Pulse connection lazy
Wrapping in Django's `lazy` makes the call to build_connection lazy but
means we need to call the function when we use it.
2018-08-24 13:29:42 +01:00