This repository was archived by the owner on Apr 24, 2025. It is now read-only.
Upgrade to Aspire 9.1, new support to Codespaces#7
Merged
elbruno merged 5 commits intoAzure-Samples:mainfrom Feb 25, 2025
elbruno:main
Merged
Upgrade to Aspire 9.1, new support to Codespaces#7elbruno merged 5 commits intoAzure-Samples:mainfrom elbruno:main
elbruno merged 5 commits intoAzure-Samples:mainfrom
elbruno:main
Conversation
…resource requirements
Significantly refactored `MemoryContext.cs` to improve initialization, error handling, and logging. Updated `Products.csproj` to remove unnecessary references and upgrade package versions. Enhanced `Program.cs` with additional logging for memory context initialization. Modified `launchSettings.json` to include new environment variables for local development. Updated `Store.csproj`, `eShopAppHost.csproj`, and `eShopServiceDefaults.csproj` to use newer versions of various packages for improved functionality and performance.
- Added a constructor to `SearchResponse` to initialize the `Products` list. - Updated SQL database configuration in `Program.cs` to use a persistent lifetime for connections.
- Streamlined response handling in `ProductEndpoints` by removing unnecessary status code production. - Added a using directive for `Microsoft.CodeAnalysis.FlowAnalysis.DataFlow` in `MemoryContext.cs`. - Enhanced user experience in `Search.razor` with a loading spinner and improved error handling. - Implemented robust error logging in `ProductService` for internal server errors and not found responses.
DETAILS - Added instructions for reusing existing Azure resources. - Included command to set user secrets for OpenAI connection strings. - Clarified modifications needed in `program.cs` for Azure OpenAI client. - Retained note on .NET Aspire support in GitHub Codespaces with version 9.1 improvements. - Preserved telemetry section highlighting integration with Aspire Dashboard.
There was a problem hiding this comment.
Copilot reviewed 14 out of 14 changed files in this pull request and generated 1 comment.
Comments suppressed due to low confidence (1)
src/Products/Endpoints/ProductEndpoints.cs:142
- The removal of the 'Produces(StatusCodes.Status404NotFound)' declaration means that if a 404 response is returned, it will not be documented correctly. Please verify that the endpoint's response types now accurately reflect the intended API behavior.
.Produces<SearchResponse>(StatusCodes.Status200OK);
| catch (Exception ex) | ||
| { | ||
| _logger.LogError(ex, "Error during Search."); | ||
| throw ex; |
There was a problem hiding this comment.
Rethrowing the exception with 'throw ex;' resets the stack trace. Consider using 'throw;' to preserve the original stack trace.
Suggested change
| throw ex; | |
| throw; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request includes several changes to improve the .NET Aspire project, including updates to the development container configuration, enhancements to the product memory context, and improvements to the user interface for search functionality. The most important changes are listed below:
Development Container Configuration:
.devcontainer/devcontainer.jsonto use a pre-built image instead of building from a Dockerfile, added host requirements, and specified commands to run on container creation and start. [1] [2]Product Memory Context Enhancements:
MemoryContextclass to use constants, readonly fields, and added checks to prevent reinitialization. Improved logging and error handling in theInitMemoryContextAsyncandSearchmethods. [1] [2] [3] [4]User Interface Improvements:
Search.razorcomponent to provide better user feedback during search operations. [1] [2]Documentation Updates:
README.mdfile. [1] [2] [3] [4]Dependency Updates:
Products.csprojfile to use newer versions of dependencies, includingAspire.Azure.AI.OpenAIandAspire.Microsoft.EntityFrameworkCore.SqlServer. [1] [2]