diff --git a/treeherder/model/fixtures/job_group.json b/treeherder/model/fixtures/job_group.json new file mode 100644 index 000000000..a126bf8e4 --- /dev/null +++ b/treeherder/model/fixtures/job_group.json @@ -0,0 +1,62 @@ +[ +{ + "pk": 1, + "model": "model.jobgroup", + "fields": { + "symbol": "B", + "name": "build", + "active_status": "active", + "description": "" + } +}, +{ + "pk": 2, + "model": "model.jobgroup", + "fields": { + "symbol": "M", + "name": "mochitest", + "active_status": "active", + "description": "" + } +}, +{ + "pk": 3, + "model": "model.jobgroup", + "fields": { + "symbol": "R", + "name": "reftest", + "active_status": "active", + "description": "" + } +}, +{ + "pk": 4, + "model": "model.jobgroup", + "fields": { + "symbol": "T", + "name": "talos", + "active_status": "active", + "description": "" + } +}, +{ + "pk": 5, + "model": "model.jobgroup", + "fields": { + "symbol": "SM", + "name": "spidermonkey", + "active_status": "active", + "description": "" + } +}, +{ + "pk": 6, + "model": "model.jobgroup", + "fields": { + "symbol": "?", + "name": "unknown", + "active_status": "active", + "description": "" + } +} +] diff --git a/treeherder/model/fixtures/job_type.json b/treeherder/model/fixtures/job_type.json new file mode 100644 index 000000000..49ab4fc66 --- /dev/null +++ b/treeherder/model/fixtures/job_type.json @@ -0,0 +1,651 @@ +[ +{ + "pk": 1, + "model": "model.jobtype", + "fields": { + "symbol": "A", + "job_group": 1, + "name": "asan", + "active_status": "active", + "description": "AddressSanitizer Build" + } +}, +{ + "pk": 2, + "model": "model.jobtype", + "fields": { + "symbol": "An", + "job_group": 1, + "name": "asan nightly", + "active_status": "active", + "description": "AddressSanitizer Nightly" + } +}, +{ + "pk": 3, + "model": "model.jobtype", + "fields": { + "symbol": "BiB", + "job_group": 1, + "name": "b2g.*_stable_dep", + "active_status": "active", + "description": "B2G Beta Channel Device Image Build" + } +}, +{ + "pk": 4, + "model": "model.jobtype", + "fields": { + "symbol": "NiB", + "job_group": 1, + "name": "b2g.*_stable_nightly", + "active_status": "active", + "description": "B2G Beta Channel Device Image Nightly" + } +}, +{ + "pk": 5, + "model": "model.jobtype", + "fields": { + "symbol": "Bi", + "job_group": 1, + "name": "b2g.*_dep", + "active_status": "active", + "description": "B2G Device Image Build" + } +}, +{ + "pk": 6, + "model": "model.jobtype", + "fields": { + "symbol": "Ni", + "job_group": 1, + "name": "b2g.*_nightly", + "active_status": "active", + "description": "B2G Device Image Nightly" + } +}, +{ + "pk": 7, + "model": "model.jobtype", + "fields": { + "symbol": "Bg", + "job_group": 1, + "name": "b2g.*gecko build", + "active_status": "active", + "description": "B2G Gecko Build" + } +}, +{ + "pk": 8, + "model": "model.jobtype", + "fields": { + "symbol": "Bg", + "job_group": 1, + "name": "b2g.*gecko-debug build", + "active_status": "active", + "description": "B2G Gecko Build" + } +}, +{ + "pk": 9, + "model": "model.jobtype", + "fields": { + "symbol": "NgL", + "job_group": 1, + "name": "b2g.*gecko_localizer nightly", + "active_status": "active", + "description": "B2G Gecko Localizer Nightly" + } +}, +{ + "pk": 10, + "model": "model.jobtype", + "fields": { + "symbol": "Ng", + "job_group": 1, + "name": "b2g.*gecko nightly", + "active_status": "active", + "description": "B2G Gecko Nightly" + } +}, +{ + "pk": 11, + "model": "model.jobtype", + "fields": { + "symbol": "BiM", + "job_group": 1, + "name": "b2g.*_eng_dep", + "active_status": "active", + "description": "B2G Marionette-Enabled Device Image Build" + } +}, +{ + "pk": 12, + "model": "model.jobtype", + "fields": { + "symbol": "NiM", + "job_group": 1, + "name": "b2g.*_eng_nightly", + "active_status": "active", + "description": "B2G Marionette-Enabled Device Image Nightly" + } +}, +{ + "pk": 13, + "model": "model.jobtype", + "fields": { + "symbol": "B", + "job_group": 1, + "name": "build", + "active_status": "active", + "description": "Build" + } +}, +{ + "pk": 14, + "model": "model.jobtype", + "fields": { + "symbol": "C", + "job_group": 3, + "name": "crashtest", + "active_status": "active", + "description": "Crashtest" + } +}, +{ + "pk": 15, + "model": "model.jobtype", + "fields": { + "symbol": "Cipc", + "job_group": 3, + "name": "crashtest-ipc", + "active_status": "active", + "description": "Crashtest-IPC" + } +}, +{ + "pk": 16, + "model": "model.jobtype", + "fields": { + "symbol": "Dxr", + "job_group": 6, + "name": "dxr", + "active_status": "active", + "description": "DXR Index Build" + } +}, +{ + "pk": 17, + "model": "model.jobtype", + "fields": { + "symbol": "G", + "job_group": 6, + "name": "gaia-ui-test", + "active_status": "active", + "description": "Gaia UI Test" + } +}, +{ + "pk": 18, + "model": "model.jobtype", + "fields": { + "symbol": "m-a", + "job_group": 6, + "name": "jetpack-mozilla-aurora", + "active_status": "active", + "description": "Jetpack mozilla-aurora" + } +}, +{ + "pk": 19, + "model": "model.jobtype", + "fields": { + "symbol": "m-b", + "job_group": 6, + "name": "jetpack-mozilla-beta", + "active_status": "active", + "description": "Jetpack mozilla-beta" + } +}, +{ + "pk": 20, + "model": "model.jobtype", + "fields": { + "symbol": "m-c", + "job_group": 6, + "name": "jetpack-mozilla-central", + "active_status": "active", + "description": "Jetpack mozilla-central" + } +}, +{ + "pk": 21, + "model": "model.jobtype", + "fields": { + "symbol": "m-r", + "job_group": 6, + "name": "jetpack-mozilla-release", + "active_status": "active", + "description": "Jetpack mozilla-release" + } +}, +{ + "pk": 22, + "model": "model.jobtype", + "fields": { + "symbol": "JP", + "job_group": 6, + "name": "jetpack", + "active_status": "active", + "description": "Jetpack SDK Test" + } +}, +{ + "pk": 23, + "model": "model.jobtype", + "fields": { + "symbol": "J", + "job_group": 3, + "name": "jsreftest", + "active_status": "active", + "description": "JSReftest" + } +}, +{ + "pk": 24, + "model": "model.jobtype", + "fields": { + "symbol": "Mn", + "job_group": 6, + "name": "marionette", + "active_status": "active", + "description": "Marionette" + } +}, +{ + "pk": 25, + "model": "model.jobtype", + "fields": { + "symbol": "M", + "job_group": 2, + "name": "mochitest", + "active_status": "active", + "description": "Mochitest" + } +}, +{ + "pk": 26, + "model": "model.jobtype", + "fields": { + "symbol": "bc", + "job_group": 2, + "name": "mochitest-browser-chrome", + "active_status": "active", + "description": "Mochitest Browser Chrome" + } +}, +{ + "pk": 27, + "model": "model.jobtype", + "fields": { + "symbol": "oth", + "job_group": 2, + "name": "mochitest-other", + "active_status": "active", + "description": "Mochitest Other" + } +}, +{ + "pk": 28, + "model": "model.jobtype", + "fields": { + "symbol": "Z", + "job_group": 6, + "name": "mozmill", + "active_status": "active", + "description": "Mozmill" + } +}, +{ + "pk": 29, + "model": "model.jobtype", + "fields": { + "symbol": "N", + "job_group": 1, + "name": "nightly", + "active_status": "active", + "description": "Nightly" + } +}, +{ + "pk": 30, + "model": "model.jobtype", + "fields": { + "symbol": "R", + "job_group": 3, + "name": "reftest", + "active_status": "active", + "description": "Reftest" + } +}, +{ + "pk": 31, + "model": "model.jobtype", + "fields": { + "symbol": "Ru", + "job_group": 3, + "name": "reftest-no-accel", + "active_status": "active", + "description": "Reftest Unaccelerated" + } +}, +{ + "pk": 32, + "model": "model.jobtype", + "fields": { + "symbol": "Ripc", + "job_group": 3, + "name": "reftest-ipc", + "active_status": "active", + "description": "Reftest-IPC" + } +}, +{ + "pk": 33, + "model": "model.jobtype", + "fields": { + "symbol": "rc", + "job_group": 2, + "name": "robocop", + "active_status": "active", + "description": "Robocop" + } +}, +{ + "pk": 34, + "model": "model.jobtype", + "fields": { + "symbol": "r", + "job_group": 5, + "name": "spidermonkey.*-rootanalysis", + "active_status": "active", + "description": "SpiderMonkey --enable-root-analysis Build" + } +}, +{ + "pk": 35, + "model": "model.jobtype", + "fields": { + "symbol": "e", + "job_group": 5, + "name": "spidermonkey.*-warnaserr", + "active_status": "active", + "description": "SpiderMonkey --enable-sm-fail-on-warnings Build" + } +}, +{ + "pk": 36, + "model": "model.jobtype", + "fields": { + "symbol": "d", + "job_group": 5, + "name": "spidermonkey.*-dtrace", + "active_status": "active", + "description": "SpiderMonkey DTrace Build" + } +}, +{ + "pk": 37, + "model": "model.jobtype", + "fields": { + "symbol": "exr", + "job_group": 5, + "name": "spidermonkey.*-exactroot", + "active_status": "active", + "description": "SpiderMonkey Exact Rooting Shell Build" + } +}, +{ + "pk": 38, + "model": "model.jobtype", + "fields": { + "symbol": "ggc", + "job_group": 5, + "name": "spidermonkey.*-generational", + "active_status": "active", + "description": "SpiderMonkey GGC Shell Build" + } +}, +{ + "pk": 39, + "model": "model.jobtype", + "fields": { + "symbol": "c", + "job_group": 4, + "name": "talos chrome", + "active_status": "active", + "description": "Talos chrome" + } +}, +{ + "pk": 40, + "model": "model.jobtype", + "fields": { + "symbol": "c", + "job_group": 4, + "name": "talos chromez", + "active_status": "active", + "description": "Talos chrome" + } +}, +{ + "pk": 41, + "model": "model.jobtype", + "fields": { + "symbol": "dr", + "job_group": 4, + "name": "talos dromaeo", + "active_status": "active", + "description": "Talos dromaeo" + } +}, +{ + "pk": 42, + "model": "model.jobtype", + "fields": { + "symbol": "d", + "job_group": 4, + "name": "talos dromaeojs", + "active_status": "active", + "description": "Talos dromaeojs" + } +}, +{ + "pk": 43, + "model": "model.jobtype", + "fields": { + "symbol": "n", + "job_group": 4, + "name": "talos nochrome", + "active_status": "active", + "description": "Talos nochrome" + } +}, +{ + "pk": 44, + "model": "model.jobtype", + "fields": { + "symbol": "o", + "job_group": 4, + "name": "talos other", + "active_status": "active", + "description": "Talos other" + } +}, +{ + "pk": 45, + "model": "model.jobtype", + "fields": { + "symbol": "p", + "job_group": 4, + "name": "talos dirtypaint", + "active_status": "active", + "description": "Talos paint" + } +}, +{ + "pk": 46, + "model": "model.jobtype", + "fields": { + "symbol": "rck", + "job_group": 4, + "name": "talos remote-trobocheck", + "active_status": "active", + "description": "Talos robocheck" + } +}, +{ + "pk": 47, + "model": "model.jobtype", + "fields": { + "symbol": "rck2", + "job_group": 4, + "name": "talos remote-trobocheck2", + "active_status": "active", + "description": "Talos robocheck2" + } +}, +{ + "pk": 48, + "model": "model.jobtype", + "fields": { + "symbol": "rp", + "job_group": 4, + "name": "talos remote-trobopan", + "active_status": "active", + "description": "Talos robopan" + } +}, +{ + "pk": 49, + "model": "model.jobtype", + "fields": { + "symbol": "rpr", + "job_group": 4, + "name": "talos remote-troboprovider", + "active_status": "active", + "description": "Talos roboprovider" + } +}, +{ + "pk": 50, + "model": "model.jobtype", + "fields": { + "symbol": "s", + "job_group": 4, + "name": "talos svgr", + "active_status": "active", + "description": "Talos svg" + } +}, +{ + "pk": 51, + "model": "model.jobtype", + "fields": { + "symbol": "s", + "job_group": 4, + "name": "talos remote-tsvgr", + "active_status": "active", + "description": "Talos svg" + } +}, +{ + "pk": 52, + "model": "model.jobtype", + "fields": { + "symbol": "tp", + "job_group": 4, + "name": "talos remote-tp4m", + "active_status": "active", + "description": "Talos tp" + } +}, +{ + "pk": 53, + "model": "model.jobtype", + "fields": { + "symbol": "tp", + "job_group": 4, + "name": "talos tp", + "active_status": "active", + "description": "Talos tp" + } +}, +{ + "pk": 54, + "model": "model.jobtype", + "fields": { + "symbol": "tpn", + "job_group": 4, + "name": "talos remote-tp4m_nochrome", + "active_status": "active", + "description": "Talos tp nochrome" + } +}, +{ + "pk": 55, + "model": "model.jobtype", + "fields": { + "symbol": "ts", + "job_group": 4, + "name": "talos remote-ts", + "active_status": "active", + "description": "Talos ts" + } +}, +{ + "pk": 56, + "model": "model.jobtype", + "fields": { + "symbol": "x", + "job_group": 4, + "name": "talos xperf", + "active_status": "active", + "description": "Talos xperf" + } +}, +{ + "pk": 57, + "model": "model.jobtype", + "fields": { + "symbol": "V", + "job_group": 1, + "name": "valgrind", + "active_status": "active", + "description": "Valgrind Build" + } +}, +{ + "pk": 58, + "model": "model.jobtype", + "fields": { + "symbol": "X", + "job_group": 6, + "name": "xpcshell", + "active_status": "active", + "description": "XPCShellTest" + } +}, +{ + "pk": 59, + "model": "model.jobtype", + "fields": { + "symbol": "Xr", + "job_group": 1, + "name": "xulrunner", + "active_status": "active", + "description": "XULRunner" + } +} +] diff --git a/treeherder/model/fixtures/repository.json b/treeherder/model/fixtures/repository.json new file mode 100644 index 000000000..d9899a00e --- /dev/null +++ b/treeherder/model/fixtures/repository.json @@ -0,0 +1,548 @@ +[ +{ + "pk": 1, + "model": "model.repository", + "fields": { + "dvcs_type": "hg", + "name": "mozilla-central", + "url": "https://hg.mozilla.org/mozilla-central", + "active_status": "active", + "codebase": "gecko", + "repository_group": 1, + "description": "" + } +}, +{ + "pk": 2, + "model": "model.repository", + "fields": { + "dvcs_type": "hg", + "name": "mozilla-inbound", + "url": "https://hg.mozilla.org/integration/mozilla-inbound", + "active_status": "active", + "codebase": "gecko", + "repository_group": 1, + "description": "" + } +}, +{ + "pk": 3, + "model": "model.repository", + "fields": { + "dvcs_type": "hg", + "name": "mozilla-aurora", + "url": "https://hg.mozilla.org/releases/mozilla-aurora", + "active_status": "active", + "codebase": "gecko", + "repository_group": 2, + "description": "" + } +}, +{ + "pk": 4, + "model": "model.repository", + "fields": { + "dvcs_type": "hg", + "name": "mozilla-beta", + "url": "https://hg.mozilla.org/releases/mozilla-beta", + "active_status": "active", + "codebase": "gecko", + "repository_group": 2, + "description": "" + } +}, +{ + "pk": 5, + "model": "model.repository", + "fields": { + "dvcs_type": "hg", + "name": "mozilla-release", + "url": "https://hg.mozilla.org/releases/mozilla-release", + "active_status": "active", + "codebase": "gecko", + "repository_group": 2, + "description": "" + } +}, +{ + "pk": 6, + "model": "model.repository", + "fields": { + "dvcs_type": "hg", + "name": "mozilla-b2g18", + "url": "https://hg.mozilla.org/releases/mozilla-b2g18", + "active_status": "active", + "codebase": "gecko", + "repository_group": 2, + "description": "" + } +}, +{ + "pk": 7, + "model": "model.repository", + "fields": { + "dvcs_type": "hg", + "name": "mozilla-b2g18_v1_0_1", + "url": "https://hg.mozilla.org/releases/mozilla-b2g18_v1_0_1", + "active_status": "active", + "codebase": "gecko", + "repository_group": 2, + "description": "" + } +}, +{ + "pk": 8, + "model": "model.repository", + "fields": { + "dvcs_type": "hg", + "name": "mozilla-b2g18_v1_1_0", + "url": "https://hg.mozilla.org/releases/mozilla-b2g18_v1_1_0", + "active_status": "active", + "codebase": "gecko", + "repository_group": 2, + "description": "" + } +}, +{ + "pk": 9, + "model": "model.repository", + "fields": { + "dvcs_type": "hg", + "name": "mozilla-esr17", + "url": "https://hg.mozilla.org/releases/mozilla-esr17", + "active_status": "active", + "codebase": "gecko", + "repository_group": 2, + "description": "" + } +}, +{ + "pk": 10, + "model": "model.repository", + "fields": { + "dvcs_type": "hg", + "name": "try", + "url": "https://hg.mozilla.org/try", + "active_status": "active", + "codebase": "gecko", + "repository_group": 3, + "description": "" + } +}, +{ + "pk": 11, + "model": "model.repository", + "fields": { + "dvcs_type": "hg", + "name": "build-system", + "url": "https://hg.mozilla.org/projects/build-system", + "active_status": "active", + "codebase": "gecko", + "repository_group": 1, + "description": "" + } +}, +{ + "pk": 12, + "model": "model.repository", + "fields": { + "dvcs_type": "hg", + "name": "fx-team", + "url": "https://hg.mozilla.org/integration/fx-team", + "active_status": "active", + "codebase": "gecko", + "repository_group": 1, + "description": "" + } +}, +{ + "pk": 13, + "model": "model.repository", + "fields": { + "dvcs_type": "hg", + "name": "graphics", + "url": "https://hg.mozilla.org/projects/graphics", + "active_status": "active", + "codebase": "gecko", + "repository_group": 1, + "description": "" + } +}, +{ + "pk": 14, + "model": "model.repository", + "fields": { + "dvcs_type": "hg", + "name": "ionmonkey", + "url": "https://hg.mozilla.org/projects/ionmonkey", + "active_status": "active", + "codebase": "gecko", + "repository_group": 1, + "description": "" + } +}, +{ + "pk": 15, + "model": "model.repository", + "fields": { + "dvcs_type": "hg", + "name": "profiling", + "url": "https://hg.mozilla.org/projects/profiling", + "active_status": "active", + "codebase": "gecko", + "repository_group": 1, + "description": "" + } +}, +{ + "pk": 16, + "model": "model.repository", + "fields": { + "dvcs_type": "hg", + "name": "services-central", + "url": "https://hg.mozilla.org/services/services-central", + "active_status": "active", + "codebase": "gecko", + "repository_group": 1, + "description": "" + } +}, +{ + "pk": 17, + "model": "model.repository", + "fields": { + "dvcs_type": "hg", + "name": "ux", + "url": "https://hg.mozilla.org/projects/ux", + "active_status": "active", + "codebase": "gecko", + "repository_group": 1, + "description": "" + } +}, +{ + "pk": 18, + "model": "model.repository", + "fields": { + "dvcs_type": "hg", + "name": "alder", + "url": "https://hg.mozilla.org/projects/alder", + "active_status": "active", + "codebase": "gecko", + "repository_group": 1, + "description": "" + } +}, +{ + "pk": 19, + "model": "model.repository", + "fields": { + "dvcs_type": "hg", + "name": "ash", + "url": "https://hg.mozilla.org/projects/ash", + "active_status": "active", + "codebase": "gecko", + "repository_group": 1, + "description": "" + } +}, +{ + "pk": 20, + "model": "model.repository", + "fields": { + "dvcs_type": "hg", + "name": "birch", + "url": "https://hg.mozilla.org/projects/birch", + "active_status": "active", + "codebase": "gecko", + "repository_group": 1, + "description": "" + } +}, +{ + "pk": 21, + "model": "model.repository", + "fields": { + "dvcs_type": "hg", + "name": "cedar", + "url": "https://hg.mozilla.org/projects/cedar", + "active_status": "active", + "codebase": "gecko", + "repository_group": 1, + "description": "" + } +}, +{ + "pk": 22, + "model": "model.repository", + "fields": { + "dvcs_type": "hg", + "name": "cypress", + "url": "https://hg.mozilla.org/projects/cypress", + "active_status": "active", + "codebase": "gecko", + "repository_group": 1, + "description": "" + } +}, +{ + "pk": 23, + "model": "model.repository", + "fields": { + "dvcs_type": "hg", + "name": "date", + "url": "https://hg.mozilla.org/projects/date", + "active_status": "active", + "codebase": "gecko", + "repository_group": 1, + "description": "" + } +}, +{ + "pk": 24, + "model": "model.repository", + "fields": { + "dvcs_type": "hg", + "name": "elm", + "url": "https://hg.mozilla.org/projects/elm", + "active_status": "active", + "codebase": "gecko", + "repository_group": 1, + "description": "" + } +}, +{ + "pk": 25, + "model": "model.repository", + "fields": { + "dvcs_type": "hg", + "name": "fig", + "url": "https://hg.mozilla.org/projects/fig", + "active_status": "active", + "codebase": "gecko", + "repository_group": 1, + "description": "" + } +}, +{ + "pk": 26, + "model": "model.repository", + "fields": { + "dvcs_type": "hg", + "name": "gum", + "url": "https://hg.mozilla.org/projects/gum", + "active_status": "active", + "codebase": "gecko", + "repository_group": 1, + "description": "" + } +}, +{ + "pk": 27, + "model": "model.repository", + "fields": { + "dvcs_type": "hg", + "name": "holly", + "url": "https://hg.mozilla.org/projects/holly", + "active_status": "active", + "codebase": "gecko", + "repository_group": 1, + "description": "" + } +}, +{ + "pk": 28, + "model": "model.repository", + "fields": { + "dvcs_type": "hg", + "name": "jamun", + "url": "https://hg.mozilla.org/projects/jamun", + "active_status": "active", + "codebase": "gecko", + "repository_group": 1, + "description": "" + } +}, +{ + "pk": 29, + "model": "model.repository", + "fields": { + "dvcs_type": "hg", + "name": "larch", + "url": "https://hg.mozilla.org/projects/larch", + "active_status": "active", + "codebase": "gecko", + "repository_group": 1, + "description": "" + } +}, +{ + "pk": 30, + "model": "model.repository", + "fields": { + "dvcs_type": "hg", + "name": "maple", + "url": "https://hg.mozilla.org/projects/maple", + "active_status": "active", + "codebase": "gecko", + "repository_group": 1, + "description": "" + } +}, +{ + "pk": 31, + "model": "model.repository", + "fields": { + "dvcs_type": "hg", + "name": "oak", + "url": "https://hg.mozilla.org/projects/oak", + "active_status": "active", + "codebase": "gecko", + "repository_group": 1, + "description": "" + } +}, +{ + "pk": 32, + "model": "model.repository", + "fields": { + "dvcs_type": "hg", + "name": "pine", + "url": "https://hg.mozilla.org/projects/pine", + "active_status": "active", + "codebase": "gecko", + "repository_group": 1, + "description": "" + } +}, +{ + "pk": 33, + "model": "model.repository", + "fields": { + "dvcs_type": "hg", + "name": "gaia-master", + "url": "https://hg.mozilla.org/integration/gaia-central", + "active_status": "active", + "codebase": "gaia", + "repository_group": 1, + "description": "" + } +}, +{ + "pk": 34, + "model": "model.repository", + "fields": { + "dvcs_type": "hg", + "name": "gaia-v1-train", + "url": "https://hg.mozilla.org/integration/gaia-v1-train", + "active_status": "active", + "codebase": "gaia", + "repository_group": 2, + "description": "" + } +}, +{ + "pk": 35, + "model": "model.repository", + "fields": { + "dvcs_type": "hg", + "name": "gaia-v1_0_1", + "url": "https://hg.mozilla.org/integration/gaia-1_0_1", + "active_status": "active", + "codebase": "gaia", + "repository_group": 2, + "description": "" + } +}, +{ + "pk": 36, + "model": "model.repository", + "fields": { + "dvcs_type": "hg", + "name": "addon-sdk", + "url": "https://hg.mozilla.org/projects/addon-sdk", + "active_status": "active", + "codebase": "jetpack", + "repository_group": 1, + "description": "" + } +}, +{ + "pk": 37, + "model": "model.repository", + "fields": { + "dvcs_type": "hg", + "name": "comm-central", + "url": "https://hg.mozilla.org/comm-central", + "active_status": "active", + "codebase": "?", + "repository_group": 1, + "description": "" + } +}, +{ + "pk": 38, + "model": "model.repository", + "fields": { + "dvcs_type": "hg", + "name": "comm-aurora", + "url": "https://hg.mozilla.org/releases/comm-aurora", + "active_status": "active", + "codebase": "?", + "repository_group": 2, + "description": "" + } +}, +{ + "pk": 39, + "model": "model.repository", + "fields": { + "dvcs_type": "hg", + "name": "comm-beta", + "url": "https://hg.mozilla.org/releases/comm-beta", + "active_status": "active", + "codebase": "?", + "repository_group": 2, + "description": "" + } +}, +{ + "pk": 40, + "model": "model.repository", + "fields": { + "dvcs_type": "hg", + "name": "comm-esr17", + "url": "https://hg.mozilla.org/releases/comm-esr17", + "active_status": "active", + "codebase": "?", + "repository_group": 2, + "description": "" + } +}, +{ + "pk": 41, + "model": "model.repository", + "fields": { + "dvcs_type": "hg", + "name": "comm-release", + "url": "https://hg.mozilla.org/releases/comm-release", + "active_status": "active", + "codebase": "?", + "repository_group": 2, + "description": "" + } +}, +{ + "pk": 42, + "model": "model.repository", + "fields": { + "dvcs_type": "hg", + "name": "try-comm-central", + "url": "https://hg.mozilla.org/try-comm-central", + "active_status": "active", + "codebase": "?", + "repository_group": 3, + "description": "" + } +} +] diff --git a/treeherder/model/fixtures/repository_group.json b/treeherder/model/fixtures/repository_group.json new file mode 100644 index 000000000..5bf1a2fc0 --- /dev/null +++ b/treeherder/model/fixtures/repository_group.json @@ -0,0 +1,29 @@ +[ +{ + "pk": 1, + "model": "model.repositorygroup", + "fields": { + "name": "development", + "active_status": "active", + "description": "" + } +}, +{ + "pk": 2, + "model": "model.repositorygroup", + "fields": { + "name": "release-stablization", + "active_status": "active", + "description": "" + } +}, +{ + "pk": 3, + "model": "model.repositorygroup", + "fields": { + "name": "try", + "active_status": "active", + "description": "" + } +} +] diff --git a/treeherder/model/management/commands/init_master_db.py b/treeherder/model/management/commands/init_master_db.py index bc9ca1621..94b21981f 100644 --- a/treeherder/model/management/commands/init_master_db.py +++ b/treeherder/model/management/commands/init_master_db.py @@ -6,6 +6,7 @@ from django.db import connection from django.core.management import call_command from django.utils.six.moves import input + class Command(BaseCommand): help = "Init master database and call syncdb" @@ -58,6 +59,14 @@ Type 'yes' to continue, or 'no' to cancel: """ % connection.settings_dict['NAME' #flush all the apps not under south call_command("syncdb", interactive=False,) #fake the first migration because manually generated - call_command("migrate", 'model','0001',fake=True) + call_command("migrate", 'model', '0001', fake=True) #safely apply all the other migrations call_command("migrate", 'model') + #load initial fixtures for reference data + # the order of this list of fixtures is important + # to avoid integrity errors + call_command("loaddata", + 'repository_group', + 'repository', + 'job_group', + 'job_type') diff --git a/treeherder/model/migrations/0001_initial.py b/treeherder/model/migrations/0001_initial.py index 5e27341b9..77c5425ed 100644 --- a/treeherder/model/migrations/0001_initial.py +++ b/treeherder/model/migrations/0001_initial.py @@ -50,12 +50,10 @@ class Migration(SchemaMigration): ('id', self.gf('django.db.models.fields.IntegerField')(primary_key=True)), ('repository_group', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['model.RepositoryGroup'])), ('name', self.gf('django.db.models.fields.CharField')(max_length=50L)), - ('type', self.gf('django.db.models.fields.CharField')(max_length=25L)), + ('dvcs_type', self.gf('django.db.models.fields.CharField')(max_length=25L)), ('url', self.gf('django.db.models.fields.CharField')(max_length=255L)), - ('branch', self.gf('django.db.models.fields.CharField')(max_length=50L, blank=True)), - ('project_name', self.gf('django.db.models.fields.CharField')(max_length=25L, blank=True)), + ('codebase', self.gf('django.db.models.fields.CharField')(max_length=50L, blank=True)), ('description', self.gf('django.db.models.fields.TextField')()), - ('purpose', self.gf('django.db.models.fields.CharField')(max_length=50L)), ('active_status', self.gf('django.db.models.fields.CharField')(max_length=7L, blank=True)), )) db.send_create_signal(u'model', ['Repository']) @@ -135,7 +133,7 @@ class Migration(SchemaMigration): db.create_table(u'repository_version', ( ('id', self.gf('django.db.models.fields.IntegerField')(primary_key=True)), ('repository', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['model.Repository'])), - ('version', self.gf('django.db.models.fields.CharField')(max_length=50L)), + ('version_timestamp', self.gf('django.db.models.fields.CharField')(max_length=50L)), ('timestamp', self.gf('django.db.models.fields.IntegerField')()), ('active_status', self.gf('django.db.models.fields.CharField')(max_length=7L, blank=True)), )) @@ -322,14 +320,12 @@ class Migration(SchemaMigration): u'model.repository': { 'Meta': {'object_name': 'Repository', 'db_table': "u'repository'"}, 'active_status': ('django.db.models.fields.CharField', [], {'max_length': '7L', 'blank': 'True'}), - 'branch': ('django.db.models.fields.CharField', [], {'max_length': '50L', 'blank': 'True'}), + 'codebase': ('django.db.models.fields.CharField', [], {'max_length': '50L', 'blank': 'True'}), 'description': ('django.db.models.fields.TextField', [], {}), 'id': ('django.db.models.fields.IntegerField', [], {'primary_key': 'True'}), 'name': ('django.db.models.fields.CharField', [], {'max_length': '50L'}), - 'project_name': ('django.db.models.fields.CharField', [], {'max_length': '25L', 'blank': 'True'}), - 'purpose': ('django.db.models.fields.CharField', [], {'max_length': '50L'}), 'repository_group': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['model.RepositoryGroup']"}), - 'type': ('django.db.models.fields.CharField', [], {'max_length': '25L'}), + 'dvcs_type': ('django.db.models.fields.CharField', [], {'max_length': '25L'}), 'url': ('django.db.models.fields.CharField', [], {'max_length': '255L'}) }, u'model.repositorygroup': { @@ -344,7 +340,7 @@ class Migration(SchemaMigration): 'active_status': ('django.db.models.fields.CharField', [], {'max_length': '7L', 'blank': 'True'}), 'id': ('django.db.models.fields.IntegerField', [], {'primary_key': 'True'}), 'repository': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['model.Repository']"}), - 'timestamp': ('django.db.models.fields.IntegerField', [], {}), + 'version_timestamp': ('django.db.models.fields.IntegerField', [], {}), 'version': ('django.db.models.fields.CharField', [], {'max_length': '50L'}) } } diff --git a/treeherder/model/models.py b/treeherder/model/models.py index 2be9ece7f..257fb0c1c 100644 --- a/treeherder/model/models.py +++ b/treeherder/model/models.py @@ -78,12 +78,10 @@ class Repository(models.Model): id = models.IntegerField(primary_key=True) repository_group = models.ForeignKey('RepositoryGroup') name = models.CharField(max_length=50L) - type = models.CharField(max_length=25L) + dvcs_type = models.CharField(max_length=25L) url = models.CharField(max_length=255L) - branch = models.CharField(max_length=50L, blank=True) - project_name = models.CharField(max_length=25L, blank=True) + codebase = models.CharField(max_length=50L, blank=True) description = models.TextField() - purpose = models.CharField(max_length=50L) active_status = models.CharField(max_length=7L, blank=True) class Meta: @@ -462,7 +460,7 @@ class RepositoryVersion(models.Model): id = models.IntegerField(primary_key=True) repository = models.ForeignKey(Repository) version = models.CharField(max_length=50L) - timestamp = models.IntegerField() + version_timestamp = models.IntegerField() active_status = models.CharField(max_length=7L, blank=True) class Meta: diff --git a/treeherder/model/sql/template_schema/treeherder_reference_1.sql.tmpl b/treeherder/model/sql/template_schema/treeherder_reference_1.sql.tmpl index 73f4d4be7..f61fb12ac 100644 --- a/treeherder/model/sql/template_schema/treeherder_reference_1.sql.tmpl +++ b/treeherder/model/sql/template_schema/treeherder_reference_1.sql.tmpl @@ -422,31 +422,25 @@ DROP TABLE IF EXISTS `repository`; * * repository_group_id - References repository_group.id * name - mozilla-inbound | mozilla-release | gaia-master | gaia-v1-train | ... - * type - hg | git | ... + * dvcs_type - hg | git | ... * url - https://hg.m.o | https://git.m.o | ... - * branch - gecko | gaia | enGB | ... - * project_name - ? - * purpose - development (aka trunk) | try | release-stablization (train) | ... + * codebase - gecko | gaia | enGB | ... * **************************/ CREATE TABLE `repository` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `repository_group_id` int(10) unsigned NOT NULL, `name` varchar(50) COLLATE utf8_bin NOT NULL, - `type` varchar(25) COLLATE utf8_bin NOT NULL, + `dvcs_type` varchar(25) COLLATE utf8_bin NOT NULL, `url` varchar(255) COLLATE utf8_bin NOT NULL, - `branch` varchar(50) COLLATE utf8_bin DEFAULT NULL, - `project_name` varchar(25) COLLATE utf8_bin DEFAULT NULL, + `codebase` varchar(50) COLLATE utf8_bin DEFAULT NULL, `description` text COLLATE utf8_bin NOT NULL, - `purpose` varchar(50) COLLATE utf8_bin NOT NULL, `active_status` enum('active','onhold','deleted') COLLATE utf8_bin DEFAULT 'active', PRIMARY KEY (`id`), KEY `idx_repository_group_id` (`repository_group_id`), KEY `idx_name` (`name`), - KEY `idx_type` (`type`), - KEY `idx_branch` (`branch`), - KEY `idx_project_name` (`project_name`), - KEY `idx_purpose` (`purpose`), + KEY `idx_type` (`dvcs_type`), + KEY `idx_codebase` (`codebase`), KEY `idx_active_status` (`active_status`), CONSTRAINT `fk_repository_group` FOREIGN KEY (`repository_group_id`) REFERENCES `repository_group` (`id`) ) ENGINE={engine} DEFAULT CHARSET=utf8 COLLATE=utf8_bin;