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

mongo: move MongoInfo type #647

Merged
merged 1 commit into from
Sep 1, 2014
Merged

mongo: move MongoInfo type #647

merged 1 commit into from
Sep 1, 2014

Conversation

davecheney
Copy link
Contributor

This PR moves the MongoInfo type from the environmentserver/authentication package to the mongo package.

This change is necessary to unblock a larger change which was hitting a circular dependency.

With that said, as this change consists of removing the import of the environmentserver/authentication from most packages (and renaming the type), it seems clear in hindsight that the MongoInfo type belongs in the mongo package.

// MongoInfo encapsulates information about cluster of
// servers holding juju state and can be used to make a
// connection to that cluster.
type MongoInfo struct {
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm wondering if you'd consider renaming the struct from MongoInfo to ConnectionInfo, so the other sites that use it will have mongo.ConnectionInfo. Thoughts?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

SGTM. But not just yet, we can repaint the bike shed once I've finished
moving things around.

On Mon, Sep 1, 2014 at 6:11 PM, Tim Penhey [email protected] wrote:

In environmentserver/authentication/authentication.go:

@@ -14,20 +14,6 @@ import (
apiprovisioner "github.com/juju/juju/state/api/provisioner"
)

-// MongoInfo encapsulates information about cluster of
-// servers holding juju state and can be used to make a
-// connection to that cluster.
-type MongoInfo struct {

I'm wondering if you'd consider renaming the struct from MongoInfo to
ConnectionInfo, so the other sites that use it will have
mongo.ConnectionInfo. Thoughts?


Reply to this email directly or view it on GitHub
https://github.com/juju/juju/pull/647/files#r16944216.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Also, MongoInfo embeds a mongo.Info, so renaming the outer type doesn't
solve the problem of mongo.MongoInfo.Info. O-O

On Mon, Sep 1, 2014 at 6:29 PM, David Cheney [email protected]
wrote:

SGTM. But not just yet, we can repaint the bike shed once I've finished
moving things around.

On Mon, Sep 1, 2014 at 6:11 PM, Tim Penhey [email protected]
wrote:

In environmentserver/authentication/authentication.go:

@@ -14,20 +14,6 @@ import (
apiprovisioner "github.com/juju/juju/state/api/provisioner"
)

-// MongoInfo encapsulates information about cluster of
-// servers holding juju state and can be used to make a
-// connection to that cluster.
-type MongoInfo struct {

I'm wondering if you'd consider renaming the struct from MongoInfo to
ConnectionInfo, so the other sites that use it will have
mongo.ConnectionInfo. Thoughts?


Reply to this email directly or view it on GitHub
https://github.com/juju/juju/pull/647/files#r16944216.

Copy link
Contributor

Choose a reason for hiding this comment

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

On 01/09/14 20:30, Dave Cheney wrote:

In environmentserver/authentication/authentication.go:

@@ -14,20 +14,6 @@ import (
apiprovisioner "github.com/juju/juju/state/api/provisioner"
)

-// MongoInfo encapsulates information about cluster of
-// servers holding juju state and can be used to make a
-// connection to that cluster.
-type MongoInfo struct {

Also, MongoInfo embeds a mongo.Info, so renaming the outer type doesn't
solve the problem of mongo.MongoInfo.Info. O-O

Fair enough. LGTM

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks.

I am 1/2 hoping that out of this set of changes we'll find we have 3 or so
slightly different data types that can be rolled into one.

On Mon, Sep 1, 2014 at 6:35 PM, Tim Penhey [email protected] wrote:

In environmentserver/authentication/authentication.go:

@@ -14,20 +14,6 @@ import (
apiprovisioner "github.com/juju/juju/state/api/provisioner"
)

-// MongoInfo encapsulates information about cluster of
-// servers holding juju state and can be used to make a
-// connection to that cluster.
-type MongoInfo struct {

On 01/09/14 20:30, Dave Cheney wrote: In
environmentserver/authentication/authentication.go: > @@ -14,20 +14,6 @@
import ( > apiprovisioner "github.com/juju/juju/state/api/provisioner" >
) > > -// MongoInfo encapsulates information about cluster of > -// servers
holding juju state and can be used to make a > -// connection to that
cluster. > -type MongoInfo struct { Also, MongoInfo embeds a mongo.Info, so
renaming the outer type doesn't solve the problem of mongo.MongoInfo.Info.
O-O
Fair enough. LGTM


Reply to this email directly or view it on GitHub
https://github.com/juju/juju/pull/647/files#r16945052.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

$$merge$$

On Mon, Sep 1, 2014 at 6:37 PM, David Cheney [email protected]
wrote:

Thanks.

I am 1/2 hoping that out of this set of changes we'll find we have 3 or so
slightly different data types that can be rolled into one.

On Mon, Sep 1, 2014 at 6:35 PM, Tim Penhey [email protected]
wrote:

In environmentserver/authentication/authentication.go:

@@ -14,20 +14,6 @@ import (
apiprovisioner "github.com/juju/juju/state/api/provisioner"
)

-// MongoInfo encapsulates information about cluster of
-// servers holding juju state and can be used to make a
-// connection to that cluster.
-type MongoInfo struct {

On 01/09/14 20:30, Dave Cheney wrote: In
environmentserver/authentication/authentication.go: > @@ -14,20 +14,6 @@
import ( > apiprovisioner "github.com/juju/juju/state/api/provisioner" >
) > > -// MongoInfo encapsulates information about cluster of > -// servers
holding juju state and can be used to make a > -// connection to that
cluster. > -type MongoInfo struct { Also, MongoInfo embeds a mongo.Info, so
renaming the outer type doesn't solve the problem of mongo.MongoInfo.Info. O-O
Fair enough. LGTM


Reply to this email directly or view it on GitHub
https://github.com/juju/juju/pull/647/files#r16945052.

@davecheney
Copy link
Contributor Author

$$merge$$

@jujubot
Copy link
Collaborator

jujubot commented Sep 1, 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 1, 2014
mongo: move MongoInfo type

This PR moves the `MongoInfo` type from the `environmentserver/authentication` package to the `mongo` package.

This change is necessary to unblock a larger change which was hitting a circular dependency.

With that said, as this change consists of _removing_ the import of the `environmentserver/authentication` from most packages (and renaming the type), it seems clear in hindsight that the `MongoInfo` type belongs in the `mongo` package.
@jujubot jujubot merged commit 3121b83 into juju:master Sep 1, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants