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

23 Коммитов

Автор SHA1 Сообщение Дата
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 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 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
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
George Hickman 3e92d05eef Make it explicit we're mirroring the Pulse connection for tests 2018-08-28 14:01:49 +01:00
George Hickman 4825058830 Bug 1483231 - Remove the PULSE_EXCHANGE_NAMESPACE configuration option 2018-08-24 14:46:31 +01:00
George Hickman 079956945f Bug 1281821 - use PULSE_URI instead of PULSE_URL for publishing to Pulse 2018-08-08 09:42:07 +01:00
George Hickman 6e7b1efac3 Bug 1281821 - Rename PULSE_URI -> PULSE_URL to match other config vars 2018-08-07 09:51:40 +01:00
George Hickman 4a67a7f6ce Remove unused/always True AUTOCLASSIFY_JOBS setting 2018-07-02 13:22:18 +01:00
George Hickman b787f78cce Move tests to internal ES wrapper 2018-04-24 15:45:48 +01:00
Hassan Ali e1b0168127
Bug 1395356 - Use auth0 instead of login.taskcluster.net for SSO (#3144)
## Rough summary of the changes

### Front end
The auth callback is written in React and lives under the /login.html endpoint. It communicates with Treeherder using the localStorage.

### Credential expiration
The Django user session expiration is set to expire when the client access token or the id token expires (whichever one expires first). These values are controlled by the IAM team. Presently, the access token expires after 1 day and the id token expires after a week. That being said, the session will therefore expire after 1 day. If you want this value change, we simply need to send a request to the IAM team.

### Credential renewal
Renewals are set to happen every 15 minutes or so. The renewal is skewed slightly so that different open tabs don't renew at the same time. Once renewal happens, both tokens are renewed and the Django session is updated.

### Migration
If the userSession localStorage key is not set, then the user will be logged out including logging out from the Django session. In other words, all users will be automatically logged out when the merge to production happens.
2018-02-07 12:59:30 -05:00
Ed Morley 03027d8ba9 Bug 1384518 - Tests: Use a cache key prefix when running tests
To prevent them clashing with keys created by running data ingestion
locally in Vagrant.
2018-01-17 11:08:39 +00:00
KWierso 03701af889 Bug 1354438 - Give the Bug Filer control of its own API URL (#2328) r=emorley
BZ_API_URL currently is used for both the bug filer and fetching bug suggestions through the rest of Treeherder. At the moment, both of them point to production bmo's API. Bug suggestions coming from the bugzilla instance that actually has most of the intermittent bugs filed makes sense. Filing bugs from staging Treeherder's bug filer into production bmo makes less sense, so this patch lets you specify a different API URL.

If the new environmental variable isn't present, the bug filer will still default to production bmo, so this should be deployable without any configuration changes, and everything should still just work.
2017-04-10 13:18:49 -07:00
Ed Morley 8fae27955a Revert "Bug 1333079 - Switch to new style Celery setting names"
This reverts commit 1db3e2baf4.
2017-02-01 16:28:55 +00:00
Ed Morley 1db3e2baf4 Bug 1333079 - Switch to new style Celery setting names
Converted using:

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

As suggested by:
http://celery.readthedocs.io/en/latest/whatsnew-4.0.html#lowercase-setting-names

(I manually reverted the env variable name back to simplify deployment,
we can always clean these up later.)

The Django integration in celery.py has been cleaned up by following:
https://celery.readthedocs.io/en/latest/django/first-steps-with-django.html
2017-02-01 14:11:45 +00:00
William Lachance 06c27becd1 Bug 1329002 - Remove misleading TREEHERDER_TEST_PROJECT constant
This naming was a relic of the old datasource code we were using. For
the most part, we don't need it. Where we do need it, we should call it
what it is: a repository name.
2017-01-06 15:01:19 -05:00
camd ba8165c239 Bug 1273034 - Transition to Taskcluster Auth from Persona (#1922)
In this commit, Sheriff access is still maintained in the
Treeherder DB, rather than using the scopes derived from
LDAP.

For local usage with Vagrant, this requires accessing
Treeherder with localhost instead of
local.treeherder.mozilla.org

Loggin in to the Django Admin is not enabled in this
branch.  Do use the admin, you must first login through
the normal Treeherder front-end.  Then the admin will
be accessible if the user has the privileges to do so.

Persona login will still be technically possible through the
login.taskcluster.net site.  But that choice will go away
shortly.
2016-11-18 10:54:48 -08:00
jgraham 223e5bcb33 Bug 1292270 - Pass a User object down to JobManager.update_after_verification. (#1760)
* Bug 1292270 - Pass a User object down to JobManager.update_after_verification.

This is required to create the BugJobMap instance in the post-datasource world.
2016-08-04 17:14:20 -07:00
jgraham 52607c2a57 Bug 1268484 - Add elastic-search based matcher for test failure lines (#1488)
Add support for matching test failures where the test, subtest, status,
and expected status are all exact matches, but the message is not an
exact match. The matching uses ElasticSearch and is initially optimised
for cases where the messages differ only in numeric values since this is
a relatively common case.

This commit also adds ElasticSearch to the travis environment.
2016-06-29 11:25:38 +01:00
Wes Kocher 371ec172de Bug 1117583 - Add an API endpoint that creates a new bug in Bugzilla.
This endpoint receives a http POST request from the UI containing information about the bug to be filed (product, component, summary, version, description), then formats it properly as a submission to Bugzilla's REST API, using a server-side Bugzilla API key, and adding a "treeherder" comment tag.

The API then passes back either the bug ID (if the submission was successful) or Bugzilla's failure response if something went wrong.
2016-04-07 14:52:11 -07:00
Ed Morley 47965837bf Bug 1153324 - Remove unused MIRROR_CLASSIFICATIONS setting
Since it's been replaced by the presence (or not) of the OrangeFactor
API password instead.
2016-02-11 20:15:21 +00:00
Mauro Doglio d5f847e559 Bug 1193836 - Decouple the jobs and reference databases for test
We were previously using the same database (test_treeherder) for both the
jobs and reference data model. I centralized the new db name in the test
settings file. All the test requiring the jobs db or its repository counterpart
can now access it using the `test_project` fixture, while utility functions use
directly the metioned setting. Where the project name is hardcoded in a static
file, I just replaced it with the new name `test_treeherder_jobs`
2015-10-27 11:18:29 +00:00
Mauro Doglio 247cc3de64 Bug 1193836 - Use a dedicated settings file for testing 2015-10-27 11:18:19 +00:00