Skip to content

Conversation

Youssef1313
Copy link
Member

@Youssef1313 Youssef1313 commented Aug 15, 2025

Related to #50054

@Youssef1313 Youssef1313 force-pushed the dev/ygerges/dotnetconfig-postaction branch from 2d51c0b to b344815 Compare August 15, 2025 09:19
@Youssef1313 Youssef1313 marked this pull request as ready for review August 20, 2025 05:54
@Copilot Copilot AI review requested due to automatic review settings August 20, 2025 05:54
@Youssef1313 Youssef1313 requested a review from a team as a code owner August 20, 2025 05:54
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 adds a new PostAction processor for creating or updating dotnet.config files in template generation scenarios. The feature allows templates to automatically configure dotnet.config settings for specific sections, keys, and values.

Key Changes

  • Adds CreateOrUpdateDotnetConfigPostActionProcessor that handles creating new dotnet.config files or updating existing ones
  • Implements comprehensive test coverage for various scenarios including missing arguments, file creation, section updates, and no-op cases
  • Adds localized error and success messages for the new functionality

Reviewed Changes

Copilot reviewed 18 out of 19 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
CreateOrUpdateDotnetConfigPostActionProcessor.cs Core implementation of the new post-action processor with config file manipulation logic
CreateOrUpdateDotnetConfigPostActionTests.cs Comprehensive unit tests covering all processor scenarios
Microsoft.TemplateEngine.Cli.csproj Added dependency on Microsoft.Extensions.Configuration.Ini package
LocalizableStrings.resx Added new localizable strings for success/error messages
Components.cs Registered the new processor in the component collection
Multiple .xlf files Localization files updated with new translation entries
Files not reviewed (1)
  • src/Cli/Microsoft.TemplateEngine.Cli/LocalizableStrings.Designer.cs: Language not supported

@Youssef1313
Copy link
Member Author

@dotnet/templating-engine-maintainers @mariam-abdulla @nohwnd Please review

@Youssef1313
Copy link
Member Author

@dotnet/templating-engine-maintainers Can I please have a review here?

@joeloff
Copy link
Member

joeloff commented Aug 21, 2025

The linked issue mentions .NET 10, main is currently .NET 11. This would need to be ported for RC2 if it needs to be included in 10.0 I think

@Youssef1313
Copy link
Member Author

@joeloff Yes I'll backport after merge. And for next PRs I'll target release/10.0.1xx right away

@Youssef1313 Youssef1313 requested a review from joeloff August 21, 2025 18:13
@nohwnd
Copy link
Member

nohwnd commented Aug 22, 2025

Suggestion:

Looking at the post action that adds project to solution, there are some more things that will need to happen (probably), adding the guid of the post action to templating schema.

And the tests that actually use the action would also be nice to have here:

https://grep.app/search?f.repo.pattern=dotnet%2F&q=D396686C-DE0E-4DE6-906D-291CD29FC5DE

Maybe if this post action moved to the location of https://github.com/dotnet/sdk/blob/main/src/Cli/dotnet/Commands/New/PostActions/DotnetSlnPostActionProcessor.cs#L24

it would be nice to re-use that infrastructure and do it the same.

@Youssef1313
Copy link
Member Author

@nohwnd I addressed your feedback on adding more tests, and opened a doc update on dotnet/templating dotnet/templating#9274. For reusing logic from DotnetSlnPostActionPreprocessor, my logic here is quite different, which is more suitable for 'dotnet.config' IMO.

Ping @dotnet/templating-engine-maintainers @marcpopMSFT any concerns merging this?

@Youssef1313 Youssef1313 changed the base branch from main to release/10.0.1xx August 22, 2025 12:16
@Youssef1313 Youssef1313 requested review from a team as code owners August 22, 2025 12:16
@Youssef1313 Youssef1313 marked this pull request as draft August 22, 2025 12:22
@Youssef1313 Youssef1313 changed the base branch from release/10.0.1xx to main August 22, 2025 12:23
@Youssef1313 Youssef1313 force-pushed the dev/ygerges/dotnetconfig-postaction branch from bd6e74f to 0c27bcc Compare August 22, 2025 12:26
@Youssef1313 Youssef1313 changed the base branch from main to release/10.0.1xx August 22, 2025 12:27
@Youssef1313 Youssef1313 marked this pull request as ready for review August 22, 2025 18:09
@Youssef1313 Youssef1313 merged commit faf4349 into release/10.0.1xx Aug 26, 2025
28 checks passed
@Youssef1313 Youssef1313 deleted the dev/ygerges/dotnetconfig-postaction branch August 26, 2025 07:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants