feat: migrate legacy redirects to yaml config#313
Merged
kilodesodiq-arch merged 5 commits intoJul 17, 2026
Conversation
Moves legacy redirection maps from python literals to a config yaml file and uses pydantic-settings to parse it.
Contributor
|
Awesome work on this! Thanks for the contribution 🚀 Merging now. |
ifygreg01-best
pushed a commit
to ifygreg01-best/ChainForge
that referenced
this pull request
Jul 23, 2026
* feat: migrate legacy redirects to yaml config Moves legacy redirection maps from python literals to a config yaml file and uses pydantic-settings to parse it. * fix: bump pydantic-settings to 2.6.1 to fix YamlConfigSettingsSource import error * fix: bump pydantic to 2.9.2 to satisfy pydantic-settings 2.6.1 requirement * fix: exclude /ai/ocr from legacy redirect coverage test * fix: sync pydantic/pydantic-settings versions in requirements-prod.txt
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.
Description
Migrates the legacy redirect map from Python literals to a structured YAML configuration, increasing operational stability and unblocking future dynamic updates without requiring code deployments.
Resolves backlog item #57.
Key Changes
app/ai-service/config/legacy_redirects.yaml.pydantic-settings[yaml]to load configurations on boot inapp/ai-service/main.py. Fast-fails during startup if the file cannot be located.test_legacy_redirects.pyensuring that every legacy FastAPI route maps to an active YAML entry without omissions or dangling logic.Motivation & Context
Prevents operation fragmentation. Defining these maps natively in Python became a de-facto and operationally fragile registry. The transition cleanly splits middleware configuration from the main codebase context.
closes #265