Skip to content

feat: add environment variable validation on service startup - #1209

Open
Mrsandeep27 wants to merge 9416 commits into
Vacademy-io:mainfrom
Mrsandeep27:feature/env-variable-validation
Open

feat: add environment variable validation on service startup#1209
Mrsandeep27 wants to merge 9416 commits into
Vacademy-io:mainfrom
Mrsandeep27:feature/env-variable-validation

Conversation

@Mrsandeep27

Copy link
Copy Markdown

Summary

Closes #1201

  • Created reusable EnvironmentValidator component in common_service that validates required env vars on ApplicationStartedEvent
  • Logs a clear error listing all missing variables and fails fast with IllegalStateException
  • Common vars (spring.datasource.url/username/password) validated by default for all services
  • Added EnvironmentValidationConfig in auth_service as an example of registering service-specific required vars
  • Other services can follow the same pattern by injecting EnvironmentValidator and calling addRequiredVariables()

Test plan

  • Start auth_service with missing datasource config and verify clear error message
  • Start auth_service with all vars set and verify "validation passed" log
  • Verify other services also get common variable validation automatically

Generated with Claude Code

Loading
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.

Add environment variable validation on service startup

9 participants