Skip to content

feat(webapp): surface run cell in the run admin panel#4308

Open
nicktrn wants to merge 3 commits into
mainfrom
feat/run-detail-cell-field
Open

feat(webapp): surface run cell in the run admin panel#4308
nicktrn wants to merge 3 commits into
mainfrom
feat/run-detail-cell-field

Conversation

@nicktrn

@nicktrn nicktrn commented Jul 20, 2026

Copy link
Copy Markdown
Collaborator

Adds a Cell field to the run detail page's admin-only panel that surfaces which cell a run executed on, when that information is present in the run's telemetry.

Why

For deployments that spread runs across multiple cells, it's useful to see which cell an individual run landed on. The admin panel shows region but not cell - this surfaces the cell whenever the run's telemetry carries it.

How

Display-only, sourced entirely from telemetry: if the run's execution span carries a trigger.cell resource attribute, the panel shows it - read via the existing getSpan path from the event store. Nothing is read from or added to the run record or the database.

  • Optional / environment-dependent: this attribute won't be present in every deployment (e.g. self-hosted, or any run whose telemetry doesn't set it). When it's absent - which is the common case - the field simply shows -. This change only surfaces the attribute; it does not produce it.
  • Admin-only: the loader gates on admin access, so only admins trigger the extra event-store read and only admins see the panel. The hot non-admin path is unchanged.
  • Best-effort + graceful: if the span isn't in the event store yet (queued/buffered/ingestion lag) or the store is briefly unreachable, the field degrades to - - it never blocks or breaks the panel. Reads both the nested and flat attribute shapes to be safe.

Scope

webapp-only. No package changes, no schema or database changes, no changes to the trigger hot path.

Testing

  • Renders - for runs with no trigger.cell attribute (e.g. local runs, or before the span is ingested).
  • Shows the cell value once the run's span is in the event store.

@nicktrn nicktrn self-assigned this Jul 20, 2026
@changeset-bot

changeset-bot Bot commented Jul 20, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 37267ea

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@coderabbitai

coderabbitai Bot commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 743b25ab-30cc-4a28-ada2-ec43470ae14c

📥 Commits

Reviewing files that changed from the base of the PR and between 7dfd4a9 and 37267ea.

📒 Files selected for processing (3)
  • apps/webapp/app/presenters/v3/SpanPresenter.server.ts
  • apps/webapp/app/routes/resources.orgs.$organizationSlug.projects.$projectParam.env.$envParam.runs.$runParam.spans.$spanParam/route.tsx
  • apps/webapp/app/v3/mollifier/syntheticSpanRun.server.ts
🚧 Files skipped from review as they are similar to previous changes (3)
  • apps/webapp/app/presenters/v3/SpanPresenter.server.ts
  • apps/webapp/app/v3/mollifier/syntheticSpanRun.server.ts
  • apps/webapp/app/routes/resources.orgs.$organizationSlug.projects.$projectParam.env.$envParam.runs.$runParam.spans.$spanParam/route.tsx
📜 Recent review details
⏰ Context from checks skipped due to timeout. (20)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (2, 12)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (9, 12)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (7, 12)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (1, 12)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (4, 12)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (3, 12)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (11, 12)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (12, 12)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (8, 12)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (5, 12)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (10, 12)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (6, 12)
  • GitHub Check: runops-guard / runops-guard
  • GitHub Check: typecheck / typecheck
  • GitHub Check: e2e-webapp / 🧪 E2E Tests: Webapp
  • GitHub Check: code-quality / code-quality
  • GitHub Check: audit
  • GitHub Check: audit
  • GitHub Check: Analyze (javascript-typescript)
  • GitHub Check: Build and publish previews

Walkthrough

The span route now authenticates with the full user, derives an admin flag, and passes both user identity and admin state to SpanPresenter. For admin requests, the presenter looks up the root span’s telemetry to resolve trigger.cell, logs lookup failures, and includes the value in the run payload. The admin run properties table displays the cell value, while synthetic span runs define cell as undefined.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description is relevant, but it does not follow the required template and omits the issue link and checklist items. Add Closes #, complete the checklist, and fill in the Testing, Changelog, and Screenshots sections using the repository template.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title is concise and accurately summarizes the main change: surfacing run cell data in the admin panel.
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.
✨ 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 feat/run-detail-cell-field

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.

devin-ai-integration[bot]

This comment was marked as resolved.

coderabbitai[bot]

This comment was marked as resolved.

devin-ai-integration[bot]

This comment was marked as resolved.

coderabbitai[bot]

This comment was marked as resolved.

@nicktrn
nicktrn force-pushed the feat/run-detail-cell-field branch from 7dfd4a9 to 37267ea Compare July 20, 2026 14:30

@devin-ai-integration devin-ai-integration Bot left a comment

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.

Devin Review found 2 new potential issues.

Open in Devin Review


export const loader = async ({ request, params }: LoaderFunctionArgs) => {
const userId = await requireUserId(request);
const user = await requireUser(request);

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.

🟡 Opening a run's detail panel now runs an extra database lookup for every user

The span-detail resource route now looks up the full user record from the database on every load (requireUser at apps/webapp/app/routes/.../spans.$spanParam/route.tsx:111) instead of the previous cookie-only check, so every user who opens a run/span panel pays an added database round-trip, not just admins.
Impact: A frequently-hit dashboard endpoint gains a per-request database query for all users, increasing load and latency contrary to the intended admin-only cost.

Why the non-admin path changed

requireUserId (previously used here) is documented as the cookie-only fast path with "zero DB queries" on the non-impersonation branch (apps/webapp/app/services/session.server.ts:82-91). The new requireUser calls getUsergetUserById, an unconditional DB fetch (apps/webapp/app/services/session.server.ts:94-110), plus a getImpersonationId read. This resource route is loaded via fetcher whenever a span/run detail panel is opened, so the extra query runs for every viewer regardless of admin status — the PR description's claim that "the hot non-admin path is unchanged" does not hold. The admin flag genuinely requires the user row, but the added cost is now borne by all users rather than gated.

Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

Comment on lines +414 to +416
const resource = rootSpan?.resourceProperties as Record<string, any> | undefined;
const value = resource?.trigger?.cell ?? resource?.["trigger.cell"];
cell = typeof value === "string" ? value : undefined;

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.

🔍 Cell attribute source shape depends on event store implementation

The cell value is read as resource?.trigger?.cell ?? resource?.["trigger.cell"] from rootSpan.resourceProperties (apps/webapp/app/presenters/v3/SpanPresenter.server.ts:414-416). This gracefully handles both nested and flat attribute shapes. Note that resourceProperties is only populated from the $resource attributes in the ClickHouse event repository (apps/webapp/app/v3/eventRepository/clickhouseEventRepository.server.ts:1916-1921). If a deployment's span for the run is served by an event store path that does not populate resourceProperties, the field will always render -. This matches the PR's stated best-effort/optional intent, so it is not a bug, but worth confirming the trigger.cell attribute is actually emitted as a resource attribute (not a span attribute) in the environments this feature targets.

Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

@pkg-pr-new

pkg-pr-new Bot commented Jul 20, 2026

Copy link
Copy Markdown

Open in StackBlitz

@trigger.dev/build

npm i https://pkg.pr.new/@trigger.dev/build@37267ea

trigger.dev

npm i https://pkg.pr.new/trigger.dev@37267ea

@trigger.dev/core

npm i https://pkg.pr.new/@trigger.dev/core@37267ea

@trigger.dev/python

npm i https://pkg.pr.new/@trigger.dev/python@37267ea

@trigger.dev/react-hooks

npm i https://pkg.pr.new/@trigger.dev/react-hooks@37267ea

@trigger.dev/redis-worker

npm i https://pkg.pr.new/@trigger.dev/redis-worker@37267ea

@trigger.dev/rsc

npm i https://pkg.pr.new/@trigger.dev/rsc@37267ea

@trigger.dev/schema-to-json

npm i https://pkg.pr.new/@trigger.dev/schema-to-json@37267ea

@trigger.dev/sdk

npm i https://pkg.pr.new/@trigger.dev/sdk@37267ea

commit: 37267ea

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.

1 participant