Closed
Bug 1068049
Opened 10 years ago
Closed 10 years ago
Pretty print the json exported file by the product details
Categories
(www.mozilla.org :: Product Details, defect)
www.mozilla.org
Product Details
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: Sylvestre, Assigned: Sylvestre)
References
Details
Attachments
(2 files)
(deleted),
patch
|
lmandel
:
review+
|
Details | Diff | Splinter Review |
(deleted),
patch
|
Details | Diff | Splinter Review |
Currently, the json files are stored on a single line.
This has two side effects:
* hard/impossible to see the changes in a single diff
* big diff for each svn commit
The attached patch proposed to use the pretty print option of the PHP json exporter.
Attachment #8490099 -
Flags: review?(lsblakk)
Attachment #8490099 -
Flags: review?(lmandel)
Assignee | ||
Comment 1•10 years ago
|
||
Example of the regenerated json files
Comment 2•10 years ago
|
||
An advantage of the current structure is less white space and therefore smaller file size. I take it this file is used at runtime where these things matter but am happy to be corrected if that's not the case.
Assignee | ||
Comment 3•10 years ago
|
||
I am not sure how whitespaces impact the overall performance but I hope it is negligible.
With the current data, 1084k without spaces, 1268k with spaces.
n-i our www friends :)
Flags: needinfo?(pmac)
Flags: needinfo?(jmize)
Comment 4•10 years ago
|
||
I guess it doesn't matter... though I'm not sure the point of this. Why do you need to see the JSON diffs? The canonical data and changes are still in the PHP right? This is just a side effect that I'd hope can be assumed to be correct.
However, at least the way we typically use the JSON, it shouldn't matter. We load it on the server side into memory and use the data, so we never send this JSON to the client. I suspect anyone who wanted to use this client side could at least have it served gzipped, and that would make the extra space moot.
Flags: needinfo?(pmac)
Assignee | ||
Comment 5•10 years ago
|
||
I am doing changes on product details. Having a pretty print version of the json helps to keep track of potential issues. The data/order remain the same.
Comment 6•10 years ago
|
||
Agreed with :pmac, the performance impact is negligible, so if it helps troubleshooting then it sounds like a good change to me.
Flags: needinfo?(jmize)
Assignee | ||
Updated•10 years ago
|
Assignee: nobody → sledru
Comment 7•10 years ago
|
||
Comment on attachment 8490099 [details] [diff] [review]
pretty-print-json-export.diff
r+ given that this won't impact runtime perf.
Attachment #8490099 -
Flags: review?(lmandel) → review+
Assignee | ||
Comment 8•10 years ago
|
||
Comment on attachment 8490099 [details] [diff] [review]
pretty-print-json-export.diff
Committed here:
http://viewvc.svn.mozilla.org/vc/libs/product-details/export_json.php?r1=130443&r2=131941
Regenerated all json files here:
http://viewvc.svn.mozilla.org/vc?view=revision&revision=131942
Attachment #8490099 -
Flags: review?(lsblakk) → checked-in+
Assignee | ||
Updated•10 years ago
|
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Assignee | ||
Updated•10 years ago
|
Component: Release Automation → Product Details
Flags: checked-in+
Product: Release Engineering → www.mozilla.org
QA Contact: bhearsum
You need to log in
before you can comment on or make changes to this bug.
Description
•