Skip to content

Commit d44095f

Browse files
committed
Merge remote-tracking branch 'upstream/release/v1.16' into codeberg-1.16
2 parents 81ee6fb + dd52c08 commit d44095f

File tree

5 files changed

+25
-4
lines changed

5 files changed

+25
-4
lines changed

.drone.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -804,11 +804,12 @@ steps:
804804
depends_on: [gpg-sign]
805805

806806
- name: github
807-
image: plugins/github-release:1
807+
image: plugins/github-release:latest
808808
pull: always
809809
settings:
810810
files:
811811
- "dist/release/*"
812+
file_exists: overwrite
812813
environment:
813814
GITHUB_TOKEN:
814815
from_secret: github_token

models/repo.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ func getRepoAssignees(ctx context.Context, repo *repo_model.Repository) (_ []*us
153153
userIDs := make([]int64, 0, 10)
154154
if err = e.Table("access").
155155
Where("repo_id = ? AND mode >= ?", repo.ID, perm.AccessModeWrite).
156-
Select("id").
156+
Select("user_id").
157157
Find(&userIDs); err != nil {
158158
return nil, err
159159
}

models/repo_test.go

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,3 +167,21 @@ func TestLinkedRepository(t *testing.T) {
167167
})
168168
}
169169
}
170+
171+
func TestRepoAssignees(t *testing.T) {
172+
assert.NoError(t, unittest.PrepareTestDatabase())
173+
174+
repo2 := unittest.AssertExistsAndLoadBean(t, &repo_model.Repository{ID: 2}).(*repo_model.Repository)
175+
users, err := GetRepoAssignees(repo2)
176+
assert.NoError(t, err)
177+
assert.Len(t, users, 1)
178+
assert.Equal(t, users[0].ID, int64(2))
179+
180+
repo21 := unittest.AssertExistsAndLoadBean(t, &repo_model.Repository{ID: 21}).(*repo_model.Repository)
181+
users, err = GetRepoAssignees(repo21)
182+
assert.NoError(t, err)
183+
assert.Len(t, users, 3)
184+
assert.Equal(t, users[0].ID, int64(15))
185+
assert.Equal(t, users[1].ID, int64(18))
186+
assert.Equal(t, users[2].ID, int64(16))
187+
}

modules/git/repo_attribute.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,9 @@ func (c *CheckAttributeReader) Run() error {
191191
}
192192
return nil
193193
})
194-
if err != nil && c.ctx.Err() != nil && err.Error() != "signal: killed" {
194+
if err != nil && // If there is an error we need to return but:
195+
c.ctx.Err() != err && // 1. Ignore the context error if the context is cancelled or exceeds the deadline (RunWithContext could return c.ctx.Err() which is Canceled or DeadlineExceeded)
196+
err.Error() != "signal: killed" { // 2. We should not pass up errors due to the program being killed
195197
return fmt.Errorf("failed to run attr-check. Error: %w\nStderr: %s", err, stdErr.String())
196198
}
197199
return nil

templates/admin/dashboard.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
{{template "base/alert" .}}
66
{{if .NeedUpdate}}
77
<div class="ui negative message flash-error">
8-
<p>{{.i18n.Tr "admin.dashboard.new_version_hint" (.RemoteVersion | Str2html) (AppVer | Str2html)}}</p>
8+
<p>{{(.i18n.Tr "admin.dashboard.new_version_hint" .RemoteVersion AppVer) | Str2html}}</p>
99
</div>
1010
{{end}}
1111
<h4 class="ui top attached header">

0 commit comments

Comments
 (0)