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: https://svn.webkit.org/repository/webkit/trunk@198503
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
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
https://bugs.webkit.org/show_bug.cgi?id=155729
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));
}
}
$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)));
class CommitLog extends DataModelObject {
constructor(id, rawData)
{
+ console.assert(parseInt(id) == id);
super(id);
this._repository = rawData.repository;
console.assert(this._repository instanceof Repository);
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);
});
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]; });