fix: wire lineage Export button to SaaS via extension host#1935
fix: wire lineage Export button to SaaS via extension host#1935
Conversation
The Export button on the lineage toolbar opens a popover where the user names the export and submits. The submit calls `ApiHelper.post("dbt/v4/export-lineage", ...)`, but the webview only patched `ApiHelper.get` — `post` fell through to the default no-op stub (`{}`), so the request never reached the SaaS, no toast was shown, and the popover silently closed.
- Patch `ApiHelper.post` in `LineageView.tsx` to route `dbt/v4/export-lineage` through `executeRequestInSync("exportLineage", ...)`.
- Add `exportLineage` command handler in `newLineagePanel.ts` mirroring the `sendFeedback` pattern, returning `{ url }` on success.
- Add `altimate.exportLineage(req)` posting to `dbt/v4/export-lineage` with the user's API key.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
WalkthroughA new lineage export feature is implemented across three layers: an HTTP method is added to handle export requests in the Altimate API client, command handling is wired in the panel to invoke the export with name and lineage data, and a frontend request handler is added to route POST requests to the export endpoint. ChangesLineage Export Feature
Sequence DiagramsequenceDiagram
participant UI as LineageView Component
participant Handler as NewLineagePanel Handler
participant API as AltimateRequest
participant Backend as Backend Service
UI->>Handler: exportLineage command with name & lineage_data
Handler->>API: exportLineage({name, lineage_data})
API->>Backend: POST /dbt/v4/export-lineage
Backend-->>API: {url: string}
API-->>Handler: {url: string}
Handler->>UI: success response with URL
UI->>UI: display result to user
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Suggested reviewers
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Bundle Size Reportdarwin-arm64: 74.2 MB
linux-x64: 75.9 MB
win32-x64: 76.8 MB
|
E2E results — pre-fix repro vs post-fix verifyRun on docker code-server ( Pre-fix (master @
|
| Step | Observation |
|---|---|
| 1. Click toolbar Export | Popover opens with name input + disabled inner Export — toolbar layer is fine |
2. Type repro-AI-6465-master |
Inner Export enables |
| 3. Click inner Export | Popover closes, no notification, no network request |
| 4. Playwright network log filtered for `export-lineage | altimate |
5. Extension log grep exportLineage| export-lineage |
No match — handler never invoked |
| Toolbar before click | Popover open + name typed | After clicking inner Export |
|---|---|---|
![]() |
![]() |
![]() |
Silent failure reproduced — exactly what the customer reports in AI-6465.
Post-fix (fix/AI-6465-export-lineage @ faa424a3)
API key + instance injected into code-server user settings via ALTIMATE_AI_KEY/ALTIMATE_INSTANCE_NAME env vars (local-only docker tweak, not part of this PR's diff).
| Step | Observation |
|---|---|
| 1. Click toolbar Export | Popover opens (unchanged) |
2. Type verify-AI-6465-fix |
Inner Export enables |
| 3. Click inner Export | Popover closes, toast appears: "Lineage is exported at link" |
| 4. Extension log | ProxyResolver#resolveProxy https://api.myaltimate.com/dbt/v4/export-lineage — extension host is making the SaaS call |
5. Toast link is the markdown rendering of response.url |
success path through ApiHelper.post → executeRequestInSync(\"exportLineage\", …) → altimate.exportLineage(…) → SaaS { url } |
| Toolbar after lineage render | Popover open + name typed | After clicking inner Export |
|---|---|---|
![]() |
![]() |
![]() |
Regression sweep
- Lineage render, expand, settings, reset — unchanged (touched files don't intersect)
-
sendFeedbackpath usesApiHelper.get, untouched - Jest
altimate.test.ts+newLineagePanel.test.ts: 9/9 pass - Typecheck (extension + webview): 0 new errors
- Bundles:
exportLineagesymbol present indist/extension.js;dbt/v4/export-lineageroute present inwebview_panels/dist/assets/main.js
Artifact branch
Screenshots are on the orphan branch screenshots/AI-6465 — not part of this PR's diff. Safe to delete after merge.
✅ Tests — All Passed |






Summary
The Export button on the lineage toolbar (top-right, next to Settings/Help) opened a popover but the inner submit silently failed — clicking Export did nothing visible, the popover closed, no notification, no network request.
Root cause: the inner submit calls
ApiHelper.post("dbt/v4/export-lineage", ...)(in@altimateai/ui-components), butLineageView.tsxonly patchedApiHelper.get.ApiHelper.postfell through to the default no-op stub (async () => ({}) as T), so the call resolved to{}immediately,response?.urlwasundefined, the success notification was skipped, and the popover closed.Fix: three small wires.
webview_panels/src/modules/lineage/LineageView.tsxApiHelper.postto routedbt/v4/export-lineage→executeRequestInSync("exportLineage", ...).src/webview_provider/newLineagePanel.tsexportLineagecommand handler mirroringsendFeedback; returns{ url }to the webview.src/altimate.tsaltimate.exportLineage(req)POSTing todbt/v4/export-lineagewith the user's API key.Test plan
tsc --noEmit(extension + webview): no new errorsrsbuild build --mode development: extension bundle containsexportLineagesymbolvite build(main + renderer,--minify false): webview bundle containsdbt/v4/export-lineageroutealtimate.test.ts+newLineagePanel.test.tspass (9/9)Summary by CodeRabbit