[WIP] Create automated report for obsolete APIs in main branch #64057
+820
−0
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Plan: Create Obsolete APIs Inventory Tool
eng/tools/ObsoleteInventory/
Summary
Created a fully functional tool that:
src/
(excluding tests, samples, benchmarks, generated code)[Obsolete]
or[ObsoleteAttribute]
--verify
mode for CI validationThe tool successfully identified 182 obsolete APIs in the repository and generated a detailed report with all required fields:
The report is sorted by introduction date (oldest first) as required.
Original prompt
Objective
Create an automated, reproducible inventory of all APIs currently marked with the Obsolete attribute in the main branch and add a generated Markdown report (ObsoletedApis.md) at the repository root. The report must list each obsolete API and the date the obsolete marking was first introduced into main (earliest commit that added the [Obsolete] attribute for that declaration), sorted from oldest to newest.
Scope
Include all C# source files under src/ (exclude tests, benchmarks, samples, eng/, tools/, obj/, bin/, generated code, and anything containing the auto-generated header). Detect any attribute forms: [Obsolete], [Obsolete("message")], [Obsolete("message", true)], and [ObsoleteAttribute(...)] (case-insensitive). Do not include members that have since had the Obsolete attribute removed (only what is currently obsolete on main). Each individual member or type with its own Obsolete attribute should appear as its own row. If both a type and a member inside it are marked obsolete independently, both appear.
Data Fields (Markdown table columns)
| API | Kind | IntroducedObsoleteDate | Commit | IsError | Message | File |
Ordering: Sort the table ascending by IntroducedObsoleteDate (oldest first). Provide a final Total count below the table.
Implementation Requirements
Acceptance Criteria
This pull request was created as a result of the following prompt from Copilot chat.
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.