mirror of
https://github.com/go-gitea/gitea.git
synced 2026-08-05 02:00:09 +00:00
Backport #38586 by @bircni Several small fixes to the Actions runner management UI. ### Runner task list links to the job, not the workflow run Relabeled the first column from "Run" to "Job"; it now shows the job ID and links to the specific job (`/actions/runs/{runID}/jobs/{jobID}`). Renamed locale key `task_list.run` to `task_list.job`. ### Missing "Disabled" translation The runner list rendered a grey label via `actions.runners.disabled`, but that key did not exist in `locale_en-US.json`, so the raw key string leaked into the UI. Replaced `"actions.runners.disabled"` with `"disabled"`. ### Status column sorting ignored active vs idle Sorting by status ordered purely on `last_online`, but the displayed status is computed from both `last_online` (offline) and `last_active` (idle vs active). As a result idle runners were interleaved with active ones. Sorting now ranks by the computed status (active → idle → offline). Disabled runners sink to the bottom of their status group (`is_disabled` as a secondary key), with `last_online`/`id` as stable tiebreakers so pagination stays deterministic. ### Status label colors Active and idle both rendered green. Idle is now yellow, active green, and offline/unknown grey; the separate grey "Disabled" badge is unchanged. This keeps connectivity visible even for disabled runners (e.g. a disabled runner still shows whether it is idle or offline). <img width="715" height="406" alt="image" src="https://github.com/user-attachments/assets/9ef06aa8-a870-4de5-9d94-603a58186908" /> Co-authored-by: bircni <bircni@icloud.com> Co-authored-by: Zettat123 <zettat123@gmail.com>
This commit is contained in:
@@ -9,6 +9,7 @@ import (
|
||||
|
||||
runnerv1 "gitea.dev/actions-proto-go/runner/v1"
|
||||
"gitea.dev/models/db"
|
||||
repo_model "gitea.dev/models/repo"
|
||||
"gitea.dev/models/unittest"
|
||||
"gitea.dev/modules/actions/jobparser"
|
||||
"gitea.dev/modules/timeutil"
|
||||
@@ -18,6 +19,21 @@ import (
|
||||
"google.golang.org/protobuf/types/known/timestamppb"
|
||||
)
|
||||
|
||||
func TestActionTask_GetRunJobLink(t *testing.T) {
|
||||
repo := &repo_model.Repository{OwnerName: "org", Name: "consumer"}
|
||||
run := &ActionRun{ID: 10, Repo: repo}
|
||||
job := &ActionRunJob{ID: 42, Run: run}
|
||||
|
||||
// a task with a loaded job links to that specific job, not just the run
|
||||
task := &ActionTask{Job: job}
|
||||
assert.Equal(t, run.Link()+"/jobs/42", task.GetRunJobLink())
|
||||
|
||||
// missing job, run or repo yields an empty link instead of a broken URL
|
||||
assert.Empty(t, (&ActionTask{}).GetRunJobLink())
|
||||
assert.Empty(t, (&ActionTask{Job: &ActionRunJob{ID: 42}}).GetRunJobLink())
|
||||
assert.Empty(t, (&ActionTask{Job: &ActionRunJob{ID: 42, Run: &ActionRun{ID: 10}}}).GetRunJobLink())
|
||||
}
|
||||
|
||||
func TestMakeTaskStepDisplayName(t *testing.T) {
|
||||
tests := []struct {
|
||||
name string
|
||||
|
||||
Reference in New Issue
Block a user