Bug 181893 - Should reject updating a build request which has an associated build.
Summary: Should reject updating a build request which has an associated build.
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-01-19 17:33 PST by dewei_zhu
Modified: 2018-01-21 19:36 PST (History)
2 users (show)

See Also:


Attachments
Patch (5.91 KB, patch)
2018-01-19 22:53 PST, dewei_zhu
no flags Details | Formatted Diff | Diff
Patch (11.88 KB, patch)
2018-01-20 00:01 PST, dewei_zhu
rniwa: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description dewei_zhu 2018-01-19 17:33:59 PST
Should reject updating a 'completed' build request.
Comment 1 dewei_zhu 2018-01-19 22:53:38 PST
Created attachment 331833 [details]
Patch
Comment 2 Ryosuke Niwa 2018-01-19 22:56:41 PST
Comment on attachment 331833 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=331833&action=review

> Websites/perf.webkit.org/public/include/report-processor.php:146
> -            if ($this->db->update_row('build_requests', 'request', array('id' => $build_request_id), array('status' => 'completed', 'build' => $build_id))
> +            if ($this->db->update_row('build_requests', 'request', array('id' => $build_request_id, 'build' => null), array('status' => 'completed', 'build' => $build_id))

We need to this check before build row is created.

> Websites/perf.webkit.org/server-tests/api-report-tests.js:784
> +            assert.equal(response['status'], 'OK');
> +            return TestServer.remoteAPI().postJSON('/api/report/', [anotherReportWithSameBuildRequest]);

As I mentioned, we should check that this didn't create a new build entry.
Comment 3 Ryosuke Niwa 2018-01-19 23:18:38 PST
Comment on attachment 331833 [details]
Patch

r- because we shouldn't be creating zombie build entires in the database.
Comment 4 dewei_zhu 2018-01-20 00:01:59 PST
Created attachment 331836 [details]
Patch