feat: Create YAML import endpoint for Tangle Deploy to preview pipeline#1829
feat: Create YAML import endpoint for Tangle Deploy to preview pipeline#1829yuechao-qin wants to merge 1 commit intomasterfrom
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. |
|
http://localhost:3000/#/import?url=http://bad-url We wanted to implement this feature for sample pipelines, but eventually went with a preloaded set of pipelines. Although, doing such importing in the browser is still more secure than doing that in the backend (which is more privileged and has access to internal resources). |
|
>/import I think we need the name to be more specific so that it does not conflict with things like importing components. Also, I'de like the frontend to minimize the number of root route "directories". In some circumstances we need to route HTTP requests between UI and API server (on same domain) and URL prefixes makes that easier. |
|
In order to properly load remote resource we would need a proxy to:
|

tangle-ui
Description
Add
/importroute to enable opening pipeline YAML files directly in the browser editor from external tools.Look at PR-28268 for Video Demos for what this PR supports.
Changes
ImportPagecomponent (src/routes/Import/index.tsx) — fetches a pipeline YAML from a URL query parameter (?url=...), imports it into IndexedDB viaimportPipelineFromYaml, and redirects to the editor/importroute inrouter.tsTest Steps
npm run start(frontend onlocalhost:3000)tangle-view-pipeline <any_pipeline.yaml> --ui-url http://localhost:3000— browser should open, show the step indicator, and redirect to the editor with the pipeline loadedhttp://localhost:3000/#/import(nourlparam) — should show "Missing 'url' parameter" error with Back to Home buttonhttp://localhost:3000/#/import?url=http://bad-url— should show fetch error UInpm test -- src/routes/Import/Import.test.tsx— all 6 tests should pass