The SGIVU Config Repository is the source of truth for all microservice configurations. Proper version control practices ensure configuration changes are tracked, reviewed, and can be rolled back if needed.
Configuration changes can have significant impact on running services. Treat configuration with the same care as application code.
# Edit configuration filesvim sgivu-auth-dev.ymlvim sgivu-auth-prod.yml# Validate with yamllintyamllint *.yml
3
Commit with Descriptive Messages
Write clear commit messages that explain the change
git add sgivu-auth-dev.yml sgivu-auth-prod.ymlgit commit -m "Update auth service database connection pool settings- Increase max pool size from 10 to 20 for better throughput- Add connection timeout of 30s to prevent hanging connections- Applied to both dev and prod environments"
# ✅ Good - clear and descriptivegit commit -m "Enable SQL logging in dev environment for auth serviceAdded show-sql and format_sql properties to aid in debugginglogin issues reported by QA team. Only affects dev environment.- sgivu-auth-dev.yml: spring.jpa.show-sql = true- sgivu-auth-dev.yml: spring.jpa.properties.hibernate.format_sql = true"# ✅ Good - explains security changegit commit -m "Restrict actuator endpoints in productionLimited exposed actuator endpoints to health, info, and prometheusfor security hardening. Development remains fully open for debugging.- sgivu-gateway-prod.yml: management.endpoints.web.exposure.include- Affects production only- Aligns with security audit recommendations"# ✅ Good - documents synchronizationgit commit -m "Synchronize Redis configuration across all environmentsStandardized Redis connection settings for gateway session storage:- Consistent timeout: 1h- Namespace: spring:session:sgivu-gateway- Connection pooling parameters alignedAffects: sgivu-gateway.yml, sgivu-gateway-dev.yml, sgivu-gateway-prod.yml"
## SummaryUpdate database connection pool settings for auth service to handle increased load## Changes- **sgivu-auth-dev.yml**: Increased max pool size from 10 to 20- **sgivu-auth-prod.yml**: Increased max pool size from 10 to 30- Added connection timeout of 30 seconds to both environments## MotivationQA reported slow login times during load testing. Database connectionpool was saturated under 100 concurrent users. These changes allow theauth service to handle up to 200 concurrent connections.## Impact- **Services Affected**: sgivu-auth- **Environments**: dev, prod- **Breaking Changes**: None- **Requires Restart**: Yes, sgivu-auth service must be restarted## Testing- [x] Validated YAML syntax with yamllint- [x] Tested in local Docker environment- [x] Load tested with 150 concurrent users in dev- [x] Verified no connection timeout errors## Rollback PlanIf issues occur, revert to previous commit:```bashgit revert <this-commit-hash>
Or manually reduce pool size back to original values.
Closes #42 - Auth service connection pool saturation
## Synchronizing Values Across EnvironmentsFrom the repository conventions:> **Sincroniza puertos, URLs y credenciales entre entornos.**Certain configuration values should remain consistent across environments:### Values to Synchronize**Service Ports**: Keep base service ports consistent (use environment variables for overrides if needed)```yaml# sgivu-auth.yml (base)server: port: ${PORT:9000}
Service Discovery URLs: Eureka URLs should follow the same pattern
# All serviceseureka: client: service-url: defaultZone: ${EUREKA_URL:http://sgivu-discovery:8761/eureka}
Structural Settings: Common Spring Boot properties should match
# All service base filesspring: jpa: open-in-view: false
Security Baselines: Core security settings should be synchronized (with environment-specific adjustments)
# Base: restrict by defaultmanagement: endpoints: web: exposure: include: health, info# Dev: can be more permissivemanagement: endpoints: web: exposure: include: "*"
Periodically compare environment configurations to detect drift:
# Compare dev and prod configurationsdiff -u sgivu-auth-dev.yml sgivu-auth-prod.yml# Or use a visual diff toolgit diff --no-index sgivu-auth-dev.yml sgivu-auth-prod.yml
When: Immediately applies changes by restarting the Config Server
docker compose restart sgivu-config
Impact: All services will get new configuration on their next restart or refreshUse case: Any configuration change
Service Restart
When: Service restarts and fetches fresh configuration from Config Server
docker compose restart sgivu-auth
Impact: Only the restarted service gets new configurationUse case: Applying changes to specific services
Actuator Refresh Endpoint
When: Dynamic refresh without restart (if service supports it)
curl -X POST http://localhost:9000/actuator/refresh
Impact: Service reloads configuration without downtimeUse case: Non-structural changes (e.g., feature flags, logging levels)Limitation: Not all properties support dynamic refresh
Full Restart
When: Restart both Config Server and all services
docker compose restart sgivu-configdocker compose restart # All services
Impact: Complete system refresh with all new configurationUse case: Major configuration overhauls, troubleshooting
For critical production issues, edit directly and commit:
# Edit the problematic filevim sgivu-auth-prod.yml# Commit the fixgit add sgivu-auth-prod.ymlgit commit -m "HOTFIX: Rollback database connection pool to stable valuesReverted max pool size from 30 to 10 due to database CPU saturation.Production auth service experiencing 500 errors.Reverting to last known stable configuration."git push origin main# Restart services immediatelydocker compose restart sgivu-config sgivu-auth
# Find the last good commitgit log --oneline# Reset to that commitgit reset --hard <good-commit-hash># Force push (use with caution!)git push --force origin main# Restart all servicesdocker compose restart
Only use git reset --hard and force push in emergencies. It rewrites history and can cause issues for other team members.