New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 644411 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Last visit > 30 days ago
Closed: May 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug

Blocking:
issue 644372



Sign in to add a comment

[Findit] Centralize the JSON conversion stuff

Project Member Reported by wrengr@chromium.org, Sep 6 2016

Issue description

Throughout the code many places pass around anonymous dicts rather than using objects; but we should prefer objects because they make the code more self-documenting, can help to catch type errors earlier, and because the help insulate the JSON layer from our choice of internal representations. One key example is:

Where: infra/appengine/findit/crash/findit_for_fracas.py

Towards the end of FindCulpritForChromeCrash we convert everything from objects to dicts, but this is premature. This function should leave things as objects; it's the caller/client's responsibility to perform that conversion if they want it. All our different classes should have methods for conversion to JSON, and the client will call them once they actually need it. (That way we can also encapsulate the __bool__ conversion stuff in the return statement as part of that object's JSON serialization method; rather than repeating it anywhere or needing the client to know anything about the innards of the object.)
 
Summary: [Findit] Centralize the JSON conversion stuff (was: Centralize the JSON conversion stuff)

Comment 4 by st...@chromium.org, Apr 24 2017

Cc: wrengr@chromium.org
Components: -Tools>Test>FindIt Tools>Test>Predator
Owner: kateso...@chromium.org
Status: Fixed (was: Assigned)

Sign in to add a comment