NM-23: Configure application.yml with datasource and custom properties#4
Open
devin-ai-integration[bot] wants to merge 1 commit into
Conversation
- Update application.yml: add spring.application.name, datasource credentials (via env vars), Hibernate dialect, rename pics-directory to pics-path per spec (classpath:static/Pics) - Update application-dev.yml: add dev datasource config, enable DEBUG logging for datasource and web layers - Update application-prod.yml: externalize datasource URL/credentials via environment variables for production deployment - Update AppConfig.java: rename picsDirectory to picsPath to match the pics-path YAML property - Add startup logging in CatalogApplication: log active profiles, datasource URL, and custom app properties on ApplicationReadyEvent - Update test application.yml: rename pics-directory to pics-path
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Configures Spring Boot YAML profiles for the eShop Catalog migration, porting datasource settings from the original .NET
Web.config(Data Source=(localdb)\MSSQLLocalDB; Initial Catalog=Microsoft.eShopOnContainers.Services.CatalogDb) and adding the custom properties specified in the ticket.Changes:
application.yml: Addedspring.application.name, datasource credentials (via env vars with defaults), Hibernate SQL Server dialect, and renamedpics-directory→pics-pathtoclasspath:static/Picsper spec.application-dev.yml: Added explicit dev datasource config, enabledshow-sql, and added DEBUG-level logging fororg.springframework.jdbc.datasourceto satisfy AC1 (logs datasource URL on startup).application-prod.yml: Externalized datasource URL, username, and password viaSPRING_DATASOURCE_*environment variables for production deployment.AppConfig.java: RenamedpicsDirectory→picsPath(getter/setter) to match thepics-pathYAML key.CatalogApplication.java: Added@EventListener(ApplicationReadyEvent.class)that logs active profiles, datasource URL, and all customapp.*properties on startup.application.yml: Updatedpics-directory→pics-pathfor consistency.Acceptance Criteria:
--spring.profiles.active=devand logs datasource URL ✓@Valueannotations ✓ (verified via existing@Value("${app.use-customization-data:false}")inCatalogDbInitializer)Jira: NM-23
Review & Testing Checklist for Human
./mvnw spring-boot:run -Dspring-boot.run.profiles=devand verify startup logs show the datasource URL and custom properties@Value("${app.pics-path}")resolves correctly in a test controller or injected beanapplication-prod.ymlenvironment variable references (SPRING_DATASOURCE_URL,SPRING_DATASOURCE_USERNAME,SPRING_DATASOURCE_PASSWORD) are compatible with your deployment environmentNotes
./mvnw clean compileand./mvnw testboth succeed).AppConfigproperty rename frompicsDirectorytopicsPathis a breaking change for any code referencinggetPicsDirectory()— currently no callers exist outsideAppConfigitself.encrypt=true;trustServerCertificate=truefor SQL Server compatibility.Link to Devin session: https://partner-workshops.devinenterprise.com/sessions/38a397f224e242c18fcdcb0312dace2c