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

Issue 48880043: New charm revision updater api (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
10 years, 4 months ago by wallyworld
Modified:
10 years, 3 months ago
Reviewers:
mp+200758, axw, william.reade, jameinel, thumper
Visibility:
Public.

Description

New charm revision updater api Add an api which provides functionality to query the charm store and record in state the latest revision for the charms. The charms queried are those which are currently deployed. A charm record is created and is marked as a placeholder. This makes the charm invisible to state.Charm() queries. If the charm is subsequently deployed and thus state.AddCharm() is called, the placeholder record is updated accordngly. The next step is to add a worker which will periodically call this api. https://code.launchpad.net/~wallyworld/juju-core/charm-version-updater/+merge/200758 Requires: https://code.launchpad.net/~wallyworld/juju-core/refactor-charm-repo/+merge/200753 (do not edit description out of merge proposal)

Patch Set 1 #

Total comments: 15

Patch Set 2 : New charm revision updater api #

Patch Set 3 : New charm revision updater api #

Total comments: 4
Unified diffs Side-by-side diffs Delta from patch set Stats (+811 lines, -33 lines) Patch
A [revision details] View 1 2 1 chunk +2 lines, -0 lines 0 comments Download
A state/api/charmrevisionupdater/package_test.go View 1 1 chunk +14 lines, -0 lines 0 comments Download
A state/api/charmrevisionupdater/updater.go View 1 1 chunk +33 lines, -0 lines 0 comments Download
A state/api/charmrevisionupdater/updater_test.go View 1 2 1 chunk +51 lines, -0 lines 2 comments Download
M state/api/state.go View 1 2 chunks +6 lines, -0 lines 0 comments Download
A state/apiserver/charmrevisionupdater/package_test.go View 1 1 chunk +14 lines, -0 lines 0 comments Download
A state/apiserver/charmrevisionupdater/testing/suite.go View 1 1 chunk +139 lines, -0 lines 0 comments Download
A state/apiserver/charmrevisionupdater/updater.go View 1 2 1 chunk +114 lines, -0 lines 2 comments Download
A state/apiserver/charmrevisionupdater/updater_test.go View 1 2 1 chunk +106 lines, -0 lines 0 comments Download
M state/apiserver/root.go View 1 2 chunks +11 lines, -0 lines 0 comments Download
M state/charm.go View 1 2 2 chunks +7 lines, -0 lines 0 comments Download
M state/state.go View 1 2 4 chunks +140 lines, -17 lines 0 comments Download
M state/state_test.go View 1 2 4 chunks +174 lines, -16 lines 0 comments Download

Messages

Total messages: 8
wallyworld
Please take a look.
10 years, 4 months ago (2014-01-08 02:19:30 UTC) #1
william.reade
Not so sure about the data, or about where we're storing it. Chat after standup? ...
10 years, 3 months ago (2014-01-13 09:10:13 UTC) #2
axw
https://codereview.appspot.com/48880043/diff/1/state/api/charmversionupdater/updater.go File state/api/charmversionupdater/updater.go (right): https://codereview.appspot.com/48880043/diff/1/state/api/charmversionupdater/updater.go#newcode29 state/api/charmversionupdater/updater.go:29: return result.Error if result.Error != nil ... (I know ...
10 years, 3 months ago (2014-01-13 09:26:29 UTC) #3
wallyworld
Please take a look.
10 years, 3 months ago (2014-01-15 07:16:56 UTC) #4
wallyworld
Please take a look.
10 years, 3 months ago (2014-01-15 23:21:45 UTC) #5
jameinel
Everything I've seen so far looks pretty good, but I didn't get to the 'state.go' ...
10 years, 3 months ago (2014-01-16 09:56:15 UTC) #6
wallyworld
https://codereview.appspot.com/48880043/diff/40001/state/api/charmrevisionupdater/updater_test.go File state/api/charmrevisionupdater/updater_test.go (right): https://codereview.appspot.com/48880043/diff/40001/state/api/charmrevisionupdater/updater_test.go#newcode48 state/api/charmrevisionupdater/updater_test.go:48: pending, err := s.State.LatestPlaceholderCharm(curl) On 2014/01/16 09:56:16, jameinel wrote: ...
10 years, 3 months ago (2014-01-16 10:11:46 UTC) #7
thumper
10 years, 3 months ago (2014-01-16 22:34:35 UTC) #8
On 2014/01/16 10:11:46, wallyworld wrote:
>
https://codereview.appspot.com/48880043/diff/40001/state/api/charmrevisionupd...
> File state/api/charmrevisionupdater/updater_test.go (right):
> 
>
https://codereview.appspot.com/48880043/diff/40001/state/api/charmrevisionupd...
> state/api/charmrevisionupdater/updater_test.go:48: pending, err :=
> s.State.LatestPlaceholderCharm(curl)
> On 2014/01/16 09:56:16, jameinel wrote:
> > Just to confirm, this isn't actually going to the real charm store, right?
> 
> Right, LatestPlaceholderCharm only queries the db. Only the worker task goes
to
> the charm store, and it updates the db and hence allows this
> LatestPlaceholderCharm call to function.
> 
>
https://codereview.appspot.com/48880043/diff/40001/state/apiserver/charmrevis...
> File state/apiserver/charmrevisionupdater/updater.go (right):
> 
>
https://codereview.appspot.com/48880043/diff/40001/state/apiserver/charmrevis...
> state/apiserver/charmrevisionupdater/updater.go:80:
> deployedCharms[baseCharm.String()] = baseCharm
> On 2014/01/16 09:56:16, jameinel wrote:
> > This breaks if you have the same charm deployed to two differently named
> > services, right?
> > 
> > juju deploy mysql mysqlA
> > juju deploy mysql mysqlB
> > 
> > It may be that WithRevision(-1) will be the same even if mysqlA and mysqlB
are
> > at different revs.
> > 
> 
> Yes, that's the intent. See below.
> 
> > I'd just like to confirm that. Maybe test worthy?
> 
> The way this works is that deployedCharms is used to hold the latest revisions
> from the charm store, as queried from the db. These latest revisions are then
> compared against each service. So mysqlA and B may well have cs:mysql-3 and
> cs:mysql-4. deployedCharms might have cs:mysql5 (since that's what the store
> has). So the status will compare cs:mysql-3 and cs:mysql-4 to cs:mysql-5 and
> present accordingly.

LGTM, and thanks for addressing all the comments.
Sign in to reply to this message.

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