Skip to content

feat(dashboard): link runner sets and job rows to GitHub - #79

Open
STRRL wants to merge 1 commit into
mainfrom
fix/wt5-dashboard-nav
Open

feat(dashboard): link runner sets and job rows to GitHub#79
STRRL wants to merge 1 commit into
mainfrom
fix/wt5-dashboard-nav

Conversation

@STRRL

@STRRL STRRL commented Apr 26, 2026

Copy link
Copy Markdown
Member

Summary

  • Dashboard: click runner set name to navigate to GitHub runners page #65 Runner-set names in the RUNNER SETS panel are now anchors that open the matching GitHub runners management page in a new tab. Org-scoped sets target https://github.com/organizations/{org}/settings/actions/runners; repo-scoped sets target https://github.com/{owner}/{repo}/settings/actions/runners. Falls back to plain text when the scope string is missing or unrecognized.
  • Dashboard: RECENT JOBS should link to GitHub Actions and show repo/workflow info #66 RECENT JOBS rows now show <repository> / <workflow_name> above the runner name, and the runner name itself becomes a link to the GitHub Actions workflow run page (https://github.com/{repository}/actions/runs/{workflow_run_id}) when both the repo and run id are known.

Backend additions (additive only)

The dashboard couldn't link to Actions runs without context, so this PR plumbs three new optional fields end-to-end:

  • proto/controlplane/v1/controlplane.proto: JobRecord gains repository, workflow_name, workflow_run_id.
  • internal/management/migrations/002_add_job_context.sql: adds the three matching columns to the jobs table (default '').
  • internal/management/sqlc/queries.sql + regenerated bindings: InsertJob and ListRecentJobs now read/write the new columns. InsertCompletedJob is untouched.
  • internal/controller/types.go: JobRecorder.RecordJobStarted now takes a JobStart struct so the controller can forward the GitHub JobMessageBase fields (OwnerName/RepositoryName, JobDisplayName falling back to the workflow file basename, WorkflowRunID).
  • internal/controller/jobcontext.go + table-driven tests cover the small normalization helpers.
  • internal/api/server.go: ListJobRecords copies the new fields onto the response. toProtoJobResult and the rest of the result-mapping logic are unchanged.

The frontend types/fetcher pick up the new fields and degrade gracefully when they are empty (e.g. for jobs the daemon only learned about at completion time).

WT4 boundary

Per the worktree split, this PR explicitly avoids touching:

  • RecordJobCompleted / InsertCompletedJob / toProtoJobResult
  • the fetchRecentJobs result-mapping logic in dashboard/src/api/fetchers.ts

Only additive changes were made to those areas (e.g. new optional fields read in fetchRecentJobs).

Data gap noted

Jobs whose JobStarted event was never observed by this daemon process (daemon restart mid-run, or the historical fallback path through InsertCompletedJob) will have empty repository / workflow_name / workflow_run_id. The UI hides the context line and renders the runner name as plain text in that case. Backfilling those rows would require querying the GitHub REST API and is out of scope here; it can be addressed separately, possibly together with WT4's job-tracking work.

Test plan

  • make build
  • make check (fmt-check, vet, build, lint, prek hooks, unit tests)
  • go test ./internal/controller/... ./internal/management/... ./internal/api/...
  • pnpm run build and pnpm run lint in dashboard/
  • Manual: load dashboard with at least one org-scoped and one repo-scoped runner set, click runner-set name, verify it opens the right GitHub runners page in a new tab.
  • Manual: kick off a real workflow run, wait for the job to land in RECENT JOBS, click the runner name, verify it opens the Actions run page; confirm a job recorded only at completion still renders gracefully.

Fixes #65
Fixes #66

Make runner-set names in the RUNNER SETS panel into anchors that open the
matching GitHub runners management page in a new tab (org or repo scope).

Enrich the RECENT JOBS panel with repository, workflow name, and a link to
the GitHub Actions workflow run when context is available. Falls back to a
plain runner-name row when the daemon could not capture the start event
(e.g. the daemon was restarted mid-job).

Backend additions, additive only:
- proto: add repository, workflow_name, workflow_run_id to JobRecord
- sqlite: 002_add_job_context migration adds three columns and InsertJob
  is updated to persist them
- controller: ScaleSetController now forwards owner/repo, JobDisplayName,
  and WorkflowRunID via a new JobStart struct on RecordJobStarted; helper
  functions normalize the upstream values
- api: ListJobRecords copies the new fields onto the response

Constraints: no changes to RecordJobCompleted, InsertCompletedJob,
toProtoJobResult, or the frontend result-mapping logic.

Fixes #65
Fixes #66
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying elastic-fruit-runner with  Cloudflare Pages  Cloudflare Pages

Latest commit: 713e328
Status: ✅  Deploy successful!
Preview URL: https://7353da2c.elastic-fruit-runner.pages.dev
Branch Preview URL: https://fix-wt5-dashboard-nav.elastic-fruit-runner.pages.dev

View logs

@codecov

codecov Bot commented Apr 26, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 90.32258% with 6 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
internal/management/jobs.go 62.50% 6 Missing ⚠️
Flag Coverage Δ
integration-GitHub App 42.43% <62.90%> (?)
integration-PAT 41.26% <62.90%> (+0.69%) ⬆️
integration-Tart 7.04% <0.00%> (-0.28%) ⬇️
unittests 28.65% <61.29%> (+1.22%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
internal/api/server.go 78.78% <100.00%> (+0.39%) ⬆️
internal/controller/jobcontext.go 100.00% <100.00%> (ø)
internal/controller/scaler.go 71.93% <100.00%> (+1.52%) ⬆️
internal/management/jobs.go 71.60% <62.50%> (-2.69%) ⬇️

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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.

Dashboard: RECENT JOBS should link to GitHub Actions and show repo/workflow info Dashboard: click runner set name to navigate to GitHub runners page

1 participant