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

chore(addons): merge two cfn template's Metadata section #995

Merged
merged 4 commits into from
Jun 8, 2020
Merged

chore(addons): merge two cfn template's Metadata section #995

merged 4 commits into from
Jun 8, 2020

Conversation

efekarakus
Copy link
Contributor

Merges the "Metadata" section of two cfn templates under "addons/".

Related to #994

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@efekarakus efekarakus added the area/addon Issues about addons. label Jun 4, 2020
@efekarakus efekarakus requested review from kohidave, bvtujo, iamhopaul123 and a team June 4, 2020 21:21
Copy link
Contributor

@iamhopaul123 iamhopaul123 left a comment

Choose a reason for hiding this comment

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

Awesome! Ship it 🚢

metadataSection cfnSection = iota + 1
)

// cloudformation represents a parsed YAML AWS CloudFormation template.
Copy link
Contributor

Choose a reason for hiding this comment

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

What do you think of renaming to "cfnTemplate" which will be more informative and avoiding struct and pkg sharing the same name cloudformation?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done!

type cfnSection int

const (
metadataSection cfnSection = iota + 1
Copy link
Contributor

Choose a reason for hiding this comment

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

nice! good trick

go.mod Outdated
golang.org/x/text v0.3.2 // indirect
gopkg.in/ini.v1 v1.57.0
gopkg.in/yaml.v2 v2.3.0
Copy link
Contributor

Choose a reason for hiding this comment

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

Why bring in v2 of yaml??

Copy link
Contributor

Choose a reason for hiding this comment

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

Is this because of mergo?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have no idea 🤷‍♂️ I ran go mod tidy again and cleaned up a bunch of old dependencies.
I wonder if I can get dependabot to run tidy periodically 💭

@efekarakus efekarakus added the do-not-merge Pull requests that mergify shouldn't merge until the requester allows it. label Jun 5, 2020
@efekarakus
Copy link
Contributor Author

I updated the PR with an additional function isEqual instead of using reflect.DeepEqual.

reflect.DeepEqual returned false if two yaml nodes had the same content but had different comments, style, or indentation.
isEqual compares all the values except those stylistic ones.

@efekarakus efekarakus removed the do-not-merge Pull requests that mergify shouldn't merge until the requester allows it. label Jun 5, 2020
@mergify mergify bot merged commit 576179d into aws:master Jun 8, 2020
@efekarakus efekarakus deleted the addons/templates branch June 9, 2020 15:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/addon Issues about addons.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants