fix(F5): remove misplaced imports and align TS types with backend models#52
Merged
Conversation
Agent-Logs-Url: https://github.com/Rowuni/Q-Ready/sessions/e301478b-d998-4c7a-9901-8aa400444a1a Co-authored-by: Rowuni <125250963+Rowuni@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Review des fondations du projet POC
fix(F5): remove misplaced imports and align TS types with backend models
May 17, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR performs small cross-stack hygiene fixes by removing/moving misplaced imports in Python modules and correcting a frontend TypeScript ↔ backend Pydantic request-shape mismatch for import endpoints.
Changes:
- Promotes in-function Python imports to module scope (router/repository) and removes an unused import in the agent CLI.
- Updates
Import*RequestTypeScript interfaces to match backendImport*Payloadfield names and shapes.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| frontend/src/types/api.ts | Aligns import request interfaces (ImportCertRequest, ImportSshRequest, ImportConfigRequest) with backend Pydantic payload models. |
| backend/routers/scan.py | Moves get_scan repository import to module level (aliased to avoid name clash with route handler). |
| backend/repository.py | Moves datetime/timezone import to module level for update_scan_finished. |
| agent/scan.py | Removes unused sys import from the agent CLI entrypoint. |
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.
Foundations review (F5) — clean up import hygiene across the stack and fix a type contract mismatch between the frontend and backend.
Changes
Unused import removed
agent/scan.py: droppedimport sys(never referenced)In-function imports promoted to module level
backend/routers/scan.py:get_scanwas imported inside the route handler on every requestbackend/repository.py:datetime/timezonewere imported insideupdate_scan_finishedTypeScript ↔ Pydantic contract fixed
frontend/src/types/api.tsimport request interfaces had field names that didn't match the backend models: