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

Conversation

@vishrutshah
Copy link
Contributor

Fixes Azure/azure-sdk-for-ruby#957

We'll inherit from the MsRestAzure::Resource or MsRestAzure::SubResource, when either name matches the regular expression or we determine that name matches and model has all properties standard properties.

@msftclas
Copy link

@vishrutshah,
Thanks for your contribution as a Microsoft full-time employee or intern. You do not need to sign a CLA.
Thanks,
Microsoft Pull Request Bot

@vishrutshah
Copy link
Contributor Author

vishrutshah commented Sep 14, 2017

@olydis : QQ Seems like CI is not getting picked up? Any idea? or did i do something :)

@vishrutshah
Copy link
Contributor Author

vishrutshah commented Sep 14, 2017

ohh got picked up..nevermind ...awesome 👍

@vishrutshah
Copy link
Contributor Author

@veronicagg @sarangan12 Feel free to review this when you get a chance.

@olydis could you please restart the win32-x64 build when you get a chance. Thanks!

@olydis
Copy link
Contributor

olydis commented Sep 15, 2017

> linux-x64 restart

@olydis
Copy link
Contributor

olydis commented Sep 16, 2017

> win32-x64 restart

@vishrutshah
Copy link
Contributor Author

@sarangan12 @veronicagg Feel free to review this when you get a chance. Thanks!

@sarangan12 sarangan12 merged commit b14c6ef into Azure:master Sep 26, 2017
@olydis
Copy link
Contributor

olydis commented Sep 26, 2017

publish job

success (version: 2.0.14)

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.

Left a few comments, event though this is now merged, sorry it took me longer to get to this review.

this.BaseModelType.Extensions.ContainsKey(AzureExtensions.AzureResourceExtension))
{
if (!resourceOrSubResourceRegEx.IsMatch(typeName) || !IsResourceModelMatchingStandardDefinition(this))
if (resourceOrSubResourceRegEx.IsMatch(typeName) || IsResourceModelMatchingStandardDefinition(this))
Copy link
Contributor

Choose a reason for hiding this comment

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

why is this an || and not and &&, I believe the name may not necessarily be enough.


if(modelName.EqualsIgnoreCase("Resource") &&
model.Properties.All(property => resourceRegEx.IsMatch(property.Name.ToString())))
if (model.Properties.All(property => subResourceRegEx.IsMatch(property.Name.ToString())) ||
Copy link
Contributor

Choose a reason for hiding this comment

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

expect(azure_resource_additional_properties.is_a?(Class)).to be_truthy

# Should not generate Resource class
expect { modules.const_get('Resource') }.to raise_error(NameError)
Copy link
Contributor

Choose a reason for hiding this comment

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

"Resource" class would exist from MsRestAzure due to the declaration at https://github.com/Azure/autorest.ruby/pull/9/files#diff-f1567bd7380ca2e7818c4047e9cdd67dR194 right?
Is this just checking that we did not generate a class withe the name "Resource"?

vishrutshah added a commit that referenced this pull request Sep 27, 2017
… azure-arm Ruby generator (#9)"

This reverts commit b14c6ef.
vishrutshah added a commit that referenced this pull request Sep 27, 2017
…Resource for azure-arm Ruby generator" (#12)

* Revert "Code changes to remove condition to check for known primary type (#7)"

This reverts commit 5b1323c.

* Revert "Updating the inheritance logic for Resoruce & SubResource for azure-arm Ruby generator (#9)"

This reverts commit b14c6ef.
@vishrutshah vishrutshah deleted the ruby-inheritance branch October 12, 2017 00:07
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.

6 participants