move from state.D to bson.D

Bug #1217868 reported by John A Meinel
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
juju-core
Fix Released
Low
Bodie Solomon

Bug Description

At the moment state has a local type definition of:

// TODO(niemeyer): This must not be exported.
type D []bson.DocElem

And then our code has lines of:

  Update: D{{"$set", newConstraintsDoc(cons)}},

However for people not very familiar with it, the D object is not obvious and is a little bit hard to figure out its definition.

the labix.org/v2/mgo/bson module already provides the D bit for us, and it shouldn't be too bad to change our lines to:

  Update: bson.D{{"$set", newConstraintsDoc(cons)}},

That helps give clarity over what this D thing might be (it clearly has to do with bson encoding) and it gives a smaller codebase to lookup the type.

Related branches

John A Meinel (jameinel)
tags: added: easy
Revision history for this message
Dave Cheney (dave-cheney) wrote : Re: [Bug 1217868] [NEW] move from state.D to bson.D

SGTM.

On Wed, Aug 28, 2013 at 10:50 PM, John A Meinel <email address hidden> wrote:
> Public bug reported:
>
> At the moment state has a local type definition of:
>
> // TODO(niemeyer): This must not be exported.
> type D []bson.DocElem
>
> And then our code has lines of:
>
> Update: D{{"$set", newConstraintsDoc(cons)}},
>
> However for people not very familiar with it, the D object is not
> obvious and is a little bit hard to figure out its definition.
>
> the labix.org/v2/mgo/bson module already provides the D bit for us, and
> it shouldn't be too bad to change our lines to:
>
> Update: bson.D{{"$set", newConstraintsDoc(cons)}},
>
> That helps give clarity over what this D thing might be (it clearly has
> to do with bson encoding) and it gives a smaller codebase to lookup the
> type.
>
> ** Affects: juju-core
> Importance: Wishlist
> Status: Triaged
>
>
> ** Tags: easy tech-debt
>
> ** Tags added: easy
>
> --
> You received this bug notification because you are subscribed to juju-
> core.
> Matching subscriptions: MOAR JUJU SPAM!
> https://bugs.launchpad.net/bugs/1217868
>
> Title:
> move from state.D to bson.D
>
> Status in juju-core:
> Triaged
>
> Bug description:
> At the moment state has a local type definition of:
>
> // TODO(niemeyer): This must not be exported.
> type D []bson.DocElem
>
> And then our code has lines of:
>
> Update: D{{"$set", newConstraintsDoc(cons)}},
>
> However for people not very familiar with it, the D object is not
> obvious and is a little bit hard to figure out its definition.
>
> the labix.org/v2/mgo/bson module already provides the D bit for us,
> and it shouldn't be too bad to change our lines to:
>
> Update: bson.D{{"$set", newConstraintsDoc(cons)}},
>
> That helps give clarity over what this D thing might be (it clearly
> has to do with bson encoding) and it gives a smaller codebase to
> lookup the type.
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/juju-core/+bug/1217868/+subscriptions

Curtis Hovey (sinzui)
tags: added: hours
removed: easy
Changed in juju-core:
importance: Wishlist → Low
Curtis Hovey (sinzui)
Changed in juju-core:
assignee: nobody → Bodie Solomon (binary132)
status: Triaged → Fix Committed
milestone: none → 1.17.7
Tim Penhey (thumper)
Changed in juju-core:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.