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

371 Коммитов

Автор SHA1 Сообщение Дата
Max Chehab c6e0c26bc8 Bug 1336272 - Refactor changing wording from resultset to push (#2644)
Change of new environment variable `PULSE_PUSH_SOURCES`.

Keep old `publish-resultset-runnable-job-action` task name by creating a 
method that points to `publish_push_runnable_job_action`.
2017-08-04 09:38:57 -07:00
KWierso 3e9e7443cb Bug 1375341 - Add support for leaksanitizer errors (#2587) r=emorley 2017-06-29 17:05:26 -07:00
KWierso 37cf7fa970 Bug 1286195 - Add 'mozalloc_abort' to the bug suggestions blacklist (#2483) r=emorley 2017-05-16 15:01:51 -07:00
Ed Morley 9dad6fec61 Bug 1340554 - Switch away from deprecated Elasticsearch count API
The count search type was deprecated in Elasticsearch 2.0.0 and has been
removed entirely in version 5+:
https://www.elastic.co/guide/en/elasticsearch/reference/current/breaking_50_search_changes.html

This switches to the `.count()` API instead:
https://elasticsearch-dsl.readthedocs.io/en/latest/api.html#elasticsearch_dsl.Search.count

This can be landed prior to the ES 5.x upgrade, since it's supported by
the ES 2.x API too.
2017-04-19 14:06:34 +01:00
Ed Morley 04945524a2 Update test_search.py for changes in elasticsearch-dsl 2.2.0
Since missing strings fields now return `None` not the empty string:
https://github.com/elastic/elasticsearch-dsl-py/blob/2.x/Changelog.rst#220-2016-11-04
19649863ea
2017-04-19 13:48:32 +01:00
James Graham ac04d5ab8c Bug 1349617 - Handle process output lines in the log parser.
Process output lines start with a prefix like GECKO(1234) or PID 1234
and then a pipe. This is an extra pipe symbol compared to other lines,
so our code that splits on | and assumes specific data in specific
positions is broken. Try to detect the process output case and discard
the first token so that we have the same fields as other
pipe-delimited data.
2017-03-23 14:39:10 +00:00
Ed Morley 4c66f383ef Bug 1348375 - Remove unused imports
Fixes:

tests/autoclassify/test_classify_failures.py:7:1: F401 'treeherder.model.models.TextLogErrorMetadata' imported but unused
tests/etl/test_job_loader.py:7:1: F401 'treeherder.model.models.Repository' imported but unused
tests/model/test_classified_failure.py:6:1: F401 'treeherder.model.models.FailureLine' imported but unused
tests/seta/conftest.py:2:1: F401 'django.utils.timezone' imported but unused
tests/seta/test_job_priorities.py:8:1: F401 'treeherder.seta.settings.SETA_LOW_VALUE_PRIORITY' imported but unused
tests/webapp/api/test_text_log_summary_lines.py:4:1: F401 'treeherder.model.models.TextLogError' imported but unused
treeherder/auth/backends.py:13:5: F401 'django.utils.encoding.smart_str as smart_bytes' imported but unused
treeherder/autoclassify/tasks.py:4:1: F401 'django.conf.settings' imported but unused
treeherder/autoclassify/tasks.py:6:1: F401 'treeherder.celery_app' imported but unused
treeherder/perfalert/__init__.py:1:1: F401 '.perfalert.*' imported but unused
treeherder/seta/analyze_failures.py:7:1: F401 'treeherder.etl.seta.valid_platform' imported but unused
treeherder/seta/job_priorities.py:10:1: F401 'treeherder.model.models.Repository' imported but unused
treeherder/seta/models.py:7:1: F401 'treeherder.model.models.Repository' imported but unused

The seta migrations file change is due to the seta models no longer
depending on `model` (since the unnecessary `Repository` import has
been removed).
2017-03-20 13:18:14 +00:00
William Lachance 73670ac626 Bug 1329742 - Expire performance data (with option to override) (#2084)
In most cases, but not all, we want to expire performance datum on the
same cadence as job data. Add some code to do this, with an optional
override to keep it around indefinitely for some cases.
2017-03-10 15:35:25 -05:00
William Lachance 1a19c1601a Bug 1328453 - Only use completed jobs for calculating average job duration
Completed jobs = those with an end time > start_time
2017-03-06 11:36:00 -05:00
William Lachance fe5742a236 Bug 1328453 - Re-add accidentally deleted unit test for calculating durations 2017-03-06 11:36:00 -05:00
jgraham 3c03bb9fba Bug 1321787 - Autoclassify through the TextLogError rather than through the FailureLine (#2179) 2017-03-04 20:58:31 +00:00
Ed Morley 390cf3afc7 Bug 1333092 - Fix flake8 E305: expected 2 blank lines after definition
tests/client/test_treeherder_client.py:514:1: E305 expected 2 blank lines after class or function definition, found 1
tests/model/test_error_summary.py:66:1: E305 expected 2 blank lines after class or function definition, found 1
tests/model/test_error_summary.py:94:1: E305 expected 2 blank lines after class or function definition, found 1
tests/model/test_error_summary.py:112:1: E305 expected 2 blank lines after class or function definition, found 1
tests/model/test_error_summary.py:148:1: E305 expected 2 blank lines after class or function definition, found 1
tests/model/test_error_summary.py:166:1: E305 expected 2 blank lines after class or function definition, found 1
tests/perfalert/test_analyze.py:94:1: E305 expected 2 blank lines after class or function definition, found 1
tests/webapp/api/test_auth.py:23:1: E305 expected 2 blank lines after class or function definition, found 1
tests/webapp/api/test_version.py:12:1: E305 expected 2 blank lines after class or function definition, found 1
treeherder/config/settings.py:21:1: E305 expected 2 blank lines after class or function definition, found 1
treeherder/credentials/admin.py:10:1: E305 expected 2 blank lines after class or function definition, found 0
treeherder/etl/schema.py:16:1: E305 expected 2 blank lines after class or function definition, found 1
treeherder/model/search.py:56:1: E305 expected 2 blank lines after class or function definition, found 1
treeherder/model/tasks.py:42:1: E305 expected 2 blank lines after class or function definition, found 1
2017-01-23 16:30:24 +00:00
William Lachance 012df34580 Bug 1329002 - Remove last pieces of and references to datasource 2017-01-06 15:01:19 -05:00
William Lachance ae0be9d81c Bug 1329002 - Remove jobs model 2017-01-06 15:01:19 -05:00
William Lachance f6407b7493 Bug 1318474 - Stop writing to datasource altogether for jobs data
The last thing we were using it for were cycling data and giving an
id numbering for jobs, and we can easily replace those with calls to
the ORM.
2017-01-05 16:09:51 -05:00
William Lachance 901f6288a5 Bug 1318474 - Rewrite unit tests to only look for ORM representation 2017-01-05 16:09:51 -05:00
William Lachance 78f66bc7c5 Bug 1328451 - Add a mock log parser fixture to cycle data test
Prevents an intermittent from popping up
2017-01-04 12:32:21 -05:00
William Lachance 32cfd2b659 Bug 1318474 - Make web api's use ORM ids as input and output 2016-12-28 15:42:12 -05:00
William Lachance 608afa4ebd Bug 1325540 - Fix setting expected job duration during ingestion (#2042) 2016-12-28 11:13:50 -05:00
William Lachance ddd9b13eef Bug 1265503 - Add a reference to the main db job objects from performance datum 2016-12-20 17:37:35 -05:00
William Lachance 931865befe Bug 1265503 - Move data cycling tests into their own file 2016-12-20 17:37:35 -05:00
William Lachance 0f10dff26a Bug 1301477 - Convert artifact model into a set of etl methods (#2013) 2016-12-20 13:10:57 -05:00
Ed Morley da7902aa75 Bug 1320356 - Remove the custom DB-based Celery taskset implementation
Since it's unused as of bug 1310974.
2016-12-02 16:25:24 +00:00
William Lachance 3721af6550 Bug 1318474 - Fix job note deletion (#2008)
We were always resetting the failure classification to an invalid value
when the last job note was deleted for a job, but we didn't notice it
before because we didn't have foreign key validation.
2016-12-02 10:49:06 -05:00
William Lachance 9f604fa323 Bug 1318474 - Switch API's and some internal consumers to use Django ORM for job data
Still *ingesting* into datasource for now
2016-11-25 12:54:53 -05:00
William Lachance 9d557622f7 Bug 1318474 - Add job metadata to ORM schema and start ingesting it (#1998) 2016-11-24 12:56:50 -05:00
William Lachance 1c0c32cec0 Bug 1311185 - Turn off remaining result set ingestion and use 2016-11-11 15:40:02 -05:00
William Lachance 8ccc91ee95 Bug 1311185 - Make API's return push id's, not result set id's
For now the resultset and job API endpoints still return result_set_id,
for backwards compatibility.
2016-11-09 13:51:00 -05:00
William Lachance 129adcfab3 Bug 1301477 - Disable external facing artifact endpoints and API's (#1965)
* Can no longer store raw artifacts (anything treeherder doesn't understand
  is ignored)
* Attempting to retrieve an artifact now returns a 405 (not allowed)
2016-11-08 09:49:21 -05:00
William Lachance d757fb6bad Bug 1311185 - Start ingesting ORM pushes / commits
But don't use them for anything yet
2016-11-07 10:27:03 -05:00
William Lachance f9178c24c0 Bug 1308773 - Memoize calls to get per-project exclusion profiles (#1913) 2016-10-18 11:32:38 -04:00
William Lachance 7789d98c2f Bug 1310262 - Process text log artifacts in an atomic transaction (#1926) 2016-10-17 11:47:42 -04:00
William Lachance 61d89cd1a1 Bug 1308528 - Serialize ingestion of job data (#1906) 2016-10-11 17:13:42 -04:00
jgraham 32029361c8 Bug 1283859 - Fix quoting of MATCH ... AGAINST in bugscache search (#1914)
It appears that the intent of this code is to to a phrase match of the
search string against the bug summary for relevance matching. However
the code incorrectly tried to quote the string and as a result failed
to handle special characters in the AGAINST clause (e.g. + - ~ >
etc.). This change simply removes any existing quote characters from
the string and places the entire thing in quotes. Per the MySQL
documentations:

 > A phrase that is enclosed within double quote (") characters
   matches only rows that contain the phrase literally, as it was
   typed
2016-10-11 18:27:56 +01:00
William Lachance 8fc9754f4e Bug 1281820 - Stop using bug suggestions artifacts
Instead, generate the data when required. We will store the return value
of this in memcache for a day to ensure things are responsive for the sheriffs
when classifying recent failures.
2016-10-07 10:51:41 -04:00
William Lachance 9b9d37e690 Bug 1281820 - Move autoclassify methods into Django ORM class 2016-10-07 10:51:41 -04:00
William Lachance 69bdc2ed15 Bug 1281820 - Clean up autoclassification unit tests
* Remove unused fixtures
* Add test_job, test_job_2 fixtures for testing job data, instead of
  ingesting 11 jobs
* Remove various uses of datasource
2016-10-07 10:51:41 -04:00
camd 40d84ee95d Bug 1286578 - Retry job task if resultset doesn't exist (#1872)
* Bug 1286578 - Retry job task if resultset doesn't exist

This removes the logic which creates `skeleton resultsets`
when a job is ingested that we don't have a resultset for yet.
The new approach is to fail and wait for the task to retry.

The buildbot job ingestion already skips and retries later if
it encounters a job for which it has no resultset.

This adds a similar check to the Pulse Job ingestion.  If
a job comes in with a revision that doesn't have a resultset
yet, then this will raise a ValueError.  That will invoke the
retryable_task actions which will wait a bit, then retry.  Each
time it will wait a little longer to retry.  After 9 retries it
waits something like 3900 seconds which should be plenty of time
for the resultset ingestion to complete.
2016-09-29 10:13:26 -07:00
William Lachance 28cae8c360 Bug 1302844 - Remove redundant information from text log artifacts (#1854)
Now that they are only an intermediary format, we can remove data
that isn't required to interpret them.
2016-09-21 10:54:53 -04:00
William Lachance f0105d47f5 Bug 1258861 - Move text log steps and errors into main database (#1696)
This changes ingestion, the API endpoints, and the frontend to match
the new structure. For now we continue to store text_log_summary artifacts,
though they don't do anything anymore.
2016-09-12 12:30:36 -04:00
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
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
William Lachance ef6833891f Bug 1289574 - Handle various edge cases when importing bugs
* UTF-8 characters in summary
* Summary exceeds 255 characters
2016-07-27 16:00:23 -04:00
Kalpesh Krishna 2dac5add3b Bug 1277993 - Improve mechanism for excluding jobs and setting tiers (#1661) 2016-07-21 11:19:52 -04:00
jgraham df61b3a2af Bug 1283253 - Don't require a subtest name in elasticsearch. (#1700) 2016-07-21 13:22:02 +01:00
camd 959540913d Bug 1287501 - Fix /jobs/ endpoint to preserve `last_modified` param (#1704)
A prior commit removed the ability to use "-Infinity" for the last_modified
query param.  However, the fix accidentally stripped the param entirely.
This change ensures that the value is a valid date string.  The range is
not limited.

This also adds some new tests to ensure the param of `last_modified` is
working correctly when included.
2016-07-20 18:24:23 -07:00
ka7 bfc5076e5a minor spelling fixes (#1686) rs=emorley 2016-07-13 21:29:58 +01:00
Shruti Jasoria a8717ec2b4 Bug 1281044 - Remove the bugscache API endpoint (#1676) 2016-07-12 13:03:49 +01:00
Ed Morley aec1a3a267 Bug 1285925 - Remove unnecessary usages of the mock_post_json fixture
All tests other than those testing the API no longer hit the API (as of
bug 1211414), so don't need to use the `mock_post_json` fixture.
2016-07-11 20:47:11 +01:00
William Lachance 5335bf4163 Bug 1266062 - Move job note ingestion / queries to Django ORM 2016-07-04 11:43:26 -04:00
William Lachance c44c258295 Bug 1266062 - Move bug job map ingestion / queries to Django ORM 2016-07-04 11:43:26 -04: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
camd 7e26d12510 Bug 1275589 - Prune runnable jobs (#1587)
* Bug 1275589 - Prune runnable jobs

Prior to this fix, the list of runnable jobs would be pruned only when
the normal cycle-data process ran.  This is not fast enough, however.

Now, defunct buildernames are removed every time the runnable jobs are
updated.

* test fix

* fix
2016-06-14 14:57:09 -07:00
James Graham 9e4a8db518 Bug 1277936 - Fix indentation issue that made update_autoclassification_bug a no-op.
This wasn't a serious issue, it just meant that we would never infer a bug
number when a job was sheriffed using the non-autoclassification UI.
2016-06-06 11:54:45 +01:00
William Lachance de99ac5749 Bug 1277345 - Fix log exception during job ingestion
When a log already exists with different state during job ingestion with
a non-default status, we should not change it.
2016-06-01 15:53:03 -04:00
William Lachance 0e9d516f8a Bug 1273231 - Store job log url/name/parse information in central database 2016-05-25 13:58:44 -04:00
William Lachance 4d143c055f Bug 1272532 - Handle case where we get two different retry guids for a job
This is an obscure case (that we should probably handle better), but I
believe this patch should at least fix the new relic exception in the
common cases (specifically when we get the same retry with a different
guid in the same batch of jobs). This patch also adds a bunch of unit
tests to test ingesting batches of jobs containing retries. There are
many cases which still fail (which would probably never occur in real
life), but I'm going to put off fixing those for now -- see comments
in the unit tests for details.
2016-05-24 10:05:52 -04:00
William Lachance 9a594837bb Bug 1271723 - Cycle machine information that is no longer used 2016-05-13 16:40:02 -04:00
William Lachance 82221633b8 Bug 1270629 - Replace Job Info artifacts with a "jobdetail" endpoint
This is simpler and removes one more type of artifact from the per-project
databases.
2016-05-09 20:09:26 -04:00
William Lachance 5e8e6d12a3 Revert "Bug 1270629 - Replace Job Info artifacts with a "jobdetail" endpoint"
This reverts commit af9c208792.
2016-05-09 16:08:26 -04:00
William Lachance af9c208792 Bug 1270629 - Replace Job Info artifacts with a "jobdetail" endpoint
This is simpler and removes one more type of artifact from the per-project
databases.
2016-05-09 14:51:42 -04:00
William Lachance 444d5e0745 Bug 1270561 - Use intermediate jobs as lookup when ingesting artifacts 2016-05-05 14:47:28 -04:00
Cameron Dawson 706014481e Bug 1268676 - fix key errors on resultsets with 12 char revisions 2016-05-02 08:16:52 -07:00
autolander 62fab5684e Merge pull request #1429 from wlach/1268593
Bug 1268593 - Cycle job type / group / runnable job reference data
2016-04-29 10:05:04 -07:00
James Graham 496335e6c5 Bug 1265188 - Make sure to check for existing identical classification when trying to update the bug number.
When setting the bug number for a classified failure, first check for an
classified failure that already has that bug number, and if one exists,
update all references to the classified failure being changed to instead
point at the existing classification
2016-04-29 17:17:25 +01:00
William Lachance 414d68a806 Bug 1268593 - Cycle job type / group / runnable job reference data 2016-04-28 14:01:39 -04:00
William Lachance f744b91de1 Revert "Bug 1265037 - Temporarily disable creation of intermediate job entries"
This reverts commit 081d86bd7b.
2016-04-25 13:36:05 -04:00
William Lachance 081d86bd7b Bug 1265037 - Temporarily disable creation of intermediate job entries
We will wait to turn this on until the initial migration is complete to
ensure jobs are more-or-less in chronological order
2016-04-25 12:46:59 -04:00
William Lachance 104787282d Bug 1265037 - Create an intermediate jobs model/table
Not really useful in-and-of-itself, but should be helpful by acting
as a centralized place to relate and map job information from what
is stored in the main treeherder database to what's in the per-project
databases. Eventually, we can extend this into a full-fledged jobs model.
2016-04-25 12:46:59 -04:00
William Lachance 95add9207e Bug 1266398 - Remove unnecessary calls to jm.disconnect() from tests 2016-04-21 11:43:00 -04:00
James Graham 6d793616f9 Add data cycling for task_set_meta table.
This refactors deleting data stored in the treeherder db a little so that
there is a generic mechanism for chunked deletes of such data
2016-04-19 19:16:08 +01:00
Cameron Dawson 6ce43bf034 Bug 1177519 - Back end changes for autoclassification work 2016-04-19 19:16:07 +01:00
William Lachance 92f02ccc25 Bug 1231361 - Remove refdata model dependency from unit tests 2016-04-04 15:10:08 -04:00
William Lachance 15ba5b10b9 Bug 1231361 - Remove bugscache methods from refdata model
Instead, just use the ORM directly where needed.
2016-04-04 15:10:07 -04:00
Cameron Dawson 41522044fd Bug 1199291 - Create result set on the fly for jobs ingested where the RS does not exist yet 2016-03-23 16:56:52 -07:00
Cameron Dawson 2a9dbefa49 Bug 1199364 - Use revsion instead of revision_hash for resultsets
New resultsets will still store a value in their ``revision_hash`` field, but it will
just be the same value as their ``long_revision`` field.

This will log an exception in New Relic when a new resultset or job is posted
to the API with only a ``revision_hash``and not a ``revision`` value.

This also switches to using the longer 40 char revisions along side the
12 char revisions.  But we leverage the longer ones for most actions.  The
short revisions are stored and used so that people and the UI can support
locating a resultset (or setting ranges) with short revisions.
2016-03-17 15:48:49 -07:00
William Lachance ecac73e26a Bug 1256485 - Don't load initial data in unit tests
It's almost entirely unnecessary (the few times we need base data
we can generate it ourselves) and can overwrite other test data
if we're not careful. Better just to remove it.
2016-03-16 14:47:39 -04:00
James Graham 326b918e35 Bug 1245080 - Remove failure lines with corresponding jobs
When jobs are cycled, also remove the failure_line rows for
those jobs, to limit data consumption of the failure_line
table.
2016-03-16 17:25:54 +00:00
William Lachance 161b3635aa Bug 1239185 - Remove use of reference data model in job ingestion 2016-03-14 15:17:43 -04:00
Cameron Dawson 26b156af5a Bug 1254673 - Stop posting new resultset info to pulse 2016-03-09 11:47:28 -08:00
Ed Morley 41526006c5 Bug 1248406 - Replace print statements with print()
For future Python 3 compatibility.

(Whilst for 100% Python 3 equivalence we should be using
`from __future__ import print_function`, it doesn't seem worth it.)
2016-02-15 14:54:46 +00:00
Ed Morley 9b5c96e6ad Bug 1144687 - Remove duplicate sample_data_generator.py file
It's unused and mostly a dupe of the file in `tests/`.
2016-01-22 17:58:20 +00: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 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
Tiramisu 1993 dae9395468 Bug 1193419 - No longer expire resultset and revision 2015-11-26 11:29:10 +00:00
Mauro Doglio 5930b4f4c1 Bug 1193836 - Use pytest-django to run tests
pytest-django doesn't setup a test database for every single test, but
only for those tests that actually require a db. Tests that require a db
need to either be marked with `@pytest.mark.django_db` or use a fixture
that has a dependency on `db` or `transactional_db`.
Using a non transactional db would make tests execution much faster, but
unfortunately it doesn't play well with the treeherder datasource
creation so I used a transactional_db.

pytest-django also allows you to specify a settings file to use for
tests in a pytest.ini file, which is nicer than monkeypatch the original
settings file in the pytest session start function 😃.
2015-10-27 11:19:13 +00:00
Cameron Dawson 53bc948f94 Bug 1079796 - store long and short revisions
We store both long and short, but only utilize the short (as before).  We
need to populate all the short and long revision records before we can
start using them.  So after this commit, we will begin backfilling the
old records that don't yet have those values populated.  Once they all
are, we can move to using the long_revision primarily in Bug 1199364.
2015-10-21 13:02:01 -07:00
Ed Morley 4196822599 Bug 1211715 - Remove the device table 2015-10-10 23:04:15 +01:00
Ed Morley a170d6c047 Bug 1212447 - Allow setting the data retention time via an env variable
By storing the duration as an int rather than a timedelta, we can set it
via the environment, rather than having to rely on local.py.

The variable has also been renamed to ease the transition and also make
its purpose clearer. Prod/Heroku use the default duration, and stage has
already had DATA_CYCLE_DAYS set to 45 in its environment, for parity
with the old stage local.py DATA_CYCLE_INTERVAL setting.
2015-10-08 12:13:19 +01:00
Ed Morley 027abb7057 Bug 1211253 - Remove the concept of a platform's VM status
It's calculated during ingestion, but not used and in fact not actually
stored anywhere.
2015-10-05 18:49:25 +01:00
Ed Morley 571c57af71 Bug 1192957 - Mass-update python import style using isort
To fix pre-existing deviations from the style that will be enforced on
Travis in the next commit.
2015-10-02 17:55:29 +01:00
Ed Morley ba39c25fa2 Bug 1202626 - Stop storing each revision's commit_timestamp
It's unused in the UI and doesn't add any value, since we're
normally much more interested in the push_timestamp.

This can land without causing errors, since the field is DEFAULT NULL,
so can be dropped at our leisure later.
2015-09-23 10:43:10 +01:00
William Lachance 066f437ca5 Bug 1192976 - Refactor performance data + store in master db 2015-09-14 10:16:25 -04:00
William Lachance 7440089508 Bug 1198786 - Stop storing performance artifacts
They were never used for anything and take up a lot of space. They
also don't fit into the new performance model we're working on. We
can always bring back the useful bits later.
2015-08-28 10:49:50 -04:00
Mauro Doglio 1ab14030ce Bug 1181879 - upgrade django to 1.8.4 2015-08-19 19:53:55 +01:00
Ed Morley 90ba77e596 Bug 1192801 - Remove per-file MPL boilerplate since it's unnecessary
The MPL 2.0 terms state that as long as a LICENSE file is present, the
per-file header text is not required. See "Exhibit A" at the end of:
https://www.mozilla.org/MPL/2.0/
2015-08-18 23:32:11 +01:00
Ed Morley 27c024d22b Bug 1060765 - Move the error summary tests to tests/model/
Since the code they are testing was moved to the models directory, as
part of bug 1163182.
2015-08-11 17:04:47 +01:00
Ed Morley 1c00ccfcc7 Bug 1192661 - Clean up Python import order
Created using |isort -p tests -rc .| and a couple of manual tweaks.

The order is:
* futures
* std library
* third party packages
* local imports
* relative local imports
...with each group ordered with "import x" before "from x import y", and
then alphabetically.
2015-08-10 18:33:49 +01:00
Ed Morley 21ca58c3d2 Bug 1185030 - Remove the contenttype field from the datasource table
Since it's redundant now that the objectstore has been removed.
2015-07-23 11:23:06 +01:00
Cameron Dawson 00cfe6643d Bug 1140349 - Remove the objectstore code
After the previous commit, the Objectstore is effectively "dead code".
So this commit removes all the dead code after anything left over in
the Objectstore has been drained and added to the DB.
2015-07-21 14:13:21 -07:00
Mauro Doglio b9881f937c Bug 1183575 - Create a requests auth backend for 2-legged oauth 2015-07-20 16:12:33 +02:00
William Lachance 61904aaffa Bug 1182282 - Handle submissions of duplicate performance data
It appears that on occasion we parse a log more than once, which
resulted in duplicate performance series going into the database.
Let's be resilient about this by not inserting duplicate jobs into the
database (we always attach a unique job id to every datapoint, so there's
no chance of accidentally removing entries which happen to have the same
performance numbers)
2015-07-13 13:32:26 -04:00
Ed Morley 2d087edaea Bug 1182455 - Remove support for different DB hosts per datasource
Having the ability to use different DB hosts for each project sounded
like a good idea, but in reality, we have no need for it.

This switches us to using the global read-write and read-only database
host names rather than the fields on the datasource table. As such, the
'host', 'read_only_host' and 'type' (eg 'mysql') fields can be removed.
The Django model had a unique_together on host+name, so we now need to
make 'name' (ie database name) a unique key on it's own.

In addition, this removes the 'creation_date' field, since we don't use
it anywhere, and we can just look at the commit history to see when a
repo was created. (I imagine it may have had more use if we actually had
started partitioning the databases uses the old 'dataset' count field).

In a future bug, I'll remove the redundant substitution of 'engine' for
'InnoDB' in the template schema, given that engine is now always InnoDB
in create_db().
2015-07-11 13:20:00 +01:00
Ed Morley 9371347bc2 Revert "Bug 1175432 - Use dj-database-url to simplify DB environment variables"
This reverts commit 3330b3c567.
2015-07-09 23:05:49 +01:00
Ed Morley c4c660f277 Bug 1182201 - Compress blobs in the performance_series table
Since they can be up to 800+ KB in size and whilst there are not many
rows in the table, if they are not compressed it bloats the binlogs.
2015-07-09 22:40:55 +01:00
Ed Morley 3330b3c567 Bug 1175432 - Use dj-database-url to simplify DB environment variables
dj-database-url extracts DB host, port, username, password and database
name from the env variable 'DATABASE_URL' (unless another env variable
name is specified). If the env variable is not defined, it falls back to
the default passed to dj_database_url.config().

This means for Heroku and similar we can replace the multiple DB env
variables with just one URL for default & one for read_only.

This also effectively makes the setting of the read only DB variable
mandatory for stage/production/heroku, since DEFAULT_DATABASE_URL won't
be valid for them - so prevents us inadvertently not using the read only
DB.

Before this is deployed, we'll need to update the stage/prod puppet
configs & Heroku settings to add the new environment variable.
2015-07-09 17:54:29 +01:00
Ed Morley 0f3d1b2bcf Bug 1179214 - Stop storing the list of files changed in a revision
Since we're not currently using it, and the schema we need will likely
be different if we were to start using it in the future.
2015-07-08 10:52:15 +01:00
Ed Morley 6b1e4f602b Bug 1178234 - Remove repository_version
Since it's unused, and hg.mozilla.org now has this information available
via its API.

Note: This commit depends on bug 1178719, to prevent issues during
deployment. Also, due to https://code.djangoproject.com/ticket/25036 a
migrate will need to be run interactively after deployment, to clean up
the old repositoryversion content type.
2015-06-30 14:16:47 +01:00
Ed Morley d2010a6215 Bug 1178232 - Remove support for multiple Datasources of the same type
The datasource table has a 'dataset' field, to allow for multiple
datasources of the same type (for partitioning; eg the "1" in
`mozilla-central_jobs_1`). However we have never used it, so let's just
remove it.
2015-06-30 14:10:07 +01:00
William Lachance 4a74b3704e Bug 1171707 - Fix locking when concurrently updating performance series
Before if two celery jobs were updating the same series, one would overwrite
the other because the locking code did not actually work (it just always
unconditonally got a new lock without checking if anything was using it).
This fixes that.
2015-06-29 15:03:44 -04:00
Cameron Dawson 358e90f685 Bug 1080760 - Auto-generate bug suggestions asynchronously
This introduces two new ways to generate ``Bug suggestions`` artifacts from
a ``text_log_summary`` artifact
1. POST a ``text_log_summary`` on the ``/artifact`` endpoint
2. POST a ``text_log_summary`` with a job on the ``/jobs`` endpoint.

Both of these cases will schedule an asynchronous task to generate the
``Bug suggestions`` artifact with ``celery``.

Artifact generation scenarios:

JobCollections
^^^^^^^^^^^^^^
Via the ``/jobs`` endpoint:

1. Submit a Log URL with no ``parse_status`` or ``parse_status`` set to "pending"
    * This will generate ``text_log_summary`` and ``Bug suggestions`` artifacts
    * Current *Buildbot* workflow

2. Submit a Log URL with ``parse_status`` set to "parsed" and a ``text_log_summary`` artifact
    * Will generate a ``Bug suggestions`` artifact only
    * Desired future state of *Task Cluster*

3. Submit a Log URL with ``parse_status`` of "parsed", with ``text_log_summary`` and ``Bug suggestions`` artifacts
    * Will generate nothing

ArtifactCollections
^^^^^^^^^^^^^^^^^^^
Via the ``/artifact`` endpoint:

1. Submit a ``text_log_summary`` artifact
    * Will generate a ``Bug suggestions`` artifact if it does not already exist for that job.

2. Submit ``text_log_summary`` and ``Bug suggestions`` artifacts
    * Will generate nothing
    * This is *Treeherder's* current internal log parser workflow
2015-05-20 16:28:32 -07:00
Cameron Dawson 44511e4518 Bug 1154470 - refactor artifact handling into its own model 2015-04-17 10:56:44 -07:00
Ed Morley 5e0f36ae91 Bug 1133482 - Always ensure files are closed after being open()ed 2015-03-03 17:13:34 +00:00
Ed Morley 05b3cebfa4 Bug 1059814 - Fix pep8/pyflakes E712, E713, E731, W503
Fixes:
tests/model/derived/test_jobs_model.py:343:23: E712 comparison to False should be 'if cond is False:' or 'if not cond:'
treeherder/__init__.py:11:1: E731 do not assign a lambda expression, use a def
treeherder/etl/buildapi.py:107:16: E713 test for membership should be 'not in'
treeherder/log_parser/utils.py:183:33: W503 line break before binary operator
treeherder/model/derived/base.py:73:12: E713 test for membership should be 'not in'
treeherder/model/derived/base.py:82:12: E713 test for membership should be 'not in'
treeherder/model/derived/jobs.py:1998:26: W503 line break before binary operator
2015-03-03 02:34:40 +00:00
Ed Morley f5c0b53e0c Bug 1059814 - Whitespace pep8 fixes
Generated using:
autopep8 --in-place --recursive .

Before:
$ pep8 | wc -l
1686

After:
$ pep8 | wc -l
57

A later autopep8 run will be performed using --aggressive, which makes
non-whitespace changes too.
2015-02-15 14:52:31 +00:00
Ed Morley e61738b5a9 Bug 1127940 - Remove the now unused get_bug_job_map_detail()
BugzillaBugRequest was the only consumer, so we can now remove it.
2015-02-05 01:48:54 +00:00
Ed Morley 280c687159 Bug 1125464 - Always set read_only_host when creating job/OS Datasources
read_only_host was previously only ever set when using the
init_datasources script, and not via any other means.
2015-01-24 19:30:17 +00:00
Ed Morley 6bf711fb4a Bug 1059811 - pyflakes: Remove unused variables 2015-01-16 12:33:32 +00:00
Ed Morley b0d1c0c168 Bug 1059811 - pyflakes: Remove unused imports 2015-01-16 12:33:32 +00:00
mdoglio f5aa1d3a9f Bug 1101040 - filter jobs by last_modified 2015-01-06 15:39:24 +00:00
mdoglio 06f62d21f6 Bug 1102228 - Improve the data cycling routine
Added several parameters to the cycle_data shell command: cycle-interval (in days),
chunk-size (in number of result sets), sleep-time (in seconds).
I made the cycle_data task a very thin wrapper around the shell command,
there is no more logic in it.
All the queries for data cycling are executed with the retry logic to
handle db deadlocks
2014-11-26 16:38:18 +00:00
mdoglio 0e19a402ca Bug 1102257 - Store the data cycle interval in the settings file 2014-11-21 15:38:32 +00:00
Ed Morley 05cf876d4a Bug 1078239 - Fix bug suggestions for recently modified, resolved bugs
We divide bug suggestions for a search term into 'open_recent' and
'all_others'. The former is supposed to be group #1 below, and the
latter groups 2-4, with the summation of the two groups corresponding
to every bug whose summary matches the search term.

1) Open + recently modified
2) Open + not recently modified
3) Resolved + recently modified
4) Resolved + not recently modified

However prior to this patch group #3 was not being returned at all, when
it should have been included in all_others.
2014-11-10 15:51:06 +00:00
Mauro Doglio 0d5b02daf5 Merge pull request #279 from tojonmz/add-headers
Bug 1090689 - Add MPL2.0 headers to the repo
2014-11-10 14:46:25 +00:00
Ed Morley 0d586fd2f1 Bug 1072377 - Add another test for truncated test name bug searches 2014-11-10 13:50:02 +00:00
Ed Morley 93e0c98999 Bug 1091643 - Add tests for SQL LIKE escaping of search_term
Test that we are treating the search term literally in the LIKE
statement, and so have correctly escaped any underscores, percent signs
or escape symbols.
2014-11-10 13:50:02 +00:00
Ed Morley b2ffa4d61f Bug 1091643 - Add test for truncated test name bug searches 2014-11-10 13:50:01 +00:00
Jonathan French dbb4d11e09 Bug 1090689 - Add MPL2.0 headers to the repo 2014-11-03 13:06:03 -05:00
Mauro Doglio 23ee49570d Merge pull request #268 from mozilla/mysql-retry
Mysql retry
2014-10-30 15:07:33 +00:00
Ed Morley d7f9350560 Bug 1091579 - Rename SEARCH_TERMS to BUG_SEARCHES 2014-10-30 13:07:07 +00:00
Ed Morley 0c8318eb51 Bug 1091579 - Remove the now redundant test_get_all_other_bugs_wrong_term() 2014-10-30 13:07:06 +00:00
Ed Morley 33e6ca8906 Bug 1091579 - test_get_all_other_bugs() should check the bug IDs
...rather than just whether the count of bugs is greater than zero.
2014-10-30 13:07:05 +00:00
Ed Morley 513d3d0c55 Bug 1091579 - Parametrize test_get_all_other_bugs() 2014-10-30 13:07:05 +00:00
Ed Morley 6cb45262e7 Bug 1091579 - Combine the tests for correct and incorrect search terms 2014-10-30 13:07:04 +00:00
Ed Morley 8b803b10f3 Bug 1091579 - test_get_open_recent_bug_right_term() should check the bug IDs found
...rather than just whether the count of bugs is greater than zero.
2014-10-30 13:07:04 +00:00
Ed Morley 110c5fe619 Bug 1091579 - Parametrize test_get_open_recent_bug_right_term() 2014-10-30 13:07:03 +00:00
Ed Morley c1faeda8a7 Bug 1091579 - Correct & reformat comments in test_refdata.py 2014-10-30 13:07:02 +00:00
Cameron Dawson 9d098e8ade bug 1089782 - fix retry limit and add test 2014-10-28 14:54:26 -07:00
camd d4bbb0475d Merge pull request #253 from mozilla/bug-1081600-investgate-job-group-update
Bug 1081600 - add a test to confirm the behaviour of job type/job group ...
2014-10-20 08:36:11 -07:00
mdoglio 70c85484cd Bug 1081600 - add a test to confirm the behaviour of job type/job group associations 2014-10-16 12:16:15 +01:00
Jonathan Eads ab1bd6a3c0 Bug 1080219 - Fix broken tests, add comments 2014-10-13 13:38:29 -07:00
mdoglio 8f9a686fde (bug 1072291) revert pushlog caching strategy
The pushlog cache now uses the top revision of the last push.
Also, increase the time limit to fetch the pushlog to 3 minutes
2014-09-25 21:02:40 +01:00
Jonathan Eads d7908793a5 Bug 1071577 - Cache revision hashes to reduce pushlog load 2014-09-24 15:46:33 -07:00
mdoglio a44c6c7cfb Bug 1048354 - send bug association to bugzilla 2014-09-10 12:07:13 -07:00
Jonathan Eads 1a97cfa944 modified detection of new result sets strategy 2014-08-26 14:05:17 -07:00
Jonathan Eads cd9f658d81 Added task/operations to report new result sets to pulse 2014-08-25 16:03:26 -07:00
mdoglio 06473c208e retrieve bug suggestions with an all words search 2014-08-07 15:37:07 +01:00
mdoglio b9262f367a fix delete_bugscache method in RefDataManager 2014-08-05 18:21:18 +01:00
mdoglio db64a83d82 (Bug 1032643) Tweak bug suggestions retrieval 2014-08-05 11:55:41 +01:00