Skip to content

chore: replace 2-string Resources.resx with constants#1786

Merged
JamieMagee merged 1 commit into
mainfrom
cleanup/remove-resx
Apr 17, 2026
Merged

chore: replace 2-string Resources.resx with constants#1786
JamieMagee merged 1 commit into
mainfrom
cleanup/remove-resx

Conversation

@JamieMagee
Copy link
Copy Markdown
Member

What

Replaces src/Microsoft.ComponentDetection.Common/Resources.resx and its auto-generated Resources.Designer.cs with a small internal static Resources class exposing the same two strings as const string.

Why

The resx file:

  • Contains exactly 2 strings (MissingComponentId, MissingNodeInDependencyGraph)
  • Has never been localized
  • Still declares System.Windows.Forms as its ResX reader/writer in <resheader> — a .NET Framework artifact

A const class is simpler, lighter (no ResourceManager), and keeps the same call sites compiling unchanged.

Changes

  • Add Resources.cs with two internal const string members
  • Delete Resources.resx and Resources.Designer.cs
  • Remove the resx-related ItemGroup from Microsoft.ComponentDetection.Common.csproj

Part 3 of a 6-PR cleanup series removing .NET-Framework-era anachronisms.

Copilot AI review requested due to automatic review settings April 17, 2026 18:21
@JamieMagee JamieMagee requested a review from a team as a code owner April 17, 2026 18:21
@JamieMagee JamieMagee requested a review from melotic April 17, 2026 18:21
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR simplifies Microsoft.ComponentDetection.Common by replacing a 2-string .resx + auto-generated designer with an internal static Resources constants class, removing legacy .NET Framework resx artifacts and avoiding ResourceManager overhead.

Changes:

  • Added Resources.cs exposing the two resource strings as internal const string.
  • Removed Resources.resx and Resources.Designer.cs.
  • Deleted the resx-related ItemGroup from the Common project file.
Show a summary per file
File Description
src/Microsoft.ComponentDetection.Common/Resources.resx Removes the unused 2-string resx resource file.
src/Microsoft.ComponentDetection.Common/Resources.Designer.cs Removes the auto-generated ResourceManager-backed resource accessor.
src/Microsoft.ComponentDetection.Common/Resources.cs Introduces an internal constants-based replacement for the previous resource accessor.
src/Microsoft.ComponentDetection.Common/Microsoft.ComponentDetection.Common.csproj Removes the resx/designer build metadata entries.

Copilot's findings

Files not reviewed (1)
  • src/Microsoft.ComponentDetection.Common/Resources.Designer.cs: Language not supported
  • Files reviewed: 3/4 changed files
  • Comments generated: 2

Comment thread src/Microsoft.ComponentDetection.Common/Resources.cs
Comment thread src/Microsoft.ComponentDetection.Common/Resources.cs
The resx contained only two never-localized strings and its <resheader> still referenced System.Windows.Forms. Replaced with an internal static Resources class with const strings; call sites are unchanged.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@JamieMagee JamieMagee force-pushed the cleanup/remove-resx branch from 008bb49 to 3f0bca9 Compare April 17, 2026 21:34
@JamieMagee JamieMagee enabled auto-merge (squash) April 17, 2026 21:34
@JamieMagee JamieMagee merged commit bcf8390 into main Apr 17, 2026
19 of 24 checks passed
@JamieMagee JamieMagee deleted the cleanup/remove-resx branch April 17, 2026 21:41
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 17, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 0.0%. Comparing base (6335b25) to head (3f0bca9).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@     Coverage Diff      @@
##   main   #1786   +/-   ##
============================
============================

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants