Skip to content

Fix minimum width of Author column in tabular output #49156

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 27, 2025

Conversation

v-wuzhai
Copy link
Member

@v-wuzhai v-wuzhai commented May 27, 2025

Fixes #49123

This PR increases the minimum width of the Author column in the tabular output of dotnet new search to prevent truncation of author names. This resolves a test failure caused by the output not containing the expected author string due to column width limitations.

@v-wuzhai v-wuzhai marked this pull request as ready for review May 27, 2025 07:19
@Copilot Copilot AI review requested due to automatic review settings May 27, 2025 07:19
@v-wuzhai v-wuzhai requested a review from a team as a code owner May 27, 2025 07:19
Copy link
Contributor

@Copilot 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 the truncation issue of author names in the tabular output by increasing the minimum width of the Author column, while also re-enabling the related integration test.

  • The test for filtering by author is re-enabled by removing the Skip attribute.
  • The minimum width for the Author column is increased from 10 to 12 to avoid truncation.

Reviewed Changes

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

File Description
test/dotnet-new.IntegrationTests/DotnetNewSearchTests.cs Removed the Skip attribute from the test case to validate that the fix works as expected.
src/Cli/Microsoft.TemplateEngine.Cli/TemplateSearch/CliTemplateSearchCoordinator.cs Increased the minimum column width for the Author field to mitigate name truncation issues.
Comments suppressed due to low confidence (2)

test/dotnet-new.IntegrationTests/DotnetNewSearchTests.cs:223

  • The removal of the Skip attribute re-enables the test; please verify that its expected output now accounts for the updated column width to avoid future failures.
[Theory]

src/Cli/Microsoft.TemplateEngine.Cli/TemplateSearch/CliTemplateSearchCoordinator.cs:194

  • While increasing the minimum width may resolve the truncation issue, please ensure that the change is consistent with the layout of other columns and verified using long author names.
.DefineColumn(r => r.TemplateGroupInfo.Author, LocalizableStrings.ColumnNameAuthor, TabularOutputSettings.ColumnNames.Author, defaultColumn: false, shrinkIfNeeded: true, minWidth: 12)

@nagilson nagilson merged commit a63cc7a into main May 27, 2025
31 checks passed
@nagilson nagilson deleted the dev/Jason/author-column-width branch May 27, 2025 18:52
@v-wuzhai
Copy link
Member Author

/backport to release/10.0.1xx-preview5

Copy link
Contributor

Started backporting to release/10.0.1xx-preview5: https://github.com/dotnet/sdk/actions/runs/15289072903

@v-wuzhai
Copy link
Member Author

/backport to release/8.0.1xx

Copy link
Contributor

Started backporting to release/8.0.1xx: https://github.com/dotnet/sdk/actions/runs/15289085642

@v-wuzhai
Copy link
Member Author

/backport to release/8.0.3xx

Copy link
Contributor

Started backporting to release/8.0.3xx: https://github.com/dotnet/sdk/actions/runs/15289087992

@v-wuzhai
Copy link
Member Author

/backport to release/8.0.4xx

Copy link
Contributor

Started backporting to release/8.0.4xx: https://github.com/dotnet/sdk/actions/runs/15289095579

@v-wuzhai
Copy link
Member Author

/backport to release/9.0.1xx

Copy link
Contributor

Started backporting to release/9.0.1xx: https://github.com/dotnet/sdk/actions/runs/15289117547

@v-wuzhai
Copy link
Member Author

/backport to release/9.0.3xx

Copy link
Contributor

Started backporting to release/9.0.3xx: https://github.com/dotnet/sdk/actions/runs/15289120944

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.

Title: [dotnet new] Skip failing test CanFilterAuthor_WithoutName due to unstable output
2 participants