Skip to content

Align actions status icons and texts with GitHub#37206

Open
silverwind wants to merge 24 commits intogo-gitea:mainfrom
silverwind:acticons
Open

Align actions status icons and texts with GitHub#37206
silverwind wants to merge 24 commits intogo-gitea:mainfrom
silverwind:acticons

Conversation

@silverwind
Copy link
Copy Markdown
Member

@silverwind silverwind commented Apr 14, 2026

Action workflows have 8 statuses but the UI only showed 5 (from the commit status api). The three action statuses were always static yellow dot. Align all 8 to GitHub as closely as possible:

  • waiting — octicon-circle (hollow circle), gray
  • blocked — octicon-blocked (slashed circle), yellow
  • running — gitea-running (rotating spinner), yellow
  • cancelled — octicon-stop (gray), was octicon-x (red)

Descriptions also aligned with GitHub:

  • "Has started running" → "In progress"
  • "Has been cancelled" → "Cancelled after {dur}"
  • "Has been skipped" → "Skipped"
Screenshot 2026-04-23 at 11 29 26

Fixes: #32228


This PR was written with the help of Claude Opus 4.7.

The PR merge-box tooltip collapsed Actions waiting/blocked/running into a
single yellow-dot icon because `CommitStatus.State` maps all three to
`CommitStatusPending` and the `createCommitStatus` dedup is keyed only on
`State`. Transitions among the three also left the stored `Description`
frozen at whichever was written first.

Fix by enriching the loaded `CommitStatus` rows with the live
`ActionRunJob.Status`:

- Add transient `CommitStatus.ActionStatus actions_model.Status` (xorm:"-")
- Add `LoadActionStatuses` enricher (one batched IN query)
- `GetDescription` method overrides `.Description` for waiting/blocked/running
- Call the enricher at every CommitStatus tooltip render site (merge box,
  PR list, commit list, branch list, release list, Diff view, file viewer)
- External CI statuses don't set an Actions TargetURL, so `ActionStatus`
  stays zero and the template falls through to the existing
  `repo/commit_status` icons — no external-vs-Actions branch needed
- `templates/repo/icons/action_status.tmpl` consolidated with a `fill`
  param: `true` for filled-circle icons (Actions UI / runs list),
  omitted for bare icons matching `repo/commit_status` (merge box)
- Delete `templates/repo/actions/status.tmpl`; sole caller inlines
  the tooltip span

Co-Authored-By: Claude (Opus 4.6) <[email protected]>
@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Apr 14, 2026
@silverwind silverwind changed the title Rework actions status icons Rework actions status icons and text Apr 14, 2026
Matches the ongoing-state phrasing in both createCommitStatus (stored
value) and GetDescription (live override).

Co-Authored-By: Claude (Opus 4.6) <[email protected]>
Copy link
Copy Markdown
Contributor

@wxiaoguang wxiaoguang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AI doesn't know how to make the code maintainable.

There are a lot of "LoadActionStatuses" calls now.

ActionStatus should not be added to the model. Only prepare it as a separate template value or function when it is needed.

@GiteaBot GiteaBot added lgtm/blocked A maintainer has reservations with the PR and thus it cannot be merged and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels Apr 14, 2026
Copy link
Copy Markdown
Contributor

@wxiaoguang wxiaoguang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And the design is completely wrong.

Commit status can come from woodpecker (update: the IsUnknown branch handles it), or by API (e.g.: commit status is changed by API call from "warning" to "success"). If the commit status is "success", then it must be displayed as "success", no matter what Actions status is.

@wxiaoguang wxiaoguang marked this pull request as draft April 14, 2026 05:42
@silverwind
Copy link
Copy Markdown
Member Author

silverwind commented Apr 14, 2026

Commit status can come from woodpecker (update: the IsUnknown branch handles it), or by API (e.g.: commit status is changed by API call from "warning" to "success"). If the commit status is "success", then it must be displayed as "success", no matter what Actions status is.

The commit status renders like before, same 5 statuses, completely unaffected. Only actions sets the additional statuses added via LoadActionStatuses.

I agree the littering of LoadActionStatuses is not ideal, maybe there is a common place to do it. I'm working under the restriction that not all places in the UI should show action status, e.g. if the icon is for a commit, only show commit status, only if it's for action workflows, show the enriched action status with the 8 states.

@a1012112796
Copy link
Copy Markdown
Member

I think add some new frature like github checks which provide more status and more params than commit status is a better solution.

@silverwind
Copy link
Copy Markdown
Member Author

silverwind commented Apr 16, 2026

I think add some new frature like github checks which provide more status and more params than commit status is a better solution.

Yes, GitHub distinguishes between:

  • commit status (5 statuses, same as gitea)
  • check_runs (at least 8 statuses)

Not sure if a full check_runs implementation is warranted currently. My goal is to just get the actions-specific statuses to render correctly on Gitea.

Reworks the previous attempt: instead of mutating
git_model.CommitStatus.ActionStatus from a LoadActionStatuses helper
called at every status-loading site, build a side map
services/actions.CommitStatusActionInfo (CommitStatus.ID → live
ActionRunJob status) and stash it in ctx.Data for templates to read
via ctx.RootData. The model no longer imports actions_model.

Only pending CommitStatus rows backed by Gitea Actions are enriched —
non-pending state from any CI source (Woodpecker, API-set, …) is
trusted as-is, addressing the "if commit status is success it must
display as success" review note.

Adds PrepareCommitStatusesUI / PrepareCommitStatusesMapUI helpers that
fold the existing CanRead(unit.TypeActions) → HideActionsURL pattern
together with the new enrichment so each route's status-loading site
reduces to one call. Mirrors the established
CommitStatusesHideActionsURL precedent.

Co-Authored-By: Claude (Opus 4.7) <[email protected]>
@silverwind
Copy link
Copy Markdown
Member Author

All feedback addressed, commit description updated and simplified.

@silverwind silverwind marked this pull request as ready for review April 19, 2026 22:24
silverwind and others added 3 commits April 20, 2026 00:24
Sibling of action_status; both render a single status icon.

Co-Authored-By: Claude (Opus 4.7) <[email protected]>
@silverwind
Copy link
Copy Markdown
Member Author

silverwind commented Apr 20, 2026

Also, "cancelled" has a wrong "X" icon, not matching GitHub.

Gitea:

image

GitHub:

image

Will fix that icon here as well and likely adjust the text. Ideally do a full pass over all statuses for correct icon and text.

@silverwind silverwind changed the title Rework actions status icons and text Align actions status icons and texts with GitHub Apr 21, 2026
@silverwind silverwind added the topic/gitea-actions related to the actions of Gitea label Apr 21, 2026
@silverwind silverwind added this to the 1.27.0 milestone Apr 21, 2026
- Cancelled jobs now render with octicon-stop (gray) instead of
  octicon-x (red). Achieved by broadening CommitStatusActionInfo to
  enrich all Gitea Actions rows, not just pending ones.
- Align descriptions with GitHub: "Cancelled after {dur}", "Skipped".
- PrepareCommitStatusesUI now enriches before hiding URLs so users
  without Actions read permission still see correct icons, and merges
  into ctx.Data across calls so multi-panel pages (PR view) render
  both panels correctly.
- Convert missed HideActionsURL sites in repo.go and issue_view.go to
  PrepareCommitStatusesUI; switch branch.go to the Map variant.
- Align `fill` default between Go template and Vue component (both
  default false); set explicitly at the filled callers.
- Add integration test covering all 8 action statuses end-to-end.

Co-Authored-By: Claude (Opus 4.7) <[email protected]>
@silverwind silverwind added the type/enhancement An improvement of existing functionality label Apr 21, 2026
Fixes modernize lint error.

Co-Authored-By: Claude (Opus 4.7) <[email protected]>
silverwind and others added 8 commits April 23, 2026 09:55
* origin/main: (32 commits)
  fix: commit status reporting (go-gitea#37372)
  Support for Custom URI Schemes in OAuth2 Redirect URIs (go-gitea#37356)
  Fix cmd tests by mocking builtin paths (go-gitea#37369)
  chore: upgrade Go version in devcontainer image to 1.26 (go-gitea#37374)
  Fix button layout shift when collapsing file tree in editor (go-gitea#37363)
  Update `Block a user` form (go-gitea#37359)
  Remove IsValidExternalURL/IsAPIURL and use IsValidURL at call sites (go-gitea#37364)
  Add URL to `Learn more about blocking a user` (go-gitea#37355)
  fix: use TriggerEvent instead of Event in workflow runs API response for scheduled runs (go-gitea#37288)
  Add event.schedule context for schedule actions task (go-gitea#37320)
  Fix typos (go-gitea#37346)
  Fix an issue where changing an organization’s visibility caused problems when users had forked its repositories. (go-gitea#37324)
  Fail vite build on rolldown warnings via NODE_ENV=test (go-gitea#37270)
  Use modern "git update-index --cacheinfo" syntax to support more file names (go-gitea#37338)
  Fix URL related escaping for oauth2 (go-gitea#37334)
  When the requested arch rpm is missing fall back to noarch (go-gitea#37236)
  Fix `relative-time` error and improve global error handler (go-gitea#37241)
  Enhance styling in actions page (go-gitea#37323)
  fix(oauth): Error on auth sources with spaces (go-gitea#37327)
  Fix actions concurrency groups cross-branch leak (go-gitea#37311)
  ...

# Conflicts:
#	services/actions/commit_status.go
PrepareCommitStatusesUI now only enriches CommitStatusActionInfo; each
callsite restores the original CanRead + CommitStatusesHideActionsURL
block so the diff against main stays additive.

Co-Authored-By: Claude (Opus 4.7) <[email protected]>
Extends TestActionsCommitStatusRunning with a commits-list page render to
confirm status.tmpl inside .tippy-target receives the live icon and
description. Every page using repo/commit_statuses.tmpl embeds this
tooltip, so coverage was previously only on the PR merge box.

Co-Authored-By: Claude (Opus 4.7) <[email protected]>
PrepareCommitStatusesUI / PrepareCommitStatusesMapUI required every
handler that loaded commit statuses to wire the enrichment into
ctx.Data. Replaced with a MiscUtils.ActionsCommitStatusInfo method on
the template context: repo/pulls/status.tmpl (rendered both in the PR
merge box and inside every repo/commit_statuses.tmpl tippy tooltip)
resolves the live ActionRunJob.Status itself.

CommitStatusActionInfo + GetCommitStatusActionInfo move to models/git
so the template helper lives in modules/templates without depending on
services/*. All 10 handler callsites and their actions_service imports
disappear.

Verified by TestActionsCommitStatusRunning (tooltip) and
TestActionsCommitStatusIcons (merge box).

Co-Authored-By: Claude (Opus 4.7) <[email protected]>
- Relocate CommitStatusActionInfo + GetCommitStatusActionInfo from
  models/git (where it landed only to dodge an import cycle) to
  modules/actions/commitstatusinfo. That package joins models/git and
  models/actions and is where a reader looking for Actions-specific
  commit-status logic would expect to find it.
- Replace MiscUtils.ActionsCommitStatusInfo (which broke MiscUtils's
  implicit "pure, cheap" contract) with a dedicated ActionsUtils
  template type. Template helpers grouped by concern mirror the
  existing RenderUtils / AvatarUtils / MiscUtils pattern, and a
  separate namespace makes "this one touches the DB" explicit.

Template call is now `ctx.ActionsUtils.CommitStatusInfo .CommitStatuses`.

Co-Authored-By: Claude (Opus 4.7) <[email protected]>
- Rename subpackage commitstatusinfo -> statusinfo; types drop the
  redundant prefix (ActionInfo, GetActionInfo) so callers read as
  statusinfo.GetActionInfo instead of the previous stutter.
- Note the status.Repo side-effect in GetActionInfo's doc: ParseGiteaActionsTargetURL
  needs Repo loaded, and the RepoID cache avoids per-row lookups.
- Move the $actionInfo binding inside {{if .CommitStatus}} so pages
  without a status panel skip the DB query entirely.

Co-Authored-By: Claude (Opus 4.7) <[email protected]>
modules/actions/artifacts.go held HTTP-response orchestration
(ctx.Redirect, httplib.ServeUserContentByFile) via *services/context.Base,
which is a reverse-layer import from modules/ into services/. Move the
whole file verbatim into services/actions next to the rest of the
action service code. Callers (three router files) swap the import
target; no behavior change.

This also unblocks modules/actions from being imported by code higher
in the layer stack without cycling through services/context.

Co-Authored-By: Claude (Opus 4.7) <[email protected]>
modules/actions/statusinfo only existed to dodge the modules/actions ->
services/context leak from artifacts.go. With that file moved, the
subpackage is unneeded. Rename types to avoid stutter in their new
home: statusinfo.ActionInfo -> actions.CommitStatusInfo and
statusinfo.GetActionInfo -> actions.GetCommitStatusInfo.

Also tighten doc on util_actions.go's ActionsUtils (drop drift-prone
cross-file comparison and a duplicated rationale on the one-line
wrapper method).

Co-Authored-By: Claude (Opus 4.7) <[email protected]>
@silverwind
Copy link
Copy Markdown
Member Author

Code significantly cleaned up. The key commit is 6cb3859 which cleans up the file structure to avoid workaround regarding circular imports.

silverwind and others added 3 commits April 24, 2026 03:54
* origin/main:
  Allow fast-forward-only merge when signed commits are required (go-gitea#37335)
  Introduce `ActionRunAttempt` to represent each execution of a run (go-gitea#37119)
  Move review request functions to a standalone file (go-gitea#37358)
  Fix repo init README EOL (go-gitea#37388)
  Fix org team assignee/reviewer lookups for team member permissions (go-gitea#37365)
  Remove external service dependencies in migration tests (go-gitea#36866)
  Extend issue context popup beyond markdown content (go-gitea#36908)

# Conflicts:
#	routers/api/v1/repo/action.go
#	web_src/js/components/RepoActionView.vue
IconStatus is nil-map safe, so the $actionInfo guard and two-step
$actionStatus assignment collapse to a single call.

Co-Authored-By: Claude (Opus 4.7) <[email protected]>
Co-Authored-By: Claude (Opus 4.7) <[email protected]>
@silverwind
Copy link
Copy Markdown
Member Author

@wxiaoguang still blocking?

Comment thread tests/integration/actions_trigger_test.go Outdated
Comment thread templates/repo/icons/action_status.tmpl Outdated
Comment thread templates/repo/icons/action_status.tmpl Outdated
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the Actions UI and commit-status rendering so all 8 workflow/job statuses are represented with GitHub-like icons and descriptions, including distinguishing waiting / blocked / running instead of showing a generic pending indicator.

Changes:

  • Add “fill vs bare” icon support and use filled icons in Actions-focused Vue views.
  • Introduce server-side templates for commit-status and action-status icons, and enrich commit-status rendering with live Actions job status.
  • Update and extend integration/unit tests to cover icon/description behavior across statuses.

Reviewed changes

Copilot reviewed 18 out of 20 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
web_src/js/components/WorkflowGraph.vue Pass fill=true so graph nodes use filled success/failure icons.
web_src/js/components/RepoActionView.vue Use fill=true in run/job status icons for the Actions run view.
web_src/js/components/ActionRunSummaryView.vue Use fill=true for summary status icon.
web_src/js/components/ActionRunStatus.vue Add fill prop to toggle filled vs bare icons for success/failure.
web_src/js/components/ActionRunJobView.vue Use fill=true for step/job status icons.
templates/repo/pulls/status.tmpl Render action-backed commit statuses with action-specific icons via enrichment.
templates/repo/icons/commit_status.tmpl New commit-status icon template (mirrors dashboard icon/color mapping).
templates/repo/icons/action_status.tmpl Update action-status icon template; add fill option.
templates/repo/commit_statuses.tmpl Switch commit-status icon rendering to the new repo/icons/commit_status template.
templates/repo/actions/runs_list.tmpl Render run list status using repo/icons/action_status (with tooltip wrapper).
modules/actions/commit_status_info.go New helper to map CommitStatus rows to live Actions job statuses.
modules/templates/util_actions.go Add ActionsUtils template helper wrapper for GetCommitStatusInfo.
services/context/context.go Expose ActionsUtils into web template context as ctx.ActionsUtils.
services/actions/commit_status.go Align stored status descriptions with GitHub-like wording.
services/actions/commit_status_test.go Update expectations for new “In progress” description.
tests/integration/actions_trigger_test.go Add integration tests verifying icon/description rendering across statuses.
services/actions/artifacts.go Add artifact v4 helpers in services/actions.
routers/web/repo/actions/view.go Use services/actions artifact v4 helpers for web artifact downloads.
routers/api/v1/repo/action.go Use services/actions artifact v4 helpers for API artifact endpoints.
routers/api/actions/artifactsv4.go Switch artifact v4 route implementation to use services/actions helpers.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread web_src/js/components/ActionRunStatus.vue Outdated
Comment thread templates/repo/pulls/status.tmpl Outdated
Comment thread routers/api/v1/repo/action.go
silverwind and others added 4 commits April 27, 2026 02:46
- Rename `fill` prop to `iconVariant` (Vue) / `IconVariant` (template) with value `"circle-fill"` (wxiaoguang)
- Use PascalCase for `action_status.tmpl` template variables (wxiaoguang)
- Move `GetCommitStatusInfo` coverage out of integration test into a unit test in `services/actions/commit_status_test.go` (wxiaoguang)
- Apply `className` to the failure/unknown SvgIcon branch in `ActionRunStatus.vue` (Copilot)
- Avoid N+1 in list-view tippies: pass `ActionInfo` explicitly from `pull_merge_box.tmpl`; `pulls/status.tmpl` skips enrichment when omitted, falling back to the basic commit_status icon (Copilot)

Co-Authored-By: Claude (Opus 4.7) <[email protected]>
Caller passes the suffix verbatim (including leading dash). The template
and Vue component just append it to the base icon name, removing the
per-status ternary fallbacks.

Co-Authored-By: Claude (Opus 4.7) <[email protected]>
@silverwind silverwind requested a review from wxiaoguang April 30, 2026 19:23
Comment thread templates/repo/icons/action_status.tmpl Outdated
"CommitStatuses" .LatestCommitStatuses
"ShowHideChecks" true
"StatusCheckData" $statusCheckData
"ActionInfo" (ctx.ActionsUtils.CommitStatusInfo .LatestCommitStatuses)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ActionInfo is not needed.

You can get it in the sub template, since .LatestCommitStatuses is ready in the sub template.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lgtm/blocked A maintainer has reservations with the PR and thus it cannot be merged topic/gitea-actions related to the actions of Gitea type/enhancement An improvement of existing functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Commit Status will not be updated if scheduled job is canceled (probably)

6 participants