Sign in

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

vole
Clone

Read only, no credentials:

https://rodent.software/git/vole.git

Write over SSH with a registered key:

git clone ssh://git@0.0.0.0:2222/vole.git

A free and open-source forge that lives in your Git repo.

Rename the request command to change

04e00cfc28cab9bfd338067a0edb4a6125164758 · Keenan Nemetz · 15d ago · parent f920a9f1

server/integration_test.go +13−13

@@ -999,7 +999,7 @@ func TestRequestAuthorComesFromTheKey(t *testing.T) {
999 999 t.Fatalf("config: %s", errs)
1000 1000 }
1001 1001
1002 out, errs, err := f.cli(clone, "request", "new", "--title", "author from the key", "-m", "body")
1002 out, errs, err := f.cli(clone, "change", "new", "--title", "author from the key", "-m", "body")
1003 1003 if err != nil {
1004 1004 t.Fatalf("request new: %v\n%s", err, errs)
1005 1005 }
@@ -1021,7 +1021,7 @@ func TestRequestAuthorComesFromTheKey(t *testing.T) {
1021 1021 if strings.Contains(raw, "keenan-nemetz") {
1022 1022 t.Fatalf("the git-config guess reached the request:\n%s", raw)
1023 1023 }
1024 if _, errs, err := f.cli(clone, "request", "new", "--title", "x", "--author", "wilbur"); err == nil {
1024 if _, errs, err := f.cli(clone, "change", "new", "--title", "x", "--author", "wilbur"); err == nil {
1025 1025 t.Fatalf("--author is still accepted: %s", errs)
1026 1026 }
1027 1027 }
@@ -1067,7 +1067,7 @@ func TestEmptyStatesPrintAWorkingCommand(t *testing.T) {
1067 1067 f.publish(f.repo)
1068 1068 for _, c := range []struct{ path, want string }{
1069 1069 {"/r/" + f.repo + "/issues", "vole issue new --title"},
1070 {"/r/" + f.repo + "/requests", "vole request new --title"},
1070 {"/r/" + f.repo + "/requests", "vole change new --title"},
1071 1071 } {
1072 1072 code, body := f.get(c.path)
1073 1073 if code != 200 {
@@ -1151,7 +1151,7 @@ func TestRequestPageSaysWhenItWouldConflict(t *testing.T) {
1151 1151 if _, errs, err := f.git("", "clone", "-q", f.sshURL(f.repo), clone); err != nil {
1152 1152 t.Fatalf("clone: %s", errs)
1153 1153 }
1154 out, _, err := f.cli(clone, "request", "show", reqID)
1154 out, _, err := f.cli(clone, "change", "show", reqID)
1155 1155 if err != nil {
1156 1156 t.Fatalf("request show: %v", err)
1157 1157 }
@@ -1169,7 +1169,7 @@ func TestRequestPageSaysWhenItWouldConflict(t *testing.T) {
1169 1169 if _, errs, err := f.git("", "clone", "-q", f.sshURL(f.repo), fresh); err != nil {
1170 1170 t.Fatalf("fresh clone: %s", errs)
1171 1171 }
1172 out, _, err = f.cli(fresh, "request", "show", reqID)
1172 out, _, err = f.cli(fresh, "change", "show", reqID)
1173 1173 if err != nil {
1174 1174 t.Fatalf("request show: %v", err)
1175 1175 }
@@ -1221,7 +1221,7 @@ func TestRequestDiscussionIsPushedAndOwned(t *testing.T) {
1221 1221 if code != 200 {
1222 1222 t.Fatalf("request page: %d", code)
1223 1223 }
1224 if !strings.Contains(body, "vole request comment "+reqID) {
1224 if !strings.Contains(body, "vole change comment "+reqID) {
1225 1225 t.Fatalf("the empty discussion state does not print the command:\n%s", body)
1226 1226 }
1227 1227
@@ -1231,7 +1231,7 @@ func TestRequestDiscussionIsPushedAndOwned(t *testing.T) {
1231 1231 if _, errs, err := f.git("", "clone", "-q", f.sshURL(f.repo), clone); err != nil {
1232 1232 t.Fatalf("clone: %s", errs)
1233 1233 }
1234 out, errs, err := f.cli(clone, "request", "comment", reqID, "-m", "Looks good to me.")
1234 out, errs, err := f.cli(clone, "change", "comment", reqID, "-m", "Looks good to me.")
1235 1235 if err != nil {
1236 1236 t.Fatalf("request comment: %v\n%s", err, errs)
1237 1237 }
@@ -1244,7 +1244,7 @@ func TestRequestDiscussionIsPushedAndOwned(t *testing.T) {
1244 1244 t.Fatalf("the comment is not rendered with an anchor:\n%s", body)
1245 1245 }
1246 1246 // `request show` prints the thread with ids, which is how they are found.
1247 if out, _, err := f.cli(clone, "request", "show", reqID); err != nil ||
1247 if out, _, err := f.cli(clone, "change", "show", reqID); err != nil ||
1248 1248 !strings.Contains(out, "--- "+cid+" keenan") {
1249 1249 t.Fatalf("request show does not print the thread: %v\n%s", err, out)
1250 1250 }
@@ -1285,7 +1285,7 @@ func TestRequestDiscussionIsPushedAndOwned(t *testing.T) {
1285 1285 t.Fatalf("the thread lost the first comment:\n%s", body)
1286 1286 }
1287 1287 // An empty comment is refused by the CLI before anything is pushed.
1288 if _, _, err := f.cli(clone, "request", "comment", reqID, "-m", " "); err == nil {
1288 if _, _, err := f.cli(clone, "change", "comment", reqID, "-m", " "); err == nil {
1289 1289 t.Fatal("an empty comment was accepted")
1290 1290 }
1291 1291 }
@@ -1320,7 +1320,7 @@ func TestReviewCommentAnchorsALine(t *testing.T) {
1320 1320 }
1321 1321
1322 1322 // New side: the line in the head's copy of the file.
1323 out, errs, err := f.cli(clone, "request", "comment", reqID, "-m", "why FEATURE?",
1323 out, errs, err := f.cli(clone, "change", "comment", reqID, "-m", "why FEATURE?",
1324 1324 "--path", "code.txt", "--line", "2")
1325 1325 if err != nil {
1326 1326 t.Fatalf("anchored comment: %v\n%s", err, errs)
@@ -1348,7 +1348,7 @@ func TestReviewCommentAnchorsALine(t *testing.T) {
1348 1348 }
1349 1349
1350 1350 // Old side: a line of the file as it stood at the merge base.
1351 out, errs, err = f.cli(clone, "request", "comment", reqID, "-m", "the old middle line",
1351 out, errs, err = f.cli(clone, "change", "comment", reqID, "-m", "the old middle line",
1352 1352 "--path", "code.txt", "--line", "2", "--side", "old")
1353 1353 if err != nil {
1354 1354 t.Fatalf("anchored comment (old side): %v\n%s", err, errs)
@@ -1363,7 +1363,7 @@ func TestReviewCommentAnchorsALine(t *testing.T) {
1363 1363
1364 1364 // A line that is not in the file is refused before anything is pushed.
1365 1365 before := f.serverIssues(t)
1366 if _, errs, err := f.cli(clone, "request", "comment", reqID, "-m", "past the end",
1366 if _, errs, err := f.cli(clone, "change", "comment", reqID, "-m", "past the end",
1367 1367 "--path", "code.txt", "--line", "99"); err == nil {
1368 1368 t.Fatal("a line past the end of the file was accepted")
1369 1369 } else if !strings.Contains(errs, "past the end") {
@@ -1393,7 +1393,7 @@ func TestReviewCommentAnchorsALine(t *testing.T) {
1393 1393 if _, errs, err := f.git(clone, "fetch", "-q", "origin", "feature"); err != nil {
1394 1394 t.Fatalf("fetch: %s", errs)
1395 1395 }
1396 if _, errs, err := f.cli(clone, "request", "update", reqID, "--head", nextHead); err != nil {
1396 if _, errs, err := f.cli(clone, "change", "update", reqID, "--head", nextHead); err != nil {
1397 1397 t.Fatalf("request update: %v\n%s", err, errs)
1398 1398 }
1399 1399 _, body = f.get("/r/" + f.repo + "/requests/" + reqID)