Skip to content

Commit 5df9e30

Browse files
authored
Merge branch 'main' into fix-remove-stale-reviewrequests
2 parents 84bcdbf + 9790f12 commit 5df9e30

File tree

4 files changed

+14
-4
lines changed

4 files changed

+14
-4
lines changed

.devcontainer/devcontainer.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
{
22
"name": "Gitea DevContainer",
33
"image": "mcr.microsoft.com/devcontainers/go:1.24-bookworm",
4+
"containerEnv": {
5+
// override "local" from packaged version
6+
"GOTOOLCHAIN": "auto"
7+
},
48
"features": {
59
// installs nodejs into container
610
"ghcr.io/devcontainers/features/node:1": {

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ XGO_VERSION := go-1.25.x
2828
AIR_PACKAGE ?= github.com/air-verse/air@v1
2929
EDITORCONFIG_CHECKER_PACKAGE ?= github.com/editorconfig-checker/editorconfig-checker/v3/cmd/editorconfig-checker@v3
3030
GOFUMPT_PACKAGE ?= mvdan.cc/gofumpt@v0.8.0
31-
GOLANGCI_LINT_PACKAGE ?= github.com/golangci/golangci-lint/v2/cmd/golangci-lint@v2.1.6
31+
GOLANGCI_LINT_PACKAGE ?= github.com/golangci/golangci-lint/v2/cmd/golangci-lint@v2.4.0
3232
GXZ_PACKAGE ?= github.com/ulikunitz/xz/cmd/gxz@v0.5.12
3333
MISSPELL_PACKAGE ?= github.com/golangci/misspell/cmd/misspell@v0.7.0
3434
SWAGGER_PACKAGE ?= github.com/go-swagger/go-swagger/cmd/swagger@v0.32.3

models/issues/pull.go

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ import (
3030

3131
var ErrMustCollaborator = util.NewPermissionDeniedErrorf("user must be a collaborator")
3232

33+
const reviewedBy = "Reviewed-by: "
34+
3335
// ErrPullRequestNotExist represents a "PullRequestNotExist" kind of error.
3436
type ErrPullRequestNotExist struct {
3537
ID int64
@@ -349,7 +351,11 @@ type ReviewCount struct {
349351
func (pr *PullRequest) GetApprovalCounts(ctx context.Context) ([]*ReviewCount, error) {
350352
rCounts := make([]*ReviewCount, 0, 6)
351353
sess := db.GetEngine(ctx).Where("issue_id = ?", pr.IssueID)
352-
return rCounts, sess.Select("issue_id, type, count(id) as `count`").Where("official = ? AND dismissed = ?", true, false).GroupBy("issue_id, type").Table("review").Find(&rCounts)
354+
return rCounts, sess.Select("issue_id, type, count(id) as `count`").
355+
Where(builder.Eq{"official": true, "dismissed": false}).
356+
GroupBy("issue_id, type").
357+
Table("review").
358+
Find(&rCounts)
353359
}
354360

355361
// GetApprovers returns the approvers of the pull request
@@ -394,7 +400,7 @@ func (pr *PullRequest) getReviewedByLines(ctx context.Context, writer io.Writer)
394400
} else if review.Reviewer == nil {
395401
continue
396402
}
397-
if _, err := writer.Write([]byte("Reviewed-by: ")); err != nil {
403+
if _, err := writer.Write([]byte(reviewedBy)); err != nil {
398404
return err
399405
}
400406
if _, err := writer.Write([]byte(review.Reviewer.NewGitSig().String())); err != nil {

templates/repo/view_file.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@
108108
{{range $idx, $code := .FileContent}}
109109
{{$line := Eval $idx "+" 1}}
110110
<tr>
111-
<td id="L{{$line}}" class="lines-num"><span id="L{{$line}}" data-line-number="{{$line}}"></span></td>
111+
<td class="lines-num"><span id="L{{$line}}" data-line-number="{{$line}}"></span></td>
112112
{{if $.EscapeStatus.Escaped}}
113113
<td class="lines-escape">{{if (index $.LineEscapeStatus $idx).Escaped}}<button class="toggle-escape-button btn interact-bg" title="{{if (index $.LineEscapeStatus $idx).HasInvisible}}{{ctx.Locale.Tr "repo.invisible_runes_line"}} {{end}}{{if (index $.LineEscapeStatus $idx).HasAmbiguous}}{{ctx.Locale.Tr "repo.ambiguous_runes_line"}}{{end}}"></button>{{end}}</td>
114114
{{end}}

0 commit comments

Comments
 (0)