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

Issue 7303097: local: added storage backend (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
11 years, 2 months ago by TheMue
Modified:
10 years, 10 months ago
Reviewers:
dimitern, mp+148809, fwereade
Visibility:
Public.

Description

local: added storage backend Added a small web server acting as storage backend. https://code.launchpad.net/~themue/juju-core/011-local-storage-backend/+merge/148809 Requires: https://code.launchpad.net/~themue/juju-core/010-local-removed-old-approach/+merge/148719 (do not edit description out of merge proposal)

Patch Set 1 #

Patch Set 2 : local: added storage backend #

Patch Set 3 : local: added storage backend #

Patch Set 4 : local: added storage backend #

Patch Set 5 : local: added storage backend #

Total comments: 11

Patch Set 6 : local: added storage backend #

Patch Set 7 : local: added storage backend #

Total comments: 32

Patch Set 8 : local: added storage backend #

Unified diffs Side-by-side diffs Delta from patch set Stats (+481 lines, -0 lines) Patch
A [revision details] View 1 2 3 4 5 6 7 1 chunk +2 lines, -0 lines 0 comments Download
A environs/local/backend.go View 1 2 3 4 5 6 7 1 chunk +146 lines, -0 lines 0 comments Download
A environs/local/backend_test.go View 1 2 3 4 5 6 7 1 chunk +324 lines, -0 lines 0 comments Download
A environs/local/export_test.go View 1 chunk +9 lines, -0 lines 0 comments Download

Messages

Total messages: 11
TheMue
Please take a look.
11 years, 2 months ago (2013-02-15 20:04:56 UTC) #1
TheMue
Please take a look.
11 years, 2 months ago (2013-02-18 13:15:41 UTC) #2
TheMue
Please take a look.
11 years, 2 months ago (2013-02-19 10:23:21 UTC) #3
TheMue
Please take a look.
11 years, 2 months ago (2013-02-19 10:59:28 UTC) #4
TheMue
Please take a look.
11 years, 2 months ago (2013-02-19 11:27:36 UTC) #5
fwereade
Coming along nicely; a few thoughts: https://codereview.appspot.com/7303097/diff/5002/environs/local/backend.go File environs/local/backend.go (right): https://codereview.appspot.com/7303097/diff/5002/environs/local/backend.go#newcode98 environs/local/backend.go:98: http.Error(w, fmt.Sprintf("403 %v", ...
11 years, 2 months ago (2013-02-20 08:16:14 UTC) #6
TheMue
Please take a look. https://codereview.appspot.com/7303097/diff/5002/environs/local/backend.go File environs/local/backend.go (right): https://codereview.appspot.com/7303097/diff/5002/environs/local/backend.go#newcode98 environs/local/backend.go:98: http.Error(w, fmt.Sprintf("403 %v", err), http.StatusForbidden) ...
11 years, 2 months ago (2013-02-20 11:17:52 UTC) #7
TheMue
Please take a look.
11 years, 2 months ago (2013-02-20 14:56:05 UTC) #8
fwereade
Thanks for all this; LGTM. But please add a comment pointing out that the local ...
11 years, 2 months ago (2013-02-22 09:46:42 UTC) #9
dimitern
LGTM, just a few trivials. https://codereview.appspot.com/7303097/diff/20001/environs/local/backend.go File environs/local/backend.go (right): https://codereview.appspot.com/7303097/diff/20001/environs/local/backend.go#newcode50 environs/local/backend.go:50: // handleList returns the ...
11 years, 2 months ago (2013-02-22 10:25:03 UTC) #10
TheMue
11 years, 2 months ago (2013-02-22 14:01:38 UTC) #11
*** Submitted:

local: added storage backend

Added a small web server acting as storage backend.

R=fwereade, dimitern
CC=
https://codereview.appspot.com/7303097

https://codereview.appspot.com/7303097/diff/20001/environs/local/backend.go
File environs/local/backend.go (right):

https://codereview.appspot.com/7303097/diff/20001/environs/local/backend.go#n...
environs/local/backend.go:50: // handleList returns the names in the storage to
the client.
On 2013/02/22 10:25:03, dimitern wrote:
> s/names/file names/ ?

Done.

https://codereview.appspot.com/7303097/diff/20001/environs/local/backend.go#n...
environs/local/backend.go:107: if err != nil {
On 2013/02/22 10:25:03, dimitern wrote:
> if _, err := io.Copy(...); err != nil {
> ..
> } ?

Done.

https://codereview.appspot.com/7303097/diff/20001/environs/local/backend.go#n...
environs/local/backend.go:114: // handleDelete removes data from the storage.
On 2013/02/22 10:25:03, dimitern wrote:
> s/data/a file/ ?

Done.

https://codereview.appspot.com/7303097/diff/20001/environs/local/backend_test.go
File environs/local/backend_test.go (right):

https://codereview.appspot.com/7303097/diff/20001/environs/local/backend_test...
environs/local/backend_test.go:44: s.listener.Close()
On 2013/02/22 10:25:03, dimitern wrote:
> Are the files/dirs cleaned up after this? We don't want stale data from
previous
> test runs, do we?

The data directory is a temporary one created and cleaned up by gocheck. So it's
clean afterwards.

https://codereview.appspot.com/7303097/diff/20001/environs/local/backend_test...
environs/local/backend_test.go:48: name    string
On 2013/02/22 10:25:03, dimitern wrote:
> Do you really need 4 named structs with the same fields for each set of tests?
> Why not define it once and then use it, or maybe define it inline var getTests
> []struct{...}{...}..

Done.

https://codereview.appspot.com/7303097/diff/20001/environs/local/backend_test...
environs/local/backend_test.go:55: // Get existing file.
On 2013/02/22 10:25:03, dimitern wrote:
> Why not put the comment into an about: or summary: string?

Sure, would be possible and if I would log it it would helpful. But here they
are only intended to explain the sometimes interesting behavior of the Go HTTP
daemon regarding relative paths. So shorter comments are only to make it
complete. ;)

https://codereview.appspot.com/7303097/diff/20001/environs/local/backend_test...
environs/local/backend_test.go:96: // root is passed without relation to the
handler
On 2013/02/22 10:25:03, dimitern wrote:
> see below

Done.

https://codereview.appspot.com/7303097/diff/20001/environs/local/backend_test...
environs/local/backend_test.go:103: // root is passed without relation to the
handler
On 2013/02/22 10:25:03, dimitern wrote:
> s/relation to/invoking/ ?

Done.

https://codereview.appspot.com/7303097/diff/20001/environs/local/backend_test...
environs/local/backend_test.go:110: // no file.
On 2013/02/22 10:25:03, dimitern wrote:
> s/no file/not a file/ ?

Done.

https://codereview.appspot.com/7303097/diff/20001/environs/local/backend_test...
environs/local/backend_test.go:121: if gt.status != 0 {
On 2013/02/22 10:25:03, dimitern wrote:
> look below

Done.

https://codereview.appspot.com/7303097/diff/20001/environs/local/backend_test...
environs/local/backend_test.go:145: // List with a full filename.
On 2013/02/22 10:25:03, dimitern wrote:
> as above - maybe make the comments part of the struct as a string field and
> print it below?

See above.

https://codereview.appspot.com/7303097/diff/20001/environs/local/backend_test...
environs/local/backend_test.go:180: // root is passed without relation to the
handler
On 2013/02/22 10:25:03, dimitern wrote:
> s/relation to/invoking/ ?

Done.

https://codereview.appspot.com/7303097/diff/20001/environs/local/backend_test...
environs/local/backend_test.go:193: if lt.status != 0 {
On 2013/02/22 10:25:03, dimitern wrote:
> look below for the similar comment

Done.

https://codereview.appspot.com/7303097/diff/20001/environs/local/backend_test...
environs/local/backend_test.go:225: // doesn't get aware of it.
On 2013/02/22 10:25:03, dimitern wrote:
> s/doesn't get/isn't/

Done.

https://codereview.appspot.com/7303097/diff/20001/environs/local/backend_test...
environs/local/backend_test.go:244: if pt.status != 0 {
On 2013/02/22 10:25:03, dimitern wrote:
> this seems wrong - what if err != nil and resp is nil? check after the assert
on
> err?

Done.

https://codereview.appspot.com/7303097/diff/20001/environs/local/backend_test...
environs/local/backend_test.go:305: if rt.status != 0 {
On 2013/02/22 10:25:03, dimitern wrote:
> as above

Done.
Sign in to reply to this message.

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