Skip to content

Commit fe22051

Browse files
committed
Indicate when only optional checks failed
1 parent 95ea2df commit fe22051

3 files changed

Lines changed: 14 additions & 2 deletions

File tree

options/locale/locale_en-US.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1848,7 +1848,9 @@
18481848
"repo.pulls.status_checks_success": "All checks were successful",
18491849
"repo.pulls.status_checks_warning": "Some checks reported warnings",
18501850
"repo.pulls.status_checks_failure": "Some checks failed",
1851+
"repo.pulls.status_checks_failure_optional": "Some optional checks failed",
18511852
"repo.pulls.status_checks_error": "Some checks reported errors",
1853+
"repo.pulls.status_checks_error_optional": "Some optional checks reported errors",
18521854
"repo.pulls.status_checks_requested": "Required",
18531855
"repo.pulls.status_checks_details": "Details",
18541856
"repo.pulls.status_checks_hide_all": "Hide all checks",

templates/repo/issue/view_content/pull_merge_box.tmpl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
"CommitStatuses" .LatestCommitStatuses
3434
"ShowHideChecks" true
3535
"StatusCheckData" .StatusCheckData
36+
"RequiredStatusCheckState" .RequiredStatusCheckState
3637
)}}
3738
</div>
3839
{{end}}

templates/repo/pulls/status.tmpl

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
* CommitStatuses: all commit status elements
44
* ShowHideChecks: whether use a button to show/hide the checks
55
* StatusCheckData: additional status check data, see backend pullCommitStatusCheckData struct
6+
* RequiredStatusCheckState: status state for required checks only (used to show "optional checks failed" message)
67
*/}}
78
{{$statusCheckData := .StatusCheckData}}
89
{{if .CommitStatus}}
@@ -15,9 +16,17 @@
1516
{{else if eq .CommitStatus.State "warning"}}
1617
{{ctx.Locale.Tr "repo.pulls.status_checks_warning"}}
1718
{{else if eq .CommitStatus.State "failure"}}
18-
{{ctx.Locale.Tr "repo.pulls.status_checks_failure"}}
19+
{{if and .RequiredStatusCheckState .RequiredStatusCheckState.IsSuccess}}
20+
{{ctx.Locale.Tr "repo.pulls.status_checks_failure_optional"}}
21+
{{else}}
22+
{{ctx.Locale.Tr "repo.pulls.status_checks_failure"}}
23+
{{end}}
1924
{{else if eq .CommitStatus.State "error"}}
20-
{{ctx.Locale.Tr "repo.pulls.status_checks_error"}}
25+
{{if and .RequiredStatusCheckState .RequiredStatusCheckState.IsSuccess}}
26+
{{ctx.Locale.Tr "repo.pulls.status_checks_error_optional"}}
27+
{{else}}
28+
{{ctx.Locale.Tr "repo.pulls.status_checks_error"}}
29+
{{end}}
2130
{{else}}
2231
{{ctx.Locale.Tr "repo.pulls.status_checking"}}
2332
{{end}}

0 commit comments

Comments
 (0)