Skip to content

Conversation

Copilot
Copy link
Contributor

@Copilot Copilot AI commented Oct 15, 2025

Summary

This PR adds a new ObsoletionReport.md file at the repository root that provides comprehensive documentation of all [Obsolete] attribute usages across the ASP.NET Core codebase, including the historical context of when each API was marked obsolete.

What's in the Report

The report documents 195 obsolete APIs spanning from 2013 to 2025, providing:

  • Symbol Information: Name and kind (Type, Method, Property, Field, etc.) for each obsolete member
  • Location: File path relative to repository root
  • Obsolete Details: The deprecation message and whether it's marked as an error
  • Historical Context: The exact commit SHA (40 characters) and UTC timestamp when the obsolete attribute was first introduced
  • Chronological Organization: Entries sorted by introduction date (oldest to newest)

Methodology

The report was generated by:

  1. Comprehensive Search: Scanning all .cs files in the src directory for [Obsolete] and [ObsoleteAttribute] usages
  2. Git History Tracking: Using git log -L to trace each attribute line through the repository history to find the original introduction commit (not just the most recent modification)
  3. Pattern-Based Extraction: Analyzing the code structure to identify the symbol type and name
  4. Message Processing: Extracting obsolete messages, handling multi-line attributes, and creating footnotes for messages longer than 200 characters (7 footnotes total)

Use Cases

This report is valuable for:

  • API Cleanup Planning: Identifying old obsoletions that may be ready for removal
  • Migration Guidance: Understanding the timeline and context of API deprecations
  • Historical Analysis: Tracking the evolution of the ASP.NET Core API surface
  • Documentation: Providing a single source of truth for all obsolete APIs

Example Entries

The earliest obsolete API dates back to December 2013:

IHttpResponseFeature.Body - marked obsolete in favor of IHttpResponseBodyFeature.Stream

The most recent additions are from August 2025:

IWebHost, WebHostBuilder, and related types - deprecated in favor of IHost and WebApplicationBuilder

Limitations

As documented in the report's methodology section:

  • File renames/restructures may attribute to later commits if not tracked via git mv
  • Some complex declarations (nested types, enum values) may show as "Unknown" for symbol name
  • Symbol names are extracted via pattern matching and may not always be fully qualified

Files Changed

  • Added: ObsoletionReport.md (254 lines)
  • No other files modified
Original prompt

Create a new markdown document at the repository root (name it ObsoletionReport.md) that lists every occurrence of the C# obsolescence attribute usages across the codebase and the date each was introduced into the main branch.

Scope:

  • Search the entire repo for the C# attribute usages: [Obsolete], [Obsolete("..."], [ObsoleteAttribute(...)] (case-sensitive) in .cs files.
  • For each occurrence, determine (via git blame / history) the commit where the attribute (the opening '[' of the attribute) was first introduced into main (not subsequent edits). Use the original introduction commit (the earliest commit that added the attribute line).
  • Extract for each symbol:
    • SymbolName: The fully qualified symbol name if easily obtainable from the file (namespace + type + member). If this is difficult to compute reliably, fallback to TypeName or MemberName as appears in the code directly below the attribute.
    • Kind: (Type, Method, Property, Field, Event, Enum, Interface, Delegate, etc.)
    • File: Relative path from repo root.
    • ObsoleteMessage: The message string argument if present (strip surrounding quotes). If no message, leave blank.
    • IsError: True if the attribute sets error: true (or the second positional parameter is true). False otherwise.
    • IntroducedCommit: The full 40-char SHA of the commit that introduced the attribute line into main.
    • IntroducedDate: Commit author date in UTC (ISO 8601, e.g. 2020-05-17T13:45:22Z).

Output formatting:

  • Produce a markdown table sorted ascending by IntroducedDate.
  • Include a short legend and methodology section at the top describing how data was gathered (search patterns, blame to find original commit, and limitations e.g. renames or moved code may attribute to later commit if file was recreated).
  • If multiple members share the exact same Obsolete attribute line (e.g., stacked attributes applying to multiple members), list each separately if they map to distinct symbols.
  • Escape pipe characters in messages.
  • For very long messages (>200 chars) truncate with ellipsis and add a footnote section enumerating the full messages referenced by a [m#] marker in the table.
  • Do not modify any existing code or config—only add this single markdown file.

Constraints / Implementation Notes:

  • Do not alter global.json, NuGet.config, package.json, or any project code files.
  • Use existing repository tooling only if needed; otherwise a straightforward search + blame approach.
  • Ensure consistent ordering and that the final line of the file ends with a newline.

Acceptance Criteria:

  • A single new file ObsoletionReport.md at repo root.
  • Contains a markdown table with columns exactly: SymbolName | Kind | File | ObsoleteMessage | IsError | IntroducedCommit | IntroducedDate.
  • Rows sorted oldest to newest by IntroducedDate.
  • Methodology and footnotes sections present if applicable.
  • No other repository changes.

This pull request was created as a result of the following prompt from Copilot chat.

Create a new markdown document at the repository root (name it ObsoletionReport.md) that lists every occurrence of the C# obsolescence attribute usages across the codebase and the date each was introduced into the main branch.

Scope:

  • Search the entire repo for the C# attribute usages: [Obsolete], [Obsolete("..."], [ObsoleteAttribute(...)] (case-sensitive) in .cs files.
  • For each occurrence, determine (via git blame / history) the commit where the attribute (the opening '[' of the attribute) was first introduced into main (not subsequent edits). Use the original introduction commit (the earliest commit that added the attribute line).
  • Extract for each symbol:
    • SymbolName: The fully qualified symbol name if easily obtainable from the file (namespace + type + member). If this is difficult to compute reliably, fallback to TypeName or MemberName as appears in the code directly below the attribute.
    • Kind: (Type, Method, Property, Field, Event, Enum, Interface, Delegate, etc.)
    • File: Relative path from repo root.
    • ObsoleteMessage: The message string argument if present (strip surrounding quotes). If no message, leave blank.
    • IsError: True if the attribute sets error: true (or the second positional parameter is true). False otherwise.
    • IntroducedCommit: The full 40-char SHA of the commit that introduced the attribute line into main.
    • IntroducedDate: Commit author date in UTC (ISO 8601, e.g. 2020-05-17T13:45:22Z).

Output formatting:

  • Produce a markdown table sorted ascending by IntroducedDate.
  • Include a short legend and methodology section at the top describing how data was gathered (search patterns, blame to find original commit, and limitations e.g. renames or moved code may attribute to later commit if file was recreated).
  • If multiple members share the exact same Obsolete attribute line (e.g., stacked attributes applying to multiple members), list each separately if they map to distinct symbols.
  • Escape pipe characters in messages.
  • For very long messages (>200 chars) truncate with ellipsis and add a footnote section enumerating the full messages referenced by a [m#] marker in the table.
  • Do not modify any existing code or config—only add this single markdown file.

Constraints / Implementation Notes:

  • Do not alter global.json, NuGet.config, package.json, or any project code files.
  • Use existing repository tooling only if needed; otherwise a straightforward search + blame approach.
  • Ensure consistent ordering and that the final line of the file ends with a newline.

Acceptance Criteria:

  • A single new file ObsoletionReport.md at repo root.
  • Contains a markdown table with columns exactly: SymbolName | Kind | File | ObsoleteMessage | IsError | IntroducedCommit | IntroducedDate.
  • Rows sorted oldest to newest by IntroducedDate.
  • Methodology and footnotes sections present if applicable.
  • No other repository changes.

💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.

Copy link
Contributor

Greetings human! You've submitted a PR that modifies code that is shared with https://github.com/dotnet/runtime . Please make sure you synchronize this code with the changes in that repo!

@Copilot Copilot AI changed the title [WIP] Create ObsoletionReport.md for C# obsolescence attributes Add comprehensive ObsoletionReport.md tracking all obsolete APIs across the codebase Oct 15, 2025
@Copilot Copilot AI requested a review from ilonatommy October 15, 2025 14:32
Copilot finished work on behalf of ilonatommy October 15, 2025 14:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants