Skip to content
This repository has been archived by the owner on Jul 25, 2020. It is now read-only.

Cleanup round 1 of azurecompute: Output value types. #92

Closed
wants to merge 10 commits into from
Closed

Cleanup round 1 of azurecompute: Output value types. #92

wants to merge 10 commits into from

Conversation

codefromthecrypt
Copy link
Contributor

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

@codefromthecrypt
Copy link
Contributor Author

cc @abayer

@codefromthecrypt
Copy link
Contributor Author

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.

@cloudbees-pull-request-builder

jclouds-labs-pull-requests #320 SUCCESS
This pull request looks good

@buildhive
Copy link

jclouds » jclouds-labs #1701 SUCCESS
This pull request looks good
(what's this?)

@codefromthecrypt
Copy link
Contributor Author

Live tests still pass. Can't migrate to google auto value yet as we use a custom @Nullable annotation. The fix for that was merged in Feb, but there's not been a new release, yet. Pinged them.

Also note. I'm only about 1/2 done cleaning objects anyway.

@cloudbees-pull-request-builder

jclouds-labs-pull-requests #322 SUCCESS
This pull request looks good

@buildhive
Copy link

jclouds » jclouds-labs #1710 SUCCESS
This pull request looks good
(what's this?)

@@ -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
Copy link
Member

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...

Copy link
Contributor Author

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!

@demobox
Copy link
Member

demobox commented Oct 18, 2014

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.

@codefromthecrypt
Copy link
Contributor Author

thanks for the review, @demobox! I'll ping you when done the last cleanup round.

@codefromthecrypt
Copy link
Contributor Author

added disk, the last biggie. I still have some consistency cleanups to do, and the input objects.

@codefromthecrypt
Copy link
Contributor Author

ps so far I'm absolutely convinced we should end the practice of builders on output-only value types.

@cloudbees-pull-request-builder

jclouds-labs-pull-requests #323 SUCCESS
This pull request looks good

@buildhive
Copy link

jclouds » jclouds-labs #1715 SUCCESS
This pull request looks good
(what's this?)

@demobox
Copy link
Member

demobox commented Oct 19, 2014

we should end the practice of builders on output-only value types.

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.
Copy link
Member

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!

@codefromthecrypt
Copy link
Contributor Author

@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.

@codefromthecrypt
Copy link
Contributor Author

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.

  1. Objects.toStringHelper will be around until June 2016, so a little early to worry about, esp in labs
  2. Using MoreObjects.toStringHelper makes backporting a royal pita
  3. I won't need any toStringHelper once auto-value is hooked up, thus avoiding the entire thrash problem for this class of guava usage.

@demobox ready for your review! After this, I'll work on the input objects, then update the api, then move on to compute service.

@cloudbees-pull-request-builder

jclouds-labs-pull-requests #324 SUCCESS
This pull request looks good

@buildhive
Copy link

jclouds » jclouds-labs #1718 SUCCESS
This pull request looks good
(what's this?)

@codefromthecrypt codefromthecrypt changed the title Cleanup round 1 of azurecompute Deployment class and imports. Cleanup round 1 of azurecompute: Output value types. Oct 20, 2014
this.description = description;
this.os = os;
this.mediaLink = mediaLink;
this.logicalSizeInGB = checkNotNull(logicalSizeInGB, "logicalSizeInGB of %s", name);
Copy link
Member

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

nullable was wrong. fixed

@demobox
Copy link
Member

demobox commented Oct 20, 2014

Only one comment that might need to be looked at now (a field marked @Nullable but with a checkNotNull) - the rest can all be ignored and/or handled later, if desired.

+1 - looks good to me! Thanks for more cleanup, @adriancole!

@cloudbees-pull-request-builder

jclouds-labs-pull-requests #325 SUCCESS
This pull request looks good

@buildhive
Copy link

jclouds » jclouds-labs #1719 SUCCESS
This pull request looks good
(what's this?)

@ccustine
Copy link
Member

+1 btw, what are we waiting on before using autovalue? A specific issue or feature?

@codefromthecrypt
Copy link
Contributor Author

@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 :)

@codefromthecrypt
Copy link
Contributor Author

merged into master. will do 1.8.x once 1.8.1 is cut.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
6 participants