From 4dd9966ceecda4abeeb47d9adf209289fb250712 Mon Sep 17 00:00:00 2001 From: Nicolas Date: Thu, 18 Jun 2026 17:16:01 +0200 Subject: [PATCH 1/2] feat(actions): show run index in run view and fix summary graph height - Add the per-repository run number (Index) to the run view response and render it as "#N" next to the run title, matching the runs list and GitHub - Restore the summary panel's flex:1 so the workflow graph fills the right column height even when a run has no job summaries - Keep the job-summary section content-sized so it doesn't steal graph height - Gate the devtest mock job summaries to a couple of runs so the devtest page also exercises the no-summary layout --- routers/web/devtest/mock_actions.go | 26 ++++++++++++++---------- routers/web/repo/actions/view.go | 2 ++ web_src/js/components/RepoActionView.vue | 10 ++++++++- 3 files changed, 26 insertions(+), 12 deletions(-) diff --git a/routers/web/devtest/mock_actions.go b/routers/web/devtest/mock_actions.go index bc6fdeb907f46..aee721887467a 100644 --- a/routers/web/devtest/mock_actions.go +++ b/routers/web/devtest/mock_actions.go @@ -85,6 +85,7 @@ func MockActionsRunsJobs(ctx *context.Context) { } resp := &actions.ViewResponse{} resp.State.Run.RepoID = 12345 + resp.State.Run.Index = runID resp.State.Run.TitleHTML = `mock run title link` resp.State.Run.Link = setting.AppSubURL + "/devtest/repo-action-view/runs/" + strconv.FormatInt(runID, 10) resp.State.Run.CanDeleteArtifact = true @@ -199,17 +200,20 @@ func MockActionsRunsJobs(ctx *context.Context) { resp.State.Run.CanRerunFailed = runID == 30 && isLatestAttempt // Mock job summaries so the devtest page can preview the Summary panel rendering. - resp.State.Run.JobSummaries = []*actions.ViewJobSummary{ - { - JobID: runID * 10, - JobName: "job 100 (testsubname)", - SummaryHTML: renderUtils.MarkdownToHtml("### Devtest job summary\n\n- Markdown rendering\n- Links: [example](https://example.com)\n\n```sh\necho hello\n```\n"), - }, - { - JobID: runID*10 + 2, - JobName: "ULTRA LOOOOOOOOOOOONG job name 102 that exceeds the limit", - SummaryHTML: renderUtils.MarkdownToHtml("### Another summary\n\nThis demonstrates multiple job summaries in one run.\n\n- Item A\n- Item B\n"), - }, + // Only some runs have summaries, so the page also exercises the "no summary" state. + if runID == 10 || runID == 20 { + resp.State.Run.JobSummaries = []*actions.ViewJobSummary{ + { + JobID: runID * 10, + JobName: "job 100 (testsubname)", + SummaryHTML: renderUtils.MarkdownToHtml("### Devtest job summary\n\n- Markdown rendering\n- Links: [example](https://example.com)\n\n```sh\necho hello\n```\n"), + }, + { + JobID: runID*10 + 2, + JobName: "ULTRA LOOOOOOOOOOOONG job name 102 that exceeds the limit", + SummaryHTML: renderUtils.MarkdownToHtml("### Another summary\n\nThis demonstrates multiple job summaries in one run.\n\n- Item A\n- Item B\n"), + }, + } } resp.Artifacts = append(resp.Artifacts, &actions.ArtifactsViewItem{ diff --git a/routers/web/repo/actions/view.go b/routers/web/repo/actions/view.go index 2f4f1950ec5db..34f8ae4475411 100644 --- a/routers/web/repo/actions/view.go +++ b/routers/web/repo/actions/view.go @@ -294,6 +294,7 @@ type ViewResponse struct { // or "/owner/repo/actions/runs/123/attempts/2" for a historical attempt. // Use this when the target should reflect the currently-viewed attempt. ViewLink string `json:"viewLink"` + Index int64 `json:"index"` // the per-repository run number, displayed as "#N" Title string `json:"title"` TitleHTML template.HTML `json:"titleHTML"` Status string `json:"status"` @@ -561,6 +562,7 @@ func fillViewRunResponseSummary(ctx *context_module.Context, resp *ViewResponse, isLatestAttempt := run.LatestAttemptID == 0 || (attempt != nil && attempt.ID == run.LatestAttemptID) resp.State.Run.RepoID = ctx.Repo.Repository.ID + resp.State.Run.Index = run.Index // the title for the "run" is from the commit message resp.State.Run.Title = run.Title resp.State.Run.TitleHTML = templates.NewRenderUtils(ctx).RenderCommitMessage(run.Title, ctx.Repo.Repository) diff --git a/web_src/js/components/RepoActionView.vue b/web_src/js/components/RepoActionView.vue index 9ce926673b980..82493dc5b0f59 100644 --- a/web_src/js/components/RepoActionView.vue +++ b/web_src/js/components/RepoActionView.vue @@ -141,6 +141,7 @@ onBeforeUnmount(() => {

+ #{{ run.index }}