Skip to content

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

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

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

Conversation

@ulixius9

@ulixius9 ulixius9 commented Oct 28, 2026 •

Copy link
Copy Markdown
Member

Describe your changes:

Backport of #36335 to 2.0.

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 with -x. One trivial conflict in hex/client.py's imports (2.0 still imports typing.List); kept both imports.

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

The new tests must follow the repository’s required pytest style before merging; no behavioral defect was established.

Findings

  1. P2 New tests violate required style ▶

Summary

Fixes Hex dashboard links by adding the workspace ID and choosing the app or notebook route.

  • Hex dashboard links now open the right workspace page.

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 stout-yeoman 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 · Changing Hex dashboard links to workspace-scoped routes could produce inaccessible links if workspace lookup or publication status is misread.

Fixes Hex dashboard source URLs by resolving the workspace UUID once per run from GET /users/me, so published projects link to {hostPort}/{workspaceId}/app/{projectId} and unpublished ones to /hex/{projectId}. 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

self.client.client.get = MagicMock(return_value={"org": {"id": "ws-uuid"}})
project = Project(id="proj_789", title="Test", last_published_at="2026-10-01T00:00:00Z")

self.assertEqual(self.client.get_project_url(project), "https://app.hex.tech/ws-uuid/app/proj_789")

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.

P2 New tests violate required style

The added cases use self.assertEqual and self.assertIsNone, including the new missing-link test in test_hex.py. The repository’s Python guide requires pytest-style tests with plain assert statements and fixtures. Write the new cases in that style before merging; the existing unittest tests do not exempt new cases.

Context Used: CLAUDE.md (source)

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

@sonarqubecloud

Copy link
Copy Markdown

@ulixius9
ulixius9 merged commit fe86ce5 into 2.0 Oct 28, 2026
60 of 63 checks passed
@ulixius9
ulixius9 deleted the ulixius9/hex-source-url-2.0 branch October 28, 2026 14:17

This branch was previously deployed

1 inactive deployment
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