Skip to content

feat(ui): link run commit ids to GitHub /commit/<sha>#472

Open
alexmond wants to merge 1 commit into
mainfrom
feat/commit-links
Open

feat(ui): link run commit ids to GitHub /commit/<sha>#472
alexmond wants to merge 1 commit into
mainfrom
feat/commit-links

Conversation

@alexmond

Copy link
Copy Markdown
Owner

Wherever a project run's commit shows as a short sha, it now links to the commit on the repo host — when the project has a repo URL. GitHub resolves abbreviated shas, so the displayed short sha is a valid link target.

Surfaces

  • Project overview → Recent runs: the Commit column links to <repo>/commit/<sha>, both the server-rendered rows and the live SSE-updated "just now" row.
  • Shared "Latest run" line (Overview, Coverage, Timing, Tests tabs): a small GitHub link on the sha (keeps the existing internal run link).
  • Perf/Load tabs already linked commits — unchanged.

Mechanics

  • AnalyticsView.repoCommitBase(repoUrl) reuses repoBase, which rejects non-http(s) schemes (XSS guard) — so the commit base is always a safe scheme.
  • latestRunLine(cur, repoCommitBase) overload carries a pre-built commitUrl; the no-arg overload keeps prior behavior.
  • The live JS row builds the href from a server-validated base + short sha (fixed scheme, textContent for the label).

Covered by a new assertion in NewOverviewPageIntegrationTest (sets a repo URL, asserts the /commit/<sha> link renders).

🤖 Generated with Claude Code

Wherever a project run's commit shows as a short sha, link it to the
commit on the repo host when the project has a repo URL. GitHub resolves
abbreviated shas, so the displayed short sha is a valid link ref.

- AnalyticsView: repoCommitBase(repoUrl) helper (reuses repoBase, which
  rejects non-http(s) schemes) + latestRunLine(cur, repoCommitBase)
  overload that carries a built commitUrl.
- Shared latestRunLine fragment: adds a GitHub octicon link on the sha
  (keeps the internal run link). Threaded through the overview, coverage,
  timing and tests page services.
- Project overview "Recent runs": the Commit column links to the commit,
  both server-rendered rows and the live SSE-updated row (commitCell in
  the inlined script, base validated to http(s) server-side).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QmnyrHG366UPQTbtsimzkj
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