Skip to content

NM-23: Configure application.yml with datasource and custom properties#4

Open
devin-ai-integration[bot] wants to merge 1 commit into
feature/java-migrationfrom
devin/1779334312-nm23-application-yml-config
Open

NM-23: Configure application.yml with datasource and custom properties#4
devin-ai-integration[bot] wants to merge 1 commit into
feature/java-migrationfrom
devin/1779334312-nm23-application-yml-config

Conversation

@devin-ai-integration
Copy link
Copy Markdown

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: Added spring.application.name, datasource credentials (via env vars with defaults), Hibernate SQL Server dialect, and renamed pics-directorypics-path to classpath:static/Pics per spec.
  • application-dev.yml: Added explicit dev datasource config, enabled show-sql, and added DEBUG-level logging for org.springframework.jdbc.datasource to satisfy AC1 (logs datasource URL on startup).
  • application-prod.yml: Externalized datasource URL, username, and password via SPRING_DATASOURCE_* environment variables for production deployment.
  • AppConfig.java: Renamed picsDirectorypicsPath (getter/setter) to match the pics-path YAML key.
  • CatalogApplication.java: Added @EventListener(ApplicationReadyEvent.class) that logs active profiles, datasource URL, and all custom app.* properties on startup.
  • Test application.yml: Updated pics-directorypics-path for consistency.

Acceptance Criteria:

  • App starts with --spring.profiles.active=dev and logs datasource URL ✓
  • Properties are accessible via @Value annotations ✓ (verified via existing @Value("${app.use-customization-data:false}") in CatalogDbInitializer)

Jira: NM-23

Review & Testing Checklist for Human

  • Run ./mvnw spring-boot:run -Dspring-boot.run.profiles=dev and verify startup logs show the datasource URL and custom properties
  • Verify @Value("${app.pics-path}") resolves correctly in a test controller or injected bean
  • Confirm application-prod.yml environment variable references (SPRING_DATASOURCE_URL, SPRING_DATASOURCE_USERNAME, SPRING_DATASOURCE_PASSWORD) are compatible with your deployment environment

Notes

  • Build and tests pass locally (./mvnw clean compile and ./mvnw test both succeed).
  • The AppConfig property rename from picsDirectory to picsPath is a breaking change for any code referencing getPicsDirectory() — currently no callers exist outside AppConfig itself.
  • The datasource URL uses encrypt=true;trustServerCertificate=true for SQL Server compatibility.

Link to Devin session: https://partner-workshops.devinenterprise.com/sessions/38a397f224e242c18fcdcb0312dace2c

- 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
@devin-ai-integration
Copy link
Copy Markdown
Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

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.

0 participants