feat(python-notebook-migration): add notebook migration orchestration service#5262
Open
zyratlo wants to merge 2 commits into
Open
feat(python-notebook-migration): add notebook migration orchestration service#5262zyratlo wants to merge 2 commits into
zyratlo wants to merge 2 commits into
Conversation
…he UI and lower layers
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.
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, apiKey)— drives the fullNotebookMigrationLLMlifecycle (initialize → verify connection → convert → close infinally) and returns{ workflowContent, mappingContent }. Surfaces API-keyvalidation failures by throwing.
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)