-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
[ApiDiff] Implementation of the new ApiDiff that reuses GenAPI features #46425
base: main
Are you sure you want to change the base?
Conversation
d8da8db
to
519ac72
Compare
src/Compatibility/ApiDiff/Microsoft.DotNet.ApiDiff.Tool/Microsoft.DotNet.ApiDiff.Tool.csproj
Show resolved
Hide resolved
src/Compatibility/ApiDiff/Microsoft.DotNet.ApiDiff.Tool/Microsoft.DotNet.ApiDiff.Tool.csproj
Outdated
Show resolved
Hide resolved
src/Compatibility/ApiDiff/Microsoft.DotNet.ApiDiff/Microsoft.DotNet.ApiDiff.csproj
Outdated
Show resolved
Hide resolved
src/Compatibility/ApiDiff/Microsoft.DotNet.ApiDiff/Microsoft.DotNet.ApiDiff.csproj
Show resolved
Hide resolved
test/Microsoft.DotNet.ApiDiff.Tests/Microsoft.DotNet.ApiDiff.Tests.csproj
Outdated
Show resolved
Hide resolved
test/Microsoft.DotNet.ApiDiff.Tests/Microsoft.DotNet.ApiDiff.Tests.csproj
Outdated
Show resolved
Hide resolved
src/Compatibility/ApiDiff/Microsoft.DotNet.ApiDiff.Tool/Microsoft.DotNet.ApiDiff.Tool.csproj
Outdated
Show resolved
Hide resolved
src/Compatibility/ApiDiff/Microsoft.DotNet.ApiDiff.Tool/Program.cs
Outdated
Show resolved
Hide resolved
src/Compatibility/ApiDiff/Microsoft.DotNet.ApiDiff/DiffConfiguration.cs
Outdated
Show resolved
Hide resolved
src/Compatibility/ApiDiff/Microsoft.DotNet.ApiDiff.Tool/Program.cs
Outdated
Show resolved
Hide resolved
src/Compatibility/ApiDiff/Microsoft.DotNet.ApiDiff/DiffGenerator.cs
Outdated
Show resolved
Hide resolved
I added a very simple test that verifies the contents of a basic DLL before and after adding one API.
|
I just noticed I didn't implement the addition of the table of contents file. Working on that. |
I think you just need to update Signing.props in this repo and tell the signing infrastructure how to sign the external assembly. This is by design afaik. @mmitche has more knowledge on this. |
Here! Lines 28 to 29 in b513b97
|
@mmitche do I sign the packages like I did in this commit? 8a94049 Or do I sign them using Lines 55 to 60 in b513b97
|
@ViktorHofer @MichaelSimons assuming we can take care of the signing problem of DiffPlex, is this the right way to exclude a src project from source-build? |
Yes - This is documented here |
Progress: setting DiffPlex resources to use no certificate got rid of the failure (pending confirming if it's the right choice, or if using The new failures are now related to the ApiDiff tool itself. Seems that the tests fail in Linux due to the wrong NewLine chars being used. |
a1110f7
to
ab99ff7
Compare
// we try to process it but we end up throwing an exception as it is unrecognized. | ||
// It's going to be fixed with https://github.com/dotnet/roslyn/pull/77102 | ||
[Fact(Skip = "https://github.com/dotnet/roslyn/issues/77101")] | ||
public void TestExcludeUnmodifiedOperator() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ericstj I implemented API exclusion in the tool. Unfortunately, it is still failing because the API needs to be processed/recognized before determining if it needs to be excluded. I added a skipped test anyway.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that I added 3 other API exclusion tests above this one, but they are excluding non-checked operators, so those work fine.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
processed/recognized before determining if it needs to be excluded
I would hope we could feed the exclusion down into the filter used for genapi. I think that should avoid trying to generate syntax for the API - since we can check if it's included before producing the syntax (just like we do for internal, for example).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, let me look at at that. Looks like I missed something.
/// <summary> | ||
/// The default attributes to exclude from the diff. | ||
/// </summary> | ||
public static readonly string[] DefaultAttributesToExclude = [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this can be improved by using the contents of this file by default: https://github.com/dotnet/runtime/blob/main/eng/DefaultGenApiDocIds.txt
Those are the attributes GenAPI excludes when generating the ref source files.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe for now, this string array is enough, and I can improve this in a follow-up PR.
…method that reads/writes to disk works.
Disallow empty table of contents. Add more file handling tests. Add innerException when syntaxGenerator.Declaration does not work.
Add a DISABLED test for explicit checked operator.
…he compat Directory.Packages.props, it's not necessary because it's already in the global Versions.props and the global Versions.Details.xml.
f3de9ae
to
27200d1
Compare
@@ -8,8 +8,4 @@ | |||
<PackageVersion Update="Microsoft.CodeAnalysis.CSharp" Version="4.4.0" /> | |||
</ItemGroup> | |||
|
|||
<ItemGroup> | |||
<PackageVersion Include="Microsoft.CodeAnalysis.Workspaces.Common" Version="$(MicrosoftCodeAnalysisWorkspacesCommonPackageVersion)" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ericstj this was not needed anymore. It's in the Versions.props. I forgot to remove it in this PR, it was a temporary workaround while I merged the PR that introduced the new Versions.props and Version.Details.xml entries, which have been merged.
Follow up of #46424
This PR is part of the work needed to create an ApiDiff tool that reuses some of the code from Microsoft.DotNet.GenAPI. The idea is to make the larger PR smaller and make it easier to review: #45389
The proposed changes in this PR include: