Merge lp://staging/~bac/charms/oneiric/buildbot-master/history-s3 into lp://staging/~yellow/charms/oneiric/buildbot-master/trunk

Proposed by Brad Crittenden
Status: Merged
Approved by: Gary Poster
Approved revision: 34
Merged at revision: 33
Proposed branch: lp://staging/~bac/charms/oneiric/buildbot-master/history-s3
Merge into: lp://staging/~yellow/charms/oneiric/buildbot-master/trunk
Diff against target: 590 lines (+372/-15)
9 files modified
HACKING.txt (+3/-0)
config.yaml (+22/-0)
examples/pyflakes.yaml (+1/-1)
hooks/config-changed (+22/-7)
hooks/install (+1/-1)
hooks/local.py (+121/-0)
hooks/start (+0/-1)
hooks/stop (+5/-2)
hooks/tests.py (+197/-3)
To merge this branch: bzr merge lp://staging/~bac/charms/oneiric/buildbot-master/history-s3
Reviewer Review Type Date Requested Status
Gary Poster (community) Approve
Yellow Squad code Pending
Review via email: mp+94262@code.staging.launchpad.net

Description of the change

Add ability to store buildbot data files to S3 and retrieve them the next time the master is started.

The configuration settings for access-key and secret-key need to be passed, like so:

juju set buildbot-master access-key='<your AWS key>' secret-key='<your AWS secret key>'

Unfortunately the 'stop' hook is not being called (see bug 872264) so automatically saving the history when bringing down the juju service does not work. As a work-around a new config value is provided which causes the files to get pushed. Setting that config variable to a different value will cause it to save again, e.g.

juju set buildbot-master save-history-now='`date`'

To post a comment you must log in.
Revision history for this message
Gary Poster (gary) wrote :

Brad, this looks great! Nicely done, and nice to have helpers that can do this for us with future charms.

As I mentioned on IRC, please clean up the log messages in handle_config_changes one way or another, so that we no longer have a colon and two messages when one would do.

Making a chdir context manager would be nice. We have one or two hanging around. You mentioned you had found one in setuplxc.

I asked whether tar xvf will have the expanded file or the existing file win: you said the expanded one, which is good.

You pointed out there are no tests. If there's a sane way to write them then that would be great.

Thank you!

Gary

review: Approve
34. By Brad Crittenden

Added unit tests of history management functions

Revision history for this message
Gary Poster (gary) wrote :

Hi Brad. That looks good.

You asked about the amount of code needed to stub boto. I am very happy we have it, and I wonder if it ought to be put somewhere else to make it reusable--later, perhaps.

For now, though, the only idea I have is that it might be nice to put the boto setup/teardown stuff in a separate file, just to make the test file easier to read. Just an idea.

Meanwhile though, I approve it again!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches

to all changes: