commit api should not return 'AmbiguousRevisionPrefix' if there is an exact revision match
Created attachment 372941 [details] Patch
<rdar://52140788>
Comment on attachment 372941 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=372941&action=review > Websites/perf.webkit.org/public/include/commit-log-fetcher.php:209 > + if ($rows[0]['commit_revision'] == $revision_prefix) > + return $rows[0]; There is no guarantee that the first one would be an exact match. It appears to me that we'd have to issue two queries one for the exact match or another one for like. Alternatively, you can generate a boolean based on exact equality of the revision and sort the results so that the exact match appear first. As is there is no guarantee this would work.
Comment on attachment 372941 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=372941&action=review >> Websites/perf.webkit.org/public/include/commit-log-fetcher.php:209 >> + return $rows[0]; > > There is no guarantee that the first one would be an exact match. > It appears to me that we'd have to issue two queries one for the exact match or another one for like. > Alternatively, you can generate a boolean based on exact equality of the revision > and sort the results so that the exact match appear first. > As is there is no guarantee this would work. Ordering by commit_revision should grantee the exact match always be the first one. Per https://www.postgresql.org/docs/9.5/queries-order.html#AEN4629. The only case that I can think of is same revision but different lower vs upper cases.
Comment on attachment 372941 [details] Patch Ah, I missed that we were only checking prefixes.