Closed Bug 1079304 Opened 10 years ago Closed 10 years ago

Remove filesize from Firefox & Fennec json files

Categories

(www.mozilla.org :: Product Details, defect)

Production
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED WONTFIX

People

(Reporter: Sylvestre, Assigned: Sylvestre)

References

Details

Attachments

(2 files, 7 obsolete files)

Remove the filesize. As seen in bug 1070004, the declaration is no longer used.
Attached patch remove-filesize.diff (obsolete) — Splinter Review
Attachment #8501105 - Flags: review?(lmandel)
Attached patch json-without-filesize.diff (obsolete) — Splinter Review
FYI, the diff without the filesize.

2K => 221
116K => 11K
Assignee: nobody → sledru
Comment on attachment 8501105 [details] [diff] [review]
remove-filesize.diff

Looks good to me. Let's see if this breaks anything downstream.
Attachment #8501105 - Flags: review?(lmandel) → review+
Merged. 
export_json:
http://viewvc.svn.mozilla.org/vc?view=revision&revision=132677

json files regenerated:
http://viewvc.svn.mozilla.org/vc?view=revision&revision=132678
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Broke a bit of everything downstream :( We're reverting r132678. Removing "filesize" is fine, completely changing the data-structure not so much.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
I reverted the regeneration of json files per the webdev team request as this patch breaks www.mozilla.org and prevents pushes to production today. (svn merge -c -132678 .)
also reverted code change in r132689 to make sure the export script causing the failure is not ran by mistake until we have a final fix.
Sorry, my bad. I was too aggressive in my change. Sorry :/
Attached patch remove_filesize_2.diff (obsolete) — Splinter Review
Is that OK with you? New JSON is the next attachment.
Attachment #8501105 - Attachment is obsolete: true
Attachment #8501584 - Flags: review?(pmac)
Attachment #8501584 - Flags: review?(lmandel)
Attached patch remove_filesize_example_2.diff (obsolete) — Splinter Review
Attachment #8501107 - Attachment is obsolete: true
Comment on attachment 8501586 [details] [diff] [review]
remove_filesize_example_2.diff

Review of attachment 8501586 [details] [diff] [review]:
-----------------------------------------------------------------

This still changes the data type of the builds. I don't disagree with even your first attempt at a new structure, but it's very hard to say how people are using the data. Our python library just loads the JSON, which the app is then able to query however they like, and if they're expecting a dict and find a list (which is what broke) then it can throw unexpected errors. The safest thing would be to just have an empty object. e.g.:

{
    "ku": {
        "33.0b8": {
            "Windows": {},
            "OS X": {},
            "Linux": {}
        },
        "34.0a2": {
            "Windows": {},
            "OS X": {},
            "Linux": {}
        }
    },
    ...
}
Attachment #8501586 - Flags: review-
Attached patch remove_filesize_example_3.diff (obsolete) — Splinter Review
better ?
Attachment #8501586 - Attachment is obsolete: true
Attachment #8501741 - Flags: review?(pmac)
Attached patch remove-filesize_3.diff (obsolete) — Splinter Review
Attachment #8501584 - Attachment is obsolete: true
Attachment #8501584 - Flags: review?(pmac)
Attachment #8501584 - Flags: review?(lmandel)
Comment on attachment 8501741 [details] [diff] [review]
remove_filesize_example_3.diff

Review of attachment 8501741 [details] [diff] [review]:
-----------------------------------------------------------------

Hmm... Better, yes. I'm not sure that's enough though. There could easily be sites expecting an object instead of a string as the value of these OS entries. What do you think :jgmize?
Flags: needinfo?(jmize)
(In reply to Paul McLanahan [:pmac] from comment #14)
> Hmm... Better, yes. I'm not sure that's enough though. There could easily be
> sites expecting an object instead of a string as the value of these OS
> entries. What do you think :jgmize?

Yes, I agree with the conservative approach of not changing the data structure other than removing the unused field. If more radical changes are needed/desired, it would probably be best to introduce some sort of version scheme, for example by adding a "v2" directory with new files with arbitrary changes to the data structures that don't need to maintain backwards compatibility, but still preserving the current data structures in the existing files.
Flags: needinfo?(jmize)
I understand your points but the goal of the work we are doing on product details is to remove as much legacy as possible.

For example, the list
            "Windows": "",
            "OS X": "",
            "Linux": ""
is probably useless. AFAIK, for every locales and versions, we ship on the 3 OS.

I would like to get ride of that too. So, if you think that a v2 is the only way to achieve that, why not!
Attached patch side-effect.diff (obsolete) — Splinter Review
FYI, in order to have 
"Windows": {},
instead of:
"Windows": "",

The patch is:
Index: export_json.php
===================================================================
--- export_json.php	(révision 132736)
+++ export_json.php	(copie de travail)
@@ -21,7 +21,7 @@
  */
 function writefile($filename, $data)
 {
-    file_put_contents(JSONDIR.$filename, json_encode($data, JSON_PRETTY_PRINT));
+    file_put_contents(JSONDIR.$filename, json_encode($data, JSON_PRETTY_PRINT | JSON_FORCE_OBJECT));
 }
 
 /** Locale Details */


but it has side effects. It is changing json/mobile_details.json in a way which could affect others.
Blocks: 1080532
Comment on attachment 8502403 [details] [diff] [review]
side-effect.diff

Review of attachment 8502403 [details] [diff] [review]:
-----------------------------------------------------------------

I don't see the point of changing the data structure away from an array here.
I see you say that the above is a side effect, hmm..... Perhaps it would be best to just leave this alone and go with a v2 for now, with the understanding that we'll be working to get a better system in place with releng (the ship-it based thing)?
Comment on attachment 8501741 [details] [diff] [review]
remove_filesize_example_3.diff

Review of attachment 8501741 [details] [diff] [review]:
-----------------------------------------------------------------

Still balking at this change. Still agreed that filesize is superfluous, but I do think the data-structures in these files need to remain constant for now.
Attachment #8501741 - Flags: review?(pmac) → review-
Attached patch export_v2.diffSplinter Review
With a new schema (but keep the previous one)
Attachment #8501742 - Attachment is obsolete: true
The example of a v2 schema
Attachment #8501741 - Attachment is obsolete: true
Attachment #8502403 - Attachment is obsolete: true
Here it is Paul.

By the way, do you use json/firefox_beta_builds.json?
Flags: needinfo?(pmac)
Yes we do. Our /{product_name}/all/ pages list "beta" locales, which come from that file.
Flags: needinfo?(pmac)
Attachment #8508535 - Flags: review?(pmac)
Touching product details is too risky. We will work on bug 1083718 instead.
Status: REOPENED → RESOLVED
Closed: 10 years ago10 years ago
Resolution: --- → WONTFIX
Comment on attachment 8508535 [details] [diff] [review]
export_v2.diff

Review of attachment 8508535 [details] [diff] [review]:
-----------------------------------------------------------------

::: export_json.php
@@ +95,5 @@
>      writefile("firefox_{$build}.json", $buildArray);
> +
> +    // New schema (to remove the filesize)
> +    $buildArray = fillFileSize($fxd->$build, true);
> +    writefile("firefox_{$build}_v2.json", $buildArray);

Probably better if it output to a separate directory called "v2" to keep it cleanly separate.
Attachment #8508535 - Flags: review?(pmac) → review-
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: