Skip to content
This repository was archived by the owner on Jan 11, 2023. It is now read-only.

Conversation

@sarangan12
Copy link
Contributor

As discussed offline, this PR is related to Azure/autorest.ruby#13 and fixes the tests associated with those changes.

@vishrutshah @veronicagg @salameer Please review and approve

Copy link
Contributor

@vishrutshah vishrutshah left a comment

Choose a reason for hiding this comment

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

We need to release the generator and then update/regen all gems to make this work right?

ip_address_path = ni_instance.ip_configurations[0].public_ipaddress.id
ip_address = network_client.make_request(:get, ip_address_path, options)
ip_address_instance = PublicIPAddress.new.from_json(ip_address)
ip_address_instance = network_client.deserialize(PublicIPAddress.mapper(), ip_address)
Copy link
Contributor

Choose a reason for hiding this comment

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

just curious what has caused this change?

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 was working with David on a different task. It was dropped eventually. This was a remnant from that task

namespace_parameters = Azure::ARM::ServiceBus::Models::SBNamespace.new
namespace_parameters.location = 'westus'
queue_parameters = Azure::ARM::ServiceBus::Models::SBQueue.new
queue_parameters.location = 'westus'
Copy link
Contributor

Choose a reason for hiding this comment

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

any reason for removing this? Just wanted to make sure what has caused this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor

@veronicagg veronicagg left a comment

Choose a reason for hiding this comment

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

Agreeing with Vishrut, these changes should be together with generation of the SDK based on the new generator, we shouldn't merge them yet.
Also, why is CI passing for this PR? shouldn't the test case update cause it to fail? or is it because of the manual edit of the files in the last release?

@sarangan12
Copy link
Contributor Author

@veronicagg The CI will pass as it is running against the current code.

@sarangan12
Copy link
Contributor Author

@vishrutshah Changed the expect per offline discussion

result = @resource_helper.network_client.network_interfaces.list_all
result.each do |network_interface|
expect(network_interface.virtual_machine).to be_an_instance_of(MsRestAzure::SubResource)
expect(network_interface.virtual_machine).to be_an_instance_of(VirtualMachine)
Copy link
Contributor

Choose a reason for hiding this comment

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

you should have to write Azure::ARM::Compute::Models::VirtualMachine

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Actually, it should be Azure::ARM::Network::Models::SubResource. The model looks like this:

class NetworkInterface < Resource

      include MsRestAzure

      # @return [SubResource] The reference of a virtual machine.
      attr_accessor :virtual_machine

So, changed it with the latest commit

@sarangan12 sarangan12 changed the title Changes related to fixing the inheritance logic. [Do not merge]Changes related to fixing the inheritance logic. Oct 2, 2017
@sarangan12 sarangan12 changed the title [Do not merge]Changes related to fixing the inheritance logic. Changes related to fixing the inheritance logic. Oct 2, 2017
Copy link
Contributor

@vishrutshah vishrutshah left a comment

Choose a reason for hiding this comment

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

LGTM 👍

Copy link
Contributor

@veronicagg veronicagg left a comment

Choose a reason for hiding this comment

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

LGTM!
Minor question inline.
For the test, line #1009 (diff) you may want to add a comment with a pointer to the spec where it indicates that "virtualmachine" is defined as "Subresource", just so it's clear in the future on why we're checking against that.


include MsRestAzure

include MsRest::JSONable
Copy link
Contributor

Choose a reason for hiding this comment

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

why was this included before?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It was a remnant from a serialization task which was later dropped.

@sarangan12
Copy link
Contributor Author

@veronicagg Added the link in the comment.

@sarangan12 sarangan12 merged commit 4ac21f2 into Azure:master Oct 4, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants