feat(dashboard): link runner sets and job rows to GitHub - #79
Open
STRRL wants to merge 1 commit into
Open
Conversation
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
Deploying elastic-fruit-runner with
|
| 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 |
Codecov Report❌ Patch coverage is
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 1 file with indirect coverage changes 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
https://github.com/organizations/{org}/settings/actions/runners; repo-scoped sets targethttps://github.com/{owner}/{repo}/settings/actions/runners. Falls back to plain text when the scope string is missing or unrecognized.<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:JobRecordgainsrepository,workflow_name,workflow_run_id.internal/management/migrations/002_add_job_context.sql: adds the three matching columns to thejobstable (default'').internal/management/sqlc/queries.sql+ regenerated bindings:InsertJobandListRecentJobsnow read/write the new columns.InsertCompletedJobis untouched.internal/controller/types.go:JobRecorder.RecordJobStartednow takes aJobStartstruct so the controller can forward the GitHubJobMessageBasefields (OwnerName/RepositoryName,JobDisplayNamefalling back to the workflow file basename,WorkflowRunID).internal/controller/jobcontext.go+ table-driven tests cover the small normalization helpers.internal/api/server.go:ListJobRecordscopies the new fields onto the response.toProtoJobResultand 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/toProtoJobResultfetchRecentJobsresult-mapping logic indashboard/src/api/fetchers.tsOnly additive changes were made to those areas (e.g. new optional fields read in
fetchRecentJobs).Data gap noted
Jobs whose
JobStartedevent was never observed by this daemon process (daemon restart mid-run, or the historical fallback path throughInsertCompletedJob) will have emptyrepository/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 buildmake check(fmt-check, vet, build, lint, prek hooks, unit tests)go test ./internal/controller/... ./internal/management/... ./internal/api/...pnpm run buildandpnpm run lintindashboard/Fixes #65
Fixes #66