Skip to content

Fix SDK Diff Baseline Updater Tool case-sensitivity mismatch#3346

Merged
ellahathaway merged 6 commits intomainfrom
copilot/fix-sdk-diff-pr-updater
Nov 26, 2025
Merged

Fix SDK Diff Baseline Updater Tool case-sensitivity mismatch#3346
ellahathaway merged 6 commits intomainfrom
copilot/fix-sdk-diff-pr-updater

Conversation

Copy link
Contributor

Copilot AI commented Nov 13, 2025

Plan to fix SDK Diff Baseline Updater Tool:

  • Analyze the issue and understand the root cause
  • Change updated API diff file naming in SdkContentTests.cs from lowercase 'updated' to capital 'Updated'
  • Update PRCreator.cs to use case-insensitive file matching for files starting with 'Updated'
  • Manually verify the logic with test code
  • Run code review and security checks
  • Address PR feedback: throw exception if file doesn't start with 'updated' prefix
  • Address PR feedback: hoist 'updated' string to a constant

Summary

Fixed the SDK Diff Baseline Updater Tool to properly handle API diff files by:

  1. Updated file naming (SdkContentTests.cs): Changed from updatedApiDiff.suppression to UpdatedApiDiff.suppression to match the expected naming convention
  2. Case-insensitive file matching (PRCreator.cs): Modified GetUpdatedFiles() to accept files starting with "updated" regardless of case
  3. Case-insensitive parsing (PRCreator.cs): Updated ParseUpdatedFileName() to extract filenames using case-insensitive string operations and throw if file doesn't have the expected prefix
  4. Code quality (PRCreator.cs): Hoisted the "updated" string to a constant UpdatedFilePrefix for maintainability

The tool now works with both old (lowercase) and new (capitalized) file naming conventions, ensuring backward compatibility while standardizing on capital 'U' for new files.

Security Summary

No security vulnerabilities detected by CodeQL analysis.

Original prompt

This section details on the original issue you should resolve

<issue_title>SDK Diff Baseline Updater Tool not Publishing PRs for API diffs</issue_title>
<issue_description>Example pipeline run

The api diff tests failed, but the PR updater tool did not create a PR.</issue_description>

<agent_instructions>Please change the updated API diff file be to named with a capital U. Also, please update the PR tool to take files that start with updated regardless of capitalization</agent_instructions>

Comments on the Issue (you are @copilot in this section)

@ellahathaway It looks like it's because the tool expects the updated files to start with `Updated` and the updated api diff files start with `updated`.

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

… files

- Changed API diff file naming from 'updatedApiDiff.suppression' to 'UpdatedApiDiff.suppression'
- Updated PRCreator to use case-insensitive matching for files starting with 'Updated'
- Modified ParseUpdatedFileName to handle case-insensitive extraction

Co-authored-by: ellahathaway <[email protected]>
Copilot AI changed the title [WIP] Fix SDK Diff Baseline Updater Tool for API diffs Fix SDK Diff Baseline Updater Tool case-sensitivity mismatch Nov 13, 2025
Copilot AI requested a review from ellahathaway November 13, 2025 17:46
@ellahathaway ellahathaway marked this pull request as ready for review November 13, 2025 19:03
@ellahathaway ellahathaway requested review from a team as code owners November 13, 2025 19:03
Copilot AI review requested due to automatic review settings November 13, 2025 19:03
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 fixes a case-sensitivity mismatch in the SDK Diff Baseline Updater Tool that prevented PRs from being created for API diffs. Tests generated files with lowercase "updated" prefix, but the PR creation tool only matched files starting with capitalized "Updated".

Key Changes:

  • Standardized test output to use capitalized filename prefix (UpdatedApiDiff.suppression)
  • Implemented case-insensitive file matching in the PR creator tool
  • Updated filename parsing logic to handle any capitalization of "updated" prefix

Reviewed Changes

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

File Description
test/Microsoft.DotNet.SourceBuild.Tests/SdkContentTests.cs Changed output filename from lowercase updatedApiDiff.suppression to capitalized UpdatedApiDiff.suppression to match expected naming convention
eng/tools/CreateBaselineUpdatePR/PRCreator.cs Made file matching and parsing case-insensitive to handle both existing lowercase and new capitalized filenames

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copilot AI requested a review from mmitche November 24, 2025 23:34
@ellahathaway ellahathaway merged commit 33798cf into main Nov 26, 2025
11 checks passed
@ellahathaway ellahathaway deleted the copilot/fix-sdk-diff-pr-updater branch November 26, 2025 18:39
@ellahathaway
Copy link
Member

/backport to release/10.0.1xx

@ellahathaway
Copy link
Member

/backport to release/10.0.2xx

@github-actions
Copy link
Contributor

github-actions bot commented Dec 2, 2025

Started backporting to release/10.0.1xx (link to workflow run)

@github-actions
Copy link
Contributor

github-actions bot commented Dec 2, 2025

Started backporting to release/10.0.2xx (link to workflow run)

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

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

SDK Diff Baseline Updater Tool not Publishing PRs for API diffs

4 participants