Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(1)

Issue 7937044: Fix json unmarshalling of large int ids (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
12 years, 3 months ago by wallyworld
Modified:
12 years, 3 months ago
Reviewers:
dimitern, mp+154588, jameinel
Visibility:
Public.

Description

Fix json unmarshalling of large int ids Large integer ids used in Entity, FlavorDetail, ServerDetail etc were being unmarsalled as strings in scientific format instead of unformatted numerics. This is fixed, and some tests are added. https://code.launchpad.net/~wallyworld/goose/fix-large-ids/+merge/154588 (do not edit description out of merge proposal)

Patch Set 1 #

Total comments: 3
Unified diffs Side-by-side diffs Delta from patch set Stats (+83 lines, -5 lines) Patch
A [revision details] View 1 chunk +2 lines, -0 lines 0 comments Download
M nova/json.go View 6 chunks +26 lines, -5 lines 0 comments Download
A nova/json_test.go View 1 chunk +55 lines, -0 lines 3 comments Download

Messages

Total messages: 4
wallyworld
Please take a look.
12 years, 3 months ago (2013-03-21 04:58:06 UTC) #1
jameinel
LGTM
12 years, 3 months ago (2013-03-21 08:52:09 UTC) #2
dimitern
LGTM, although I'm not sure what's the reasoning behind the chosen numbers (2000000 etc.). https://codereview.appspot.com/7937044/diff/1/nova/json_test.go ...
12 years, 3 months ago (2013-03-21 08:56:55 UTC) #3
wallyworld
12 years, 3 months ago (2013-03-21 11:40:41 UTC) #4
The rational behind the numbers is that they must be > 1000000. For ids >
1000000, before the business logic changes, the tests would fail.

https://codereview.appspot.com/7937044/diff/1/nova/json_test.go
File nova/json_test.go (right):

https://codereview.appspot.com/7937044/diff/1/nova/json_test.go#newcode21
nova/json_test.go:21: panic(err)
On 2013/03/21 08:56:55, dimitern wrote:
> why a panic instead of c.Fatalf or smth?

Because in a controlled environment like this test, we *know* the Marshall will
work. The panic is a failsafe. This pattern has been used elsewhere I think.
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b