Skip to content

feat(config-service): implement RFC-0001 config-service (Phase 1 + Phase 2)#57

Open
LostPointer wants to merge 1 commit intoDafeCpp:developfrom
LostPointer:feat/config-service
Open

feat(config-service): implement RFC-0001 config-service (Phase 1 + Phase 2)#57
LostPointer wants to merge 1 commit intoDafeCpp:developfrom
LostPointer:feat/config-service

Conversation

@LostPointer
Copy link
Copy Markdown
Contributor

Summary

  • Реализует RFC-0001: runtime-конфигурация платформы (feature flags, QoS, kill-switches) на порту 8005
  • Полный CRUD с optimistic locking (If-Match), idempotency keys, dry-run, rollback, bulk-эндпоинт с ETag, RBAC, редакция sensitive-значений, paranoid-read, compat-проверки JSON Schema
  • Инфраструктура: инит БД config_db, docker-compose сервисы config-migrate + config-service, Makefile-цели

Что входит

Новый сервис (projects/backend/services/config-service/):

  • api/ — aiohttp routes: /api/v1/config CRUD, /rollback, /history, /activate, /deactivate, /api/v1/configs/bulk, /api/v1/schemas
  • services/ConfigService, SchemaService, ValidationService, BulkService, IdempotencyService, AuditService
  • repositories/ — raw asyncpg: ConfigRepo, HistoryRepo, SchemaRepo, IdempotencyRepo
  • domain/ — Pydantic v2 DTO, dataclass-модели, enums
  • migrations/ — 001 schema + 002 seed (feature_flag / qos JSON Schema)
  • workers/ — background cleanup idempotency keys

Тесты (97 всего, mypy чист):

  • 61 интеграционный (yandex-taxi-testsuite + реальный PG)
  • 36 юнит-тестов

Инфра-изменения:

  • docker-compose.yml — сервисы config-migrate, config-service
  • docker-entrypoint-initdb.d/init-multiple-databases.sh — создание config_db / config_user
  • Makefile — цели config-create-db, config-migrate, config-init; сервис добавлен в DEV_ALL_SERVICES
  • env.docker.example — переменные config-service

Test plan

  • cd projects/backend/services/config-service && poetry run pytest tests/ -q → 97 passed
  • poetry run mypy src/ → Success: no issues found in 32 source files
  • make config-init → миграции применяются без ошибок
  • make dev-upcurl http://localhost:8005/health → 200

🤖 Generated with Claude Code

…ase 2)

Runtime configuration service for feature flags, QoS parameters, and
kill-switches. Supports optimistic locking (If-Match), idempotency keys,
dry-run, rollback, bulk endpoint with ETag, RBAC, sensitive-value
redaction, paranoid-read, and schema compat checks.

Infra: postgres DB init, docker-compose services, Makefile targets.
Tests: 97 tests total (61 integration + 36 unit), mypy clean.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.

1 participant