[webkit-reviews] review denied: [Bug 189822] Updating file on perf dashboard should be transactional between Apache and php : [Attachment 350341] Patch
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Fri Sep 21 22:47:51 PDT 2018
Ryosuke Niwa <rniwa at webkit.org> has denied dewei_zhu at apple.com's request for
review:
Bug 189822: Updating file on perf dashboard should be transactional between
Apache and php
https://bugs.webkit.org/show_bug.cgi?id=189822
Attachment 350341: Patch
https://bugs.webkit.org/attachment.cgi?id=350341&action=review
--- Comment #2 from Ryosuke Niwa <rniwa at webkit.org> ---
Comment on attachment 350341
--> https://bugs.webkit.org/attachment.cgi?id=350341
Patch
View in context: https://bugs.webkit.org/attachment.cgi?id=350341&action=review
r-. There are enough problems in this patch that I'd like to see another
iteration.
> Websites/perf.webkit.org/ChangeLog:3
> + Updating file on perf-safari should be transactional between php and
apache.
We shouldn't mention perf-safari. I've updated the bug title. Please update the
change log as well.
> Websites/perf.webkit.org/public/api/measurement-set.php:41
> + $json = NULL;
Please declare these variables inside the loop.
Also, there is no point in declaring $json.
> Websites/perf.webkit.org/public/api/measurement-set.php:55
> + $content['elapsedTime'] = $elapsed_time;
> + $json = json_encode($content);
> + generate_json_data_conditionally($cache_filename, $json,
'elapsedTime');
I don't think we want to rely on elapsedTime being the last item like this.
Pass in $elapsed_time as the last argument to generate_json_data_conditionally
instead:
generate_json_data_conditionally($cache_filename, $content, $elapsed_time);
It's better to invoke json_encode in generate_json_data_conditionally instead.
Also, we should probably call this generate_json_data_if_needed to match the
naming convention used elsewhere in WebKit.
> Websites/perf.webkit.org/public/include/db.php:65
> + $target_file_path = config_path('dataDirectory', $filename);
> + $temp_file_path = tempnam(config_path('dataDirectory', ''), $filename .
'-temp-');
Why do we need to make a temporary file before comparing the content?
> Websites/perf.webkit.org/public/include/json-header.php:17
> +function set_success(&$details = array()) {
This should be set_successful instead.
More information about the webkit-reviews
mailing list