Skip to content

Comments

[tools] Convert tools/diff-to-html to a C# script in scripts/diff-to-html#24756

Merged
rolfbjarne merged 2 commits intomainfrom
dev/rolf/diff-to-html
Feb 21, 2026
Merged

[tools] Convert tools/diff-to-html to a C# script in scripts/diff-to-html#24756
rolfbjarne merged 2 commits intomainfrom
dev/rolf/diff-to-html

Conversation

@rolfbjarne
Copy link
Member

@rolfbjarne rolfbjarne commented Feb 20, 2026

Replace the old Mono csharp script with a proper .NET project following
the scripts/ directory pattern. Update compare-commits.sh to use the
new script via dotnet run.

This fixes a problem with api-diff not working

…html

Replace the old Mono csharp script with a proper .NET project following
the scripts/ directory pattern. Update compare-commits.sh to use the
new script via dotnet run.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copy link
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 migrates the tools/diff-to-html Mono csharp script to a modern .NET project in scripts/diff-to-html, following the established pattern for C# scripts in the repository. The script converts unified diff files into styled HTML pages for easier viewing.

Changes:

  • Converted Mono csharp script to a proper .NET project with top-level statements
  • Changed from System.Web.HttpUtility.HtmlEncode to System.Net.WebUtility.HtmlEncode for modern .NET compatibility
  • Updated compare-commits.sh to invoke the script via dotnet run instead of direct execution
  • Added build system integration files (fragment.mk, csproj) following the scripts/ directory pattern

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.

Show a summary per file
File Description
tools/compare-commits.sh Updated invocation to use dotnet run --project instead of direct script execution
scripts/diff-to-html/fragment.mk Added makefile fragment for build system integration following template pattern
scripts/diff-to-html/diff-to-html.csproj Created project file targeting .NET runtime version from BundledNETCoreAppTargetFrameworkVersion
scripts/diff-to-html/diff-to-html.cs Migrated script from Mono csharp to modern C# with top-level statements and nullable reference types
scripts/diff-to-html/README.md Added documentation explaining the script's purpose and usage
Comments suppressed due to low confidence (5)

scripts/diff-to-html/diff-to-html.cs:154

  • The filename 'fn' is inserted into HTML without encoding. If the filename contains special HTML characters like '<', '>', or '&', they could break the HTML structure or create XSS vulnerabilities. Use WebUtility.HtmlEncode(fn) before inserting into the HTML output.
    scripts/diff-to-html/diff-to-html.cs:157
  • The 'line' variable is inserted into HTML without encoding. This should use WebUtility.HtmlEncode(line) to prevent HTML special characters from breaking the structure, consistent with line 184 where line content is properly encoded.
    scripts/diff-to-html/diff-to-html.cs:167
  • The 'line' variable is inserted into HTML without encoding. This should use WebUtility.HtmlEncode(line) to prevent HTML special characters from breaking the structure, consistent with line 184 where line content is properly encoded.
    scripts/diff-to-html/diff-to-html.cs:166
  • The code assumes the array 'nl' has at least 2 elements after splitting. If the line format is unexpected, accessing nl[0] or nl[1] could throw an IndexOutOfRangeException. Consider adding bounds checking to ensure the array has the expected number of elements before accessing them.
    scripts/diff-to-html/diff-to-html.cs:152
  • The code assumes the filename path has at least 2 path components (e.g., "a/b/file"). If the path is shorter, calling RemoveAt(0) twice will throw an IndexOutOfRangeException. Consider adding bounds checking before removing elements, or using Skip to safely remove the first two elements.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2
Copy link
Collaborator

✅ [PR Build #5bc5c79] Build passed (Detect API changes) ✅

Pipeline on Agent
Hash: 5bc5c79bd1127f4fd6415c67ea56311cc9197889 [PR build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

✅ [CI Build #5bc5c79] Build passed (Build packages) ✅

Pipeline on Agent
Hash: 5bc5c79bd1127f4fd6415c67ea56311cc9197889 [PR build]

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2
Copy link
Collaborator

✅ API diff for current PR / commit

NET (empty diffs)

✅ API diff vs stable

NET (empty diffs)

ℹ️ Generator diff

Generator Diff: vsdrops (html) vsdrops (raw diff) gist (raw diff) - Please review changes)

Pipeline on Agent
Hash: 5bc5c79bd1127f4fd6415c67ea56311cc9197889 [PR build]

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2
Copy link
Collaborator

✅ [CI Build #5bc5c79] Build passed (Build macOS tests) ✅

Pipeline on Agent
Hash: 5bc5c79bd1127f4fd6415c67ea56311cc9197889 [PR build]

@rolfbjarne rolfbjarne enabled auto-merge (squash) February 20, 2026 19:44
@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2
Copy link
Collaborator

🚀 [CI Build #5bc5c79] Test results 🚀

Test results

✅ All tests passed on VSTS: test results.

🎉 All 156 tests passed 🎉

Tests counts

✅ cecil: All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (iOS): All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (MacCatalyst): All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (macOS): All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (Multiple platforms): All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (tvOS): All 1 tests passed. Html Report (VSDrops) Download
✅ framework: All 2 tests passed. Html Report (VSDrops) Download
✅ fsharp: All 4 tests passed. Html Report (VSDrops) Download
✅ generator: All 5 tests passed. Html Report (VSDrops) Download
✅ interdependent-binding-projects: All 4 tests passed. Html Report (VSDrops) Download
✅ introspection: All 6 tests passed. Html Report (VSDrops) Download
✅ linker: All 44 tests passed. [attempt 4] Html Report (VSDrops) Download
✅ monotouch (iOS): All 11 tests passed. [attempt 2] Html Report (VSDrops) Download
✅ monotouch (MacCatalyst): All 15 tests passed. Html Report (VSDrops) Download
✅ monotouch (macOS): All 12 tests passed. [attempt 2] Html Report (VSDrops) Download
✅ monotouch (tvOS): All 11 tests passed. Html Report (VSDrops) Download
✅ msbuild: All 2 tests passed. Html Report (VSDrops) Download
✅ sharpie: All 1 tests passed. Html Report (VSDrops) Download
✅ windows: All 3 tests passed. Html Report (VSDrops) Download
✅ xcframework: All 4 tests passed. Html Report (VSDrops) Download
✅ xtro: All 1 tests passed. Html Report (VSDrops) Download

macOS tests

✅ Tests on macOS Monterey (12): All 5 tests passed. Html Report (VSDrops) Download
✅ Tests on macOS Ventura (13): All 5 tests passed. Html Report (VSDrops) Download
✅ Tests on macOS Sonoma (14): All 5 tests passed. Html Report (VSDrops) Download
✅ Tests on macOS Sequoia (15): All 5 tests passed. Html Report (VSDrops) Download
✅ Tests on macOS Tahoe (26): All 5 tests passed. Html Report (VSDrops) Download

Pipeline on Agent
Hash: 5bc5c79bd1127f4fd6415c67ea56311cc9197889 [PR build]

@rolfbjarne rolfbjarne merged commit 7c21d58 into main Feb 21, 2026
43 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants