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

Deprecate API and add NFW telemetry for it #70365

Merged
merged 3 commits into from Oct 17, 2023

Conversation

CyrusNajmabadi
Copy link
Member

In 17.9 we'd like to remove the logic to serialize syntax nodes to streams (see #70275 for more details on this and why it should be safe).

However, to build confidence that this will not be an issue, we're pre-emptively deprecating the API (but still keeping the logic for it) in 17.8 and also including an NFW so we can see if this gets hit in the wild for cases we don't know about.

API change was approved in API review.

@CyrusNajmabadi CyrusNajmabadi requested review from a team as code owners October 12, 2023 23:00
@dotnet-issue-labeler dotnet-issue-labeler bot added Area-Compilers untriaged Issues and PRs which have not yet been triaged by a lead labels Oct 12, 2023
@CyrusNajmabadi
Copy link
Member Author

@arkalyanms @phil-allen-msft for QB.

@@ -194,6 +196,8 @@ public static SyntaxNode DeserializeFrom(Stream stream, CancellationToken cancel
throw new InvalidOperationException(CodeAnalysisResources.TheStreamCannotBeReadFrom);
}

// Report NFW to see if this is being used in the wild.
FatalError.ReportAndPropagate(new SerializationDeprecationException());
Copy link
Member Author

Choose a reason for hiding this comment

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

@jasonmalinowski does this look correct wrt to reporting a good NFW we can trak on our side?

Copy link
Member

Choose a reason for hiding this comment

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

I'd use ReportAndCatch; as discussed it doesn't change anything beyond the return code (if it were being used in an exception filter), but this as written might make people think this will actually throw this.

Copy link
Member Author

Choose a reason for hiding this comment

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

not available at this layer :)

@@ -13,6 +13,8 @@
using Roslyn.Test.Utilities;
using Xunit;

#pragma warning disable CS0618 // Type or member is obsolete
Copy link
Member Author

Choose a reason for hiding this comment

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

@jasonmalinowski the presumption here is that we do not actual send NFWs for compiler unit tests.

@@ -1403,10 +1405,26 @@ public virtual void SerializeTo(Stream stream, CancellationToken cancellationTok
throw new InvalidOperationException(CodeAnalysisResources.TheStreamCannotBeWrittenTo);
}

// Report NFW to see if this is being used in the wild.
FatalError.ReportAndPropagate(new SerializationDeprecationException());
Copy link
Member

Choose a reason for hiding this comment

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

Same as other place.

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 the check that is causing the MVID test to fo fail.

@@ -13,6 +13,8 @@
using Microsoft.CodeAnalysis.CSharp.Syntax;
using Microsoft.CodeAnalysis.Text;

#pragma warning disable CS0618 // Type or member is obsolete
Copy link
Member

Choose a reason for hiding this comment

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

For these you could also the class itself as [Obsolete] which might make it clearer this obsolete in it's own right.

@CyrusNajmabadi
Copy link
Member Author

@jaredpar ptal.

@CyrusNajmabadi CyrusNajmabadi force-pushed the deprecateAPI branch 2 times, most recently from dadd680 to 2489912 Compare October 16, 2023 18:22
@CyrusNajmabadi
Copy link
Member Author

@dotnet/roslyn-compiler for a second pair of eyes.

@arkalyanms @phil-allen-msft as a reminder to take this for QB.

@arkalyanms
Copy link
Member

@arkalyanms @phil-allen-msft as a reminder to take this for QB.

Ready for official submission when PR merges. Tracked via https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1903056

@CyrusNajmabadi
Copy link
Member Author

@arkalyanms integration tests seem to be the same ones we're having issues with everywhere.

@CyrusNajmabadi
Copy link
Member Author

@333fred could you potentially review this? Since you're aware of hte API review around it? Thanks!

@arkalyanms arkalyanms merged commit 0cf3dfa into dotnet:release/dev17.8 Oct 17, 2023
22 of 27 checks passed
@CyrusNajmabadi CyrusNajmabadi deleted the deprecateAPI branch October 17, 2023 22:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Compilers untriaged Issues and PRs which have not yet been triaged by a lead
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants