now populating revisions, but not yet verifying that data.

This commit is contained in:
Cameron Dawson 2013-04-25 17:27:59 -07:00
Родитель 5810943ef5
Коммит 8583deea38
7 изменённых файлов: 469 добавлений и 367 удалений

Просмотреть файл

@ -3,15 +3,12 @@ import difflib
import pprint import pprint
from .sample_data_generator import job_json
def test_unicode(jm): def test_unicode(jm):
"""Unicode representation of a ``JobModel`` is the project name.""" """Unicode representation of a ``JobModel`` is the project name."""
assert unicode(jm) == unicode(jm.project) assert unicode(jm) == unicode(jm.project)
def test_disconnect(jm): def xtest_disconnect(jm):
"""test that your model disconnects""" """test that your model disconnects"""
# establish the connection to jobs. # establish the connection to jobs.
@ -25,19 +22,20 @@ def test_disconnect(jm):
def test_ingest_single_sample_job(jm, sample_data): def test_ingest_single_sample_job(jm, sample_data):
"""Process all job structures in the job_data.txt file""" """Process a single job structure in the job_data.txt file"""
blob = sample_data.job_data[0] blob = sample_data.job_data[0]
jm.store_job_data(json.dumps(blob)) jm.store_job_data(json.dumps(blob))
job_id = jm.process_objects(1)[0] jobs = jm.process_objects(1)
# import time
# time.sleep(30)
assert len(jobs) == 1
job_id = jobs[0]
exp_job = clean_job_blob_dict(blob["jobs"][0]) exp_job = clean_job_blob_dict(blob["jobs"][0])
act_job = JobDictBuilder(jm, job_id).as_dict() act_job = JobDictBuilder(jm, job_id).as_dict()
assert exp_job == act_job, diff_dict(exp_job, act_job) assert exp_job == act_job, diff_dict(exp_job, act_job)
# print json.dumps(blob, indent=4)
# print json.dumps(job_dict, indent=4)
complete_count = jm.get_os_dhub().execute( complete_count = jm.get_os_dhub().execute(
proc="objectstore_test.counts.complete")[0]["complete_count"] proc="objectstore_test.counts.complete")[0]["complete_count"]
loading_count = jm.get_os_dhub().execute( loading_count = jm.get_os_dhub().execute(
@ -48,10 +46,18 @@ def test_ingest_single_sample_job(jm, sample_data):
def test_ingest_all_sample_jobs(jm, sample_data): def test_ingest_all_sample_jobs(jm, sample_data):
"""Process all job structures in the job_data.txt file""" """
Process each job structure in the job_data.txt file and verify.
This rebuilds the JSON blob (for the most part) and compares that
everything was stored correctly.
"""
for blob in sample_data.job_data: for blob in sample_data.job_data:
jm.store_job_data(json.dumps(blob)) jm.store_job_data(json.dumps(blob))
job_id = jm.process_objects(1)[0] jobs = jm.process_objects(1)
assert len(jobs) == 1
job_id = jobs[0]
exp_job = clean_job_blob_dict(blob["jobs"][0]) exp_job = clean_job_blob_dict(blob["jobs"][0])
act_job = JobDictBuilder(jm, job_id).as_dict() act_job = JobDictBuilder(jm, job_id).as_dict()

Просмотреть файл

@ -180,9 +180,15 @@ class JobsModel(TreeherderModelBase):
""" """
# @@@ sources result_set_id = self._set_result_set(data["revision_hash"])
# Get/Set reference info, all inserts use ON DUPLICATE KEY # assert result_set_id > 0
# sources
for src in data["sources"]:
revision_id = self._insert_revision(src)
self._insert_revision_map(revision_id, result_set_id)
# set Job data
rdm = self.refdata_model rdm = self.refdata_model
job_id = -1 job_id = -1
@ -223,8 +229,6 @@ class JobsModel(TreeherderModelBase):
job["product_name"], job["product_name"],
) )
result_set_id = self._set_result_set(data["revision_hash"])
job_id = self._set_job_data( job_id = self._set_job_data(
job, job,
result_set_id, result_set_id,
@ -277,6 +281,45 @@ class JobsModel(TreeherderModelBase):
return result_set_id return result_set_id
def _insert_revision(self, src):
"""
Insert a source to the ``revision`` table
Example source:
{
"commit_timestamp": 1365732271,
"push_timestamp": 1365732271,
"comments": "Bug 854583 - Use _pointer_ instead of...",
"repository": "mozilla-aurora",
"revision": "c91ee0e8a980"
}
"""
repository_id = self.refdata_model.get_repository_id(
src["repository"])
revision_id = self._insert_data_and_get_id(
'set_revision',
[
src["revision"],
"author?",
src["comments"],
src["push_timestamp"],
src["commit_timestamp"],
repository_id,
]
)
return revision_id
def _insert_revision_map(self, revision_id, result_set_id):
self._insert_data(
'set_revision_map',
[
revision_id,
result_set_id
]
)
def _set_job_data(self, data, result_set_id, build_platform_id, def _set_job_data(self, data, result_set_id, build_platform_id,
machine_platform_id, machine_id, option_collection_id, machine_platform_id, machine_id, option_collection_id,
job_type_id, product_id): job_type_id, product_id):

Просмотреть файл

@ -264,6 +264,16 @@ class RefDataManager(object):
id_iter = self.dhub.execute( id_iter = self.dhub.execute(
proc='reference.selects.get_repository_version_id', proc='reference.selects.get_repository_version_id',
placeholders=[repository_id, version],
debug_show=self.DEBUG,
return_type='iter')
return id_iter.get_column_data('id')
def get_repository_id(self, name):
id_iter = self.dhub.execute(
proc='reference.selects.get_repository_id',
placeholders=[name], placeholders=[name],
debug_show=self.DEBUG, debug_show=self.DEBUG,
return_type='iter') return_type='iter')

Просмотреть файл

@ -1,547 +1,560 @@
[ [
{ {
"pk": 1, "pk": 1,
"model": "model.repository", "model": "model.repository",
"fields": { "fields": {
"dvcs_type": "hg", "dvcs_type": "hg",
"name": "mozilla-central", "name": "mozilla-central",
"url": "https://hg.mozilla.org/mozilla-central", "url": "https://hg.mozilla.org/mozilla-central",
"active_status": "active", "active_status": "active",
"codebase": "gecko", "codebase": "gecko",
"repository_group": 1, "repository_group": 1,
"description": "" "description": ""
} }
}, },
{ {
"pk": 2, "pk": 2,
"model": "model.repository", "model": "model.repository",
"fields": { "fields": {
"dvcs_type": "hg", "dvcs_type": "hg",
"name": "mozilla-inbound", "name": "mozilla-inbound",
"url": "https://hg.mozilla.org/integration/mozilla-inbound", "url": "https://hg.mozilla.org/integration/mozilla-inbound",
"active_status": "active", "active_status": "active",
"codebase": "gecko", "codebase": "gecko",
"repository_group": 1, "repository_group": 1,
"description": "" "description": ""
} }
}, },
{ {
"pk": 3, "pk": 3,
"model": "model.repository", "model": "model.repository",
"fields": { "fields": {
"dvcs_type": "hg", "dvcs_type": "hg",
"name": "mozilla-aurora", "name": "mozilla-aurora",
"url": "https://hg.mozilla.org/releases/mozilla-aurora", "url": "https://hg.mozilla.org/releases/mozilla-aurora",
"active_status": "active", "active_status": "active",
"codebase": "gecko", "codebase": "gecko",
"repository_group": 2, "repository_group": 2,
"description": "" "description": ""
} }
}, },
{ {
"pk": 4, "pk": 4,
"model": "model.repository", "model": "model.repository",
"fields": { "fields": {
"dvcs_type": "hg", "dvcs_type": "hg",
"name": "mozilla-beta", "name": "mozilla-beta",
"url": "https://hg.mozilla.org/releases/mozilla-beta", "url": "https://hg.mozilla.org/releases/mozilla-beta",
"active_status": "active", "active_status": "active",
"codebase": "gecko", "codebase": "gecko",
"repository_group": 2, "repository_group": 2,
"description": "" "description": ""
} }
}, },
{ {
"pk": 5, "pk": 5,
"model": "model.repository", "model": "model.repository",
"fields": { "fields": {
"dvcs_type": "hg", "dvcs_type": "hg",
"name": "mozilla-release", "name": "mozilla-release",
"url": "https://hg.mozilla.org/releases/mozilla-release", "url": "https://hg.mozilla.org/releases/mozilla-release",
"active_status": "active", "active_status": "active",
"codebase": "gecko", "codebase": "gecko",
"repository_group": 2, "repository_group": 2,
"description": "" "description": ""
} }
}, },
{ {
"pk": 6, "pk": 6,
"model": "model.repository", "model": "model.repository",
"fields": { "fields": {
"dvcs_type": "hg", "dvcs_type": "hg",
"name": "mozilla-b2g18", "name": "mozilla-b2g18",
"url": "https://hg.mozilla.org/releases/mozilla-b2g18", "url": "https://hg.mozilla.org/releases/mozilla-b2g18",
"active_status": "active", "active_status": "active",
"codebase": "gecko", "codebase": "gecko",
"repository_group": 2, "repository_group": 2,
"description": "" "description": ""
} }
}, },
{ {
"pk": 7, "pk": 7,
"model": "model.repository", "model": "model.repository",
"fields": { "fields": {
"dvcs_type": "hg", "dvcs_type": "hg",
"name": "mozilla-b2g18_v1_0_1", "name": "mozilla-b2g18_v1_0_1",
"url": "https://hg.mozilla.org/releases/mozilla-b2g18_v1_0_1", "url": "https://hg.mozilla.org/releases/mozilla-b2g18_v1_0_1",
"active_status": "active", "active_status": "active",
"codebase": "gecko", "codebase": "gecko",
"repository_group": 2, "repository_group": 2,
"description": "" "description": ""
} }
}, },
{ {
"pk": 8, "pk": 8,
"model": "model.repository", "model": "model.repository",
"fields": { "fields": {
"dvcs_type": "hg", "dvcs_type": "hg",
"name": "mozilla-b2g18_v1_1_0", "name": "mozilla-b2g18_v1_1_0",
"url": "https://hg.mozilla.org/releases/mozilla-b2g18_v1_1_0", "url": "https://hg.mozilla.org/releases/mozilla-b2g18_v1_1_0",
"active_status": "active", "active_status": "active",
"codebase": "gecko", "codebase": "gecko",
"repository_group": 2, "repository_group": 2,
"description": "" "description": ""
} }
}, },
{ {
"pk": 9, "pk": 9,
"model": "model.repository", "model": "model.repository",
"fields": { "fields": {
"dvcs_type": "hg", "dvcs_type": "hg",
"name": "mozilla-esr17", "name": "mozilla-esr17",
"url": "https://hg.mozilla.org/releases/mozilla-esr17", "url": "https://hg.mozilla.org/releases/mozilla-esr17",
"active_status": "active", "active_status": "active",
"codebase": "gecko", "codebase": "gecko",
"repository_group": 2, "repository_group": 2,
"description": "" "description": ""
} }
}, },
{ {
"pk": 10, "pk": 10,
"model": "model.repository", "model": "model.repository",
"fields": { "fields": {
"dvcs_type": "hg", "dvcs_type": "hg",
"name": "try", "name": "try",
"url": "https://hg.mozilla.org/try", "url": "https://hg.mozilla.org/try",
"active_status": "active", "active_status": "active",
"codebase": "gecko", "codebase": "gecko",
"repository_group": 3, "repository_group": 3,
"description": "" "description": ""
} }
}, },
{ {
"pk": 11, "pk": 11,
"model": "model.repository", "model": "model.repository",
"fields": { "fields": {
"dvcs_type": "hg", "dvcs_type": "hg",
"name": "build-system", "name": "build-system",
"url": "https://hg.mozilla.org/projects/build-system", "url": "https://hg.mozilla.org/projects/build-system",
"active_status": "active", "active_status": "active",
"codebase": "gecko", "codebase": "gecko",
"repository_group": 1, "repository_group": 1,
"description": "" "description": ""
} }
}, },
{ {
"pk": 12, "pk": 12,
"model": "model.repository", "model": "model.repository",
"fields": { "fields": {
"dvcs_type": "hg", "dvcs_type": "hg",
"name": "fx-team", "name": "fx-team",
"url": "https://hg.mozilla.org/integration/fx-team", "url": "https://hg.mozilla.org/integration/fx-team",
"active_status": "active", "active_status": "active",
"codebase": "gecko", "codebase": "gecko",
"repository_group": 1, "repository_group": 1,
"description": "" "description": ""
} }
}, },
{ {
"pk": 13, "pk": 13,
"model": "model.repository", "model": "model.repository",
"fields": { "fields": {
"dvcs_type": "hg", "dvcs_type": "hg",
"name": "graphics", "name": "graphics",
"url": "https://hg.mozilla.org/projects/graphics", "url": "https://hg.mozilla.org/projects/graphics",
"active_status": "active", "active_status": "active",
"codebase": "gecko", "codebase": "gecko",
"repository_group": 1, "repository_group": 1,
"description": "" "description": ""
} }
}, },
{ {
"pk": 14, "pk": 14,
"model": "model.repository", "model": "model.repository",
"fields": { "fields": {
"dvcs_type": "hg", "dvcs_type": "hg",
"name": "ionmonkey", "name": "ionmonkey",
"url": "https://hg.mozilla.org/projects/ionmonkey", "url": "https://hg.mozilla.org/projects/ionmonkey",
"active_status": "active", "active_status": "active",
"codebase": "gecko", "codebase": "gecko",
"repository_group": 1, "repository_group": 1,
"description": "" "description": ""
} }
}, },
{ {
"pk": 15, "pk": 15,
"model": "model.repository", "model": "model.repository",
"fields": { "fields": {
"dvcs_type": "hg", "dvcs_type": "hg",
"name": "profiling", "name": "profiling",
"url": "https://hg.mozilla.org/projects/profiling", "url": "https://hg.mozilla.org/projects/profiling",
"active_status": "active", "active_status": "active",
"codebase": "gecko", "codebase": "gecko",
"repository_group": 1, "repository_group": 1,
"description": "" "description": ""
} }
}, },
{ {
"pk": 16, "pk": 16,
"model": "model.repository", "model": "model.repository",
"fields": { "fields": {
"dvcs_type": "hg", "dvcs_type": "hg",
"name": "services-central", "name": "services-central",
"url": "https://hg.mozilla.org/services/services-central", "url": "https://hg.mozilla.org/services/services-central",
"active_status": "active", "active_status": "active",
"codebase": "gecko", "codebase": "gecko",
"repository_group": 1, "repository_group": 1,
"description": "" "description": ""
} }
}, },
{ {
"pk": 17, "pk": 17,
"model": "model.repository", "model": "model.repository",
"fields": { "fields": {
"dvcs_type": "hg", "dvcs_type": "hg",
"name": "ux", "name": "ux",
"url": "https://hg.mozilla.org/projects/ux", "url": "https://hg.mozilla.org/projects/ux",
"active_status": "active", "active_status": "active",
"codebase": "gecko", "codebase": "gecko",
"repository_group": 1, "repository_group": 1,
"description": "" "description": ""
} }
}, },
{ {
"pk": 18, "pk": 18,
"model": "model.repository", "model": "model.repository",
"fields": { "fields": {
"dvcs_type": "hg", "dvcs_type": "hg",
"name": "alder", "name": "alder",
"url": "https://hg.mozilla.org/projects/alder", "url": "https://hg.mozilla.org/projects/alder",
"active_status": "active", "active_status": "active",
"codebase": "gecko", "codebase": "gecko",
"repository_group": 1, "repository_group": 1,
"description": "" "description": ""
} }
}, },
{ {
"pk": 19, "pk": 19,
"model": "model.repository", "model": "model.repository",
"fields": { "fields": {
"dvcs_type": "hg", "dvcs_type": "hg",
"name": "ash", "name": "ash",
"url": "https://hg.mozilla.org/projects/ash", "url": "https://hg.mozilla.org/projects/ash",
"active_status": "active", "active_status": "active",
"codebase": "gecko", "codebase": "gecko",
"repository_group": 1, "repository_group": 1,
"description": "" "description": ""
} }
}, },
{ {
"pk": 20, "pk": 20,
"model": "model.repository", "model": "model.repository",
"fields": { "fields": {
"dvcs_type": "hg", "dvcs_type": "hg",
"name": "birch", "name": "birch",
"url": "https://hg.mozilla.org/projects/birch", "url": "https://hg.mozilla.org/projects/birch",
"active_status": "active", "active_status": "active",
"codebase": "gecko", "codebase": "gecko",
"repository_group": 1, "repository_group": 1,
"description": "" "description": ""
} }
}, },
{ {
"pk": 21, "pk": 21,
"model": "model.repository", "model": "model.repository",
"fields": { "fields": {
"dvcs_type": "hg", "dvcs_type": "hg",
"name": "cedar", "name": "cedar",
"url": "https://hg.mozilla.org/projects/cedar", "url": "https://hg.mozilla.org/projects/cedar",
"active_status": "active", "active_status": "active",
"codebase": "gecko", "codebase": "gecko",
"repository_group": 1, "repository_group": 1,
"description": "" "description": ""
} }
}, },
{ {
"pk": 22, "pk": 22,
"model": "model.repository", "model": "model.repository",
"fields": { "fields": {
"dvcs_type": "hg", "dvcs_type": "hg",
"name": "cypress", "name": "cypress",
"url": "https://hg.mozilla.org/projects/cypress", "url": "https://hg.mozilla.org/projects/cypress",
"active_status": "active", "active_status": "active",
"codebase": "gecko", "codebase": "gecko",
"repository_group": 1, "repository_group": 1,
"description": "" "description": ""
} }
}, },
{ {
"pk": 23, "pk": 23,
"model": "model.repository", "model": "model.repository",
"fields": { "fields": {
"dvcs_type": "hg", "dvcs_type": "hg",
"name": "date", "name": "date",
"url": "https://hg.mozilla.org/projects/date", "url": "https://hg.mozilla.org/projects/date",
"active_status": "active", "active_status": "active",
"codebase": "gecko", "codebase": "gecko",
"repository_group": 1, "repository_group": 1,
"description": "" "description": ""
} }
}, },
{ {
"pk": 24, "pk": 24,
"model": "model.repository", "model": "model.repository",
"fields": { "fields": {
"dvcs_type": "hg", "dvcs_type": "hg",
"name": "elm", "name": "elm",
"url": "https://hg.mozilla.org/projects/elm", "url": "https://hg.mozilla.org/projects/elm",
"active_status": "active", "active_status": "active",
"codebase": "gecko", "codebase": "gecko",
"repository_group": 1, "repository_group": 1,
"description": "" "description": ""
} }
}, },
{ {
"pk": 25, "pk": 25,
"model": "model.repository", "model": "model.repository",
"fields": { "fields": {
"dvcs_type": "hg", "dvcs_type": "hg",
"name": "fig", "name": "fig",
"url": "https://hg.mozilla.org/projects/fig", "url": "https://hg.mozilla.org/projects/fig",
"active_status": "active", "active_status": "active",
"codebase": "gecko", "codebase": "gecko",
"repository_group": 1, "repository_group": 1,
"description": "" "description": ""
} }
}, },
{ {
"pk": 26, "pk": 26,
"model": "model.repository", "model": "model.repository",
"fields": { "fields": {
"dvcs_type": "hg", "dvcs_type": "hg",
"name": "gum", "name": "gum",
"url": "https://hg.mozilla.org/projects/gum", "url": "https://hg.mozilla.org/projects/gum",
"active_status": "active", "active_status": "active",
"codebase": "gecko", "codebase": "gecko",
"repository_group": 1, "repository_group": 1,
"description": "" "description": ""
} }
}, },
{ {
"pk": 27, "pk": 27,
"model": "model.repository", "model": "model.repository",
"fields": { "fields": {
"dvcs_type": "hg", "dvcs_type": "hg",
"name": "holly", "name": "holly",
"url": "https://hg.mozilla.org/projects/holly", "url": "https://hg.mozilla.org/projects/holly",
"active_status": "active", "active_status": "active",
"codebase": "gecko", "codebase": "gecko",
"repository_group": 1, "repository_group": 1,
"description": "" "description": ""
} }
}, },
{ {
"pk": 28, "pk": 28,
"model": "model.repository", "model": "model.repository",
"fields": { "fields": {
"dvcs_type": "hg", "dvcs_type": "hg",
"name": "jamun", "name": "jamun",
"url": "https://hg.mozilla.org/projects/jamun", "url": "https://hg.mozilla.org/projects/jamun",
"active_status": "active", "active_status": "active",
"codebase": "gecko", "codebase": "gecko",
"repository_group": 1, "repository_group": 1,
"description": "" "description": ""
} }
}, },
{ {
"pk": 29, "pk": 29,
"model": "model.repository", "model": "model.repository",
"fields": { "fields": {
"dvcs_type": "hg", "dvcs_type": "hg",
"name": "larch", "name": "larch",
"url": "https://hg.mozilla.org/projects/larch", "url": "https://hg.mozilla.org/projects/larch",
"active_status": "active", "active_status": "active",
"codebase": "gecko", "codebase": "gecko",
"repository_group": 1, "repository_group": 1,
"description": "" "description": ""
} }
}, },
{ {
"pk": 30, "pk": 30,
"model": "model.repository", "model": "model.repository",
"fields": { "fields": {
"dvcs_type": "hg", "dvcs_type": "hg",
"name": "maple", "name": "maple",
"url": "https://hg.mozilla.org/projects/maple", "url": "https://hg.mozilla.org/projects/maple",
"active_status": "active", "active_status": "active",
"codebase": "gecko", "codebase": "gecko",
"repository_group": 1, "repository_group": 1,
"description": "" "description": ""
} }
}, },
{ {
"pk": 31, "pk": 31,
"model": "model.repository", "model": "model.repository",
"fields": { "fields": {
"dvcs_type": "hg", "dvcs_type": "hg",
"name": "oak", "name": "oak",
"url": "https://hg.mozilla.org/projects/oak", "url": "https://hg.mozilla.org/projects/oak",
"active_status": "active", "active_status": "active",
"codebase": "gecko", "codebase": "gecko",
"repository_group": 1, "repository_group": 1,
"description": "" "description": ""
} }
}, },
{ {
"pk": 32, "pk": 32,
"model": "model.repository", "model": "model.repository",
"fields": { "fields": {
"dvcs_type": "hg", "dvcs_type": "hg",
"name": "pine", "name": "pine",
"url": "https://hg.mozilla.org/projects/pine", "url": "https://hg.mozilla.org/projects/pine",
"active_status": "active", "active_status": "active",
"codebase": "gecko", "codebase": "gecko",
"repository_group": 1, "repository_group": 1,
"description": "" "description": ""
} }
}, },
{ {
"pk": 33, "pk": 33,
"model": "model.repository", "model": "model.repository",
"fields": { "fields": {
"dvcs_type": "hg", "dvcs_type": "hg",
"name": "gaia-master", "name": "gaia-master",
"url": "https://hg.mozilla.org/integration/gaia-central", "url": "https://hg.mozilla.org/integration/gaia-central",
"active_status": "active", "active_status": "active",
"codebase": "gaia", "codebase": "gaia",
"repository_group": 1, "repository_group": 1,
"description": "" "description": ""
} }
}, },
{ {
"pk": 34, "pk": 34,
"model": "model.repository", "model": "model.repository",
"fields": { "fields": {
"dvcs_type": "hg", "dvcs_type": "hg",
"name": "gaia-v1-train", "name": "gaia-v1-train",
"url": "https://hg.mozilla.org/integration/gaia-v1-train", "url": "https://hg.mozilla.org/integration/gaia-v1-train",
"active_status": "active", "active_status": "active",
"codebase": "gaia", "codebase": "gaia",
"repository_group": 2, "repository_group": 2,
"description": "" "description": ""
} }
}, },
{ {
"pk": 35, "pk": 35,
"model": "model.repository", "model": "model.repository",
"fields": { "fields": {
"dvcs_type": "hg", "dvcs_type": "hg",
"name": "gaia-v1_0_1", "name": "gaia-v1_0_1",
"url": "https://hg.mozilla.org/integration/gaia-1_0_1", "url": "https://hg.mozilla.org/integration/gaia-1_0_1",
"active_status": "active", "active_status": "active",
"codebase": "gaia", "codebase": "gaia",
"repository_group": 2, "repository_group": 2,
"description": "" "description": ""
} }
}, },
{ {
"pk": 36, "pk": 36,
"model": "model.repository", "model": "model.repository",
"fields": { "fields": {
"dvcs_type": "hg", "dvcs_type": "hg",
"name": "addon-sdk", "name": "addon-sdk",
"url": "https://hg.mozilla.org/projects/addon-sdk", "url": "https://hg.mozilla.org/projects/addon-sdk",
"active_status": "active", "active_status": "active",
"codebase": "jetpack", "codebase": "jetpack",
"repository_group": 1, "repository_group": 1,
"description": "" "description": ""
} }
}, },
{ {
"pk": 37, "pk": 37,
"model": "model.repository", "model": "model.repository",
"fields": { "fields": {
"dvcs_type": "hg", "dvcs_type": "hg",
"name": "comm-central", "name": "comm-central",
"url": "https://hg.mozilla.org/comm-central", "url": "https://hg.mozilla.org/comm-central",
"active_status": "active", "active_status": "active",
"codebase": "?", "codebase": "?",
"repository_group": 1, "repository_group": 1,
"description": "" "description": ""
} }
}, },
{ {
"pk": 38, "pk": 38,
"model": "model.repository", "model": "model.repository",
"fields": { "fields": {
"dvcs_type": "hg", "dvcs_type": "hg",
"name": "comm-aurora", "name": "comm-aurora",
"url": "https://hg.mozilla.org/releases/comm-aurora", "url": "https://hg.mozilla.org/releases/comm-aurora",
"active_status": "active", "active_status": "active",
"codebase": "?", "codebase": "?",
"repository_group": 2, "repository_group": 2,
"description": "" "description": ""
} }
}, },
{ {
"pk": 39, "pk": 39,
"model": "model.repository", "model": "model.repository",
"fields": { "fields": {
"dvcs_type": "hg", "dvcs_type": "hg",
"name": "comm-beta", "name": "comm-beta",
"url": "https://hg.mozilla.org/releases/comm-beta", "url": "https://hg.mozilla.org/releases/comm-beta",
"active_status": "active", "active_status": "active",
"codebase": "?", "codebase": "?",
"repository_group": 2, "repository_group": 2,
"description": "" "description": ""
} }
}, },
{ {
"pk": 40, "pk": 40,
"model": "model.repository", "model": "model.repository",
"fields": { "fields": {
"dvcs_type": "hg", "dvcs_type": "hg",
"name": "comm-esr17", "name": "comm-esr17",
"url": "https://hg.mozilla.org/releases/comm-esr17", "url": "https://hg.mozilla.org/releases/comm-esr17",
"active_status": "active", "active_status": "active",
"codebase": "?", "codebase": "?",
"repository_group": 2, "repository_group": 2,
"description": "" "description": ""
} }
}, },
{ {
"pk": 41, "pk": 41,
"model": "model.repository", "model": "model.repository",
"fields": { "fields": {
"dvcs_type": "hg", "dvcs_type": "hg",
"name": "comm-release", "name": "comm-release",
"url": "https://hg.mozilla.org/releases/comm-release", "url": "https://hg.mozilla.org/releases/comm-release",
"active_status": "active", "active_status": "active",
"codebase": "?", "codebase": "?",
"repository_group": 2, "repository_group": 2,
"description": "" "description": ""
} }
}, },
{ {
"pk": 42, "pk": 42,
"model": "model.repository", "model": "model.repository",
"fields": { "fields": {
"dvcs_type": "hg", "dvcs_type": "hg",
"name": "try-comm-central", "name": "try-comm-central",
"url": "https://hg.mozilla.org/try-comm-central", "url": "https://hg.mozilla.org/try-comm-central",
"active_status": "active", "active_status": "active",
"codebase": "?", "codebase": "?",
"repository_group": 3, "repository_group": 3,
"description": ""
}
},
{
"pk": 43,
"model": "model.repository",
"fields": {
"dvcs_type": "hg",
"name": "comm-central-trunk",
"url": "https://hg.mozilla.org/comm-central-trunk",
"active_status": "active",
"codebase": "?",
"repository_group": 1,
"description": "" "description": ""
} }
} }

Просмотреть файл

@ -22,18 +22,41 @@
`submit_timestamp`, `submit_timestamp`,
`start_timestamp`, `start_timestamp`,
`end_timestamp`) `end_timestamp`)
VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)", VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)",
"host":"master_host" "host":"master_host"
}, },
"set_result_set":{ "set_result_set":{
"sql":"INSERT INTO `result_set` ( "sql":"INSERT INTO `result_set` (
`revision_hash`) `revision_hash`
)
VALUES (?)", VALUES (?)",
"host":"master_host" "host":"master_host"
}, },
"set_revision":{
"sql":"INSERT INTO `revision` (
`revision`,
`author`,
`comments`,
`push_timestamp`,
`commit_timestamp`,
`repository_id`)
VALUES (?,?,?,?,?,?)",
"host":"master_host"
},
"set_revision_map":{
"sql":"INSERT INTO `revision_map` (
`revision_id`,
`result_set_id`)
VALUES (?,?)",
"host":"master_host"
},
"set_job_log_url":{ "set_job_log_url":{
"sql":"INSERT INTO `job_log_url` ( "sql":"INSERT INTO `job_log_url` (

Просмотреть файл

@ -108,12 +108,13 @@
)", )",
"host":"master_host" "host":"master_host"
} }
}, },
"selects":{ "selects":{
"get_build_platform_id":{ "get_build_platform_id":{
"sql": "SELECT `id` "sql": "SELECT `id`
FROM `build_platform` FROM `build_platform`
WHERE WHERE
`os_name` = ? `os_name` = ?
AND `platform` = ? AND `platform` = ?
AND `architecture` = ? AND `architecture` = ?
@ -123,7 +124,7 @@
"get_job_group_id":{ "get_job_group_id":{
"sql": "SELECT `id` "sql": "SELECT `id`
FROM `job_group` FROM `job_group`
WHERE WHERE
`name` = ? `name` = ?
AND `active_status` = 'active'", AND `active_status` = 'active'",
"host":"read_host" "host":"read_host"
@ -131,10 +132,10 @@
"get_job_type_id":{ "get_job_type_id":{
"sql": "SELECT jt.`id` "sql": "SELECT jt.`id`
FROM `job_type` jt FROM `job_type` jt
INNER JOIN `job_group` jg INNER JOIN `job_group` jg
ON jg.id = jt.job_group_id ON jg.id = jt.job_group_id
WHERE WHERE
jt.`name` = ? jt.`name` = ?
AND jg.`name` = ? AND jg.`name` = ?
AND jt.`active_status` = 'active' AND jt.`active_status` = 'active'
AND jg.`active_status` = 'active'", AND jg.`active_status` = 'active'",
@ -143,7 +144,7 @@
"get_machine_id":{ "get_machine_id":{
"sql": "SELECT `id` "sql": "SELECT `id`
FROM `machine` FROM `machine`
WHERE WHERE
`name` = ? `name` = ?
AND `active_status` = 'active'", AND `active_status` = 'active'",
"host":"read_host" "host":"read_host"
@ -151,7 +152,7 @@
"get_machine_platform_id":{ "get_machine_platform_id":{
"sql": "SELECT `id` "sql": "SELECT `id`
FROM `machine_platform` FROM `machine_platform`
WHERE WHERE
`os_name` = ? `os_name` = ?
AND `platform` = ? AND `platform` = ?
AND `architecture` = ? AND `architecture` = ?
@ -161,7 +162,7 @@
"get_option_id":{ "get_option_id":{
"sql": "SELECT `id` "sql": "SELECT `id`
FROM `option` FROM `option`
WHERE WHERE
`name` = ? `name` = ?
AND `active_status` = 'active'", AND `active_status` = 'active'",
"host":"read_host" "host":"read_host"
@ -174,24 +175,30 @@
"get_option_collection_id":{ "get_option_collection_id":{
"sql": "SELECT `option_collection_id` "sql": "SELECT `option_collection_id`
FROM `option_collection` oc FROM `option_collection` oc
INNER JOIN `option` o on o.id = oc.option_id INNER JOIN `option` o on o.id = oc.option_id
GROUP BY `option_collection_id` GROUP BY `option_collection_id`
HAVING HAVING
GROUP_CONCAT(o.name ORDER BY o.name ASC SEPARATOR ',') = ?", GROUP_CONCAT(o.name ORDER BY o.name ASC SEPARATOR ',') = ?",
"host":"read_host" "host":"read_host"
}, },
"get_product_id":{ "get_product_id":{
"sql": "SELECT `id` "sql": "SELECT `id`
FROM `product` FROM `product`
WHERE WHERE
`name` = ? `name` = ?
AND `active_status` = 'active'", AND `active_status` = 'active'",
"host":"read_host" "host":"read_host"
}, },
"get_repository_id":{
"sql": "SELECT `id`
FROM `repository`
WHERE `name` = ?",
"host":"read_host"
},
"get_repository_version_id":{ "get_repository_version_id":{
"sql": "SELECT `id` "sql": "SELECT `id`
FROM `repository_version` FROM `repository_version`
WHERE WHERE
`repository_id` = ? `repository_id` = ?
AND `version` = ? AND `version` = ?
AND `active_status` = 'active'", AND `active_status` = 'active'",

Просмотреть файл

@ -298,7 +298,7 @@ DROP TABLE IF EXISTS `revision`;
* *
* revision - The revision string associated with the repository * revision - The revision string associated with the repository
* author - The author associated with the revision * author - The author associated with the revision
* comment - The comments associated with the revision * comments - The comments associated with the revision
* push_timestamp - Timestamp associated with the push to the test system * push_timestamp - Timestamp associated with the push to the test system
* commit_timestamp - Timestamp associated with the commit * commit_timestamp - Timestamp associated with the commit
**************************/ **************************/
@ -306,7 +306,7 @@ CREATE TABLE `revision` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`revision` varchar(50) COLLATE utf8_bin NOT NULL, `revision` varchar(50) COLLATE utf8_bin NOT NULL,
`author` varchar(50) COLLATE utf8_bin NOT NULL, `author` varchar(50) COLLATE utf8_bin NOT NULL,
`comment` text DEFAULT NULL, `comments` text DEFAULT NULL,
`push_timestamp` int(11) unsigned NOT NULL, `push_timestamp` int(11) unsigned NOT NULL,
`commit_timestamp` int(11) unsigned NOT NULL, `commit_timestamp` int(11) unsigned NOT NULL,
`repository_id` int(11) unsigned NOT NULL, `repository_id` int(11) unsigned NOT NULL,