-
Notifications
You must be signed in to change notification settings - Fork 95
Cleanup round 1 of azurecompute: Output value types. #92
Cleanup round 1 of azurecompute: Output value types. #92
Conversation
cc @abayer |
For the passer-by, I'm doing slow-burn cleanup, and also playing with ideas wrt where we actually need builders or defensive enums. Current thinking is that we don't unless it is an in-out or input value object. Once I'm done cleanup here, I can present a coherent idea back to the group. That may not happen until a week from now. |
jclouds-labs-pull-requests #320 SUCCESS |
jclouds » jclouds-labs #1701 SUCCESS |
bcec4f6
to
c005ff7
Compare
Live tests still pass. Can't migrate to google auto value yet as we use a custom Also note. I'm only about 1/2 done cleaning objects anyway. |
jclouds-labs-pull-requests #322 SUCCESS |
jclouds » jclouds-labs #1710 SUCCESS |
@@ -20,4 +20,4 @@ Once you do this, you will set the following to run the live tests. | |||
mvn -Plive -Dtest.jclouds.azurecompute.subscription-id=12345678-abcd-dcba-abdc-ba0987654321 | |||
-Dtest.azurecompute.credential=P12_EXPORT_PASSWORD | |||
-Dtest.azurecompute.identity=$HOME/.jclouds/azure.p12 |
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.
[minor] Should this also be .pem
? If so, happy to fix this during merge...
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.
nope! actually this should be p12 for now anyway. I haven't refactored the authentication bit, yet, and was surprised myself at this!
Thanks for another big cleanup, @adriancole! +1 - looks good to me. A couple of minor questions, but they can be dealt with, if at all, in later stages of the cleanup. |
thanks for the review, @demobox! I'll ping you when done the last cleanup round. |
added disk, the last biggie. I still have some consistency cleanups to do, and the input objects. |
ps so far I'm absolutely convinced we should end the practice of builders on output-only value types. |
jclouds-labs-pull-requests #323 SUCCESS |
jclouds » jclouds-labs #1715 SUCCESS |
Do you recall where this came from in the first place..? |
|
||
@VisibleForTesting static InstanceStatus parseInstanceStatus(String instanceStatus) { | ||
try { | ||
// Azure isn't exactly upper-camel, as some states end in VM, not Vm. |
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.
Ahhh...this is what the V_M
was all about!
@demobox wrt builder for output-only.. I think it was probably my fault. I'm sure I suggested that we use builders, but didn't think through that they are only relevant for input objects. |
OK. all output objects are clean. I'd expect another 1K or so less lines when auto-value cuts another release. Note: I decided to not use MoreObjects.toStringHelper for a few reasons.
@demobox ready for your review! After this, I'll work on the input objects, then update the api, then move on to compute service. |
jclouds-labs-pull-requests #324 SUCCESS |
jclouds » jclouds-labs #1718 SUCCESS |
this.description = description; | ||
this.os = os; | ||
this.mediaLink = mediaLink; | ||
this.logicalSizeInGB = checkNotNull(logicalSizeInGB, "logicalSizeInGB of %s", name); |
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.
This is listed above as @Nullable
?
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.
nullable was wrong. fixed
Only one comment that might need to be looked at now (a field marked +1 - looks good to me! Thanks for more cleanup, @adriancole! |
jclouds-labs-pull-requests #325 SUCCESS |
jclouds » jclouds-labs #1719 SUCCESS |
+1 btw, what are we waiting on before using autovalue? A specific issue or feature? |
@ccustine there's a snapshot published to sonatype, but no stable version. Since we use our own Nullable annotation, auto-value 1.0-rc1 can't work, but anything after Feb will :) |
merged into master. will do 1.8.x once 1.8.1 is cut. |
Main changes are consolidating and cleaning output value objects, like Deployment. Some time in the future, we can remove a lot more code and also the guava dependency from these classes via
@AutoValue