Skip to content

Add second placeholder to duplicate display names error message#3092

Draft
Copilot wants to merge 3 commits intomainfrom
copilot/sub-pr-3091
Draft

Add second placeholder to duplicate display names error message#3092
Copilot wants to merge 3 commits intomainfrom
copilot/sub-pr-3091

Conversation

Copy link
Contributor

Copilot AI commented Jan 8, 2026

Description

Fixed format string parameter mismatch in TfsUserMappingTool.cs where the log message had one placeholder but two parameters were being passed.

Changes

  • Added {accountName} placeholder to the error message format string in TfsUserMappingTool::GetUsersInSourceMappedToTarget
  • Error message now displays: Multiple target users found with the same display name '{displayName}' (account: {accountName}). Consider enabling MatchUsersByEmail option to avoid this issue.

Before:

Log.LogError("TfsUserMappingTool::GetUsersInSourceMappedToTarget:: Multiple target users found with the same display name '{displayName}'. "
    + "Consider enabling MatchUsersByEmail option to avoid this issue. ", 
    sourceUser.DisplayName, sourceUser.AccountName);
// Second parameter (sourceUser.AccountName) was ignored by Serilog

After:

Log.LogError("TfsUserMappingTool::GetUsersInSourceMappedToTarget:: Multiple target users found with the same display name '{displayName}' (account: {accountName}). "
    + "Consider enabling MatchUsersByEmail option to avoid this issue. ", 
    sourceUser.DisplayName, sourceUser.AccountName);
// Both parameters now properly formatted in log output

Things to be aware of

  • Logging uses serilog - All Logging should be in the format "My message that contains {item} and {item2}", item, item2! Do not use $"My message that contains {item} and {item2}" to pass text into the log strings as this disables Serilog's ability to pass that data as telemetry to Application Insights and for log highlighting.

Type of change

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

  • Build validation - project builds successfully with no warnings or errors
  • Code review - automated review passed with no issues

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

@coderabbitai
Copy link

coderabbitai bot commented Jan 8, 2026

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


Comment @coderabbitai help to get the list of available commands and usage tips.

Co-authored-by: MrHinsh <5205575+MrHinsh@users.noreply.github.com>
Base automatically changed from 3090-You-have-two-users-with-identical-display-names to main January 8, 2026 16:31
Copilot AI changed the title [WIP] Add second placeholder to duplicate display names error message Add second placeholder to duplicate display names error message Jan 8, 2026
Copilot AI requested a review from MrHinsh January 8, 2026 16:32
@nkdagility-actions-bot
Copy link

Azure Static Web Apps: Your stage site is ready! Visit it here: https://blue-river-093197403-3092.westeurope.5.azurestaticapps.net

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.

2 participants