Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose a top-level abstraction for all the backups functionality. #708

Merged
merged 6 commits into from Sep 10, 2014

Conversation

ericsnowcurrently
Copy link
Contributor

This patch adds a top-level backups abstraction. It also exposes the backup creation functionality through a method.

The PR that will follow this one:
ericsnowcurrently#4

@ericsnowcurrently ericsnowcurrently changed the title Expose all the backups functionality as a top-level struct. Expose a top-level abstraction for all the backups functionality. Sep 8, 2014
var (
getFilesToBackUp = files.GetFilesToBackUp
getDBDumper (func(db.ConnInfo) db.Dumper) = db.NewDumper
runCreate = create

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this seems unnecessary to me (runCreate)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's for testing. Otherwise I agree.

@wwitzel3
Copy link
Contributor

wwitzel3 commented Sep 9, 2014

LGTM, my review mentor is @fwereade

if err != nil {
return nil, errors.Annotate(err, "error listing files to back up")
}
dumper := getDBDumper(*dbInfo)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Manually dereferencing a pointer is almost always a sign that something is wrong. IIRC, the ConnInfo doesn't really need to be a pointer anyway (it's not a large value... and we aren't going to be passing a lot of them around regardless), so maybe just pass it in as a value?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fine with me.

@natefinch
Copy link
Contributor

LGTM. I don't think the abstraction is really necessary or beneficial, but I don't think it's the end of the world, either.

@cmars
Copy link
Contributor

cmars commented Sep 9, 2014

LGTM.

@ericsnowcurrently
Copy link
Contributor Author

Thanks, all, for your reviews. Once we're unblocked I'll get this merged.

filesToBackUp, err := getFilesToBackUp("")
if err != nil {
return nil, errors.Annotate(err, "error listing files to back up")
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not tested.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added

@ericsnowcurrently
Copy link
Contributor Author

Thanks for the review, Jesse, and especially for pointing out the missing tests. Since I want to keep some internal types private, the solution was kind of messy. However, it's not too bad.

@ericsnowcurrently
Copy link
Contributor Author

$$merge$$

@jujubot
Copy link
Collaborator

jujubot commented Sep 10, 2014

Status: merge request accepted. Url: http://juju-ci.vapour.ws:8080/job/github-merge-juju

@jujubot
Copy link
Collaborator

jujubot commented Sep 10, 2014

Build failed: Does not match ['fixes-1366802']
build url: http://juju-ci.vapour.ws:8080/job/github-merge-juju/596

@ericsnowcurrently
Copy link
Contributor Author

$$should-not-be-blocked$$

@jujubot
Copy link
Collaborator

jujubot commented Sep 10, 2014

Status: merge request accepted. Url: http://juju-ci.vapour.ws:8080/job/github-merge-juju

@jujubot
Copy link
Collaborator

jujubot commented Sep 10, 2014

Build failed: Does not match ['fixes-1366802']
build url: http://juju-ci.vapour.ws:8080/job/github-merge-juju/597

@ericsnowcurrently
Copy link
Contributor Author

$$really-should-not-be-blocked-now$$

@jujubot
Copy link
Collaborator

jujubot commented Sep 10, 2014

Status: merge request accepted. Url: http://juju-ci.vapour.ws:8080/job/github-merge-juju

@jujubot
Copy link
Collaborator

jujubot commented Sep 10, 2014

Build failed: Does not match ['fixes-1366802']
build url: http://juju-ci.vapour.ws:8080/job/github-merge-juju/599

@ericsnowcurrently
Copy link
Contributor Author

$$trying-again$$

@jujubot
Copy link
Collaborator

jujubot commented Sep 10, 2014

Status: merge request accepted. Url: http://juju-ci.vapour.ws:8080/job/github-merge-juju

@jujubot
Copy link
Collaborator

jujubot commented Sep 10, 2014

Build failed: Tests failed
build url: http://juju-ci.vapour.ws:8080/job/github-merge-juju/600

@ericsnowcurrently
Copy link
Contributor Author

$$this-patch-did-not-fail$$

@jujubot
Copy link
Collaborator

jujubot commented Sep 10, 2014

Status: merge request accepted. Url: http://juju-ci.vapour.ws:8080/job/github-merge-juju

@jujubot
Copy link
Collaborator

jujubot commented Sep 10, 2014

Build failed: Tests failed
build url: http://juju-ci.vapour.ws:8080/job/github-merge-juju/603

@ericsnowcurrently
Copy link
Contributor Author

$$ec2-borked-the-last-run$$

@jujubot
Copy link
Collaborator

jujubot commented Sep 10, 2014

Status: merge request accepted. Url: http://juju-ci.vapour.ws:8080/job/github-merge-juju

jujubot added a commit that referenced this pull request Sep 10, 2014
Expose a top-level abstraction for all the backups functionality.

This patch adds a top-level backups abstraction.  It also exposes the backup creation functionality through a method.

The PR that will follow this one:
  ericsnowcurrently#4
@jujubot jujubot merged commit f1a081a into juju:master Sep 10, 2014
@ericsnowcurrently ericsnowcurrently deleted the backups-create branch September 10, 2014 18:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
7 participants