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

4906 Коммитов

Автор SHA1 Сообщение Дата
William Lachance 45caf5de80 Bug 1228154 - Use fixtures for performance ingestion unit tests
It's easier to reuse code and reason about it this way
2015-12-02 13:20:17 -05:00
William Lachance 66f15e23f5 Bug 1229203 - Remove etag caching from frontend views
It doesn't handle cache invalidation/updates properly. Since the
savings are almost certainly negligible, let's just get rid of it.
2015-12-02 13:06:41 -05:00
Tiramisu 1993 49f6afa861 Bug 1223085 - sort filted results 2015-12-02 18:31:56 +08:00
William Lachance bd69433d5f Bug 1227301 - More fixes to logins 2015-12-01 14:17:04 -05:00
William Lachance c7835fc0d8 Bug 1227301 - Fix perfherder login in production 2015-12-01 13:57:14 -05:00
camd 5ef28f0110 Merge pull request #1163 from adusca/runnable-fix
Bug 1227552: Don't force a new job_group on fetch_allthethings
2015-12-01 10:41:23 -08:00
Tiramisu 1993 cbd32a438a Bug 1229049 - Highlight all points that match the given revision 2015-12-01 14:22:00 +08:00
William Lachance edec73c614 Bug 1229101 - Change alert titling
* Alert Summary -> Alert
* Alert -> Detected Changes
* Include id # in summary (for people to look up and reference later)
2015-11-30 15:04:22 -05:00
Ed Morley ca24ba6d41 Bug 1229022 - Make treeherder-client HTTPError output less verbose
The request body, request headers & response headers are now output with
a log level of `debug` rather than `error`, to reduce verbosity of logs.

In addition, the response body has now been combined with the log line
that outputs the URL, to make it easier to correlate lines in the log.
The type in the `_get_json()` ("Error *submitting* data") has also been
fixed, and string substitution now occurs lazily.
2015-11-30 17:10:52 +00:00
Tiramisu 1993 ddc3ec1aa0 Bug 1223085 - Only use one search box to filter in perfherder compare 2015-11-30 11:16:56 -05:00
Ed Morley 8384eefc60 Bug 1196764 - Add a test for calculating and using average job durations
This test checks that the `calculate_duration` command correctly
populates the `job_duration` table both on an initial run and when new
jobs cause an existing average duration to change.

It also checks that once the task has been run, any subsequent ingestion
of jobs with matching signatures cause those jobs to have the correct
`running_eta` value when inserted into the `job` table.
2015-11-30 11:36:21 +00:00
Ed Morley 978a3c207f Bug 1196764 - Remove the unused per-project job_eta table
Once we're happy we don't need to rollback, it can be dropped from
stage/prod/heroku.
2015-11-30 11:36:21 +00:00
Ed Morley c8dba75a29 Bug 1196764 - Fetch job durations from the new unified table
The old per-project job_eta table is no longer being updated. This makes
job ingestion retrieve expected durations from the new table instead.
2015-11-30 11:36:20 +00:00
Ed Morley cd64c64a65 Bug 1196764 - Store job durations in the new unified table using the ORM
Instead of storing the calculated average job durations in the
per-project job_eta tables, they are now stored in the new job_duration
table in the main treeherder database. This means we can use Django's
ORM instead of datasource.

In addition, if a job signature already exists in the table, we update
it rather than creating duplicate rows - and most importantly unlike the
previous table, the correct columns are indexed to avoid performance
problems.

This commit just changes where we store new durations, a later commit
will switch the retrieval of them from the old table to the new.
2015-11-30 11:36:20 +00:00
Ed Morley 6e4b6f2dea Bug 1196764 - Add a JobDuration model
Which will replace the per-project job_eta tables.

I've not added a `modified` field, since I think it's best we wait until
we actually need it. One use-case would be for data expiration, however
I think that's best done by cross-referencing signatures on the
reference_data_signatures table, however (a) that table doesn't yet have
data expiration either, and (b) it's possible once that table is
refactored we may even want to combine it with the job_durations table
too.
2015-11-30 11:36:19 +00:00
Ed Morley c89fc00502 Bug 1196764 - Add the test_repository fixture to tests that store jobs
At the moment tests that store jobs can get away with not having the
test project listed in the repository table. However with later commits,
the new job_duration table will have a foreign key on the repository
table, which will break those tests unless they use the test_repository
fixture, which creates the repository record for them.
2015-11-30 11:36:19 +00:00
Ed Morley 620228cbf3 Bug 1196764 - Rename calculate_eta to calculate_durations
Since we're not calculating ETAs (the UI does that once it knows the
start time and expected duraction), we're calculating recent average
durations instead.
2015-11-30 11:36:18 +00:00
Ed Morley ab20e09a2c Bug 1196764 - Rename job_eta_times to average_job_durations
Since ETA means a time, but we're actually dealing with durations.
2015-11-30 11:36:18 +00:00
Ed Morley d075e41705 Bug 1196764 - Flatten the return value of get_job_eta_times()
We only ever use the 'running' subkey for each signature (since
bug 1181572), so there's no point in including both 'running' and
'pending' subkeys in the dict returned from get_job_eta_times().
2015-11-30 11:36:17 +00:00
Ed Morley fb7f83154e Bug 1196764 - Return early if max_start_timestamp was not found
Which can occur when no jobs exist for that repository.
2015-11-30 11:36:17 +00:00
Ed Morley 585ddc5189 Bug 1196764 - Clean up the fetching of recent job average durations
Switches the datasource query to return the raw tuple from
cursor.fetchall() rather the dict return_type which repacks everything
unnecessarily.

Also renames the query and variables since what's being calculated is no
longer a group (it's just the average duration and not pending time too)
and 'duration' is more accurate than 'eta' (the latter is a time not an
int).
2015-11-30 11:36:16 +00:00
Ed Morley 006caebe36 Bug 1196764 - Use start not submit timestamp to retrieve job durations
Previously the time a job spent in the pending state *and* also the time
spent in the running state were calculated and stored. However, now that
only the latter is required, the time window that the query searches
over needs to only cover the start_timestamp onwards, not the earlier
submit_timestamp.
2015-11-30 11:36:16 +00:00
Ed Morley f509337788 Bug 1196764 - Stop calculating/storing unused job duration statistics
The calculate_eta task calculates average/median/min/max & standard
deviation of recent job durations, when only the average is used.

Whilst the job_eta table will be replaced entirely in later commits, the
query that fetches the stats to populate it will still be used, so needs
cleaning up regardless.
2015-11-30 11:36:15 +00:00
Ed Morley 31c5bdca67 Bug 1228739 - Remove unnecessary .gitignore entries & clean up ordering
Removed:
*.mo
*.py[od]
.coverage
.mr.developer.cfg
.project
.pydevproject
.tmp/
.tox
htmlcov/
LOGFILE
nosetests.xml
pip-log.txt
supervisor*.log
test.log
treeherder*.log
treeherder.log.*
2015-11-28 16:02:30 +00:00
William Lachance 3897dee31d Fix getting series for related branches in Perfherder
Currently if a series does not exist on another branch (i.e. MacOSX 10.10
on b2g-inbound), Perfherder graphs won't be able to fetch the related
series. The fix for this is so simple, I'm just going to push it.
2015-11-26 15:47:27 -05:00
William Lachance ddc14a0cac Merge pull request #1162 from klahnakoski/temp5
ignore ide files
2015-11-26 15:28:40 -05:00
William Lachance f35bab7baf Bug 1227635 - Fix missing semicolon 2015-11-26 15:23:03 -05:00
William Lachance 25659725d2 Bug 1227635 - Better explanation of what low/med/high means in compare view 2015-11-26 15:00:45 -05:00
William Lachance fb47eb98a3 Bug 1227301 - Make perfherder use treeherder's logo button style 2015-11-26 14:29:26 -05:00
Wes Kocher c06ba00cd6 Bug 1112407 - Remove the revision list window
Since it doesn't display all changesets in the case of large pushes,
and its functionality is replaced by bugherder.
2015-11-26 16:53:03 +00:00
Ed Morley 2d8bb0b32d Bug 1228324 - Use the new style urlpatterns syntax
Since the `patterns()` syntax is now deprecated:
https://docs.djangoproject.com/en/1.8/releases/1.8/#django-conf-urls-patterns
2015-11-26 13:54:30 +00:00
Tiramisu 1993 dae9395468 Bug 1193419 - No longer expire resultset and revision 2015-11-26 11:29:10 +00:00
Ed Morley dd53914771 Bug 1228013 - Add a test for missing Django migrations
This test checks that `./manage.py makemigrations` was run, and the
resultant migrations file committed to the repo, since the last time the
Django models were updated.

Django 1.8 only supports an `exit_code` option, which unhelpfully makes
the command `sys.exit(1)` if there are *no* missing migrations, when
we're more interested in the opposite. As such, we have to confirm that
it does exit 1 (which causes a `SystemExit` exception).

On Django master they've replaced `exit_code` with `check_changes` that
inverts the check, which we should switch to once we're using a version
of Django that includes that fix.
2015-11-25 22:40:15 +00:00
Ed Morley cd353f5e3c Bug 1160561 - Add support for setting BROKER_URL via the environment
The individual RABBITMQ_* variables are never used on their own, so it
makes more sense to switch to a URL variable that combines all of them.

Travis/Vagrant have also had BROKER URL explicitly set, since we're
generally moving away from having testing defaults set in settings.py.

Once stage/prod have BROKER_URL set, we can remove the fallback to the
old variable names, and also remove defaults entirely, making missing
settings fail fast.
2015-11-25 21:48:15 +00:00
Ed Morley d1b1cb534c Bug 1160561 - Replace dj-database-url with django-environ
We're already using django-environ for standard environment variables,
however it also supports DB URL parsing too, so we might as well use
it for everything, rather than using two packages.

In addition, django-environ already supports DB URI options (eg for
specifying the SSL cert), whereas the dj-database-url PR for that
feature has sat unmerged since May.

Compare:
https://github.com/kennethreitz/dj-database-url/blob/v0.3.0/dj_database_url.py
...with:
https://github.com/joke2k/django-environ/blob/v0.4/environ/environ.py#L323-L392
2015-11-25 21:48:15 +00:00
Ed Morley 04dbd2b98b Bug 1160561 - Handle the Django DB password being missing or None
Whilst Django itself handles the password property being set to `None`,
we use the Django DB configs in several places outside of Django (either
directly with MySQLdb, or via datasource which uses MySQLdb too).

MySQLdb will handle the password being the empty string, but raises
if `None` is passed, which can occur if using django-environ, due to:
https://github.com/joke2k/django-environ/issues/56

This change both works around that issue, and is also likely the right
thing to do regardless, since we shouldn't assume that the password is
even set in settings.py at all. (Django defaults the password to the
empty string, so it's perfectly acceptable to omit the password
property in the DATABASES dict entirely.)
2015-11-25 21:48:14 +00:00
Ed Morley 5fc4a1a8b9 Bug 1160561 - Remove unnecessary DEBUG define in local settings file
Now that we're using django-environ's env.bool() in settings.py, the
value of TREEHERDER_DEBUG set in the Vagrant environment is correctly
picked up, so the local settings file DEBUG define is unnecessary.
2015-11-25 21:48:13 +00:00
Ed Morley e8444645d9 Bug 1160561 - Use django-environ rather than os.environ.get
Since it's cleaner & simplifies casting of non-string values. For usage
guide, see:
https://github.com/joke2k/django-environ/blob/develop/README.rst
2015-11-25 21:48:13 +00:00
William Lachance 3286af09eb Bug 1227301 - Add ability to log into treeherder from perfherder 2015-11-25 15:27:31 -05:00
William Lachance 3daa4adfa5 Bug 1227301 - Make perfherder navbar use treeherder's style 2015-11-25 15:27:31 -05:00
William Lachance 9ddb21d521 Bug 1201154 - Fix getting more alert summaries 2015-11-25 15:00:36 -05:00
William Lachance 2497d6f702 Bug 1227740 - Detect and handle case where we alert inside a retrigger
Previously we would make the previous result set id the same as the current
one, which meant we couldn't resolve the treeherder changeset.
2015-11-25 14:06:24 -05:00
William Lachance 1821c545b7 Bug 1227740 - Modify performance alerts code to be simpler + more robust
* Make sorting more deterministic in cases where we have multiple
  entries with the same push timestamp
* Internal PerfDatum clas renamed to just Datum
* Remove buildid parameter from Datum (not used for anything)
* Remove testrun_timestamp paramater from Datum (it's not really useful,
  better to use push_timestamp
* Consolidate debug printing into one function that shows
  everything
2015-11-25 14:06:24 -05:00
William Lachance 86628a3350 Bug 1227740 - Use fixtures for performance alert unit test 2015-11-25 14:06:24 -05:00
Ed Morley 014bcd7c5a Bug 1227653 - Remove the custom wrapper around Django's MemcachedCache
It purports to add two features:
(a) the ability to set a "never expire"
(b) the ability to check the result of a set()

However (a) isn't needed any more, since Django supports this natively
(albeit "never expire" is set with a `TIMEOUT` of `None` rather than 0),
and (b) isn't used, since Treeherder never checks the return value from
cache.set():
https://github.com/mozilla/treeherder/search?q=%22cache.set%22

The custom wrapper is also the cause of deprecation warnings, eg:
RemovedInDjango19Warning: `MemcachedCache._get_memcache_timeout` method
should be renamed `get_backend_timeout`.

It was copied from Datazilla:
https://github.com/mozilla/datazilla/pull/37

...which at the time was using Django 1.3.1, which didn't support never
expiring:
https://github.com/django/django/blob/1.3.1/django/core/cache/backends/memcached.py#L41

Whereas 1.7+ does:
https://github.com/django/django/blob/1.8.5/django/core/cache/backends/memcached.py#L56
https://docs.djangoproject.com/en/1.8/ref/settings/#std:setting-CACHES-TIMEOUT
2015-11-25 14:16:12 +00:00
Ed Morley 998f4d374d Bug 1226651 - Add missing unique_together model constraints
These were present in the raw SQL used prior to bug 1193836, so should
already exist on stage/prod/heroku. As such, I've added these to the
initial migration to avoid errors during migrate/having to use `--fake`.
2015-11-25 13:57:38 +00:00
Ed Morley 63309178d9 Bug 1227733 - Update Django from v1.8.5 to v1.8.7
https://docs.djangoproject.com/en/1.8/releases/1.8.6/
https://docs.djangoproject.com/en/1.8/releases/1.8.7/
https://github.com/django/django/compare/1.8.5...1.8.7
2015-11-25 13:53:32 +00:00
Ed Morley 5f9a57ef21 Bug 1225597 - Docs: Use anonymous links to avoid build warnings
Fixes:
common_tasks.rst:2: WARNING: Duplicate explicit target name: "stage".
common_tasks.rst:2: WARNING: Duplicate explicit target name: "production".

http://docutils.sourceforge.net/docs/ref/rst/restructuredtext.html#anonymous-hyperlinks
2015-11-25 13:35:25 +00:00
Ed Morley 6df3aa4ac3 Bug 1225597 - Docs: Make local hawk credentials section easier to find
Also remove the duplication between the two pages, by having the
submitting data section not mention requesting credentials at all, and
leave that to the common tasks page instead.
2015-11-25 13:35:25 +00:00
Ed Morley ba22abc4e0 Bug 1227352 - Add the b2g-ota repository 2015-11-25 12:57:25 +00:00