dotnet / docs

This repository contains .NET Documentation.
https://learn.microsoft.com/dotnet
Creative Commons Attribution 4.0 International
4.27k stars 5.9k forks source link

Automation for C#/VB diagnostics area #20937

Open Youssef1313 opened 4 years ago

Youssef1313 commented 4 years ago

This is partially dependent on https://github.com/dotnet/docs/issues/20935

  1. It would be nice to have automated PRs to update f1_keywords for the undocumented messages in both C# and VB.

  2. It would also be good to have a CI check that fails on duplicate f1 (this can happen when a new documented error message PR forgets to remove the f1_keyword from the undocumented page).

  3. This could be somewhat hard, but sometimes Roslyn updates the text for error message, it would be nice if an automation can submit PRs with the updated text messages.

    For that to be done, the bot will need to do the following for each article:

    1. Get the error name from https://github.com/dotnet/roslyn/blob/master/src/Compilers/CSharp/Portable/Errors/ErrorCode.cs
    2. Get the message from https://github.com/dotnet/roslyn/blob/master/src/Compilers/CSharp/Portable/CSharpResources.resx
    3. Compare the retrieved message with the first paragraph in the doc article.
    4. Comparing will need to track {some_number} (e.g, {0}) in the retrieved error message and assume anything in place of it in the article as valid.
    5. If the comparison implied they're not equivalent, update it. The updates will need to be manually reviewed/edited due to the existence of {0}, {1}, etc.

Note that the second point about duplicate f1 won't be needed if https://github.com/dotnet/docs/issues/20198#issuecomment-683167066 was done.

BillWagner commented 4 years ago

This is a good start @Youssef1313

Adding @davidwengier @CyrusNajmabadi for discussion. Let's go over the plan and agree on the tasks and order for addressing this.