Repository navigation
fix(hex): build dashboard source URLs that resolve in the Hex UI (2.1) - #36419
Conversation
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)
(cherry picked from commit ed3f6ec)
❌ PR checklist incompleteThis PR cannot be merged until the following are addressed on its linked issue:
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 |
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 VerificationRules No rules evaluated Functional validation Not enabledAuto-approval Not enabledFor more verification details, comment OptionsDisplay: compact → Showing compact verification results. Comment with these commands to change the behavior for this request:
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" |
There was a problem hiding this comment.
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.
|



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 fromGET /users/me:{hostPort}/{workspaceId}/app/{projectId}; unpublished ones to the notebook (/hex/{projectId}).sourceUrlinstead of a broken one.Both commits of #36335 cherry-picked cleanly with
-x.Type of change:
Tests:
Unit tests
PYTHONPATH=src python -m pytest tests/unit/topology/dashboard/test_hex.py tests/unit/topology/dashboard/test_hex_client.pyon this branch → 46 passed.ruff check/ruff format --checkclean on the changed files.Backend integration tests
UI screen recording:
Not applicable: ingestion-only fix.
Checklist:
🤖 Generated with Claude Code
Fix the publication field mismatch before merging so published apps receive links their viewers can open.
Findings
Summary
This backport builds workspace-scoped Hex links and lets dashboard ingestion continue when the workspace lookup fails.
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]Reviews (1) · Last reviewed commit: "fix(hex): guard /users/me response type ..." · Reviewed by Greptile