Diff
Modified: trunk/Websites/perf.webkit.org/ChangeLog (222226 => 222227)
--- trunk/Websites/perf.webkit.org/ChangeLog 2017-09-19 21:23:18 UTC (rev 222226)
+++ trunk/Websites/perf.webkit.org/ChangeLog 2017-09-19 21:47:41 UTC (rev 222227)
@@ -1,3 +1,53 @@
+2017-09-19 Dewei Zhu <[email protected]>
+
+ Use 'owned commit' instead of 'sub commit' whenever refers to a commit owned by another commit.
+ https://bugs.webkit.org/show_bug.cgi?id=177178
+
+ Reviewed by Ryosuke Niwa.
+
+ We use both 'owned commit' and 'sub commit' to refer to a commit owned by an another commit. We should use one term instead of two.
+ Renaming 'subCommit' to 'ownedCommit', 'ownsSubCommit' to 'ownsCommit' and 'sub-commit' to 'owned-commit'.
+
+ * browser-tests/commit-log-viewer-tests.js:
+ * public/api/commits.php:
+ * public/api/report-commits.php:
+ * public/include/commit-log-fetcher.php:
+ * public/v3/components/commit-log-viewer.js:
+ (CommitLogViewer.prototype._renderCommitList):
+ * public/v3/components/owned-commit-viewer.js: Renamed from Websites/perf.webkit.org/public/v3/components/sub-commit-viewer.js.
+ (OwnedCommitViewer):
+ (OwnedCommitViewer.prototype.didConstructShadowTree):
+ (OwnedCommitViewer.prototype._toggleVisibility):
+ (OwnedCommitViewer.prototype.render):
+ (OwnedCommitViewer.prototype._renderOwnedCommitTable):
+ (OwnedCommitViewer.htmlTemplate):
+ (OwnedCommitViewer.cssTemplate):
+ * public/v3/index.html:
+ * public/v3/models/commit-log.js:
+ (CommitLog):
+ (CommitLog.prototype.updateSingleton):
+ (CommitLog.prototype.ownsCommits):
+ (CommitLog.prototype.fetchOwnedCommits):
+ (CommitLog.prototype._buildOwnedCommitMap):
+ (CommitLog.diffOwnedCommits):
+ (CommitLog.prototype.ownsSubCommits): Deleted.
+ (CommitLog.prototype.fetchSubCommits): Deleted.
+ (CommitLog.prototype._buildSubCommitMap): Deleted.
+ (CommitLog.diffSubCommits): Deleted.
+ * server-tests/api-commits-tests.js:
+ * server-tests/api-report-commits-tests.js:
+ * server-tests/tools-os-build-fetcher-tests.js:
+ (return.waitForInvocationPromise.then):
+ (string_appeared_here.return.waitForInvocationPromise.then):
+ * tools/js/os-build-fetcher.js:
+ (prototype._fetchAvailableBuilds):
+ (prototype._addOwnedCommitsForBuild):
+ (prototype._addSubCommitsForBuild): Deleted.
+ * unit-tests/commit-log-tests.js:
+ (return.commit.fetchOwnedCommits.then):
+ (return.fetchingPromise.then):
+ (return.commit.fetchSubCommits.then): Deleted.
+
2017-09-12 Dewei Zhu <[email protected]>
Performance Dashboard backend should support A/B testing for owned components.
Modified: trunk/Websites/perf.webkit.org/browser-tests/commit-log-viewer-tests.js (222226 => 222227)
--- trunk/Websites/perf.webkit.org/browser-tests/commit-log-viewer-tests.js 2017-09-19 21:23:18 UTC (rev 222226)
+++ trunk/Websites/perf.webkit.org/browser-tests/commit-log-viewer-tests.js 2017-09-19 21:47:41 UTC (rev 222227)
@@ -23,7 +23,7 @@
"revision": "210949",
"repository": 1,
"previousCommit": null,
- "ownsSubCommits": false,
+ "ownsCommits": false,
"time": +new Date("2017-01-20T03:23:50.645Z"),
"authorName": "Chris Dumez",
"authorEmail": "[email protected]",
@@ -35,7 +35,7 @@
"revision": "210950",
"repository": 1,
"previousCommit": null,
- "ownsSubCommits": false,
+ "ownsCommits": false,
"time": +new Date("2017-01-20T03:49:37.887Z"),
"authorName": "Commit Queue",
"authorEmail": "[email protected]",
Modified: trunk/Websites/perf.webkit.org/public/api/commits.php (222226 => 222227)
--- trunk/Websites/perf.webkit.org/public/api/commits.php 2017-09-19 21:23:18 UTC (rev 222226)
+++ trunk/Websites/perf.webkit.org/public/api/commits.php 2017-09-19 21:47:41 UTC (rev 222227)
@@ -38,9 +38,9 @@
$commits = $fetcher->fetch_latest_for_platform($repository_id, $platform_id);
} else
$commits = $fetcher->fetch_latest($repository_id);
- } else if ($filter == 'sub-commits') {
+ } else if ($filter == 'owned-commits') {
$owner_revision = array_get($_GET, 'owner-revision');
- $commits = $fetcher->fetch_subcommits_for_revision($repository_id, $owner_revision);
+ $commits = $fetcher->fetch_owned_commits_for_revision($repository_id, $owner_revision);
} else if ($filter == 'last-reported') {
$from = array_get($_GET, 'from');
$to = array_get($_GET, 'to');
Modified: trunk/Websites/perf.webkit.org/public/api/report-commits.php (222226 => 222227)
--- trunk/Websites/perf.webkit.org/public/api/report-commits.php 2017-09-19 21:23:18 UTC (rev 222226)
+++ trunk/Websites/perf.webkit.org/public/api/report-commits.php 2017-09-19 21:47:41 UTC (rev 222227)
@@ -32,20 +32,20 @@
exit_with_error('FailedToInsertRepository', array('commit' => $commit_info));
}
$owner_commit_id = insert_commit($db, $commit_info, $repository_id, NULL);
- if (!array_key_exists('subCommits', $commit_info))
+ if (!array_key_exists('ownedCommits', $commit_info))
continue;
- foreach($commit_info['subCommits'] as $sub_commit_repository_name => $sub_commit_info) {
- if (array_key_exists('time', $sub_commit_info)) {
+ foreach($commit_info['ownedCommits'] as $owned_commit_repository_name => $owned_commit_info) {
+ if (array_key_exists('time', $owned_commit_info)) {
$db->rollback_transaction();
- exit_with_error('SubCommitShouldNotContainTimestamp', array('commit' => $sub_commit_info));
+ exit_with_error('OwnedCommitShouldNotContainTimestamp', array('commit' => $owned_commit_info));
}
- $sub_commit_repository_id = $db->select_or_insert_row('repositories', 'repository', array('name' => $sub_commit_repository_name, 'owner' => $repository_id));
- if (!$sub_commit_repository_id) {
+ $owned_commit_repository_id = $db->select_or_insert_row('repositories', 'repository', array('name' => $owned_commit_repository_name, 'owner' => $repository_id));
+ if (!$owned_commit_repository_id) {
$db->rollback_transaction();
- exit_with_error('FailedToInsertRepository', array('commit' => $sub_commit_info));
+ exit_with_error('FailedToInsertRepository', array('commit' => $owned_commit_info));
}
- insert_commit($db, $sub_commit_info, $sub_commit_repository_id, $owner_commit_id);
+ insert_commit($db, $owned_commit_info, $owned_commit_repository_id, $owner_commit_id);
}
}
$db->commit_transaction();
Modified: trunk/Websites/perf.webkit.org/public/include/commit-log-fetcher.php (222226 => 222227)
--- trunk/Websites/perf.webkit.org/public/include/commit-log-fetcher.php 2017-09-19 21:23:18 UTC (rev 222226)
+++ trunk/Websites/perf.webkit.org/public/include/commit-log-fetcher.php 2017-09-19 21:47:41 UTC (rev 222227)
@@ -35,7 +35,7 @@
foreach ($commit_rows as &$commit_row) {
$associated_task = &$task_by_id[$commit_row['taskcommit_task']];
# FIXME: The last parameter should be determined based on commit_ownerships.
- $commit = $this->format_commit($commit_row, $commit_row, /* owns_sub_commits */ FALSE);
+ $commit = $this->format_commit($commit_row, $commit_row, /* owns_commits */ FALSE);
$commit['repository'] = $commit_row['commit_repository'];
array_push($commits, $commit);
array_push($associated_task[Database::is_true($commit_row['taskcommit_is_fix']) ? 'fixes' : 'causes'], $commit_row['commit_id']);
@@ -61,7 +61,7 @@
committer_account as "authorEmail",
commit_repository as "repository",
commit_message as "message",
- EXISTS(SELECT * FROM commit_ownerships WHERE commit_owner = commit_id) as "ownsSubCommits"
+ EXISTS(SELECT * FROM commit_ownerships WHERE commit_owner = commit_id) as "ownsCommits"
FROM commits LEFT OUTER JOIN committers ON commit_committer = committer_id
WHERE commit_repository = $1 AND commit_reported = true';
$values = array($repository_id);
@@ -107,13 +107,13 @@
foreach ($commits as &$commit) {
$commit['time'] = Database::to_js_time($commit['time']);
- $commit['ownsSubCommits'] = Database::is_true($commit['ownsSubCommits']);
+ $commit['ownsCommits'] = Database::is_true($commit['ownsCommits']);
}
return $commits;
}
- function fetch_subcommits_for_revision($repository_id, $commit_revision) {
+ function fetch_owned_commits_for_revision($repository_id, $commit_revision) {
return $this->db->query_and_fetch_all('SELECT owned.commit_repository as "repository",
owned.commit_revision as "revision",
owned.commit_time as "time",
@@ -195,11 +195,11 @@
if (!$commit_row)
return array();
$committer = $this->db->select_first_row('committers', 'committer', array('id' => $commit_row['commit_committer']));
- $owns_sub_commits = !!$this->db->select_first_row('commit_ownerships', 'commit', array('owner' => $commit_row['commit_id']));
- return array($this->format_commit($commit_row, $committer, $owns_sub_commits));
+ $owns_commits = !!$this->db->select_first_row('commit_ownerships', 'commit', array('owner' => $commit_row['commit_id']));
+ return array($this->format_commit($commit_row, $committer, $owns_commits));
}
- private function format_commit($commit_row, $committer_row, $owns_sub_commits) {
+ private function format_commit($commit_row, $committer_row, $owns_commits) {
return array(
'id' => $commit_row['commit_id'],
'revision' => $commit_row['commit_revision'],
@@ -210,7 +210,7 @@
'authorName' => $committer_row ? $committer_row['committer_name'] : null,
'authorEmail' => $committer_row ? $committer_row['committer_account'] : null,
'message' => $commit_row['commit_message'],
- 'ownsSubCommits' => $owns_sub_commits
+ 'ownsCommits' => $owns_commits
);
}
}
Modified: trunk/Websites/perf.webkit.org/public/v3/components/commit-log-viewer.js (222226 => 222227)
--- trunk/Websites/perf.webkit.org/public/v3/components/commit-log-viewer.js 2017-09-19 21:23:18 UTC (rev 222226)
+++ trunk/Websites/perf.webkit.org/public/v3/components/commit-log-viewer.js 2017-09-19 21:47:41 UTC (rev 222227)
@@ -77,10 +77,10 @@
this.renderReplace(this.content('commits-list'), (commits || []).map((commit) => {
const label = commit.label();
const url = ""
- const ownsSubCommits = previousCommit && previousCommit.ownsSubCommits() && commit.ownsSubCommits();
- const subCommitDifferenceRow = ownsSubCommits ? element('tr', element('td', {colspan: 2}, new SubCommitViewer(previousCommit, commit))) : [];
+ const ownsCommits = previousCommit && previousCommit.ownsCommits() && commit.ownsCommits();
+ const ownedCommitDifferenceRow = ownsCommits ? element('tr', element('td', {colspan: 2}, new OwnedCommitViewer(previousCommit, commit))) : [];
previousCommit = commit;
- return [subCommitDifferenceRow,
+ return [ownedCommitDifferenceRow,
element('tr', [
element('th', [element('h4', {class: 'revision'}, url ? link(label, commit.title(), url) : label), commit.author() || '']),
element('td', commit.message() ? commit.message().substring(0, 80) : '')])];
Copied: trunk/Websites/perf.webkit.org/public/v3/components/owned-commit-viewer.js (from rev 222226, trunk/Websites/perf.webkit.org/public/v3/components/sub-commit-viewer.js) (0 => 222227)
--- trunk/Websites/perf.webkit.org/public/v3/components/owned-commit-viewer.js (rev 0)
+++ trunk/Websites/perf.webkit.org/public/v3/components/owned-commit-viewer.js 2017-09-19 21:47:41 UTC (rev 222227)
@@ -0,0 +1,98 @@
+class OwnedCommitViewer extends ComponentBase {
+
+ constructor(previousCommit, currentCommit)
+ {
+ super('owned-commit-viewer');
+ this._previousCommit = previousCommit;
+ this._currentCommit = currentCommit;
+ this._previousOwnedCommits = null;
+ this._currentOwnedCommits = null;
+ this._showingOwnedCommits = false;
+ this._renderOwnedCommitTableLazily = new LazilyEvaluatedFunction(this._renderOwnedCommitTable.bind(this));
+ }
+
+ didConstructShadowTree()
+ {
+ this.part('expand-collapse').listenToAction('toggle', (expanded) => this._toggleVisibility(expanded));
+ }
+
+ _toggleVisibility(expanded)
+ {
+ this._showingOwnedCommits = expanded;
+ this.enqueueToRender();
+
+ Promise.all([this._previousCommit.fetchOwnedCommits(), this._currentCommit.fetchOwnedCommits()]).then((ownedCommitsList) => {
+ this._previousOwnedCommits = ownedCommitsList[0];
+ this._currentOwnedCommits = ownedCommitsList[1];
+ this.enqueueToRender();
+ });
+ }
+
+ render()
+ {
+ const hideSpinner = (this._previousOwnedCommits && this._currentOwnedCommits) || !this._showingOwnedCommits;
+
+ this.content('difference-entries').style.display = this._showingOwnedCommits ? null : 'none';
+ this.content('spinner-container').style.display = hideSpinner ? 'none' : null;
+ this.content('difference-table').style.display = this._showingOwnedCommits ? null : 'none';
+ this._renderOwnedCommitTableLazily.evaluate(this._previousOwnedCommits, this._currentOwnedCommits);
+ }
+
+ _renderOwnedCommitTable(previousOwnedCommits, currentOwnedCommits)
+ {
+ if (!previousOwnedCommits || !currentOwnedCommits)
+ return;
+
+ const difference = CommitLog.diffOwnedCommits(this._previousCommit, this._currentCommit);
+ const sortedRepositories = Repository.sortByName([...difference.keys()]);
+ const element = ComponentBase.createElement;
+
+ const tableEntries = sortedRepositories.map((repository) => {
+ const revisions = difference.get(repository);
+ return element('tr', [element('td', repository.name()),
+ element('td', revisions[0] ? revisions[0].revision() : ''),
+ element('td', revisions[1] ? revisions[1].revision() : '')]);
+ });
+ this.renderReplace(this.content('difference-entries'), tableEntries);
+ }
+
+ static htmlTemplate()
+ {
+ return `
+ <expand-collapse-button id="expand-collapse"></expand-collapse-button>
+ <table id="difference-table">
+ <tbody id="difference-entries"></tbody>
+ </table>
+ <div id="spinner-container"><spinner-icon id="spinner"></spinner-icon></div>`;
+ }
+
+ static cssTemplate() {
+ return `
+ :host {
+ display: block;
+ font-size: 0.8rem;
+ font-weight: normal;
+ }
+
+ expand-collapse-button {
+ margin-left: calc(50% - 0.8rem);
+ display: block;
+ }
+
+ td, th {
+ padding: 0.2rem;
+ margin: 0;
+ border-top: solid 1px #ccc;
+ }
+
+ #difference-table {
+ width: 100%;
+ }
+
+ #spinner-container {
+ text-align: center;
+ }`;
+ }
+}
+
+ComponentBase.defineElement('owned-commit-viewer', OwnedCommitViewer);
Deleted: trunk/Websites/perf.webkit.org/public/v3/components/sub-commit-viewer.js (222226 => 222227)
--- trunk/Websites/perf.webkit.org/public/v3/components/sub-commit-viewer.js 2017-09-19 21:23:18 UTC (rev 222226)
+++ trunk/Websites/perf.webkit.org/public/v3/components/sub-commit-viewer.js 2017-09-19 21:47:41 UTC (rev 222227)
@@ -1,98 +0,0 @@
-class SubCommitViewer extends ComponentBase {
-
- constructor(previousCommit, currentCommit)
- {
- super('sub-commit-viewer');
- this._previousCommit = previousCommit;
- this._currentCommit = currentCommit;
- this._previousSubCommits = null;
- this._currentSubCommits = null;
- this._showingSubCommits = false;
- this._renderSubCommitTableLazily = new LazilyEvaluatedFunction(this._renderSubcommitTable.bind(this));
- }
-
- didConstructShadowTree()
- {
- this.part('expand-collapse').listenToAction('toggle', (expanded) => this._toggleVisibility(expanded));
- }
-
- _toggleVisibility(expanded)
- {
- this._showingSubCommits = expanded;
- this.enqueueToRender();
-
- Promise.all([this._previousCommit.fetchSubCommits(), this._currentCommit.fetchSubCommits()]).then((subCommitsList) => {
- this._previousSubCommits = subCommitsList[0];
- this._currentSubCommits = subCommitsList[1];
- this.enqueueToRender();
- });
- }
-
- render()
- {
- const hideSpinner = (this._previousSubCommits && this._currentSubCommits) || !this._showingSubCommits;
-
- this.content('difference-entries').style.display = this._showingSubCommits ? null : 'none';
- this.content('spinner-container').style.display = hideSpinner ? 'none' : null;
- this.content('difference-table').style.display = this._showingSubCommits ? null : 'none';
- this._renderSubCommitTableLazily.evaluate(this._previousSubCommits, this._currentSubCommits);
- }
-
- _renderSubcommitTable(previousSubCommits, currentSubCommits)
- {
- if (!previousSubCommits || !currentSubCommits)
- return;
-
- const difference = CommitLog.diffSubCommits(this._previousCommit, this._currentCommit);
- const sortedRepositories = Repository.sortByName([...difference.keys()]);
- const element = ComponentBase.createElement;
-
- const tableEntries = sortedRepositories.map((repository) => {
- const revisions = difference.get(repository);
- return element('tr', [element('td', repository.name()),
- element('td', revisions[0] ? revisions[0].revision() : ''),
- element('td', revisions[1] ? revisions[1].revision() : '')]);
- });
- this.renderReplace(this.content('difference-entries'), tableEntries);
- }
-
- static htmlTemplate()
- {
- return `
- <expand-collapse-button id="expand-collapse"></expand-collapse-button>
- <table id="difference-table">
- <tbody id="difference-entries"></tbody>
- </table>
- <div id="spinner-container"><spinner-icon id="spinner"></spinner-icon></div>`;
- }
-
- static cssTemplate() {
- return `
- :host {
- display: block;
- font-size: 0.8rem;
- font-weight: normal;
- }
-
- expand-collapse-button {
- margin-left: calc(50% - 0.8rem);
- display: block;
- }
-
- td, th {
- padding: 0.2rem;
- margin: 0;
- border-top: solid 1px #ccc;
- }
-
- #difference-table {
- width: 100%;
- }
-
- #spinner-container {
- text-align: center;
- }`;
- }
-}
-
-ComponentBase.defineElement('sub-commit-viewer', SubCommitViewer);
\ No newline at end of file
Modified: trunk/Websites/perf.webkit.org/public/v3/index.html (222226 => 222227)
--- trunk/Websites/perf.webkit.org/public/v3/index.html 2017-09-19 21:23:18 UTC (rev 222226)
+++ trunk/Websites/perf.webkit.org/public/v3/index.html 2017-09-19 21:47:41 UTC (rev 222227)
@@ -74,7 +74,7 @@
<script src=""
<script src=""
<script src=""
- <script src=""
+ <script src=""
<script src=""
<script src=""
<script src=""
Modified: trunk/Websites/perf.webkit.org/public/v3/models/commit-log.js (222226 => 222227)
--- trunk/Websites/perf.webkit.org/public/v3/models/commit-log.js 2017-09-19 21:23:18 UTC (rev 222226)
+++ trunk/Websites/perf.webkit.org/public/v3/models/commit-log.js 2017-09-19 21:47:41 UTC (rev 222227)
@@ -11,7 +11,7 @@
this._remoteId = rawData.id;
if (this._remoteId)
this.ensureNamedStaticMap('remoteId')[this._remoteId] = this;
- this._subCommits = null;
+ this._ownedCommits = null;
}
updateSingleton(rawData)
@@ -25,8 +25,8 @@
this._rawData.authorName = rawData.authorName;
if (rawData.message)
this._rawData.message = rawData.message;
- if (rawData.ownsSubCommits)
- this._rawData.ownsSubCommits = rawData.ownsSubCommits;
+ if (rawData.ownsCommits)
+ this._rawData.ownsCommits = rawData.ownsCommits;
}
repository() { return this._repository; }
@@ -35,7 +35,7 @@
revision() { return this._rawData['revision']; }
message() { return this._rawData['message']; }
url() { return this._repository.urlForRevision(this._rawData['revision']); }
- ownsSubCommits() { return this._rawData['ownsSubCommits']; }
+ ownsCommits() { return this._rawData['ownsCommits']; }
label()
{
@@ -86,48 +86,48 @@
});
}
- fetchSubCommits()
+ fetchOwnedCommits()
{
if (!this.repository().ownedRepositories())
return Promise.reject();
- if (!this.ownsSubCommits())
+ if (!this.ownsCommits())
return Promise.reject();
- if (this._subCommits)
- return Promise.resolve(this._subCommits);
+ if (this._ownedCommits)
+ return Promise.resolve(this._ownedCommits);
- return CommitLog.cachedFetch(`../api/commits/${this.repository().id()}/sub-commits?owner-revision=${escape(this.revision())}`).then((data) => {
- this._subCommits = CommitLog._constructFromRawData(data);
- return this._subCommits;
+ return CommitLog.cachedFetch(`../api/commits/${this.repository().id()}/owned-commits?owner-revision=${escape(this.revision())}`).then((data) => {
+ this._ownedCommits = CommitLog._constructFromRawData(data);
+ return this._ownedCommits;
});
}
- _buildSubCommitMap()
+ _buildOwnedCommitMap()
{
- const subCommitMap = new Map;
- for (const commit of this._subCommits)
- subCommitMap.set(commit.repository(), commit);
- return subCommitMap;
+ const ownedCommitMap = new Map;
+ for (const commit of this._ownedCommits)
+ ownedCommitMap.set(commit.repository(), commit);
+ return ownedCommitMap;
}
- static diffSubCommits(previousCommit, currentCommit)
+ static diffOwnedCommits(previousCommit, currentCommit)
{
console.assert(previousCommit);
console.assert(currentCommit);
- console.assert(previousCommit._subCommits);
- console.assert(currentCommit._subCommits);
+ console.assert(previousCommit._ownedCommits);
+ console.assert(currentCommit._ownedCommits);
- const previousSubCommitMap = previousCommit._buildSubCommitMap();
- const currentSubCommitMap = currentCommit._buildSubCommitMap();
- const subCommitRepositories = new Set([...currentSubCommitMap.keys(), ...previousSubCommitMap.keys()]);
+ const previousOwnedCommitMap = previousCommit._buildOwnedCommitMap();
+ const currentOwnedCommitMap = currentCommit._buildOwnedCommitMap();
+ const ownedCommitRepositories = new Set([...currentOwnedCommitMap.keys(), ...previousOwnedCommitMap.keys()]);
const difference = new Map;
- subCommitRepositories.forEach((subCommitRepository) => {
- const currentRevision = currentSubCommitMap.get(subCommitRepository);
- const previousRevision = previousSubCommitMap.get(subCommitRepository);
+ ownedCommitRepositories.forEach((ownedCommitRepository) => {
+ const currentRevision = currentOwnedCommitMap.get(ownedCommitRepository);
+ const previousRevision = previousOwnedCommitMap.get(ownedCommitRepository);
if (currentRevision != previousRevision)
- difference.set(subCommitRepository, [previousRevision, currentRevision]);
+ difference.set(ownedCommitRepository, [previousRevision, currentRevision]);
});
return difference;
Modified: trunk/Websites/perf.webkit.org/server-tests/api-commits-tests.js (222226 => 222227)
--- trunk/Websites/perf.webkit.org/server-tests/api-commits-tests.js 2017-09-19 21:23:18 UTC (rev 222226)
+++ trunk/Websites/perf.webkit.org/server-tests/api-commits-tests.js 2017-09-19 21:47:41 UTC (rev 222227)
@@ -413,8 +413,8 @@
});
- describe('/api/commits/<repository>/sub-commits?owner-revision=<commit>', () => {
- it("should return sub commits for a given commit", () => {
+ describe('/api/commits/<repository>/owned-commits?owner-revision=<commit>', () => {
+ it("should return owned commits for a given commit", () => {
const db = TestServer.database();
return Promise.all([
db.insert('repositories', {'id': 1, 'name': 'macOS'}),
@@ -423,19 +423,19 @@
db.insert('commits', {'id': 2, 'repository': 2, 'revision': '210950', 'reported': true}),
db.insert('commit_ownerships', {'owner': 1, 'owned': 2})
]).then(() => {
- return TestServer.remoteAPI().getJSON('/api/commits/1/sub-commits?owner-revision=10.12%2016A323')
+ return TestServer.remoteAPI().getJSON('/api/commits/1/owned-commits?owner-revision=10.12%2016A323')
}).then((results) => {
assert.equal(results.status, 'OK');
assert.equal(results.commits.length, 1);
- const subCommit = results.commits[0];
- assert.equal(subCommit.repository, 2);
- assert.equal(subCommit.revision, '210950');
- assert.equal(subCommit.id, 2);
+ const ownedCommit = results.commits[0];
+ assert.equal(ownedCommit.repository, 2);
+ assert.equal(ownedCommit.revision, '210950');
+ assert.equal(ownedCommit.id, 2);
});
});
- it("should return an empty list of commits if no sub-commits is associated with given commit", () => {
+ it("should return an empty list of commits if no owned-commit is associated with given commit", () => {
const db = TestServer.database();
return Promise.all([
db.insert('repositories', {'id': 1, 'name': 'macOS'}),
@@ -443,7 +443,7 @@
db.insert('commits', {'id': 1, 'repository': 1, 'revision': '10.12 16A323', order: 1, 'reported': true}),
db.insert('commits', {'id': 2, 'repository': 2, 'revision': '210950', 'reported': true})
]).then(() => {
- return TestServer.remoteAPI().getJSON('/api/commits/1/sub-commits?owner-revision=10.12%2016A323')
+ return TestServer.remoteAPI().getJSON('/api/commits/1/owned-commits?owner-revision=10.12%2016A323')
}).then((results) => {
assert.equal(results.status, 'OK');
assert.deepEqual(results.commits, []);
@@ -458,7 +458,7 @@
db.insert('commits', {'id': 1, 'repository': 1, 'revision': '10.12 16A323', order: 1, 'reported': true}),
db.insert('commits', {'id': 2, 'repository': 2, 'revision': '210950', 'reported': true})
]).then(() => {
- return TestServer.remoteAPI().getJSON('/api/commits/1/sub-commits?owner-revision=10.12%2016A324')
+ return TestServer.remoteAPI().getJSON('/api/commits/1/owned-commits?owner-revision=10.12%2016A324')
}).then((results) => {
assert.equal(results.status, 'OK');
assert.equal(results.commits.length, 0);
Modified: trunk/Websites/perf.webkit.org/server-tests/api-report-commits-tests.js (222226 => 222227)
--- trunk/Websites/perf.webkit.org/server-tests/api-report-commits-tests.js 2017-09-19 21:23:18 UTC (rev 222226)
+++ trunk/Websites/perf.webkit.org/server-tests/api-report-commits-tests.js 2017-09-19 21:47:41 UTC (rev 222227)
@@ -268,7 +268,7 @@
});
});
- const sameRepositoryNameInSubCommitAndMajorCommit = {
+ const sameRepositoryNameInOwnedCommitAndMajorCommit = {
"slaveName": "someSlave",
"slavePassword": "somePassword",
"commits": [
@@ -276,7 +276,7 @@
"repository": "OSX",
"revision": "Sierra16D32",
"order": 1,
- "subCommits": {
+ "ownedCommits": {
"WebKit": {
"revision": "141978",
"author": {"name": "Commit Queue", "account": "[email protected]"},
@@ -299,8 +299,8 @@
}
it("should distinguish between repositories with the same name but with a different owner.", () => {
- return addSlaveForReport(sameRepositoryNameInSubCommitAndMajorCommit).then(() => {
- return TestServer.remoteAPI().postJSON('/api/report-commits/', sameRepositoryNameInSubCommitAndMajorCommit);
+ return addSlaveForReport(sameRepositoryNameInOwnedCommitAndMajorCommit).then(() => {
+ return TestServer.remoteAPI().postJSON('/api/report-commits/', sameRepositoryNameInOwnedCommitAndMajorCommit);
}).then((response) => {
assert.equal(response['status'], 'OK');
return TestServer.database().selectRows('repositories', {'name': 'WebKit'});
@@ -314,7 +314,7 @@
});
});
- const systemVersionCommitWithSubcommits = {
+ const systemVersionCommitWithOwnedCommits = {
"slaveName": "someSlave",
"slavePassword": "somePassword",
"commits": [
@@ -322,7 +322,7 @@
"repository": "OSX",
"revision": "Sierra16D32",
"order": 1,
- "subCommits": {
+ "ownedCommits": {
"WebKit": {
"revision": "141978",
"author": {"name": "Commit Queue", "account": "[email protected]"},
@@ -338,10 +338,10 @@
]
}
- it("should accept inserting one commit with some sub commits", () => {
+ it("should accept inserting one commit with some owned commits", () => {
const db = TestServer.database();
- return addSlaveForReport(systemVersionCommitWithSubcommits).then(() => {
- return TestServer.remoteAPI().postJSON('/api/report-commits/', systemVersionCommitWithSubcommits);
+ return addSlaveForReport(systemVersionCommitWithOwnedCommits).then(() => {
+ return TestServer.remoteAPI().postJSON('/api/report-commits/', systemVersionCommitWithOwnedCommits);
}).then((response) => {
assert.equal(response['status'], 'OK');
return Promise.all([db.selectRows('commits', {'revision': 'Sierra16D32'}),
@@ -402,7 +402,7 @@
});
})
- const multipleSystemVersionCommitsWithSubcommits = {
+ const multipleSystemVersionCommitsWithOwnedCommits = {
"slaveName": "someSlave",
"slavePassword": "somePassword",
"commits": [
@@ -410,7 +410,7 @@
"repository": "OSX",
"revision": "Sierra16D32",
"order": 2,
- "subCommits": {
+ "ownedCommits": {
"WebKit": {
"revision": "141978",
"author": {"name": "Commit Queue", "account": "[email protected]"},
@@ -427,7 +427,7 @@
"repository": "OSX",
"revision": "Sierra16C67",
"order": 1,
- "subCommits": {
+ "ownedCommits": {
"WebKit": {
"revision": "141978",
"author": {"name": "Commit Queue", "account": "[email protected]"},
@@ -443,10 +443,10 @@
]
};
- it("should accept inserting multiple commits with multiple sub-commits", () => {
+ it("should accept inserting multiple commits with multiple owned-commits", () => {
const db = TestServer.database();
- return addSlaveForReport(multipleSystemVersionCommitsWithSubcommits).then(() => {
- return TestServer.remoteAPI().postJSON('/api/report-commits/', multipleSystemVersionCommitsWithSubcommits);
+ return addSlaveForReport(multipleSystemVersionCommitsWithOwnedCommits).then(() => {
+ return TestServer.remoteAPI().postJSON('/api/report-commits/', multipleSystemVersionCommitsWithOwnedCommits);
}).then((response) => {
assert.equal(response['status'], 'OK');
return Promise.all([db.selectRows('commits', {'revision': 'Sierra16D32'}),
@@ -530,7 +530,7 @@
});
});
- const systemVersionCommitWithEmptySubcommits = {
+ const systemVersionCommitWithEmptyOwnedCommits = {
"slaveName": "someSlave",
"slavePassword": "somePassword",
"commits": [
@@ -538,15 +538,15 @@
"repository": "OSX",
"revision": "Sierra16D32",
"order": 1,
- "subCommits": {
+ "ownedCommits": {
}
}
]
}
- it("should accept inserting one commit with no sub commits", () => {
- return addSlaveForReport(systemVersionCommitWithEmptySubcommits).then(() => {
- return TestServer.remoteAPI().postJSON('/api/report-commits/', systemVersionCommitWithEmptySubcommits);
+ it("should accept inserting one commit with no owned commits", () => {
+ return addSlaveForReport(systemVersionCommitWithEmptyOwnedCommits).then(() => {
+ return TestServer.remoteAPI().postJSON('/api/report-commits/', systemVersionCommitWithEmptyOwnedCommits);
}).then((response) => {
assert.equal(response['status'], 'OK');
const db = TestServer.database();
@@ -563,7 +563,7 @@
});
});
- const systemVersionCommitAndSubcommitWithTimestamp = {
+ const systemVersionCommitAndOwnedCommitWithTimestamp = {
"slaveName": "someSlave",
"slavePassword": "somePassword",
"commits": [
@@ -571,7 +571,7 @@
"repository": "OSX",
"revision": "Sierra16D32",
"order": 1,
- "subCommits": {
+ "ownedCommits": {
"WebKit": {
"revision": "141978",
"time": "2013-02-06T08:55:20.9Z",
@@ -583,11 +583,11 @@
]
}
- it("should reject inserting one commit with sub commits that contains timestamp", () => {
- return addSlaveForReport(systemVersionCommitAndSubcommitWithTimestamp).then(() => {
- return TestServer.remoteAPI().postJSON('/api/report-commits/', systemVersionCommitAndSubcommitWithTimestamp);
+ it("should reject inserting one commit with owned commits that contains timestamp", () => {
+ return addSlaveForReport(systemVersionCommitAndOwnedCommitWithTimestamp).then(() => {
+ return TestServer.remoteAPI().postJSON('/api/report-commits/', systemVersionCommitAndOwnedCommitWithTimestamp);
}).then((response) => {
- assert.equal(response['status'], 'SubCommitShouldNotContainTimestamp');
+ assert.equal(response['status'], 'OwnedCommitShouldNotContainTimestamp');
});
});
});
Modified: trunk/Websites/perf.webkit.org/server-tests/tools-os-build-fetcher-tests.js (222226 => 222227)
--- trunk/Websites/perf.webkit.org/server-tests/tools-os-build-fetcher-tests.js 2017-09-19 21:23:18 UTC (rev 222226)
+++ trunk/Websites/perf.webkit.org/server-tests/tools-os-build-fetcher-tests.js 2017-09-19 21:47:41 UTC (rev 222227)
@@ -30,15 +30,15 @@
'password': 'somePassword'
};
- const subCommitWithWebKit = {
+ const ownedCommitWithWebKit = {
'WebKit': {'revision': '141978'}
};
- const anotherSubCommitWithWebKit = {
+ const anotherownedCommitWithWebKit = {
'WebKit': {'revision': '141999'}
};
- const anotherSubCommitWithWebKitAndJavaScriptCore = {
+ const anotherownedCommitWithWebKitAndJavaScriptCore = {
'WebKit': {'revision': '142000'},
'_javascript_Core': {'revision': '142000'}
};
@@ -61,7 +61,7 @@
'customCommands': [
{
'command': ['list', 'all osx 16Dxx builds'],
- 'subCommitCommand': ['list', 'subCommit', 'for', 'revision'],
+ 'ownedCommitCommand': ['list', 'ownedCommit', 'for', 'revision'],
'linesToIgnore': '^\\.*$',
'minRevision': 'Sierra16D0',
'maxRevision': 'Sierra16D999'
@@ -68,7 +68,7 @@
},
{
'command': ['list', 'all osx 16Exx builds'],
- 'subCommitCommand': ['list', 'subCommit', 'for', 'revision'],
+ 'ownedCommitCommand': ['list', 'ownedCommit', 'for', 'revision'],
'linesToIgnore': '^\\.*$',
'minRevision': 'Sierra16E0',
'maxRevision': 'Sierra16E999'
@@ -77,7 +77,7 @@
};
- const configWithoutSubCommitCommand = {
+ const configWithoutownedCommitCommand = {
'name': 'OSX',
'customCommands': [
{
@@ -141,68 +141,68 @@
});
});
- describe('OSBuildFetcher._addSubCommitsForBuild', () => {
- it('should add sub-commit info for commits', () => {
+ describe('OSBuildFetcher._addOwnedCommitsForBuild', () => {
+ it('should add owned-commit info for commits', () => {
const logger = new MockLogger;
const fetchter = new OSBuildFetcher(null, null, null, MockSubprocess, logger);
const waitForInvocationPromise = MockSubprocess.waitForInvocation();
- const addSubCommitPromise = fetchter._addSubCommitsForBuild([osxCommit, anotherOSXCommit], ['subCommit', 'for', 'revision']);
+ const addownedCommitPromise = fetchter._addOwnedCommitsForBuild([osxCommit, anotherOSXCommit], ['ownedCommit', 'for', 'revision']);
return waitForInvocationPromise.then(() => {
assert.equal(MockSubprocess.invocations.length, 1);
- assert.deepEqual(MockSubprocess.invocations[0].command, ['subCommit', 'for', 'revision', 'Sierra16D32']);
- MockSubprocess.invocations[0].resolve(JSON.stringify(subCommitWithWebKit));
+ assert.deepEqual(MockSubprocess.invocations[0].command, ['ownedCommit', 'for', 'revision', 'Sierra16D32']);
+ MockSubprocess.invocations[0].resolve(JSON.stringify(ownedCommitWithWebKit));
MockSubprocess.reset();
return MockSubprocess.waitForInvocation();
}).then(() => {
assert.equal(MockSubprocess.invocations.length, 1);
- assert.deepEqual(MockSubprocess.invocations[0].command, ['subCommit', 'for', 'revision', 'Sierra16E32']);
- MockSubprocess.invocations[0].resolve(JSON.stringify(anotherSubCommitWithWebKit));
- return addSubCommitPromise;
+ assert.deepEqual(MockSubprocess.invocations[0].command, ['ownedCommit', 'for', 'revision', 'Sierra16E32']);
+ MockSubprocess.invocations[0].resolve(JSON.stringify(anotherownedCommitWithWebKit));
+ return addownedCommitPromise;
}).then((results) => {
assert.equal(results.length, 2);
assert.equal(results[0]['repository'], osxCommit['repository']);
assert.equal(results[0]['revision'], osxCommit['revision']);
- assert.deepEqual(results[0]['subCommits'], subCommitWithWebKit);
+ assert.deepEqual(results[0]['ownedCommits'], ownedCommitWithWebKit);
assert.equal(results[1]['repository'], anotherOSXCommit['repository']);
assert.equal(results[1]['revision'], anotherOSXCommit['revision']);
- assert.deepEqual(results[1]['subCommits'], anotherSubCommitWithWebKit);
+ assert.deepEqual(results[1]['ownedCommits'], anotherownedCommitWithWebKit);
});
});
- it('should fail if the command to get sub-commit info fails', () => {
+ it('should fail if the command to get owned-commit info fails', () => {
const logger = new MockLogger;
const fetchter = new OSBuildFetcher(null, null, null, MockSubprocess, logger);
const waitForInvocationPromise = MockSubprocess.waitForInvocation();
- const addSubCommitPromise = fetchter._addSubCommitsForBuild([osxCommit], ['subCommit', 'for', 'revision'])
+ const addownedCommitPromise = fetchter._addOwnedCommitsForBuild([osxCommit], ['ownedCommit', 'for', 'revision'])
return waitForInvocationPromise.then(() => {
assert.equal(MockSubprocess.invocations.length, 1);
- assert.deepEqual(MockSubprocess.invocations[0].command, ['subCommit', 'for', 'revision', 'Sierra16D32']);
- MockSubprocess.invocations[0].reject('Failed getting sub-commit');
+ assert.deepEqual(MockSubprocess.invocations[0].command, ['ownedCommit', 'for', 'revision', 'Sierra16D32']);
+ MockSubprocess.invocations[0].reject('Failed getting owned-commit');
- return addSubCommitPromise.then(() => {
+ return addownedCommitPromise.then(() => {
assert(false, 'should never be reached');
}, (error_output) => {
assert(error_output);
- assert.equal(error_output, 'Failed getting sub-commit');
+ assert.equal(error_output, 'Failed getting owned-commit');
});
});
});
- it('should fail if entries in sub-commits does not contain revision', () => {
+ it('should fail if entries in owned-commits does not contain revision', () => {
const logger = new MockLogger;
const fetchter = new OSBuildFetcher(null, null, null, MockSubprocess, logger);
const waitForInvocationPromise = MockSubprocess.waitForInvocation();
- const addSubCommitPromise = fetchter._addSubCommitsForBuild([osxCommit], ['subCommit', 'for', 'revision'])
+ const addownedCommitPromise = fetchter._addOwnedCommitsForBuild([osxCommit], ['ownedCommit', 'for', 'revision'])
return waitForInvocationPromise.then(() => {
assert.equal(MockSubprocess.invocations.length, 1);
- assert.deepEqual(MockSubprocess.invocations[0].command, ['subCommit', 'for', 'revision', 'Sierra16D32']);
+ assert.deepEqual(MockSubprocess.invocations[0].command, ['ownedCommit', 'for', 'revision', 'Sierra16D32']);
MockSubprocess.invocations[0].resolve('{"WebKit":{"RandomKey": "RandomValue"}}');
- return addSubCommitPromise.then(() => {
+ return addownedCommitPromise.then(() => {
assert(false, 'should never be reached');
}, (error_output) => {
assert(error_output);
@@ -223,7 +223,7 @@
TestServer.database().disconnect();
});
- it('should report all build commits with sub-commits', () => {
+ it('should report all build commits with owned-commits', () => {
const logger = new MockLogger;
const fetchter = new OSBuildFetcher(config, TestServer.remoteAPI(), slaveAuth, MockSubprocess, logger);
const db = TestServer.database();
@@ -260,8 +260,8 @@
return MockSubprocess.resetAndWaitForInvocation();
}).then(() => {
assert.equal(invocations.length, 1);
- assert.deepEqual(invocations[0].command, ['list', 'subCommit', 'for', 'revision', 'Sierra16D69']);
- invocations[0].resolve(JSON.stringify(subCommitWithWebKit));
+ assert.deepEqual(invocations[0].command, ['list', 'ownedCommit', 'for', 'revision', 'Sierra16D69']);
+ invocations[0].resolve(JSON.stringify(ownedCommitWithWebKit));
return MockSubprocess.resetAndWaitForInvocation();
}).then(() => {
assert.equal(invocations.length, 1);
@@ -270,13 +270,13 @@
return MockSubprocess.resetAndWaitForInvocation();
}).then(() => {
assert.equal(invocations.length, 1);
- assert.deepEqual(invocations[0].command, ['list', 'subCommit', 'for', 'revision', 'Sierra16E33h']);
- invocations[0].resolve(JSON.stringify(anotherSubCommitWithWebKit));
+ assert.deepEqual(invocations[0].command, ['list', 'ownedCommit', 'for', 'revision', 'Sierra16E33h']);
+ invocations[0].resolve(JSON.stringify(anotherownedCommitWithWebKit));
return MockSubprocess.resetAndWaitForInvocation();
}).then(() => {
assert.equal(invocations.length, 1);
- assert.deepEqual(invocations[0].command, ['list', 'subCommit', 'for', 'revision', 'Sierra16E34']);
- invocations[0].resolve(JSON.stringify(anotherSubCommitWithWebKitAndJavaScriptCore));
+ assert.deepEqual(invocations[0].command, ['list', 'ownedCommit', 'for', 'revision', 'Sierra16E34']);
+ invocations[0].resolve(JSON.stringify(anotherownedCommitWithWebKitAndJavaScriptCore));
return fetchAvailableBuildsPromise;
}).then((results) => {
assert.equal(results.length, 3);
@@ -290,8 +290,8 @@
return MockSubprocess.resetAndWaitForInvocation();
}).then(() => {
assert.equal(invocations.length, 1);
- assert.deepEqual(invocations[0].command, ['list', 'subCommit', 'for', 'revision', 'Sierra16D69']);
- invocations[0].resolve(JSON.stringify(subCommitWithWebKit));
+ assert.deepEqual(invocations[0].command, ['list', 'ownedCommit', 'for', 'revision', 'Sierra16D69']);
+ invocations[0].resolve(JSON.stringify(ownedCommitWithWebKit));
return MockSubprocess.resetAndWaitForInvocation();
}).then(() => {
assert.equal(invocations.length, 1);
@@ -300,13 +300,13 @@
return MockSubprocess.resetAndWaitForInvocation();
}).then(() => {
assert.equal(invocations.length, 1);
- assert.deepEqual(invocations[0].command, ['list', 'subCommit', 'for', 'revision', 'Sierra16E33h']);
- invocations[0].resolve(JSON.stringify(anotherSubCommitWithWebKit));
+ assert.deepEqual(invocations[0].command, ['list', 'ownedCommit', 'for', 'revision', 'Sierra16E33h']);
+ invocations[0].resolve(JSON.stringify(anotherownedCommitWithWebKit));
return MockSubprocess.resetAndWaitForInvocation();
}).then(() => {
assert.equal(invocations.length, 1);
- invocations[0].resolve(JSON.stringify(anotherSubCommitWithWebKitAndJavaScriptCore));
- assert.deepEqual(invocations[0].command, ['list', 'subCommit', 'for', 'revision', 'Sierra16E34']);
+ invocations[0].resolve(JSON.stringify(anotherownedCommitWithWebKitAndJavaScriptCore));
+ assert.deepEqual(invocations[0].command, ['list', 'ownedCommit', 'for', 'revision', 'Sierra16E34']);
return fetchAndReportPromise;
}).then((result) => {
@@ -355,9 +355,9 @@
});
});
- it('should report commits without sub-commits if "subCommitCommand" is not specified in config', () => {
+ it('should report commits without owned-commits if "ownedCommitCommand" is not specified in config', () => {
const logger = new MockLogger;
- const fetchter = new OSBuildFetcher(configWithoutSubCommitCommand, TestServer.remoteAPI(), slaveAuth, MockSubprocess, logger);
+ const fetchter = new OSBuildFetcher(configWithoutownedCommitCommand, TestServer.remoteAPI(), slaveAuth, MockSubprocess, logger);
const db = TestServer.database();
let fetchAndReportPromise = null;
let fetchAvailableBuildsPromise = null;
@@ -478,8 +478,8 @@
return MockSubprocess.resetAndWaitForInvocation();
}).then(() => {
assert.equal(invocations.length, 1);
- assert.deepEqual(invocations[0].command, ['list', 'subCommit', 'for', 'revision', 'Sierra16D69']);
- MockSubprocess.invocations[0].resolve(JSON.stringify(subCommitWithWebKit));
+ assert.deepEqual(invocations[0].command, ['list', 'ownedCommit', 'for', 'revision', 'Sierra16D69']);
+ MockSubprocess.invocations[0].resolve(JSON.stringify(ownedCommitWithWebKit));
return MockSubprocess.resetAndWaitForInvocation();
}).then(() => {
assert.equal(invocations.length, 1);
@@ -487,12 +487,12 @@
invocations[0].resolve('\n\nSierra16E32\nSierra16E33\nSierra16E33h\nSierra16E34');
return MockSubprocess.resetAndWaitForInvocation();
}).then(() => {
- assert.deepEqual(invocations[0].command, ['list', 'subCommit', 'for', 'revision', 'Sierra16E33h']);
- invocations[0].resolve(JSON.stringify(anotherSubCommitWithWebKit));
+ assert.deepEqual(invocations[0].command, ['list', 'ownedCommit', 'for', 'revision', 'Sierra16E33h']);
+ invocations[0].resolve(JSON.stringify(anotherownedCommitWithWebKit));
return MockSubprocess.resetAndWaitForInvocation();
}).then(() => {
assert.equal(invocations.length, 1);
- assert.deepEqual(invocations[0].command, ['list', 'subCommit', 'for', 'revision', 'Sierra16E34']);
+ assert.deepEqual(invocations[0].command, ['list', 'ownedCommit', 'for', 'revision', 'Sierra16E34']);
invocations[0].reject('Command failed');
return fetchAndReportPromise.then(() => {
assert(false, 'should never be reached');
Modified: trunk/Websites/perf.webkit.org/tools/js/os-build-fetcher.js (222226 => 222227)
--- trunk/Websites/perf.webkit.org/tools/js/os-build-fetcher.js 2017-09-19 21:23:18 UTC (rev 222226)
+++ trunk/Websites/perf.webkit.org/tools/js/os-build-fetcher.js 2017-09-19 21:47:41 UTC (rev 222227)
@@ -56,9 +56,9 @@
const label = 'name' in command ? `"${command['name']}"` : `"command['minRevision']" to "command['maxRevision']"`;
this._logger.log(`Found ${commits.length} builds for ${label}`);
- if ('subCommitCommand' in command) {
- this._logger.log(`Resolving subcommits for "${label}"`);
- return this._addSubCommitsForBuild(commits, command['subCommitCommand']);
+ if ('ownedCommitCommand' in command) {
+ this._logger.log(`Resolving ownedCommits for "${label}"`);
+ return this._addOwnedCommitsForBuild(commits, command['ownedCommitCommand']);
}
return commits;
@@ -91,17 +91,17 @@
});
}
- _addSubCommitsForBuild(commits, command)
+ _addOwnedCommitsForBuild(commits, command)
{
return mapInSerialPromiseChain(commits, (commit) => {
- return this._subprocess.execute(command.concat(commit['revision'])).then((subCommitOutput) => {
- const subCommits = JSON.parse(subCommitOutput);
- for (let repositoryName in subCommits) {
- const subCommit = subCommits[repositoryName];
- assert.deepEqual(Object.keys(subCommit), ['revision']);
- assert(typeof(subCommit['revision']) == 'string');
+ return this._subprocess.execute(command.concat(commit['revision'])).then((ownedCommitOutput) => {
+ const ownedCommits = JSON.parse(ownedCommitOutput);
+ for (let repositoryName in ownedCommits) {
+ const ownedCommit = ownedCommits[repositoryName];
+ assert.deepEqual(Object.keys(ownedCommit), ['revision']);
+ assert(typeof(ownedCommit['revision']) == 'string');
}
- commit['subCommits'] = subCommits;
+ commit['ownedCommits'] = ownedCommits;
return commit;
});
});
Modified: trunk/Websites/perf.webkit.org/unit-tests/commit-log-tests.js (222226 => 222227)
--- trunk/Websites/perf.webkit.org/unit-tests/commit-log-tests.js 2017-09-19 21:23:18 UTC (rev 222226)
+++ trunk/Websites/perf.webkit.org/unit-tests/commit-log-tests.js 2017-09-19 21:47:41 UTC (rev 222227)
@@ -60,12 +60,12 @@
});
}
-function commitWithoutSubCommits()
+function commitWithoutOwnedCommits()
{
return new CommitLog(6, {
repository: MockModels.ownerRepository,
revision: '10.11.4 15E66',
- ownsSubCommits: false,
+ ownsCommits: false,
time: null,
});
}
@@ -75,7 +75,7 @@
return new CommitLog(5, {
repository: MockModels.ownerRepository,
revision: '10.11.4 15E65',
- ownsSubCommits: true,
+ ownsCommits: true,
time: null,
});
}
@@ -85,7 +85,7 @@
return new CommitLog(5, {
repository: MockModels.ownerRepository,
revision: '10.11.4 15E66',
- ownsSubCommits: true,
+ ownsCommits: true,
time: null,
});
}
@@ -167,7 +167,7 @@
});
});
- describe('fetchSubCommits', () => {
+ describe('fetchOwnedCommits', () => {
beforeEach(() => {
MockRemoteAPI.inject();
});
@@ -174,7 +174,7 @@
it('should reject if repository of the commit does not own other repositories', () => {
const commit = osxCommit();
- return commit.fetchSubCommits().then(() => {
+ return commit.fetchOwnedCommits().then(() => {
assert(false, 'Should not execute this line.');
}, (error) => {
assert.equal(error, undefined);
@@ -181,9 +181,9 @@
});
});
- it('should reject if commit does not own other sub-commits', () => {
- const commit = commitWithoutSubCommits();
- return commit.fetchSubCommits().then(() => {
+ it('should reject if commit does not own other owned-commits', () => {
+ const commit = commitWithoutOwnedCommits();
+ return commit.fetchOwnedCommits().then(() => {
assert(false, 'Should not execute this line.');
}, (error) => {
assert.equal(error, undefined);
@@ -190,11 +190,11 @@
});
});
- it('should return sub-commit for a valid commit revision', () => {
- const fetchingPromise = ownerCommit().fetchSubCommits();
+ it('should return owned-commit for a valid commit revision', () => {
+ const fetchingPromise = ownerCommit().fetchOwnedCommits();
const requests = MockRemoteAPI.requests;
assert.equal(requests.length, 1);
- assert.equal(requests[0].url, '../api/commits/111/sub-commits?owner-revision=10.11.4%2015E65');
+ assert.equal(requests[0].url, '../api/commits/111/owned-commits?owner-revision=10.11.4%2015E65');
assert.equal(requests[0].method, 'GET');
requests[0].resolve({commits: [{
@@ -203,21 +203,21 @@
revision: '6f8b0dbbda95a440503b88db1dd03dad3a7b07fb',
time: +(new Date('2016-05-13T00:55:57.841344Z')),
}]});
- return fetchingPromise.then((subCommits) => {
- assert.equal(subCommits.length, 1);
- assert.equal(subCommits[0].repository(), MockModels.ownedRepository);
- assert.equal(subCommits[0].revision(), '6f8b0dbbda95a440503b88db1dd03dad3a7b07fb');
- assert.equal(subCommits[0].id(), 233);
+ return fetchingPromise.then((ownedCommits) => {
+ assert.equal(ownedCommits.length, 1);
+ assert.equal(ownedCommits[0].repository(), MockModels.ownedRepository);
+ assert.equal(ownedCommits[0].revision(), '6f8b0dbbda95a440503b88db1dd03dad3a7b07fb');
+ assert.equal(ownedCommits[0].id(), 233);
});
});
- it('should only fetch sub-commits exactly once', () => {
+ it('should only fetch owned-commits exactly once', () => {
const commit = ownerCommit();
- const fetchingPromise = commit.fetchSubCommits();
+ const fetchingPromise = commit.fetchOwnedCommits();
const requests = MockRemoteAPI.requests;
- let existingSubCommits = null;
+ let existingOwnedCommits = null;
assert.equal(requests.length, 1);
- assert.equal(requests[0].url, '../api/commits/111/sub-commits?owner-revision=10.11.4%2015E65');
+ assert.equal(requests[0].url, '../api/commits/111/owned-commits?owner-revision=10.11.4%2015E65');
assert.equal(requests[0].method, 'GET');
MockRemoteAPI.requests[0].resolve({commits: [{
@@ -227,32 +227,32 @@
time: +(new Date('2016-05-13T00:55:57.841344Z')),
}]});
- return fetchingPromise.then((subCommits) => {
- existingSubCommits = subCommits;
- assert.equal(subCommits.length, 1);
- assert.equal(subCommits[0].repository(), MockModels.ownedRepository);
- assert.equal(subCommits[0].revision(), '6f8b0dbbda95a440503b88db1dd03dad3a7b07fb');
- assert.equal(subCommits[0].id(), 233);
- return commit.fetchSubCommits();
- }).then((subCommits) => {
+ return fetchingPromise.then((ownedCommits) => {
+ existingOwnedCommits = ownedCommits;
+ assert.equal(ownedCommits.length, 1);
+ assert.equal(ownedCommits[0].repository(), MockModels.ownedRepository);
+ assert.equal(ownedCommits[0].revision(), '6f8b0dbbda95a440503b88db1dd03dad3a7b07fb');
+ assert.equal(ownedCommits[0].id(), 233);
+ return commit.fetchOwnedCommits();
+ }).then((ownedCommits) => {
assert.equal(requests.length, 1);
- assert.equal(existingSubCommits, subCommits);
+ assert.equal(existingOwnedCommits, ownedCommits);
});
});
});
- describe('diffSubCommits', () => {
+ describe('diffOwnedCommits', () => {
beforeEach(() => {
MockRemoteAPI.reset();
});
- it('should return difference between 2 sub-commits', () => {
+ it('should return difference between 2 owned-commits', () => {
const _oneCommit_ = ownerCommit();
const otherCommit = otherOwnerCommit();
- const fetchingPromise = oneCommit.fetchSubCommits();
+ const fetchingPromise = oneCommit.fetchOwnedCommits();
const requests = MockRemoteAPI.requests;
assert.equal(requests.length, 1);
- assert.equal(requests[0].url, '../api/commits/111/sub-commits?owner-revision=10.11.4%2015E65');
+ assert.equal(requests[0].url, '../api/commits/111/owned-commits?owner-revision=10.11.4%2015E65');
assert.equal(requests[0].method, 'GET');
requests[0].resolve({commits: [{
@@ -268,9 +268,9 @@
}]});
return fetchingPromise.then(() => {
- const otherFetchingPromise = otherCommit.fetchSubCommits();
+ const otherFetchingPromise = otherCommit.fetchOwnedCommits();
assert.equal(requests.length, 2);
- assert.equal(requests[1].url, '../api/commits/111/sub-commits?owner-revision=10.11.4%2015E66');
+ assert.equal(requests[1].url, '../api/commits/111/owned-commits?owner-revision=10.11.4%2015E66');
assert.equal(requests[1].method, 'GET');
requests[1].resolve({commits: [{
@@ -287,7 +287,7 @@
return otherFetchingPromise;
}).then(() => {
- const difference = CommitLog.diffSubCommits(oneCommit, otherCommit);
+ const difference = CommitLog.diffOwnedCommits(oneCommit, otherCommit);
assert.equal(difference.size, 1);
assert.equal(difference.keys().next().value, MockModels.ownedRepository);
});