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

Upgrade analyzer version to 0.1.1-dev.20230613.1 #37037

Closed
wants to merge 27 commits into from
Closed
Show file tree
Hide file tree
Changes from 4 commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
c5ca5b0
Upgrade analyzer version to 0.1.1-dev.20230613.1
pshao25 Jun 15, 2023
81d6a5d
Update
pshao25 Jun 15, 2023
2a88ad2
Merge branch 'main' of https://github.com/Azure/azure-sdk-for-net int…
pshao25 Jul 7, 2023
e1215ed
Update
pshao25 Jul 12, 2023
bf4450e
Merge branch 'main' of https://github.com/Azure/azure-sdk-for-net int…
pshao25 Jul 17, 2023
0adff3b
Update
pshao25 Jul 17, 2023
c07d7d1
Update
pshao25 Jul 17, 2023
b0bef5e
Merge branch 'main' of https://github.com/Azure/azure-sdk-for-net int…
pshao25 Jul 17, 2023
56d9071
Update
pshao25 Jul 17, 2023
08b896f
Update
pshao25 Jul 18, 2023
90a0baf
Update
pshao25 Jul 18, 2023
4df596e
Update
pshao25 Jul 25, 2023
db0cdb7
Merge branch 'main' of https://github.com/Azure/azure-sdk-for-net int…
pshao25 Jul 25, 2023
eada748
Merge branch 'main' of https://github.com/Azure/azure-sdk-for-net int…
pshao25 Jul 27, 2023
6e97987
update
pshao25 Jul 27, 2023
20913a8
update
pshao25 Jul 27, 2023
ced9931
Update
pshao25 Jul 27, 2023
42ebc54
Update
pshao25 Jul 27, 2023
23cd6ba
update
pshao25 Jul 27, 2023
5a158ef
Merge branch 'main' of https://github.com/Azure/azure-sdk-for-net int…
pshao25 Jul 31, 2023
4a39793
update
pshao25 Aug 2, 2023
d1754a8
Update
pshao25 Aug 2, 2023
07da049
Merge branch 'main' of https://github.com/Azure/azure-sdk-for-net int…
pshao25 Aug 2, 2023
4b1c9dc
Update
pshao25 Aug 3, 2023
99e18d5
Update
pshao25 Aug 3, 2023
e43eb1d
Merge branch 'main' of https://github.com/Azure/azure-sdk-for-net int…
pshao25 Aug 3, 2023
0b4746d
Merge branch 'main' of https://github.com/Azure/azure-sdk-for-net int…
pshao25 Aug 15, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion eng/Packages.Data.props
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@
-->
<ItemGroup>
<PackageReference Update="Microsoft.Azure.AutoRest.CSharp" Version="3.0.0-beta.20230706.2" PrivateAssets="All" />
<PackageReference Update="Azure.ClientSdk.Analyzers" Version="0.1.1-dev.20230131.1" PrivateAssets="All" />
<PackageReference Update="Azure.ClientSdk.Analyzers" Version="0.1.1-dev.20230613.1" PrivateAssets="All" />
<PackageReference Update="coverlet.collector" Version="3.2.0" PrivateAssets="All" />
<PackageReference Update="Microsoft.CodeAnalysis.NetAnalyzers" Version="7.0.1" PrivateAssets="All" />
<PackageReference Update="Microsoft.CodeAnalysis.BannedApiAnalyzers" Version="3.3.2" PrivateAssets="All" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,4 @@
using System.Diagnostics.CodeAnalysis;

[assembly: SuppressMessage("Usage", "AZC0007: A client type should have a public constructor with equivalent parameters that doesn't take a Azure.Core.ClientOptions-derived type as the last argument", Justification = "")]
[assembly: SuppressMessage("Usage", "AZC0006: A client type should have a public constructor with equivalent parameters that takes a Azure.Core.ClientOptions-derived type as the last argument", Justification = "")]
[assembly: SuppressMessage("Usage", "AZC0002: Client method should have cancellationToken as the last optional parameter (both name and it being optional matters", Justification = "")]
[assembly: SuppressMessage("Usage", "AZC0006: A client type should have a public constructor with equivalent parameters that takes a Azure.Core.ClientOptions-derived type as the last argument", Justification = "")]
annelo-msft marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -1396,7 +1396,9 @@ private Response ToCreateResponse(string key, string label, MatchConditions requ
/// Adds an external synchronization token to ensure service requests receive up-to-date values.
/// </summary>
/// <param name="token">The synchronization token value.</param>
#pragma warning disable AZC0004 // DO provide both asynchronous and synchronous variants for all service methods.
public virtual void UpdateSyncToken(string token)
#pragma warning restore AZC0004 // DO provide both asynchronous and synchronous variants for all service methods.
{
Argument.AssertNotNull(token, nameof(token));
_syncTokenPolicy.AddToken(token);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

using System.Diagnostics.CodeAnalysis;

[assembly: SuppressMessage("Usage", "AZC0018: Protocol method should have requestContext as the last parameter and don't have model as parameter type or return type. Protocol method should not have optional parameters if ambiguity exists between protocol method and convenience method.", Justification = "Flag keep-non-overloadable-protocol-signature is on.")]
pshao25 marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -746,7 +746,9 @@ private static MediaStreamingOptionsInternal CreateMediaStreamingOptionsInternal

/// <summary> Initializes a new instance of CallConnection. <see cref="CallConnection"/>.</summary>
/// <param name="callConnectionId"> The call connection id for the GetCallConnection instance. </param>
#pragma warning disable AZC0004 // DO provide both asynchronous and synchronous variants for all service methods.
public virtual CallConnection GetCallConnection(string callConnectionId)
#pragma warning restore AZC0004 // DO provide both asynchronous and synchronous variants for all service methods.
{
using DiagnosticScope scope = _clientDiagnostics.CreateScope($"{nameof(CallAutomationClient)}.{nameof(GetCallConnection)}");
scope.Start();
Expand All @@ -762,7 +764,9 @@ public virtual CallConnection GetCallConnection(string callConnectionId)
}

/// <summary> Initializes a new instance of GetCallRecording. <see cref="CallRecording"/>.</summary>
#pragma warning disable AZC0004 // DO provide both asynchronous and synchronous variants for all service methods.
public virtual CallRecording GetCallRecording()
#pragma warning restore AZC0004 // DO provide both asynchronous and synchronous variants for all service methods.
{
using DiagnosticScope scope = _clientDiagnostics.CreateScope($"{nameof(CallAutomationClient)}.{nameof(GetCallRecording)}");
scope.Start();
Expand All @@ -778,7 +782,9 @@ public virtual CallRecording GetCallRecording()
}

/// <summary>Get Call Automation's EventProcessor for handling Call Automation's event more easily.</summary>
#pragma warning disable AZC0004 // DO provide both asynchronous and synchronous variants for all service methods.
public virtual CallAutomationEventProcessor GetEventProcessor()
#pragma warning restore AZC0004 // DO provide both asynchronous and synchronous variants for all service methods.
{
using DiagnosticScope scope = _clientDiagnostics.CreateScope($"{nameof(CallAutomationClient)}.{nameof(GetEventProcessor)}");
scope.Start();
Expand All @@ -797,7 +803,9 @@ public virtual CallAutomationEventProcessor GetEventProcessor()
/// Get source identity used by Call Automation client.
/// </summary>
/// <returns></returns>
#pragma warning disable AZC0004 // DO provide both asynchronous and synchronous variants for all service methods.
public virtual CommunicationUserIdentifier GetSourceIdentity()
#pragma warning restore AZC0004 // DO provide both asynchronous and synchronous variants for all service methods.
{
using DiagnosticScope scope = _clientDiagnostics.CreateScope($"{nameof(CallAutomationClient)}.{nameof(GetSourceIdentity)}");
scope.Start();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,9 @@ private static MediaStreamingOptionsInternal CreateMediaStreamingOptionsInternal

/// <summary> Initializes a new instance of CallConnection. <see cref="CallConnection"/>.</summary>
/// <param name="callConnectionId"> The call connection id for the GetCallConnection instance. </param>
#pragma warning disable AZC0004 // DO provide both asynchronous and synchronous variants for all service methods.
public virtual CallConnection GetCallConnection(string callConnectionId)
#pragma warning restore AZC0004 // DO provide both asynchronous and synchronous variants for all service methods.
{
using DiagnosticScope scope = _clientDiagnostics.CreateScope($"{nameof(CallAutomationClient)}.{nameof(GetCallConnection)}");
scope.Start();
Expand All @@ -446,7 +448,9 @@ public virtual CallConnection GetCallConnection(string callConnectionId)
}

/// <summary> Initializes a new instance of GetCallRecording. <see cref="CallRecording"/>.</summary>
#pragma warning disable AZC0004 // DO provide both asynchronous and synchronous variants for all service methods.
public virtual CallRecording GetCallRecording()
#pragma warning restore AZC0004 // DO provide both asynchronous and synchronous variants for all service methods.
{
using DiagnosticScope scope = _clientDiagnostics.CreateScope($"{nameof(CallAutomationClient)}.{nameof(GetCallRecording)}");
scope.Start();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public partial class ChatClient
protected ChatClient() { }
public ChatClient(System.Uri endpoint, Azure.Communication.CommunicationTokenCredential communicationTokenCredential, Azure.Communication.Chat.ChatClientOptions options = null) { }
public virtual Azure.Response<Azure.Communication.Chat.CreateChatThreadResult> CreateChatThread(string topic, System.Collections.Generic.IEnumerable<Azure.Communication.Chat.ChatParticipant> participants, string idempotencyToken = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual System.Threading.Tasks.Task<Azure.Response<Azure.Communication.Chat.CreateChatThreadResult>> CreateChatThreadAsync(string topic, System.Collections.Generic.IEnumerable<Azure.Communication.Chat.ChatParticipant> participants = null, string idempotencyToken = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual System.Threading.Tasks.Task<Azure.Response<Azure.Communication.Chat.CreateChatThreadResult>> CreateChatThreadAsync(string topic, System.Collections.Generic.IEnumerable<Azure.Communication.Chat.ChatParticipant> participants, string idempotencyToken = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
Copy link
Member

Choose a reason for hiding this comment

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

Is this a breaking change to a GA library?

Copy link
Member Author

Choose a reason for hiding this comment

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

I think it is OK. See #37037 (comment)

Copy link
Member

Choose a reason for hiding this comment

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

@tg-msft, can you confirm this is an acceptable change?

Copy link
Member

Choose a reason for hiding this comment

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

Given that we're effectively replacing a runtime NullRefEx with a compile time break per https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/communication/Azure.Communication.Chat/src/ChatClient.cs#L59-L95, I think we should take this.

+@glorialimicrosoft as an FYI of the change and that we might also want an Argument.AssertNotNull(participants, nameof(participants)) here (which isn't considered breaking to add either).

public virtual Azure.Response DeleteChatThread(string threadId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual System.Threading.Tasks.Task<Azure.Response> DeleteChatThreadAsync(string threadId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual Azure.Communication.Chat.ChatThreadClient GetChatThreadClient(string threadId) { throw null; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ protected ChatClient()
/// <param name="idempotencyToken"> If specified, the client directs that the request is repeatable; that is, that the client can make the request multiple times with the same Repeatability-Request-ID and get back an appropriate response without the server executing the request multiple times. The value of the Repeatability-Request-ID is an opaque string representing a client-generated, globally unique for all time, identifier for the request. It is recommended to use version 4 (random) UUIDs. </param>
/// <param name="cancellationToken">The cancellation token for the task.</param>
/// <exception cref="RequestFailedException">The server returned an error. See <see cref="Exception.Message"/> for details returned from the server.</exception>
public virtual async Task<Response<CreateChatThreadResult>> CreateChatThreadAsync(string topic, IEnumerable<ChatParticipant> participants = null, string idempotencyToken = null, CancellationToken cancellationToken = default)
public virtual async Task<Response<CreateChatThreadResult>> CreateChatThreadAsync(string topic, IEnumerable<ChatParticipant> participants, string idempotencyToken = null, CancellationToken cancellationToken = default)
pshao25 marked this conversation as resolved.
Show resolved Hide resolved
{
using DiagnosticScope scope = _clientDiagnostics.CreateScope($"{nameof(ChatClient)}.{nameof(CreateChatThread)}");
scope.Start();
Expand Down
Loading