Skip to content

Feature/migrate routes#47

Merged
Germanadjemian merged 3 commits intomainfrom
feature/migrate-routes
Dec 17, 2025
Merged

Feature/migrate routes#47
Germanadjemian merged 3 commits intomainfrom
feature/migrate-routes

Conversation

@TDxBruuno
Copy link
Copy Markdown
Collaborator

No description provided.

@github-actions
Copy link
Copy Markdown

🔍 PR Validation Results

Check Status
Build ✅ success
Trivy Check Security tab

View detailed results

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR refactors the routing structure to introduce API versioning and better organization by extracting routes from the main application file into dedicated router modules.

Key Changes:

  • Introduces API versioning with /api/v1 prefix for all document-related endpoints
  • Extracts base routes (/ and /health) from main.py into a dedicated base router
  • Consolidates versioned API routes under a centralized router in __init__.py

Reviewed changes

Copilot reviewed 3 out of 4 changed files in this pull request and generated 3 comments.

File Description
RAGManager/main.py Reorganizes router imports and inclusion; removes inline route definitions and unused imports
RAGManager/app/api/routes/base.py New file containing unversioned base routes (root and health check) extracted from main.py
RAGManager/app/api/routes/init.py Creates versioned API router (/api/v1) that aggregates feature-specific routers

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.


@router.get("/")
async def root():
return {"message": "RAGManager up"}
Copy link

Copilot AI Dec 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The root endpoint response message has changed from "Hello World" to "RAGManager up". This is a breaking change that could affect clients expecting the original message. Consider maintaining backward compatibility or documenting this as a breaking change.

Suggested change
return {"message": "RAGManager up"}
return {"message": "Hello World"}

Copilot uses AI. Check for mistakes.
Comment on lines +7 to +9
router = APIRouter(prefix="/api/v1")

router.include_router(documents.router) No newline at end of file
Copy link

Copilot AI Dec 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The API versioning prefix "/api/v1" introduces a breaking change. The documents endpoint will now be accessible at "/api/v1/documents/..." instead of "/documents/...". Existing clients will receive 404 errors unless they update their endpoints. Consider implementing redirects from old paths or documenting this breaking change clearly in release notes.

Suggested change
router = APIRouter(prefix="/api/v1")
router.include_router(documents.router)
# Root router (no prefix) to preserve existing unversioned endpoints,
# e.g. /documents/...
router = APIRouter()
# Versioned router for new clients, e.g. /api/v1/documents/...
versioned_router = APIRouter(prefix="/api/v1")
# Include document routes both unversioned and versioned
router.include_router(documents.router)
versioned_router.include_router(documents.router)
# Mount the versioned router under the root router
router.include_router(versioned_router)

Copilot uses AI. Check for mistakes.

@router.get("/health")
def health_check():
return {"message": "200 running..."}
Copy link

Copilot AI Dec 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The health check response message has changed from "200 corriendo..." to "200 running...". This is a breaking change that could affect clients expecting the original Spanish message. Consider maintaining backward compatibility or documenting this as a breaking change.

Suggested change
return {"message": "200 running..."}
return {"message": "200 corriendo..."}

Copilot uses AI. Check for mistakes.
@Germanadjemian Germanadjemian merged commit 259a3ce into main Dec 17, 2025
10 checks passed
@Germanadjemian Germanadjemian deleted the feature/migrate-routes branch December 17, 2025 00:38
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.

3 participants