Sign in

Search issue titles and bodies, change requests and comments. Private repositories you cannot read are not included.

vole
Site
Clone

Read only, no credentials:

https://rodent.software/vole.git

Write over SSH with a registered key:

git clone ssh://git@rodent.software/vole.git

Self-hosted forge that lives in your Git repo.

Name role capabilities consistently

cc5123a549d8d0991e74a88fff8208b5071d1192 · Keenan Nemetz · 1d ago · parent 648cd81b

server/hook/hook_test.go +4−4

@@ -187,7 +187,7 @@ func TestContributorCanPushOnlyTheirNamespace(t *testing.T) {
187 187 if code == 0 {
188 188 t.Fatalf("contributor was allowed to push %s", ref)
189 189 }
190 if !strings.Contains(out, "the contribute role may only push branches under refs/heads/contrib/contributor/") {
190 if !strings.Contains(out, "the contributor role may only push branches under refs/heads/contrib/contributor/") {
191 191 t.Fatalf("%s: unclear rejection: %s", ref, out)
192 192 }
193 193 }
@@ -220,14 +220,14 @@ func TestInstanceRoleAppliesOnlyToPublicReposAndAdminEverywhere(t *testing.T) {
220 220 }
221 221 if code, out := f.run("invited", "refs/heads/main", 0); code == 0 {
222 222 t.Fatal("instance contributor pushed a shared branch")
223 } else if !strings.Contains(out, "the contribute role may only push branches under") {
223 } else if !strings.Contains(out, "the contributor role may only push branches under") {
224 224 t.Fatalf("unclear contributor rejection: %s", out)
225 225 }
226 226
227 227 f.setACL(func(a *access.ACL) { a.Default = "none" })
228 228 if code, out := f.run("invited", own, 0); code == 0 {
229 229 t.Fatal("instance contributor pushed to a private repo")
230 } else if !strings.Contains(out, "does not have maintain, runner, or contribute access") {
230 } else if !strings.Contains(out, "does not have maintainer, runner, or contributor access") {
231 231 t.Fatalf("unclear private-repo rejection: %s", out)
232 232 }
233 233
@@ -246,7 +246,7 @@ func TestReadOnlyCannotPush(t *testing.T) {
246 246 if code == 0 {
247 247 t.Fatal("read-only user was allowed to push")
248 248 }
249 if !strings.Contains(out, "does not have maintain, runner, or contribute access") {
249 if !strings.Contains(out, "does not have maintainer, runner, or contributor access") {
250 250 t.Fatalf("message should name the reason, got: %s", out)
251 251 }
252 252 if !strings.Contains(out, "reader") {