Skip to content

feat: migrate legacy redirects to yaml config#313

Merged
kilodesodiq-arch merged 5 commits into
ChainForgee:mainfrom
Emelie-Dev:fix/issue-57-legacy-redirects
Jul 17, 2026
Merged

feat: migrate legacy redirects to yaml config#313
kilodesodiq-arch merged 5 commits into
ChainForgee:mainfrom
Emelie-Dev:fix/issue-57-legacy-redirects

Conversation

@Emelie-Dev

Copy link
Copy Markdown
Contributor

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

  • Configuration Migration: Moved routing entries to app/ai-service/config/legacy_redirects.yaml.
  • Implementation: Used pydantic-settings[yaml] to load configurations on boot in app/ai-service/main.py. Fast-fails during startup if the file cannot be located.
  • Testing: Added rigorous test suite test_legacy_redirects.py ensuring 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

Copy link
Copy Markdown
Contributor

Awesome work on this! Thanks for the contribution 🚀 Merging now.

@kilodesodiq-arch
kilodesodiq-arch merged commit 9887bcd into ChainForgee:main Jul 17, 2026
7 checks passed
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
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.

Retire hardcoded legacy → v1 redirect map

2 participants