Skip to content

fix: wire lineage Export button to SaaS via extension host#1935

Merged
mdesmet merged 1 commit intomasterfrom
fix/AI-6465-export-lineage
May 6, 2026
Merged

fix: wire lineage Export button to SaaS via extension host#1935
mdesmet merged 1 commit intomasterfrom
fix/AI-6465-export-lineage

Conversation

@ralphstodomingo
Copy link
Copy Markdown
Contributor

@ralphstodomingo ralphstodomingo commented May 6, 2026

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), but LineageView.tsx only patched ApiHelper.get. ApiHelper.post fell through to the default no-op stub (async () => ({}) as T), so the call resolved to {} immediately, response?.url was undefined, the success notification was skipped, and the popover closed.

Fix: three small wires.

File Change
webview_panels/src/modules/lineage/LineageView.tsx Patch ApiHelper.post to route dbt/v4/export-lineageexecuteRequestInSync("exportLineage", ...).
src/webview_provider/newLineagePanel.ts Add exportLineage command handler mirroring sendFeedback; returns { url } to the webview.
src/altimate.ts Add altimate.exportLineage(req) POSTing to dbt/v4/export-lineage with the user's API key.

Test plan

  • Typecheck tsc --noEmit (extension + webview): no new errors
  • rsbuild build --mode development: extension bundle contains exportLineage symbol
  • vite build (main + renderer, --minify false): webview bundle contains dbt/v4/export-lineage route
  • Jest: altimate.test.ts + newLineagePanel.test.ts pass (9/9)
  • Pre-fix/post-fix E2E on docker code-server (results posted as comment)
  • Manual smoke: lineage render, expand/reset, settings, sendFeedback all unaffected

Summary by CodeRabbit

  • New Features
    • Users can now export lineage data with custom naming, receiving a URL to access their exported information.

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.
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 6, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 40245440-c01d-4ffd-949e-58dadacf7d34

📥 Commits

Reviewing files that changed from the base of the PR and between d8ebb4e and faa424a.

📒 Files selected for processing (3)
  • src/altimate.ts
  • src/webview_provider/newLineagePanel.ts
  • webview_panels/src/modules/lineage/LineageView.tsx

Walkthrough

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

Changes

Lineage Export Feature

Layer / File(s) Summary
API Method
src/altimate.ts
New exportLineage method posts request with name and lineage_data to dbt/v4/export-lineage endpoint, returns object containing URL string.
Command Handler
src/webview_provider/newLineagePanel.ts
New exportLineage command branch calls altimate.exportLineage, posts success/failure responses, displays user-facing errors, and logs telemetry on failure.
Frontend Request Routing
webview_panels/src/modules/lineage/LineageView.tsx
New ApiHelper.post handler for dbt/v4/export-lineage endpoint delegates to executeRequestInSync with exportLineage operation and provided data.

Sequence Diagram

sequenceDiagram
    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
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Suggested reviewers

  • mdesmet
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically summarizes the main change: wiring the lineage Export button to communicate with the SaaS backend via the extension host.
Description check ✅ Passed The description is comprehensive, including Problem, Solution, detailed test plan, and references to the issue; all required sections are present and well-documented.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/AI-6465-export-lineage

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 6, 2026

Bundle Size Report

darwin-arm64: 74.2 MB
Category Size Compressed Files
Webview JS bundles 36.3 MB 12.3 MB 346
Native: altimate-core 35.1 MB 14.0 MB 1
Media assets 29.6 MB 25.8 MB 91
Native: zeromq 20.5 MB 8.2 MB 15
Webview images 15.3 MB 12.2 MB 18
Extension backend (JS) 2.7 MB 0.6 MB 1
Python packages 2.0 MB 0.5 MB 95
Native: other node_modules 1.0 MB 0.2 MB 139
Webview CSS 0.8 MB 0.1 MB 2
Webview other 0.5 MB 0.1 MB 5
Other 0.1 MB 26 KB 15
Total 143.9 MB 74.0 MB 728
linux-x64: 75.9 MB
Category Size Compressed Files
Native: altimate-core 41.8 MB 15.1 MB 1
Webview JS bundles 36.3 MB 12.3 MB 346
Media assets 29.6 MB 25.8 MB 91
Native: zeromq 21.9 MB 8.7 MB 16
Webview images 15.3 MB 12.2 MB 18
Extension backend (JS) 2.7 MB 0.6 MB 1
Python packages 2.0 MB 0.5 MB 95
Native: other node_modules 1.0 MB 0.2 MB 139
Webview CSS 0.8 MB 0.1 MB 2
Webview other 0.5 MB 0.1 MB 5
Other 0.1 MB 26 KB 15
Total 152.0 MB 75.7 MB 729
win32-x64: 76.8 MB
Category Size Compressed Files
Native: altimate-core 50.3 MB 16.2 MB 1
Webview JS bundles 36.3 MB 12.3 MB 346
Media assets 29.6 MB 25.8 MB 91
Native: zeromq 20.0 MB 8.1 MB 15
Webview images 15.3 MB 12.2 MB 18
Extension backend (JS) 2.7 MB 0.6 MB 1
Native: other node_modules 2.3 MB 0.7 MB 147
Python packages 2.0 MB 0.5 MB 95
Webview CSS 0.8 MB 0.1 MB 2
Webview other 0.5 MB 0.1 MB 5
Other 0.1 MB 26 KB 15
Total 159.8 MB 76.6 MB 736

@ralphstodomingo
Copy link
Copy Markdown
Contributor Author

ralphstodomingo commented May 6, 2026

E2E results — pre-fix repro vs post-fix verify

Run on docker code-server (docker-setup/) with jaffle-shop-duckdb seeded + ran (customers lineage, 1L upstream).

Pre-fix (master @ d8ebb4e7, freshly built)

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
pre-toolbar pre-popover pre-silent

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.postexecuteRequestInSync(\"exportLineage\", …)altimate.exportLineage(…) → SaaS { url }
Toolbar after lineage render Popover open + name typed After clicking inner Export
post-toolbar post-popover post-success

Regression sweep

  • Lineage render, expand, settings, reset — unchanged (touched files don't intersect)
  • sendFeedback path uses ApiHelper.get, untouched
  • Jest altimate.test.ts + newLineagePanel.test.ts: 9/9 pass
  • Typecheck (extension + webview): 0 new errors
  • Bundles: exportLineage symbol present in dist/extension.js; dbt/v4/export-lineage route present in webview_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.

@ralphstodomingo ralphstodomingo changed the title fix: [AI-6465] wire lineage Export button to SaaS via extension host fix: wire lineage Export button to SaaS via extension host May 6, 2026
@ralphstodomingo ralphstodomingo self-assigned this May 6, 2026
@ralphstodomingo ralphstodomingo marked this pull request as ready for review May 6, 2026 12:42
@ralphstodomingo ralphstodomingo requested a review from mdesmet May 6, 2026 13:11
@dev-punia-altimate
Copy link
Copy Markdown
Contributor

✅ Tests — All Passed

cc @ralphstodomingo

@mdesmet mdesmet merged commit f053960 into master May 6, 2026
21 checks passed
@mdesmet mdesmet deleted the fix/AI-6465-export-lineage branch May 6, 2026 13:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants