Skip to content

Fix actions skipped commit status indicator #34507

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 36 commits into from
May 28, 2025
Merged
Show file tree
Hide file tree
Changes from 19 commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
8d799c2
use the correct context data for PR link template in issue card
badhezi Apr 15, 2025
f2a2acf
Merge branch 'main' into main
badhezi Apr 15, 2025
5cc1bda
Merge branch 'main' into main
GiteaBot Apr 16, 2025
54d37d1
Merge branch 'main' into main
GiteaBot Apr 16, 2025
ac25150
Merge branch 'go-gitea:main' into main
badhezi Apr 16, 2025
e11a339
Merge branch 'go-gitea:main' into main
badhezi Apr 20, 2025
104eecc
Merge branch 'go-gitea:main' into main
badhezi Apr 21, 2025
bcc4ade
Merge branch 'go-gitea:main' into main
badhezi Apr 22, 2025
a7aaa79
Merge branch 'go-gitea:main' into main
badhezi Apr 27, 2025
b46d314
Merge branch 'go-gitea:main' into main
badhezi Apr 28, 2025
4e2434b
Merge branch 'go-gitea:main' into main
badhezi Apr 29, 2025
7f72fe9
Merge branch 'go-gitea:main' into main
badhezi May 2, 2025
c6acfc1
Merge branch 'go-gitea:main' into main
badhezi May 11, 2025
016c2f3
Merge branch 'go-gitea:main' into main
badhezi May 12, 2025
a3c2953
Merge branch 'go-gitea:main' into main
badhezi May 13, 2025
4d7ea0d
Merge branch 'go-gitea:main' into main
badhezi May 20, 2025
8adf028
add skipped commit status and icon indicator
badhezi May 20, 2025
ec76f44
Merge branch 'main' into dev/hezi/fix-skipped-icon
badhezi May 20, 2025
d352cfb
update js CommitStatus type
badhezi May 20, 2025
4479858
add commitStatusPriorities to skipped status
badhezi May 23, 2025
59f9944
Merge branch 'main' into dev/hezi/fix-skipped-icon
badhezi May 23, 2025
a2d0521
Update modules/structs/commit_status.go
wxiaoguang May 27, 2025
40bcd57
Merge branch 'main' into dev/hezi/fix-skipped-icon
wxiaoguang May 27, 2025
8d78184
clean up
wxiaoguang May 27, 2025
e9b8a15
Merge branch 'main' into dev/hezi/fix-skipped-icon
wxiaoguang May 27, 2025
e6dc186
add comment for CalcCommitStatus
wxiaoguang May 27, 2025
ebeed31
fix status check in MergeRequiredContextsCommitStatus
wxiaoguang May 27, 2025
49eef32
improve tests
wxiaoguang May 27, 2025
708b158
improve tests
wxiaoguang May 27, 2025
8c21f01
improve comments
wxiaoguang May 27, 2025
ca6bcf0
improve comments
wxiaoguang May 27, 2025
e843ac5
fix lint
wxiaoguang May 27, 2025
31e8115
fine tune
wxiaoguang May 27, 2025
ae60b24
remove dead code
wxiaoguang May 27, 2025
f4e75b2
Merge branch 'main' into dev/hezi/fix-skipped-icon
wxiaoguang May 28, 2025
747375a
Merge branch 'main' into dev/hezi/fix-skipped-icon
GiteaBot May 28, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions modules/structs/commit_status.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ const (
CommitStatusFailure CommitStatusState = "failure"
// CommitStatusWarning is for when the CommitStatus is Warning
CommitStatusWarning CommitStatusState = "warning"
// CommitStatusSkipped is for when CommitStatus is Skipped
CommitStatusSkipped CommitStatusState = "skipped"
)

var commitStatusPriorities = map[CommitStatusState]int{
Expand Down
4 changes: 3 additions & 1 deletion services/actions/commit_status.go
Original file line number Diff line number Diff line change
Expand Up @@ -149,12 +149,14 @@ func createCommitStatus(ctx context.Context, job *actions_model.ActionRunJob) er

func toCommitStatus(status actions_model.Status) api.CommitStatusState {
switch status {
case actions_model.StatusSuccess, actions_model.StatusSkipped:
case actions_model.StatusSuccess:
return api.CommitStatusSuccess
case actions_model.StatusFailure, actions_model.StatusCancelled:
return api.CommitStatusFailure
case actions_model.StatusWaiting, actions_model.StatusBlocked, actions_model.StatusRunning:
return api.CommitStatusPending
case actions_model.StatusSkipped:
return api.CommitStatusSkipped
default:
return api.CommitStatusError
}
Expand Down
3 changes: 3 additions & 0 deletions templates/repo/commit_status.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,6 @@
{{if eq .State "warning"}}
{{svg "gitea-exclamation" 18 "commit-status icon text yellow"}}
{{end}}
{{if eq .State "skipped"}}
{{svg "octicon-skip" 18 "commit-status icon text grey"}}
{{end}}
3 changes: 2 additions & 1 deletion web_src/js/components/DashboardRepoList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {fomanticQuery} from '../modules/fomantic/base.ts';

const {appSubUrl, assetUrlPrefix, pageData} = window.config;

type CommitStatus = 'pending' | 'success' | 'error' | 'failure' | 'warning';
type CommitStatus = 'pending' | 'success' | 'error' | 'failure' | 'warning' | 'skipped';

type CommitStatusMap = {
[status in CommitStatus]: {
Expand All @@ -22,6 +22,7 @@ const commitStatus: CommitStatusMap = {
error: {name: 'gitea-exclamation', color: 'red'},
failure: {name: 'octicon-x', color: 'red'},
warning: {name: 'gitea-exclamation', color: 'yellow'},
skipped: {name: 'octicon-skip', color: 'grey'},
};

export default defineComponent({
Expand Down