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

Issue 1427933002: Decouple PLS from MGS. (Closed)

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

Description

Decouple PLS from MGS. Decouple PropertyLoadSaver from MetaGetterSetter. This allows implementing structs to override either one of those interfaces without depending on spooky the interaction between them implemented by "structPLS". "structPLS" no longer magic-detects if its type implements MetaGetterSetter and defers to it. Instead, a struct that implements MetaGetterSetter and wants to use "structPLS" cool meta defaults can call GetPLS(this) to get a handle on that base functionality. BUG= Committed: https://github.com/luci/gae/commit/3932cd48f52a6fd2051c48c183cd3c0a17ae4913

Patch Set 1 #

Total comments: 5

Patch Set 2 : Add regression test for bug. #

Patch Set 3 : Add test for basic struct extraction. #

Total comments: 2

Patch Set 4 : Add test for MGS that fails to export $kind. #

Total comments: 1

Patch Set 5 : Update dox w/ example. #

Total comments: 1

Patch Set 6 : Cleaner code for test. #

Total comments: 2

Patch Set 7 : Derp #

Unified diffs Side-by-side diffs Delta from patch set Stats (+219 lines, -107 lines) Patch
M service/datastore/datastore_test.go View 1 2 3 2 chunks +27 lines, -0 lines 0 comments Download
M service/datastore/interface.go View 1 2 3 4 2 chunks +8 lines, -2 lines 0 comments Download
M service/datastore/multiarg.go View 9 chunks +19 lines, -13 lines 0 comments Download
M service/datastore/pls.go View 1 2 3 4 5 6 3 chunks +44 lines, -2 lines 0 comments Download
M service/datastore/pls_impl.go View 7 chunks +4 lines, -28 lines 0 comments Download
M service/datastore/pls_test.go View 1 2 3 4 5 17 chunks +117 lines, -60 lines 0 comments Download
M service/datastore/properties.go View 1 chunk +0 lines, -2 lines 0 comments Download

Messages

Total messages: 16 (4 generated)
dnj
PTAL, hard to tell if I'm missing anything, but it passes all tests, so there's ...
5 years, 1 month ago (2015-10-30 07:47:55 UTC) #2
iannucci
lgtm (certainly better than before) + comment/question. https://chromiumcodereview.appspot.com/1427933002/diff/1/service/datastore/pls.go File service/datastore/pls.go (right): https://chromiumcodereview.appspot.com/1427933002/diff/1/service/datastore/pls.go#newcode112 service/datastore/pls.go:112: func getMGS(obj ...
5 years, 1 month ago (2015-10-30 20:21:07 UTC) #3
dnj
https://chromiumcodereview.appspot.com/1427933002/diff/1/service/datastore/pls.go File service/datastore/pls.go (right): https://chromiumcodereview.appspot.com/1427933002/diff/1/service/datastore/pls.go#newcode112 service/datastore/pls.go:112: func getMGS(obj interface{}) MetaGetterSetter { On 2015/10/30 20:21:06, iannucci ...
5 years, 1 month ago (2015-10-30 20:34:48 UTC) #4
iannucci
https://chromiumcodereview.appspot.com/1427933002/diff/40001/service/datastore/pls_impl.go File service/datastore/pls_impl.go (left): https://chromiumcodereview.appspot.com/1427933002/diff/40001/service/datastore/pls_impl.go#oldcode338 service/datastore/pls_impl.go:338: ret = p.getMGS().GetAllMeta() This is the code that I ...
5 years, 1 month ago (2015-10-30 21:29:29 UTC) #5
dnj
https://chromiumcodereview.appspot.com/1427933002/diff/40001/service/datastore/pls_impl.go File service/datastore/pls_impl.go (left): https://chromiumcodereview.appspot.com/1427933002/diff/40001/service/datastore/pls_impl.go#oldcode338 service/datastore/pls_impl.go:338: ret = p.getMGS().GetAllMeta() On 2015/10/30 21:29:29, iannucci wrote: > ...
5 years, 1 month ago (2015-10-30 21:40:04 UTC) #6
iannucci
ok, I understand this better now. still lgtm :) I don't think any code in ...
5 years, 1 month ago (2015-10-30 21:47:07 UTC) #8
Vadim Sh.
I don't think my code depended on the difference. If it did, unit tests should ...
5 years, 1 month ago (2015-10-30 21:54:20 UTC) #9
Vadim Sh.
lgtm https://codereview.chromium.org/1427933002/diff/80001/service/datastore/interface.go File service/datastore/interface.go (right): https://codereview.chromium.org/1427933002/diff/80001/service/datastore/interface.go#newcode79 service/datastore/interface.go:79: // implements GetMeta to make some minor tweaks ...
5 years, 1 month ago (2015-10-30 21:56:50 UTC) #10
iannucci
https://chromiumcodereview.appspot.com/1427933002/diff/100001/service/datastore/pls.go File service/datastore/pls.go (right): https://chromiumcodereview.appspot.com/1427933002/diff/100001/service/datastore/pls.go#newcode113 service/datastore/pls.go:113: // return GetPLS(props) I think this should be `GetPLS(s).Load(props)` ...
5 years, 1 month ago (2015-10-30 22:02:54 UTC) #11
iannucci
lgtm
5 years, 1 month ago (2015-10-30 22:12:08 UTC) #12
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1427933002/120001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1427933002/120001
5 years, 1 month ago (2015-10-30 22:12:39 UTC) #15
commit-bot: I haz the power
5 years, 1 month ago (2015-10-30 22:15:55 UTC) #16
Message was sent while issue was closed.
Committed patchset #7 (id:120001) as
https://github.com/luci/gae/commit/3932cd48f52a6fd2051c48c183cd3c0a17ae4913

Powered by Google App Engine
This is Rietveld 408576698