Skip to content

refactor: group flat config sections into nested optional models #618

Closed

Description

@HosseinNejatiJavaremi

Flat config sections are large (vault 55+, scylladb 55+, temporal 50+ fields) and mix unrelated groups. Group them into nested optional models like FastAPIFormLimits.

Single PR from branch refactor/nested-config-groups to master (closes this issue); no chunk PRs. The FastAPIFormLimits rename ships separately in #620 for release 5.32.0.

Rules for every chunk:

  • Nested BaseModel, extra="forbid", UPPER_CASE fields, None = library default.
  • Env: SECTION__GROUP__FIELD.
  • Old flat fields stay, emit DeprecationWarning naming the new path, and fill the group when it is unset.
  • Behave scenarios per chunk (outline with example columns).
  • Docs and changelog only in the last chunk.

Checklist

  • 0. shared deprecated-alias helper + FastAPIFormLimits UPPER_CASE rename (files: sections/_common.py, fastapi.py, app_utils.py, app_utils_steps.py; blocks all others)
  • 1. vault: per-auth-method models + TLS + RETRY (files: vault.py; parallel-safe, after 0)
  • 2. scylladb: TLS, RETRY, RECONNECTION, SPECULATIVE_EXECUTION, PREPARED_CACHE, HEARTBEAT, POOL (files: scylladb.py; parallel-safe, after 0)
  • 3. temporal: TLS, WORKER, CLIENT_RETRY, KEEP_ALIVE, WORKFLOW, ACTIVITY (files: temporal.py; parallel-safe, after 0)
  • 4. redis: CLUSTER, SENTINEL, TLS, RETRY, TIMEOUTS (files: redis.py; parallel-safe, after 0)
  • 5. sqlalchemy: POOL, COUNT_CACHE, per-driver SSL and TIMEOUTS (files: sqlalchemy.py; parallel-safe, after 0)
  • 6. auth: JWT, TOTP, PASSWORD_POLICY, RATE_LIMITS (files: auth.py; parallel-safe, after 0)
  • 7. keycloak: ADMIN, TLS, TOKEN_VALIDATION (files: keycloak.py; parallel-safe, after 0)
  • 8. email: TLS, POOL, ATTACHMENTS (files: email.py; parallel-safe, after 0)
  • 9. grpc: TLS, STUB_TLS (files: grpc.py; parallel-safe, after 0)
  • 10. kafka: SASL, SSL, TIMEOUTS, producer/consumer groups (files: kafka.py; parallel-safe, after 0)
  • 11. elasticsearch: AUTH, TLS, RETRY (files: elasticsearch.py; parallel-safe, after 0)
  • 12. otel: TRACES, METRICS, LOGS, PUSHGATEWAY (files: otel.py; parallel-safe, after 0)
  • 13. uvicorn + FastAPI middleware groups: TLS, WEBSOCKET, LIMITS, CORS, GZIP, TRUSTED_HOST, HTTPS_REDIRECT (files: uvicorn.py, fastapi.py; after 0)
  • 14. docs + changelog (files: docs/api_reference/configs.md, changelog; after all)

Activity

  1. added
    area:configs
    priority:medium
    refactor
    on Nov 21, 2026
  2. github-actions commented on Nov 21, 2026

    @github-actions
    Contributor

    Merged #620: fix(config): use UPPER_CASE fields in FastAPIFormLimits

  3. HosseinNejatiJavaremi commented on Nov 21, 2026

    @HosseinNejatiJavaremi
    MemberAuthor

    Single PR: #622 (draft). Sections land as commits on its branch; items are ticked as each is pushed.

  4. HosseinNejatiJavaremi commented on Nov 21, 2026

    @HosseinNejatiJavaremi
    MemberAuthor

    Status on #622: done and pushed: helper, vault, scylladb, temporal, redis, elasticsearch, sqlalchemy (POOL, COUNT_CACHE only), auth, keycloak, email, grpc, kafka (SASL, SSL only), fastapi middleware groups, docs. Not grouped on purpose: sqlalchemy per-driver SSL/timeouts (DSN-parsing validators write them), kafka timeout groups (cross-field validators), uvicorn (FASTAPI mirrors its flat names). Open: otel (100+ consumers, standard OTEL_* env mapping by field name). Changelog is skipped per changelog.mdc (only on request).

  5. HosseinNejatiJavaremi commented on Nov 21, 2026

    @HosseinNejatiJavaremi
    MemberAuthor

    Added to #622: uvicorn (TLS, WEBSOCKET, LIMITS; the FASTAPI mirror still falls back) and otel PUSHGATEWAY. Per-signal OTLP groups stay flat: the standard OTEL_* env mapping fills them by flat field name.

  6. github-actions commented on Nov 21, 2026

    @github-actions
    Contributor

    Merged #622: refactor(config): group flat config sections into nested models

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:configspriority:mediumrefactor

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions