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

Update AutoRest C# version #21225

Closed
wants to merge 1 commit into from

Conversation

azure-sdk
Copy link
Collaborator

Update AutoRest C# version to 3.0.0-beta.20210520.2

@chamons
Copy link
Contributor

chamons commented May 20, 2021

This requires manual changes for the security attribute change.

@check-enforcer
Copy link

This pull request is protected by Check Enforcer.

What is Check Enforcer?

Check Enforcer helps ensure all pull requests are covered by at least one check-run (typically an Azure Pipeline). When all check-runs associated with this pull request pass then Check Enforcer itself will pass.

Why am I getting this message?

You are getting this message because Check Enforcer did not detect any check-runs being associated with this pull request within five minutes. This may indicate that your pull request is not covered by any pipelines and so Check Enforcer is correctly blocking the pull request being merged.

What should I do now?

If the check-enforcer check-run is not passing and all other check-runs associated with this PR are passing (excluding license-cla) then you could try telling Check Enforcer to evaluate your pull request again. You can do this by adding a comment to this pull request as follows:
/check-enforcer evaluate
Typically evaulation only takes a few seconds. If you know that your pull request is not covered by a pipeline and this is expected you can override Check Enforcer using the following command:
/check-enforcer override
Note that using the override command triggers alerts so that follow-up investigations can occur (PRs still need to be approved as normal).

What if I am onboarding a new service?

Often, new services do not have validation pipelines associated with them. In order to bootstrap pipelines for a new service, please perform following steps:

For data-plane/track 2 SDKs Issue the following command as a pull request comment:

/azp run prepare-pipelines
This will run a pipeline that analyzes the source tree and creates the pipelines necessary to build and validate your pull request. Once the pipeline has been created you can trigger the pipeline using the following comment:
/azp run net - [service] - ci

For track 1 management-plane SDKs

Please open a separate PR and to your service SDK path in this file. Once that PR has been merged, you can re-run the pipeline to trigger the verification.

@azure-sdk azure-sdk force-pushed the auto-update-autorest branch from 11989ee to f5778e6 Compare May 20, 2021 16:00
@chamons
Copy link
Contributor

chamons commented May 20, 2021

Blew away my work, again :(

@chamons
Copy link
Contributor

chamons commented May 20, 2021

Failing with:

  Failed ObserveExistingAssetConversion [15 s]
  Error Message:
   System.IO.IOException : No space left on device

Copy link
Member

@JoshLove-msft JoshLove-msft left a comment

Choose a reason for hiding this comment

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

Event Grid changes look good.

Copy link
Member

@heaths heaths left a comment

Choose a reason for hiding this comment

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

The factory isn't really needed in either KV project. See comments for details.

@@ -0,0 +1,169 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
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 a sample and doesn't need this. I'd rather not have to maintain it or complicate the sample with unnecessary code.

Copy link
Member

Choose a reason for hiding this comment

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

If this can't be elided, can you at least use the CodeModelAttribute to make it internal. I'd rather not have it in the sample, but not exposing it is next best.

@@ -0,0 +1,53 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
Copy link
Member

Choose a reason for hiding this comment

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

This doesn't add any value since all classes are constructable with public members. Can we suppress this for now? I wouldn't want to call the class name this anyway, as it doesn't follow our existing naming convention we used in other packages.

For example, can we use existing model renaming functionality to not only rename this but also hide it?

Copy link
Contributor

Choose a reason for hiding this comment

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

I'll make it internal for now. Do you need an ability to be able to remove it completely?

Copy link
Member

Choose a reason for hiding this comment

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

Don't need it, but definitely need the ability to rename it. That is not the naming convention we have used throughout all the languages SDKs for KV.

Copy link
Member

Choose a reason for hiding this comment

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

Given what you told Mariana, could you rename this to just AdministrationModelFactory. That aligns with our other model factories in our other KV packages.

@chamons
Copy link
Contributor

chamons commented May 20, 2021

I believe there is a key @AlexanderSher can add to your project to disable it.

namespace Azure.Storage.Queues
{
/// <summary> Model factory for AzureQueueStorage read-only models. </summary>
public static partial class AzureQueueStorageModelFactory
Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

Could the generator define a new attribute like CodeModelAttribute where, if provided, you use that name? That would also help resolve one of my comments.

@azure-sdk azure-sdk force-pushed the auto-update-autorest branch from 1e1db40 to d3a59b9 Compare May 20, 2021 20:13
@AlexanderSher
Copy link
Contributor

I have removed flag in the last commit, but I can bring it back. However, adding an ability to remove specific types from codegen sounds like a better, though more complicated approach.

using Azure.AI.FormRecognizer.Models;
using Azure.AI.FormRecognizer.Training;

namespace Azure.AI.FormRecognizer
Copy link
Member

@maririos maririos May 20, 2021

Choose a reason for hiding this comment

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

is there a way to change the namespace? what is the repercussion for this in FR? https://github.com/Azure/azure-sdk-for-net/blob/master/sdk/formrecognizer/Azure.AI.FormRecognizer/src/FormRecognizerModelFactory.cs#L11

Also, we are in code freeze for anything that modifies the public API for FR until we go GA next week

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, you can change namespace and type name similar to REST client:

    [CodeGenType("GeneratedModelFactory")]
    partial class MyModelFactory

/// <param name="documentId"> Document Id. </param>
/// <param name="charactersCharged"> Character charged by the API. </param>
/// <returns> A new <see cref="Document.DocumentStatusResult"/> instance for mocking. </returns>
public static DocumentStatusResult DocumentStatusResult(Uri translatedDocumentUri = default, Uri sourceDocumentUri = default, DateTimeOffset createdOn = default, DateTimeOffset lastModified = default, TranslationStatus status = default, string translateTo = default, DocumentTranslationError error = default, float progress = default, string documentId = default, long charactersCharged = default)
Copy link
Member

Choose a reason for hiding this comment

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

curious, why there are only 2 types generated here?
also, why is everything with =default?

/// <param name="certainty"> Describes the entities certainty and polarity. </param>
/// <param name="association"> Describes if the entity is the subject of the text or if it describes someone else. </param>
/// <returns> A new <see cref="TextAnalytics.HealthcareEntityAssertion"/> instance for mocking. </returns>
public static HealthcareEntityAssertion HealthcareEntityAssertion(EntityConditionality? conditionality = default, EntityCertainty? certainty = default, EntityAssociation? association = default)
Copy link
Member

Choose a reason for hiding this comment

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

I feel like there are a ton of other types missing. do you know why is that? i.e. HealthcareEntity

Copy link
Contributor

Choose a reason for hiding this comment

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

HealthcareEntity is hand-written type, the one that is generated is HealthcareEntityInternal:

This type is made internal, so there can be no public factory method for it.

Copy link
Member

@christothes christothes left a comment

Choose a reason for hiding this comment

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

tables looks good.


namespace Azure.Security.KeyVault.Administration
{
/// <summary> Model factory for AzureSecurityKeyVaultAdministration read-only models. </summary>
Copy link
Member

Choose a reason for hiding this comment

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

The name in the comment doesn't make sense. I'd just elide it from generated code and leave the comment "Model factory for read-only models." The package name really doesn't add much value to the statement anyway.

@annelo-msft
Copy link
Member

Fixes #21144

Copy link
Member

@LarryOsterman LarryOsterman left a comment

Choose a reason for hiding this comment

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

Attestation looks good.

@azure-sdk azure-sdk force-pushed the auto-update-autorest branch 2 times, most recently from aa80d4a to 1724e32 Compare May 21, 2021 17:24
namespace Azure.Search.Documents
{
/// <summary> Model factory for SearchService read-only models. </summary>
public static partial class SearchServiceModelFactory
Copy link
Contributor

Choose a reason for hiding this comment

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

Noob questions here -

  1. What is this needed for?
  2. Will I manually update this file if a change is needed (like yanking out some model type)?

Copy link
Member

@heaths heaths May 21, 2021

Choose a reason for hiding this comment

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

These classes are only for customer tests e.g. for mocking - to create models that have members customers can't otherwise set because they are response-only, for example. See https://azure.github.io/azure-sdk/dotnet_introduction.html#dotnet-mocking for more details.

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks Heath.

@azure-sdk azure-sdk force-pushed the auto-update-autorest branch from 1724e32 to 5187587 Compare May 24, 2021 15:36
@AlexanderSher
Copy link
Contributor

Replaced with #21301 to unblock other work in Autorest

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.