Analysis task should look for a git commit based on abridged hashes
authorrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 19 May 2016 02:39:54 +0000 (02:39 +0000)
committerrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 19 May 2016 02:39:54 +0000 (02:39 +0000)
commitbb17ee5f67b70e24b3ca61b0947b0868e04734bf
treef6b35d9465e99a4b95ea13d0d8d9734f5784a047
parent4d7775762b518a4377acf5054b6856a61ed7f9ce
Analysis task should look for a git commit based on abridged hashes
https://bugs.webkit.org/show_bug.cgi?id=157877
<rdar://problem/26254374>

Reviewed by Chris Dumez.

Made /privileged-api/associate-commit look for commits using LIKE instead of an exact match.
Associate the commit when there is exactly one match.

* public/include/commit-log-fetcher.php:
(CommitLogFetcher::fetch_between):
* public/include/db.php:
(Database::escape_for_like): Extracted from CommitLogFetcher::fetch_between.
* public/privileged-api/associate-commit.php:
(main): Look for the commits using LIKE. Reject whenever there are multiple commits. We limit the number of
matches to two for performance when the user specifies something that almost thousands of commits: e.g. "1".
* public/v3/pages/analysis-task-page.js:
(AnalysisTaskPage.prototype._associateCommit): Added human friendly error messages for mismatching commits.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@201123 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Websites/perf.webkit.org/ChangeLog
Websites/perf.webkit.org/public/include/commit-log-fetcher.php
Websites/perf.webkit.org/public/include/db.php
Websites/perf.webkit.org/public/privileged-api/associate-commit.php
Websites/perf.webkit.org/public/v3/pages/analysis-task-page.js