Analysis task page is broken after r198479
authorrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 21 Mar 2016 22:27:34 +0000 (22:27 +0000)
committerrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 21 Mar 2016 22:27:34 +0000 (22:27 +0000)
https://bugs.webkit.org/show_bug.cgi?id=155735

Rubber-stamped by Chris Dumez.

* public/api/measurement-set.php:
(AnalysisResultsFetcher::fetch_commits): We need to emit the commit ID as done for regular data.
* public/include/build-requests-fetcher.php:
(BuildRequestsFetcher::fetch_roots_for_set_if_needed): Ditto. Don't use a fake ID after r198479.
* public/v3/models/commit-log.js:
(CommitLog): Assert that all commit log IDs are integers to catch regressions like this in future.
* public/v3/models/root-set.js:
(RootSet): Don't resolve Repository here as doing so would modify the shared "root" entry in the JSON
we fetched, and subsequent construction of RootSet would fail since this line would blow up trying to
find the repository with "[object]" as the ID.
* public/v3/models/test-group.js:
(TestGroup._createModelsFromFetchedTestGroups): Resolve Repository here.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@198503 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Websites/perf.webkit.org/ChangeLog
Websites/perf.webkit.org/public/api/measurement-set.php
Websites/perf.webkit.org/public/include/build-requests-fetcher.php
Websites/perf.webkit.org/public/v3/models/commit-log.js
Websites/perf.webkit.org/public/v3/models/root-set.js
Websites/perf.webkit.org/public/v3/models/test-group.js

index 46fc6373e82bfaa6cfede21fc35f4f02b8f80a5e..84956a1ddc8b0ab19f649f7b2bcb316405e561a0 100644 (file)
@@ -1,3 +1,23 @@
+2016-03-21  Ryosuke Niwa  <rniwa@webkit.org>
+
+        Analysis task page is broken after r198479
+        https://bugs.webkit.org/show_bug.cgi?id=155735
+
+        Rubber-stamped by Chris Dumez.
+
+        * public/api/measurement-set.php:
+        (AnalysisResultsFetcher::fetch_commits): We need to emit the commit ID as done for regular data.
+        * public/include/build-requests-fetcher.php:
+        (BuildRequestsFetcher::fetch_roots_for_set_if_needed): Ditto. Don't use a fake ID after r198479.
+        * public/v3/models/commit-log.js:
+        (CommitLog): Assert that all commit log IDs are integers to catch regressions like this in future.
+        * public/v3/models/root-set.js:
+        (RootSet): Don't resolve Repository here as doing so would modify the shared "root" entry in the JSON
+        we fetched, and subsequent construction of RootSet would fail since this line would blow up trying to
+        find the repository with "[object]" as the ID.
+        * public/v3/models/test-group.js:
+        (TestGroup._createModelsFromFetchedTestGroups): Resolve Repository here.
+
 2016-03-21  Ryosuke Niwa  <rniwa@webkit.org>
 
         v3 UI sometimes don't update the list of revisions on the commit log viewer
index c1452c2116059412fdd80e8f82a64277917ffad7..2dedbf3670665fba04f9b107bb1781da67f0f3bb 100644 (file)
@@ -252,14 +252,14 @@ class AnalysisResultsFetcher {
 
     function fetch_commits()
     {
-        $query = $this->db->query('SELECT commit_build, commit_repository, commit_revision, commit_time
+        $query = $this->db->query('SELECT commit_id, commit_build, commit_repository, commit_revision, commit_time
             FROM commits, build_commits, build_requests, analysis_test_groups
             WHERE commit_id = build_commit AND commit_build = request_build
                 AND request_group = testgroup_id AND testgroup_task = $1', array($this->task_id));
         while ($row = $this->db->fetch_next_row($query)) {
             $commit_time = Database::to_js_time($row['commit_time']);
             array_push(array_ensure_item_has_array($this->build_to_commits, $row['commit_build']),
-                array($row['commit_repository'], $row['commit_revision'], $commit_time));
+                array($row['commit_id'], $row['commit_repository'], $row['commit_revision'], $commit_time));
         }
     }
 
index f724e8bc0eb6c1edb5adac8e04b7c966736b231f..7eef3e57ae640bd1b1881732e2b0f800589bd982 100644 (file)
@@ -92,14 +92,12 @@ class BuildRequestsFetcher {
 
         $root_ids = array();
         foreach ($root_rows as $row) {
-            $repository = $row['repository_id'];
+            $repository_id = $row['commit_repository'];
             $revision = $row['commit_revision'];
             $commit_time = $row['commit_time'];
-            $root_id = $root_set_id . '-' . $repository;
-            array_push($root_ids, $root_id);
-            $repository_id = $resolve_ids ? $row['repository_name'] : $row['repository_id'];
+            array_push($root_ids, $row['commit_id']);
             array_push($this->roots, array(
-                'id' => $root_id,
+                'id' => $row['commit_id'],
                 'repository' => $repository_id,
                 'revision' => $revision,
                 'time' => Database::to_js_time($commit_time)));
index 45229abc6eedf7197aed8ac0540a32a007111b90..bc07712c214b55eee568822767b45517d89885b1 100644 (file)
@@ -3,6 +3,7 @@
 class CommitLog extends DataModelObject {
     constructor(id, rawData)
     {
+        console.assert(parseInt(id) == id);
         super(id);
         this._repository = rawData.repository;
         console.assert(this._repository instanceof Repository);
index 30c89d17a5dc7ad2e1678253ff0ceb952d7a9cab..d7e680d570b58e8247c5486cb4f109d278f78a05 100644 (file)
@@ -13,9 +13,7 @@ class RootSet extends DataModelObject {
             return;
 
         for (var row of object.roots) {
-            var repositoryId = row.repository;
-            row.repository = Repository.findById(repositoryId);
-
+            var repositoryId = row.repository.id();
             console.assert(!this._repositoryToCommitMap[repositoryId]);
             this._repositoryToCommitMap[repositoryId] = CommitLog.ensureSingleton(row.id, row);
             this._repositories.push(row.repository);
index 8c94c4ed669d6b43c18be3b27ded35e24522c2e3..a698b137808f10c5a2c97b5bc4cd1de420bd9f46 100644 (file)
@@ -222,8 +222,10 @@ class TestGroup extends LabeledObject {
         });
 
         var rootIdMap = {};
-        for (var root of data['roots'])
+        for (var root of data['roots']) {
             rootIdMap[root.id] = root;
+            root.repository = Repository.findById(root.repository);
+        }
 
         var rootSets = data['rootSets'].map(function (row) {
             row.roots = row.roots.map(function (rootId) { return rootIdMap[rootId]; });