<html>
<head>
<base href="https://bugs.webkit.org/" />
</head>
<body><span class="vcard"><a class="email" href="mailto:rniwa@webkit.org" title="Ryosuke Niwa <rniwa@webkit.org>"> <span class="fn">Ryosuke Niwa</span></a>
</span> changed
<a class="bz_bug_link
bz_status_NEW "
title="NEW - Commit should order by 'commit_order' as secondary key."
href="https://bugs.webkit.org/show_bug.cgi?id=168866">bug 168866</a>
<br>
<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>What</th>
<th>Removed</th>
<th>Added</th>
</tr>
<tr>
<td style="text-align:right;">Attachment #302736 Flags</td>
<td>review?
</td>
<td>review+
</td>
</tr></table>
<p>
<div>
<b><a class="bz_bug_link
bz_status_NEW "
title="NEW - Commit should order by 'commit_order' as secondary key."
href="https://bugs.webkit.org/show_bug.cgi?id=168866#c2">Comment # 2</a>
on <a class="bz_bug_link
bz_status_NEW "
title="NEW - Commit should order by 'commit_order' as secondary key."
href="https://bugs.webkit.org/show_bug.cgi?id=168866">bug 168866</a>
from <span class="vcard"><a class="email" href="mailto:rniwa@webkit.org" title="Ryosuke Niwa <rniwa@webkit.org>"> <span class="fn">Ryosuke Niwa</span></a>
</span></b>
<pre>Comment on <span class=""><a href="attachment.cgi?id=302736&action=diff" name="attach_302736" title="Patch">attachment 302736</a> <a href="attachment.cgi?id=302736&action=edit" title="Patch">[details]</a></span>
Patch
View in context: <a href="https://bugs.webkit.org/attachment.cgi?id=302736&action=review">https://bugs.webkit.org/attachment.cgi?id=302736&action=review</a>
<span class="quote">> Websites/perf.webkit.org/public/include/commit-log-fetcher.php:87
> - return $this->format_single_commit($this->db->select_first_row('commits', 'commit', array('repository' => $repository_id), 'time'));
> + return $this->format_single_commit($this->db->select_first_row('commits', 'commit', array('repository' => $repository_id), ['time', 'order']));</span >
[] syntax doesn't work on an older versions of PHP.
So please use array() instead.
<span class="quote">> Websites/perf.webkit.org/public/include/db.php:217
> + if (!is_array($order_by)) {
> + $order_by = array($order_by);
> + }</span >
Nit: No curtly braces around a single line statement.
<span class="quote">> Websites/perf.webkit.org/public/include/db.php:223
> + $order_column = $this->prefixed_name($order_key, $prefix);
> + if ($descending_order)
> + $order_column .= ' DESC';</span >
Might be cleaner to always specify ASC/DES using tertiary expression as in:
$order_column = $this->prefixed_name($order_key, $prefix) . ' ' . ($descending_order ? 'DESC' : 'ASC');
<span class="quote">> Websites/perf.webkit.org/server-tests/api-commits.js:137
> + it("should return the list of ordered commits for a given repository", () => {</span >
Please also add tests for latest, & oldest, and last-reported.
<span class="quote">> Websites/perf.webkit.org/server-tests/api-commits.js:146
> + assert.equal(commits.length, 6);</span >
You can just check against submittedCommits.length here.
<span class="quote">> Websites/perf.webkit.org/server-tests/api-commits.js:147
> + var submittedCommits = systemVersionCommits['commits'];</span >
Use const instead of var.</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are the assignee for the bug.</li>
</ul>
</body>
</html>