fix(config): migrate Pydantic v1 class Config → v2 ConfigDict / SettingsConfigDict (H-6)#124
Merged
Merged
Conversation
…ngsConfigDict (H-6) Eliminates 63+ `PydanticDeprecatedSince20: Support for class-based `config` is deprecated, use ConfigDict instead` warnings emitted on every API/service boot and during every test run. BaseSettings → SettingsConfigDict: - services/fusion/app/core/config.py - services/threatintel/app/config.py BaseModel → ConfigDict (from_attributes=True on response models): - services/api/app/api/v1/endpoints/sla.py - services/api/app/api/v1/endpoints/threat_intel.py - services/api/app/api/v1/endpoints/reports.py - services/api/app/api/v1/endpoints/mssp.py - services/api/app/api/v1/endpoints/remediation.py - services/api/app/api/v1/endpoints/identity_graph.py - services/api/app/api/v1/endpoints/insider_threat.py - services/api/app/api/v1/endpoints/assets.py - services/api/app/api/v1/endpoints/posture.py - services/ueba/app/api/routes.py No schema or wire-format changes. Verified with `python -W error::DeprecationWarning` — full API surface imports clean. Refs: H-6
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Eliminates 63+
PydanticDeprecatedSince20warnings that were emitted on every API/service boot and during every test run, by migrating from Pydantic v1class Config:to the v2ConfigDict/SettingsConfigDictAPI.Scope: pure API-surface migration. No schema or wire-format changes.
Changes
BaseSettings→SettingsConfigDictservices/fusion/app/core/config.pyservices/threatintel/app/config.pyBaseModel→ConfigDict(every endpoint withfrom_attributes=True)services/api/app/api/v1/endpoints/sla.pyservices/api/app/api/v1/endpoints/threat_intel.pyservices/api/app/api/v1/endpoints/reports.pyservices/api/app/api/v1/endpoints/mssp.pyservices/api/app/api/v1/endpoints/remediation.pyservices/api/app/api/v1/endpoints/identity_graph.pyservices/api/app/api/v1/endpoints/insider_threat.pyservices/api/app/api/v1/endpoints/assets.pyservices/api/app/api/v1/endpoints/posture.pyservices/ueba/app/api/routes.pyVerification
Repo-wide grep for the deprecated patterns now returns no matches:
class Config:→ 0 hitsorm_mode = True→ 0 hits@validator(→ 0 hitsTest plan
SettingsConfigDictresolves to adict(Pydantic v2 contract)-W error::DeprecationWarningRefs: H-6
Made with Cursor