-
Notifications
You must be signed in to change notification settings - Fork 203
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
Create conversions package #1520
Conversation
7e05710
to
326c98a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like the AssignPropertiesTo/From naming a lot more.
|
||
import ( | ||
"fmt" | ||
"github.com/Azure/azure-service-operator/hack/generator/pkg/astmodel" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move this down into a separate this-module stanza along with the astbuilder import?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
"github.com/Azure/azure-service-operator/hack/generator/pkg/astmodel" | ||
"github.com/Azure/azure-service-operator/hack/generator/pkg/conversions" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Split these out?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
"bytes" | ||
"github.com/Azure/azure-service-operator/hack/generator/pkg/astmodel" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
} | ||
} | ||
|
||
//TODO: Remove this? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So should you? 😉
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Those methods were introduced as a part of relocating things one by one into the new package, but I'll keep them. Fixed the comments.
|
||
import ( | ||
"github.com/Azure/azure-service-operator/hack/generator/pkg/astmodel" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
|
||
import ( | ||
"github.com/Azure/azure-service-operator/hack/generator/pkg/astmodel" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
Codecov Report
@@ Coverage Diff @@
## master #1520 +/- ##
==========================================
+ Coverage 63.23% 63.25% +0.01%
==========================================
Files 175 175
Lines 11583 11597 +14
==========================================
+ Hits 7325 7336 +11
- Misses 3601 3604 +3
Partials 657 657
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice fix!
What this PR does / why we need it:
Moves much of the code around creation of storage variants out of the astmodel package and into a package dedicated to generation of conversions.
Requires PR #1495 to be merged first.PR #1495 has been merged.Special notes for your reviewer:
The PR is almost entirely moving files and renaming types (see below for the exception). However, not every file rename has been detected and correctly shown in the PR, so in some cases we see new-file + file-deleted.
The one functional change is that functions are named for the type being converted, not for the version. This can be seen in the changes to the (relocated) golden files, where
ConvertToVNext()
now becomesAssignPropertiesToPerson()
. In the actuall generated code, where the versions are date based, the change will look likeConvertToV20180501()
becomingAssignPropertiesToBatchAccount()
.How does this PR make you feel:
If applicable: