Should reject updating a build request which has an associated build.
authordewei_zhu@apple.com <dewei_zhu@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 22 Jan 2018 07:38:16 +0000 (07:38 +0000)
committerdewei_zhu@apple.com <dewei_zhu@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 22 Jan 2018 07:38:16 +0000 (07:38 +0000)
commita971643d2e1510b4ad72076cf1fc2dbe61cea3d9
tree855d07498d8aa6b0a7dd023388318ab74083fa77
parent81b8dfbd0a5838c5263b310dfda441cc1889ae61
Should reject updating a build request which has an associated build.
https://bugs.webkit.org/show_bug.cgi?id=181893

Reviewed by Ryosuke Niwa.

Current code does not prevent submitting to same build request multiple times.
This could lead to a build losing its associated build request.
As a result, this build will be visible in charts which is not right.
Added a check when a build request is reported.
Addressed a 'FIXME' for the race condition inside ReportProcessor->resolve_build_id by surrounding
it with a database transaction.

* public/include/report-processor.php:
Wrap adding platform and resolve_build_id with a database transaction.
Add a check to make sure only a build request has no associated build can be updated.
* server-tests/api-report-tests.js: Added unit tests accordingly.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@227283 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Websites/perf.webkit.org/ChangeLog
Websites/perf.webkit.org/public/include/report-processor.php
Websites/perf.webkit.org/server-tests/api-report-tests.js