Skip to content
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

Add UserMetricsModel to exception list for missing readOnly attribute. #4003

Merged
merged 1 commit into from
Sep 26, 2018
Merged

Add UserMetricsModel to exception list for missing readOnly attribute. #4003

merged 1 commit into from
Sep 26, 2018

Conversation

ttlcgl
Copy link
Contributor

@ttlcgl ttlcgl commented Sep 25, 2018

This checklist is used to make sure that common issues in a pull request are addressed. This will expedite the process of getting your pull request merged and avoid extra work on your part to fix issues discovered during the review process.

PR information

  • The title of the PR is clear and informative.
  • There are a small number of commits, each of which have an informative message. This means that previously merged commits do not appear in the history of the PR. For information on cleaning up the commits in your pull request, see this page.
  • Except for special cases involving multiple contributors, the PR is started from a fork of the main repository, not a branch.
  • If applicable, the PR references the bug/issue that it fixes.
  • Swagger files are correctly named (e.g. the api-version in the path should match the api-version in the spec).

Quality of Swagger

@AutorestCI
Copy link

AutorestCI commented Sep 25, 2018

Automation for azure-sdk-for-js

Nothing to generate for azure-sdk-for-js

@AutorestCI
Copy link

AutorestCI commented Sep 25, 2018

Automation for azure-sdk-for-python

The initial PR has been merged into your service PR:
Azure/azure-sdk-for-python#2899

@AutorestCI
Copy link

AutorestCI commented Sep 25, 2018

Automation for azure-sdk-for-java

Nothing to generate for azure-sdk-for-java

@AutorestCI
Copy link

AutorestCI commented Sep 25, 2018

Automation for azure-sdk-for-node

The initial PR has been merged into your service PR:
Azure/azure-sdk-for-node#3708

@AutorestCI
Copy link

AutorestCI commented Sep 25, 2018

Automation for azure-sdk-for-ruby

The initial PR has been merged into your service PR:
Azure/azure-sdk-for-ruby#1581

@AutorestCI
Copy link

AutorestCI commented Sep 25, 2018

Automation for azure-sdk-for-go

Nothing to generate for azure-sdk-for-go

@azuresdkci
Copy link
Contributor

Can one of the admins verify this patch?

- suppress: RequiredPropertiesMissingInResourceModel
reason: This will cause breaking changes in .NET SDK
from: trafficmanager.json
where: $.definitions.UserMetricsModel
Copy link
Member

Choose a reason for hiding this comment

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

@tatlicioglu - this is to suppress the following ARMViolation I guess:

RequiredPropertiesMissingInResourceModel/R2020/ARMViolation: Model definition 'UserMetricsModel' must have the properties 'name', 'id' and 'type' in its hierarchy and these properties must be marked as readonly.

Looking at the definition of UserMetricsModel it does have name, id and type in the hierarchy (UserMetricsModel -> ProxyResource -> Resource), but id is not readonly.

As mentioned in the suppression reason, adding readonly attribute for Resource::id will cause breaking change in the SDK (e.g. ctr for UserMetricsModel will break) that requires a major version bump for the SDK. A major version upgrade of SDK for such a small change doesn't worth.

So we might want add the work of marking id as readonly as a TODO in major version upgrade work items. At this point i'm not sure when that happens. Maybe we should introduce a process of cleaning the swaggers once in a semester or so where we fix all these issues and do a major version upgrade. Something that needs to be discussed within the team.

It looks like there are bunch of other models (Endpoint, Profile, TrafficManagerGeographicHierarchy & HeatMapModel) inherits from Resource has RequiredPropertiesMissingInResourceModel. Any reason not to suppress violations for those models?

\cc @johanste, @salameer

Copy link
Contributor

@ryansbenson ryansbenson left a comment

Choose a reason for hiding this comment

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

Reviewed

@dsgouda dsgouda merged commit b900e9e into Azure:master Sep 26, 2018
@anuchandy
Copy link
Member

@dsgouda looks like we merged this, but my question on models is not addressed. What's exactly this PR solves by suppress ing violation on one model when there exits other models with similar violation?

@dsgouda
Copy link
Contributor

dsgouda commented Sep 27, 2018

@anuchandy We discussed these concerns with @tatlicioglu and @RyanBensonMSFT and decided to move forward with this change as a hotfix. Moving forward the TrafficManager RP will be modelling these models in a way that it doesn't violate rules around Resources

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants