Update to use gopkg.in/yaml.v2 #164

Closed
wants to merge 3 commits into
from

Conversation

Projects
None yet
4 participants

bz2 commented Oct 10, 2015

The GetYAML interface has been dropped in favour of MarshalYAML
and some error messages have been improved.

It was possible to get rid of the Meta.GetYAML function entirely,
and as a side effect the storage attribute will now be serialised
to yaml rather than accidentally omitted.

Martin Packman added some commits Oct 10, 2015

Update to use gopkg.in/yaml.v2
The GetYAML interface has been dropped in favour of MarshalYAML
and some error messages have been improved.

It was possible to get rid of the Meta.GetYAML function entirely,
and as a side effect the storage attribute will now be serialised
to yaml rather than accidentally omitted.
Readd Meta yaml tags lost in rebase
These tags retain the behaviour of the old GetYAML method. There is
some insanity here, in particular the json tags differ and are
untested. In addition, the new Storage and PayloadClasses fields are
unserialised.
golang.org/x/crypto git aedad9a179ec1ea11b7064c57cbc6dc30d7724ec 2015-08-30T18:06:42Z
gopkg.in/check.v1 git b3d3430320d4260e5fea99841af984b3badcea63 2015-06-26T10:50:28Z
gopkg.in/mgo.v2 git f4923a569136442e900b8cf5c1a706c0a8b0883c 2015-08-21T15:31:23Z
-gopkg.in/yaml.v1 git 9f9df34309c04878acc86042b16630b0f696e1de 2014-09-24T16:16:07Z
+gopkg.in/yaml.v2 git 53feefa2559fb8dfa8d81baad31be332c97d6c77 2015-09-24T14:23:14Z
@mattyw

mattyw Oct 14, 2015

Member

I wonder if we should standardise on the version of yaml in core? Maybe not important thought? handwave handwave bikeshed etc

@@ -180,20 +180,20 @@ func (r Relation) IsImplicit() bool {
// only applies to JSON because Meta has a custom
// YAML marshaller.
type Meta struct {
@mattyw

mattyw Oct 14, 2015

Member

I'd be tempted to add a TODO (maybe a bug in lp) about the difference in yaml/bson tag names

Member

mattyw commented Oct 14, 2015

LGTM

+ Categories []string `bson:"categories,omitempty" json:"categories,omitempty" yaml:"categories,omitempty"`
+ Tags []string `bson:"tags,omitempty" json:"tag,omitempty" yaml:"tags,omitempty"`
+ Series []string `bson:"series,omitempty" json:"supported-series,omitempty" yaml:"series,omitempty"`
+ Storage map[string]Storage `bson:"storage,omitempty" json:"storage,omitempty" yaml:"-"`
@rogpeppe

rogpeppe Oct 29, 2015

Owner

Why ignore this in the YAML format? Shouldn't we be writing it out in the same format that we read it in as? Ditto for payloads.

Owner

rogpeppe commented Oct 29, 2015

Looks good except for the Storage and PayloadClasses attributes being ignored when marshaling.

Owner

rogpeppe commented Oct 29, 2015

LGTM with a TODO to marshal Storage and PayloadClasses correctly. Thanks.

+ OldRevision int `bson:"oldrevision,omitempty" yaml:"-"` // Obsolete
+ Categories []string `bson:"categories,omitempty" json:"categories,omitempty" yaml:"categories,omitempty"`
+ Tags []string `bson:"tags,omitempty" json:"tag,omitempty" yaml:"tags,omitempty"`
+ Series []string `bson:"series,omitempty" json:"supported-series,omitempty" yaml:"series,omitempty"`
@alesstimec

alesstimec Oct 30, 2015

Member

"series" in bson, but "supported-series" in json?

Owner

rogpeppe commented Jun 9, 2016

This PR is now redundant.

@rogpeppe rogpeppe closed this Jun 9, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment