designs icon indicating copy to clipboard operation
designs copied to clipboard

Proposal to provide API Compat tools

Open safern opened this issue 4 years ago • 5 comments

Design doc for: https://github.com/dotnet/core/issues/5701 Contributes to: https://github.com/dotnet/core/issues/5700

Relates to: https://github.com/dotnet/roslyn-analyzers/issues/3901

cc: @terrajobst @danmoseley @ericstj @Anipik @sharwell @ViktorHofer @stephentoub

Feel free to loop in other people that might be interested on this.

safern avatar Feb 10 '21 06:02 safern

I was wondering today whether I could reuse some of the tooling I know from dotnet repos in my own libraries. @ViktorHofer pointed me to this design.

I see many things I'd like in the design doc. This is how I imagine using them:

After adding something in csproj, dotnet build produces a text file that describes the public API and compares it with a text file that describes the previous API. When they differ on my development machine, I get a warning during the build. When they differ in the CI build, it is an error. When I think the changes are good, I can copy them over, and include them in the commit.

tmds avatar Feb 11 '21 15:02 tmds

See also https://github.com/dotnet/roslyn-analyzers/issues/3047 for some places where the Roslyn PublicApiAnalyzer could have been extended.

drewnoakes avatar Feb 12 '21 01:02 drewnoakes

I see many things I'd like in the design doc. This is how I imagine using them:

After adding something in csproj, dotnet build produces a text file that describes the public API and compares it with a text file that describes the previous API. When they differ on my development machine, I get a warning during the build. When they differ in the CI build, it is an error. When I think the changes are good, I can copy them over, and include them in the commit.

Thanks @tmds for your input and interest on this. I will push an updated doc after the feedback and your input and will describe more extensively the scenarios and how customers would use it.

See also dotnet/roslyn-analyzers#3047 for some places where the Roslyn PublicApiAnalyzer could have been extended.

Thanks, @drewnoakes, will make sure to include all of them in the list of rules. I believe most of them are already covered, but I need to confirm.

Adding [Obsolete] to a member, I think that should be configurable by excluding/including the attribute from the attributes list so that each customer can tweak about the attributes they care... maybe for a major release they want to obsolete some members and want to exclude that attribute from the errors in the compatibility checks from one release to the other.

safern avatar Feb 25 '21 00:02 safern

@safern, what do we need to do to move this forward?

ericstj avatar Jun 17 '21 13:06 ericstj

I'll update it to what we decided at the end and clean it up. Thanks!

safern avatar Jun 17 '21 15:06 safern