Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(749)

Issue 1516173002: Fix error message from KeyForObj when passing an invalid struct. (Closed)

Created:
5 years ago by iannucci
Modified:
5 years ago
Reviewers:
dnj, Vadim Sh., martiniss, hinoka
CC:
chromium-reviews, infra-reviews+luci-gae_chromium.org
Base URL:
https://github.com/luci/gae.git@master
Target Ref:
refs/heads/master
Project:
luci-gae
Visibility:
Public.

Description

Clean up PropertyLoadSaver interface. This removes GetMetaDefault and Problem from the interfaces, and makes GetPLS errors into panics, on the assumption that if you pass it a bad datatype, you can't really do anything about it without recompiling, and failing fast is better. This also fixes a bug where doing any operations on an invalid (non datastore- compatible) struct would return the unhelpful "unable to extract $kind" error. R=dnj@chromium.org, hinoka@chromium.org, martiniss@chromium.org, vadimsh@chromium.org BUG= Committed: https://github.com/luci/gae/commit/043deeee59a8e1203b3350fb9d315b3d0d7db076

Patch Set 1 #

Patch Set 2 : Fix GetMetaDefault silliness #

Total comments: 3

Patch Set 3 : get rid of Problem #

Patch Set 4 : fix it more #

Patch Set 5 : more simplification #

Total comments: 5

Patch Set 6 : whitespace #

Patch Set 7 : panic harder, better, faster, stronger #

Patch Set 8 : remove accidental extra test #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+308 lines, -407 lines) Patch
M filter/dscache/ds.go View 1 2 3 4 1 chunk +2 lines, -1 line 0 comments Download
M filter/dscache/support.go View 1 2 3 4 1 chunk +2 lines, -1 line 0 comments Download
M filter/txnBuf/txnbuf_test.go View 1 2 3 4 5 5 chunks +10 lines, -5 lines 0 comments Download
M impl/memory/datastore_test.go View 1 2 3 4 2 chunks +3 lines, -3 lines 0 comments Download
M service/datastore/datastore.go View 1 2 3 4 5 6 4 chunks +3 lines, -9 lines 0 comments Download
M service/datastore/datastore_test.go View 1 2 3 4 5 6 7 20 chunks +84 lines, -80 lines 0 comments Download
M service/datastore/errors.go View 1 2 3 4 1 chunk +0 lines, -6 lines 0 comments Download
M service/datastore/multiarg.go View 1 2 3 4 5 6 8 chunks +20 lines, -42 lines 0 comments Download
M service/datastore/pls.go View 1 2 3 4 5 6 4 chunks +18 lines, -13 lines 1 comment Download
M service/datastore/pls_impl.go View 1 2 3 4 5 6 7 chunks +11 lines, -34 lines 0 comments Download
M service/datastore/pls_test.go View 1 2 3 4 7 17 chunks +95 lines, -128 lines 0 comments Download
M service/datastore/properties.go View 1 2 3 4 7 chunks +25 lines, -45 lines 0 comments Download
M service/datastore/properties_test.go View 1 2 3 4 1 chunk +19 lines, -17 lines 0 comments Download
M service/datastore/raw_interface.go View 1 2 3 4 2 chunks +2 lines, -10 lines 0 comments Download
M service/datastore/raw_interface_test.go View 1 2 3 4 1 chunk +14 lines, -13 lines 0 comments Download

Messages

Total messages: 13 (4 generated)
iannucci
OK, PTAL. This was supposed to just be a fix for the stupid error message, ...
5 years ago (2015-12-11 05:45:45 UTC) #1
dnj
https://chromiumcodereview.appspot.com/1516173002/diff/20001/service/datastore/pls.go File service/datastore/pls.go (right): https://chromiumcodereview.appspot.com/1516173002/diff/20001/service/datastore/pls.go#newcode161 service/datastore/pls.go:161: Problem() error Since Problem() is only used by tests, ...
5 years ago (2015-12-11 06:36:17 UTC) #2
iannucci
OK, PTAL pls. This fixes all of the problems.
5 years ago (2015-12-12 00:20:12 UTC) #3
dnj
https://chromiumcodereview.appspot.com/1516173002/diff/80001/service/datastore/pls.go File service/datastore/pls.go (right): https://chromiumcodereview.appspot.com/1516173002/diff/80001/service/datastore/pls.go#newcode21 service/datastore/pls.go:21: // property types), this function will panic Other problems ...
5 years ago (2015-12-12 02:47:50 UTC) #6
iannucci
PTALP https://chromiumcodereview.appspot.com/1516173002/diff/20001/filter/dscache/ds.go File filter/dscache/ds.go (right): https://chromiumcodereview.appspot.com/1516173002/diff/20001/filter/dscache/ds.go#newcode93 filter/dscache/ds.go:93: // TODO(riannucci): Not sure what to do with ...
5 years ago (2015-12-12 03:52:22 UTC) #7
dnj
Nice! LGTM (w/ comment) https://chromiumcodereview.appspot.com/1516173002/diff/140001/service/datastore/pls.go File service/datastore/pls.go (right): https://chromiumcodereview.appspot.com/1516173002/diff/140001/service/datastore/pls.go#newcode193 service/datastore/pls.go:193: if c.problem != nil { ...
5 years ago (2015-12-12 04:04:53 UTC) #8
iannucci
as i mentioned elsewhere, it makes detecting recursion really easy and I already spent too ...
5 years ago (2015-12-12 04:34:00 UTC) #9
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1516173002/140001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1516173002/140001
5 years ago (2015-12-12 17:15:14 UTC) #11
commit-bot: I haz the power
5 years ago (2015-12-12 17:23:06 UTC) #13
Message was sent while issue was closed.
Committed patchset #8 (id:140001) as
https://github.com/luci/gae/commit/043deeee59a8e1203b3350fb9d315b3d0d7db076

Powered by Google App Engine
This is Rietveld 408576698