Align actions status icons and texts with GitHub#37206
Align actions status icons and texts with GitHub#37206silverwind wants to merge 19 commits intogo-gitea:mainfrom
Conversation
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) <noreply@anthropic.com>
Matches the ongoing-state phrasing in both createCommitStatus (stored value) and GetDescription (live override). Co-Authored-By: Claude (Opus 4.6) <noreply@anthropic.com>
There was a problem hiding this comment.
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.
The commit status renders like before, same 5 statuses, completely unaffected. Only actions sets the additional statuses added via I agree the littering of |
|
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:
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) <noreply@anthropic.com>
|
All feedback addressed, commit description updated and simplified. |
Co-Authored-By: Claude (Opus 4.7) <noreply@anthropic.com>
Sibling of action_status; both render a single status icon. Co-Authored-By: Claude (Opus 4.7) <noreply@anthropic.com>
- 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) <noreply@anthropic.com>
|
7c310e8 fixes the cancel status and adds parity with GitHub (except for statuses like "blocked" which don't exist on GitHub) and adds a full integration tests for all 8 statuses. |
Fixes modernize lint error. Co-Authored-By: Claude (Opus 4.7) <noreply@anthropic.com>
* 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) <noreply@anthropic.com>
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) <noreply@anthropic.com>
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) <noreply@anthropic.com>
- 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) <noreply@anthropic.com>
- 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) <noreply@anthropic.com>
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) <noreply@anthropic.com>
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) <noreply@anthropic.com>
|
Code significantly cleaned up. The key commit is 6cb3859 which cleans up the file structure to avoid workaround regarding circular imports. |
* 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) <noreply@anthropic.com>
Co-Authored-By: Claude (Opus 4.7) <noreply@anthropic.com>
|
@wxiaoguang still blocking? |
| // Verify GetCommitStatusInfo surfaces the live ActionRunJob.Status so the | ||
| // icon reflects Waiting/Running/Blocked — all three share State=Pending in the | ||
| // stored CommitStatus row. |
There was a problem hiding this comment.
It's very slow and fragile to test GetCommitStatusInfo via web page.
It should have its own unit test clearly.
| * status: one of success, skipped, waiting, blocked, running, failure, cancelled, unknown | ||
| * size: icon size in pixels (default 16) | ||
| * className: additional CSS classes | ||
| * fill: use filled-circle icons for success/failure (default false: bare icons matching repo/commit_status) |
There was a problem hiding this comment.
I don't think "fill" is a right prop name.
What you mean is "use filled (or some other concept: solid, opaque) icon, but not fill the icon's color"
It should be IconStyle='filled-circle' or or something.
| {{/* Template Attributes: | ||
| * status: one of success, skipped, waiting, blocked, running, failure, cancelled, unknown | ||
| * size: icon size in pixels (default 16) | ||
| * className: additional CSS classes |
There was a problem hiding this comment.
For consistency, all template variables are PascalCase
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:
octicon-circle(hollow circle), grayocticon-blocked(slashed circle), yellowgitea-running(rotating spinner), yellowocticon-stop(gray), wasocticon-x(red)Descriptions also aligned with GitHub:
This PR was written with the help of Claude Opus 4.7.