Skip to content

fix(hex): build dashboard source URLs that resolve in the Hex UI (2.1) - #36419

Merged
ulixius9 merged 2 commits into
2.1from
ulixius9/hex-source-url-2.1
Oct 28, 2026
Merged

ulixius9 merged 2 commits into
2.1from
ulixius9/hex-source-url-2.1

Conversation

@ulixius9

@ulixius9 ulixius9 commented Oct 28, 2026 •

Copy link
Copy Markdown
Member

Describe your changes:

Backport of #36335 to 2.1.

Hex dashboard sourceUrls were built as {hostPort}/app/projects/{id}, which isn't a route Hex serves, so every "View in Hex" link was dead. Hex project URLs are scoped by the workspace UUID, which is now resolved once per run from GET /users/me:

  • Published projects link to {hostPort}/{workspaceId}/app/{projectId}; unpublished ones to the notebook (/hex/{projectId}).
  • If the workspace id can't be resolved, a warning is logged and dashboards are ingested without a sourceUrl instead of a broken one.

Both commits of #36335 cherry-picked cleanly with -x.

Type of change:

  • Bug fix

Tests:

Unit tests

  • PYTHONPATH=src python -m pytest tests/unit/topology/dashboard/test_hex.py tests/unit/topology/dashboard/test_hex_client.py on this branch → 46 passed.
  • ruff check / ruff format --check clean on the changed files.

Backend integration tests

  • Not applicable (no backend API changes).

UI screen recording:

Not applicable: ingestion-only fix.

Checklist:

🤖 Generated with Claude Code

RetriggerView in GreptileConfidence Score: 4/5

Fix the publication field mismatch before merging so published apps receive links their viewers can open.

Findings

  1. P1 Published apps open the notebook ▶

Summary

This backport builds workspace-scoped Hex links and lets dashboard ingestion continue when the workspace lookup fails.

  • Hex dashboard links use workspace routes that match each project's publish state.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Read projects] --> B[Parse Project fields]
  B --> C[Resolve cached workspace ID]
  C --> D{Workspace found?}
  D -->|No| E[Yield dashboard without sourceUrl]
  D -->|Yes| F{lastPublishedAt set?}
  F -->|Yes| G[Build workspace app link]
  F -->|No| H[Build workspace notebook link]
Loading

Reviews (1) · Last reviewed commit: "fix(hex): guard /users/me response type ..." · Reviewed by Greptile

Hex app URLs are scoped by the workspace UUID, which no project endpoint
returns. Resolve it once per run from /users/me and link published projects
to /app (viewable by everyone) and unpublished ones to the notebook (/hex).
If the workspace can't be resolved, ingest the dashboard without a link
instead of a broken one.

(cherry picked from commit 065de47)
@ulixius9
ulixius9 requested a review from a team as a code owner October 28, 2026 08:40
@ulixius9
ulixius9 requested review from akashverma0786 and removed request for a team October 28, 2026 08:40
@github-actions

Copy link
Copy Markdown
Contributor

❌ PR checklist incomplete

This PR cannot be merged until the following are addressed on its linked issue:

  • No GitHub issue is linked. Link an issue in the Development section of the PR (or add Fixes #12345 to the description). For a same-org cross-repo issue, add Fixes open-metadata/<repo>#123 to the description.

The fields live on the linked issue in the Shipping project (open the issue → right sidebar → Projects). After you set them, re-run this check (or push a commit) — issue/project changes do not re-trigger it automatically.

Maintainers can bypass this check by adding the skip-pr-checks label.

@github-actions github-actions Bot added Ingestion safe to test Add this label to run secure Github workflows on PRs labels Oct 28, 2026
@gitar-bot

gitar-bot Bot commented Oct 28, 2026 •

Copy link
Copy Markdown
Code Review ✅ Approved

🟡 Medium risk · Fetching a workspace ID and switching Hex project routes could omit dashboard links when lookup fails or the returned workspace ID is unusable.

Fixes Hex dashboard source URLs by resolving the workspace UUID once per run from GET /users/me and building published project links as {hostPort}/{workspaceId}/app/{projectId}, with unpublished ones pointing to the notebook route. Dashboards whose workspace id cannot be resolved are ingested without a sourceUrl instead of a broken one. No issues found.

Verification

Rules No rules evaluated

Functional validation Not enabled

Set up

Auto-approval Not enabled

Set up

For more verification details, comment gitar display:verbose.

Options

Display: compact → Showing compact verification results.

Comment with these commands to change the behavior for this request:

Compact
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source

if not self.workspace_id:
return None
# Only editors can open the notebook (/hex); a published app (/app) is viewable by everyone
path = "app" if project.lastPublishedAt else "hex"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Published apps open the notebook

Hex returns lastPublishedAt, but Project only accepts last_published_at for this field. When get_projects() parses the response, the timestamp stays None. This new branch therefore chooses hex even for published projects, sending app viewers to a notebook they cannot open without editor access.

Accept the API field spelling and test a published response through get_projects() before checking its URL. The current test supplies last_published_at directly, so it misses this failure.

@sonarqubecloud

Copy link
Copy Markdown

@ulixius9
ulixius9 merged commit 76ef186 into 2.1 Oct 28, 2026
69 of 71 checks passed
@ulixius9
ulixius9 deleted the ulixius9/hex-source-url-2.1 branch October 28, 2026 14:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Ingestion safe to test Add this label to run secure Github workflows on PRs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants