feat(python-notebook-migration): add notebook migration orchestration service - #5262
Conversation
…he UI and lower layers
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #5262 +/- ##
============================================
+ Coverage 73.99% 74.03% +0.03%
- Complexity 3435 3439 +4
============================================
Files 1157 1158 +1
Lines 45621 45694 +73
Branches 5031 5043 +12
============================================
+ Hits 33757 33828 +71
- Misses 10184 10187 +3
+ Partials 1680 1679 -1
*This pull request uses carry forward flags. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Automated Reviewer SuggestionsBased on the
|
…k-migration service with updated LLM client)
… into migration-tool-notebook-service
|
/request-review @mengw15 |
|
Test-isolation fix touching
Fix: route the SDK call through a Since #5260 is already merged, this fix necessarily modifies that landed code, so it's part of this PR's diff. I applied the fix here on #5262 to get CI green. Flagging it because it's outside this PR's nominal scope (the notebook-migration orchestration service). @mengw15 do you want it kept here, or pulled into a dedicated follow-up PR against |
we can keep the change in this pr |
What changes were proposed in this PR?
Introduces
NotebookMigrationService, the frontend orchestration service that sits between the migration-tool UI and the lower layers: the LLM client (migration-tool-llm-client) and the backend notebook-migration microservice (migration-tool-backend-notebook-migration-service).notebook-migration.service.tsgetAvailableModels()—GET /api/modelsagainst the existing LiteLLM proxy, returns the model dropdown options.sendToAIGenerateWorkflow(notebook, modelType)— drives the fullNotebookMigrationLLMlifecycle (initialize → verify connection → convert → close infinally) and returns{ workflowContent, mappingContent }.sendNotebookToJupyter(notebookData)—POST /api/notebook-migration/set-notebook; surfaces aNotificationServicetoast on success and failure; returns1/0.getJupyterURL(),getJupyterIframeURL()— calls the matching microservice endpoints to retrieve URLs to embed.storeNotebookAndMapping(wid, vid, mappingContent, notebookContent)—POST /api/notebook-migration/store-notebook-and-mapping; returns theHttpClientobservable directly so callers can compose withswitchMap.{ [key: string]: MappingContent }keyed bymapping_wid_<workflowId>, withhasMapping,getMapping,setMapping,deleteMapping.notebook-migration.service.spec.tsgetAvailableModels: maps the LiteLLMdata[].idarray correctly; falls back to an empty array on HTTP error.sendNotebookToJupyter: success → returns1; error → returns0and toasts.getJupyterURL/getJupyterIframeURL: success → returns the URL; non-OK response or thrown error → returnsnull.setMappingthengetMappinground-trips;deleteMappingremoves the entry.storeNotebookAndMapping: makes the expectedPOSTto the persistence endpoint.Any related issues, documentation, discussions?
Closes #5261
Parent issue #4301
How was this PR tested?
The new
notebook-migration.service.spec.tsaddsHttpClientTestingModule-driven test casesWas this PR authored or co-authored using generative AI tooling?
Generated-by: Claude Code (Claude Opus 4.7)