Skip to content

feat(python-notebook-migration): add notebook migration orchestration service#5262

Open
zyratlo wants to merge 2 commits into
apache:mainfrom
zyratlo:migration-tool-notebook-service
Open

feat(python-notebook-migration): add notebook migration orchestration service#5262
zyratlo wants to merge 2 commits into
apache:mainfrom
zyratlo:migration-tool-notebook-service

Conversation

@zyratlo
Copy link
Copy Markdown
Contributor

@zyratlo zyratlo commented May 28, 2026

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.ts

  • getAvailableModels()GET /api/models against the existing LiteLLM proxy, returns the model dropdown options.
  • sendToAIGenerateWorkflow(notebook, modelType, apiKey) — drives the full NotebookMigrationLLM lifecycle (initialize → verify connection → convert → close in finally) and returns { workflowContent, mappingContent }. Surfaces API-key
    validation failures by throwing.
  • sendNotebookToJupyter(notebookData)POST /api/notebook-migration/set-notebook; surfaces a NotificationService toast on success and failure; returns 1 / 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 the HttpClient observable directly so callers can compose with switchMap.
  • Mapping cache — small in-memory dictionary { [key: string]: MappingContent } keyed by mapping_wid_<workflowId>, with hasMapping, getMapping, setMapping, deleteMapping.

notebook-migration.service.spec.ts

  • getAvailableModels: maps the LiteLLM data[].id array correctly; falls back to an empty array on HTTP error.
  • sendNotebookToJupyter: success → returns 1; error → returns 0 and toasts.
  • getJupyterURL / getJupyterIframeURL: success → returns the URL; non-OK response or thrown error → returns null.
  • Mapping cache: setMapping then getMapping round-trips; deleteMapping removes the entry.
  • storeNotebookAndMapping: makes the expected POST to the persistence endpoint.

Any related issues, documentation, discussions?

Closes #5261
Parent issue #4301

How was this PR tested?

The new notebook-migration.service.spec.ts adds HttpClientTestingModule-driven test cases

Was this PR authored or co-authored using generative AI tooling?

Generated-by: Claude Code (Claude Opus 4.7)

@github-actions github-actions Bot added the frontend Changes related to the frontend GUI label May 28, 2026
@Yicong-Huang Yicong-Huang changed the title feat(python-notebook-migration, frontend): add notebook migration orchestration service feat(python-notebook-migration): add notebook migration orchestration service May 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

frontend Changes related to the frontend GUI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Notebook Migration] Add frontend notebook migration orchestration service

1 participant