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

5942 Коммитов

Автор SHA1 Сообщение Дата
Ed Morley 527efdccf5 Bug 1294096 - Fix test that times out due to external HTTP requests
Previously test_new_job_in_exclusion_profile was attempting to download
logs from ftp.mozilla.org, due to the log parser not being mocked, which
caused intermittent test timeouts on Travis.
2016-08-10 19:20:46 +01:00
KWierso 721d2f5221 Bug 1278746 - Make 'intermittent-failure' keyword optional (#1772) r=emorley 2016-08-10 19:12:06 +01:00
Ed Morley 2f4f5019df Bug 1289156 - Update the Heroku PATH workaround so pip can be found
The Heroku pre_compile script is currently run prior to the cache being
restored (https://github.com/heroku/heroku-buildpack-python/pull/321),
which means we have to tweak PATH so vendor-libmysqlclient.sh can find
the binaries from the cache instead of the app directory.

However the workaround added in #1770 only added one of the two extra
required PATHs, this adds the other.

Prior to this the buildpack compile would output:
> ./bin/vendor-libmysqlclient.sh: line 65: pip: command not found

...and so wouldn't purge the old mysqlclient package, which is needed to
force recompilation against the newer libmysqlclient.

Once the PR against heroku-buildpack-python is merged, these workarounds
can be removed.
2016-08-10 14:34:55 +01:00
Ed Morley 6425ba8a56 Bug 1289156 - Add a test to check mysqlclient TLS can't be downgraded
If mysqlclient has been compiled against a vulnerable version of
libmysqlclient then this test will fail. There is overlap between this
and our custom Django system check for ensuring mysqlclient has been
compiled against libmysqlclient >= 5.7.11, however there advantages in
having both:
* the system check is run during deploy, unlike this test
* however this test is more thorough since it actually checks TLS
behaviour and not just version numbers (but this method cannot be used
in the system check run during production deployment, since it relies on
having a MySQL server instance that doesn't support TLS, to emulate the
TLS being stripped by an attacker)
2016-08-10 11:45:08 +01:00
Ed Morley 9968b432f7 Bug 1289156 - Clean up the db_conn fixture
Since we're about to copy part of it to a new test.
2016-08-10 11:45:08 +01:00
Ed Morley a8866ec0b8 Bug 1289156 - Add a Django system check for libmysqlclient >= 5.7.11
This registers a custom Django system check (that is run as part of
`./manage.py check` during testing/deploys, and also prior to commands
such as migrate), to check that mysqlclient has been compiled against a
version of libmysqlclient that isn't vulnerable to TLS stripping. See:
https://docs.djangoproject.com/en/1.8/topics/checks/#writing-your-own-checks
2016-08-10 11:45:08 +01:00
Ed Morley 3b1e45ce0c Bug 1289156 - Vendor libmysqlclient 5.7 to protect against CVE-2015-3152
The latest versions of libmysqlclient 5.5/5.6 (used by mysqlclient) are
still vulnerable to TLS stripping, even after last year's backports of
5.7.x fixes:
  - https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2015-3152
  - http://bugs.mysql.com/bug.php?id=82383

Ideally we'd just use the standalone Connector/C library instead of the
libmysqlclient packages, however the latest release is too old:
  - http://bugs.mysql.com/bug.php?id=82448

Heroku's cedar-14 stack comes with libmysqlclient 5.5.x, so until it is
updated to 5.7.x (see https://github.com/heroku/stack-images/pull/38) we
must manually vendor 5.7.x ourselves, so that connections between the
Heroku dynos and our public RDS instances are secure. We can do this and
still remain on MySQL server 5.6, since newer client releases are
backwards compatible with older server versions.

Whilst the Vagrant/Travis MySQL instances don't use TLS (and so aren't
affected), we still want them to use libmysqlclient 5.7, to be
consistent with production.

Installing the newer libmysqlclient isn't sufficient on it's own. Any
packages compiled against the older version (in our case mysqlclient)
need to be recompiled. We ensure this happens by pip uninstalling the
existing package if it was already installed.
2016-08-10 11:45:08 +01:00
KWierso 4d1b7fe63a Bug 1293447 - Use a placeholder attribute instead of a separate element for placeholder text (#1769) r=camd 2016-08-10 00:18:51 +01:00
jgraham dcf8a471bd Bug 1293653 - Sort the unstructured bug suggestion in the autoclassify panel. (#1774)
Order is based on a token match with the error summary.
2016-08-09 23:16:54 +01:00
jgraham af490d3553 Bug 1293337 - Disable 'Save All' button when the user is not logged in (#1768) 2016-08-09 22:43:12 +01:00
KWierso 8c6be586aa Restrict the summary field to 255 characters (#1773) r=emorley 2016-08-09 20:57:34 +01:00
camd 13943f6e21 Bug 1278711 - Add unique_together index for job_detail (#1667) 2016-08-08 16:15:12 -07:00
KWierso 54abbd49c8 Bug 1291955 - Show a better error if we've managed to lose authentication when classifying failures (#1758) r=camd 2016-08-08 23:59:16 +01:00
KWierso f1035c6736 Bug 1292708 - Scroll job into view if it is hidden behind the navbar/header (#1763) r=camd 2016-08-08 23:27:33 +01:00
jgraham d50d60744c Bug 1293224 - Add 'a' keyboard shortcut for Ignore All autoclassification option (#1767) 2016-08-08 22:00:16 +01:00
jgraham 0d32de7ead Bug 1292643 - Flip the Ignore/Save All buttons to the other side of the panel and prevent them scrolling (#1765) 2016-08-08 19:21:14 +01:00
jgraham 532587b811 Bug 1292672 - Put autoclassification radio labels inside a <label> element. (#1766)
This makes them clickable to select the corresponding radio input.
2016-08-08 18:16:52 +01:00
KWierso 754406075e Bug 1292834 - Add an opt out for autoclassify UI (#1764) r=jgraham 2016-08-06 08:12:26 +01:00
camd 0f2fd75019 Bug 1278711 - Lower field lengths in job_detail table (#1666)
This is required in order to create a unique index on title,
value and job_id to prevent duplicates.  The index will be
created in a later PR.

This also uses update_or_create instead of get_or_create as
this will be the mechanism going forward to prevent duplicates.
2016-08-05 15:15:18 -07:00
jgraham be1ca5872b Bug 1292338 - Remove reftest references from error summary search terms. (#1761) 2016-08-05 14:45:49 +01: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
Shruti Jasoria 4c8d3f69e6 Bug 1289138 - Enable disabled eslint rules and fix corresponding js problems (#1736)
Enable the following rules and fixed corresponding problems:
* comma-dangle
* no-console
* no-redeclare
* no-unused-vars
* no-undef
* no-unused-vars
2016-08-04 16:18:00 -07:00
camd 0f5564d13d Bug 1291882 - Add unique_together index on build_platform table (#1759)
Also to the machine_platform table.

This is necessary because we use a get_or_create() on these
tables, but without the unique index, we can (and did) get
duplicates which then blocked data ingestion of jobs on try.
2016-08-04 09:35:11 -07:00
camd 2039eb7545 Bug 1291010 - Add branch field to Repository model/table (#1755)
We need a 'branch' field on the repository so that we can determine
which repo to use for incoming resultsets from pulse exchanges. In
the past, projects like gaia-taskcluster have had their own maps of
github repositories/names/branches to Treeherder projects.  But
Treeherder should be the one owning that mapping.  The only thing on
this table was the branch that's used.  So here it is.

The "branch" field will default to "master" which is appropriate for
several of the repos.  But a few will need more custom values set.
These are laid out in the fixtures/repository.json file.  But they
will need to be manually entered into the databases on Prod/Stage
and Heroku.
2016-08-02 13:47:47 -07:00
jgraham a7e28cdd5c Bug 1288230 - Show autoclassify panel by default for sheriffs (#1713) (#1756) 2016-08-02 18:34:03 +01:00
Ed Morley 617de68a44 Bug 1286702 - Make SITE_HOSTNAME use `hostname` not `netloc`
Since whilst most of the time there will be no port specified (and so
they'll be equivalent), it's really just the hostname we want, so let's
be clear about it.
2016-08-01 17:33:56 +01:00
Ed Morley fc95375ac3 Bug 1286702 - Fix hostname extraction in server_supports_tls()
urlparse's `netloc` attribute (which I'd copied from the `SITE_HOSTNAME`
usage elsewhere in settings.py) includes the port number as well as the
hostname, and so was causing the SCL3 hostname check to not match,
meaning TLS was enabled for celery on SCL3 when the rabbitmq instance
there doesn't support it.
2016-08-01 17:32:58 +01:00
William Lachance 420bd61306 Bug 1290525 - Fix cancelling buildbot jobs from revision bar (#1752) 2016-08-01 17:01:51 +01:00
jgraham 8a856d514a Bug 1290127 - Update fetchJob to work with id rather than guid (#1744) 2016-08-01 11:20:41 +01:00
jgraham 25aed2e6bf Bug 1290134 - Send an event when one or more classifications are verified. (#1743)
This allows us to force an update of the rest of the UI in response.
2016-08-01 11:20:31 +01:00
jgraham 1206e02cb8 Merge pull request #1749 from mozilla/classification_dupe
Bug 1289406 - Handle multiple classifications with the same bug id better.
2016-08-01 11:06:38 +01:00
James Graham d19b219ea7 Bug 1289406 - Don't count classified failures as missing when they have been merged and the client sends the old id. 2016-08-01 10:51:16 +01:00
James Graham f5e5961d39 Bug 1289406 - Avoid trying to create multiple classifications with the same bug number 2016-08-01 10:51:16 +01:00
Ed Morley 50818d965e Bug 1286702 - Enable TLS for Celery RabbitMQ connections that support it
Celery uses Kombu to connect to the RabbitMQ instance, which defaults to
not enabling SSL, unless the URL scheme is `amqps://` or the query
string contains `ssl=1` / `ssl=true`.

On Heroku we're using CloudAMQP, who don't use either string in their
automatically defined `CLOUDAMQP_URL` environment variable, so we must
set the Celery preference `BROKER_USE_SSL` to ensure TLS is still used:
http://docs.celeryproject.org/en/latest/configuration.html#broker-use-ssl

I've contacted CloudAMQP to encourage them to use `amqps://` in their
URLs, however even if they do switch, using `BROKER_USE_SSL` is a
sensible defence-in-depth measure we should take regardless.

TLS support isn't set up for the rabbitmq servers on SCL3, Travis or in
the Vagrant environment, so `BROKER_USE_SSL` must not be set there. In
the future we may decide it's worth the effort to use self-signed
certificates to add support for TLS to Travis/Vagrant too.
2016-07-30 13:12:18 +01:00
Ed Morley c9470ac83d Bug 1289709 - Docs: Simplify development data ingestion instructions
Now that Treeherder's data ingestion process doesn't hit it's own API:
* `./manage.py runserver` is less susceptible to memory issues.
* The runserver/gunicorn process doesn't need to be running whilst the
data ingestion takes place.
2016-07-30 13:11:58 +01:00
William Lachance 9e6f92e60f Merge pull request #1732 from wlach/1289574
Bug 1289574 - Handle various edge cases with bugzilla mirroring
2016-07-29 15:19:40 -04:00
Rob Wood 9d1e05e74a Merge pull request #1747 from rwood-moz/rwood-bug1289726
Bug 1289726 - Fix subtest compare view window title and header
2016-07-29 13:22:18 -04:00
Rob Wood 79977ea03e Bug 1289726 - Fix subtest compare view window title and header 2016-07-29 11:52:32 -04:00
Rob Wood a84e94f13e Bug 1285368 - Add more details to the clipboard for copy summary (#1741) 2016-07-29 11:33:52 -04:00
KWierso 5219f00e7a Bug 1289651 - Only scroll job into view if it's not already visible (#1735) r=camd 2016-07-28 18:29:26 +01:00
Roy C ef46fa00eb Bug 1288530 - Update classifier unconditionally, and move classifier tooltip in AlertView (#1742) 2016-07-28 12:59:27 -04:00
KWierso 09ef553945 Bug 1287911 - Add the ability to tag revisions with metadata (#1706) r=camd
* Bug 1287911 - Add the ability to tag revisions with metadata

* Bug 1287911 - Make backout commit text be red in the list of revisions
2016-07-28 17:55:43 +01:00
Shruti Jasoria 71c02dbb26 Bug 1269825 - Auto load mozilla-aurora data for mozilla-beta alerts (#1737) 2016-07-28 11:45:24 -04:00
Ed Morley 7f81eb32ce Bug 1275405 - Default to the IsAuthenticatedOrReadOnly permissions class
Since:
* It avoids unnecessary code duplication.
* Avoids us accidentally making any new API endpoints writable to
anonymous users (since if not specified, the default is `AllowAny`).
* Makes it easier to temporarily block API access in the case of
maintenance (eg for bug 1277304), since there are fewer places where
`permissions_classes` will need updating.
2016-07-28 09:55:18 +01:00
Ed Morley 2818afbb2c Bug 1275405 - Remove unnecessary check for user.is_authenticated
Since:
* It's always true for all users other than `AnonymousUser`.
* d-r-f's similar `IsAdminUser` implementation doesn't use it:
https://github.com/tomchristie/django-rest-framework/blob/3.3.3/rest_framework/permissions.py#L49-L55
2016-07-28 09:55:18 +01:00
Ed Morley 70f20eb6ba Bug 1275405 - Merge HasHawkPermissions into HasHawkPermissionsOrReadOnly
Since the former isn't used outside of `HasHawkPermissionsOrReadOnly`.
2016-07-28 09:55:18 +01:00
Ed Morley 9905a16bc6 Bug 1275405 - Clarify error message when Hawk client_id not found
The previous message implied the client_id wasn't known at all, when in
reality it could either be unknown or just not authorised. In the future
we may allow authenticating even if the credentials are not 'authorised'
(for example for higher rate limits for GETs, even if the user isn't
permitted to make POSTs to job endpoints etc), but for now we should try
and avoid confusion.
2016-07-28 09:55:18 +01:00
Ed Morley 8e66776436 Bug 1275405 - test_auth.py: Test the `...OrReadOnly` permissions_class
The tests previously used the `HasHawkPermissions` permissions class,
which is not actually used in Treeherder at all. More useful would be to
test `HasHawkPermissionsOrReadOnly`, since that is used. The only
difference is that for the latter, read-only requests (such as GETs) are
allowed to succeed even if no credentials were provided.

Note however, that even if a request is read-only, if incorrect
credentials are given (or that user isn't 'authorised'), then the
request won't succeed regardless.

Since anonymous GETs are now allowed to succeed, the expected response
content has been changed to something more generic to avoid confusion.

This change makes `HasHawkPermissions` unused, and so it will be merged
into `HasHawkPermissionsOrReadOnly` later.
2016-07-28 09:55:18 +01:00
Ed Morley fa60e2f966 Bug 1275405 - test_auth.py: Add a test for POSTs with no auth
Since currently only no-auth GETs are tested. In a later commit, the
GET case will be made to succeed, since the test will instead use the
`permissions_class` of `HasHawkPermissionsOrReadOnly`, which is actually
what the rest of Treeherder uses.
2016-07-28 09:55:18 +01:00
Ed Morley 5e106b28b1 Bug 1275405 - test_auth.py: Check HTTP status code not just content 2016-07-28 09:55:18 +01:00