GitLabgitlab-org
cli
main
1//go:build !integration
3package note
5import (
6 "bytes"
7 "encoding/json"
8 "testing"
9 "time"
11 "github.com/acarl005/stripansi"
12 "github.com/stretchr/testify/assert"
13 "github.com/stretchr/testify/require"
14 "go.uber.org/mock/gomock"
16 gitlab "gitlab.com/gitlab-org/api/client-go/v3"
17 gitlabtesting "gitlab.com/gitlab-org/api/client-go/v3/testing"
19 "gitlab.com/gitlab-org/cli/internal/testing/cmdtest"
20)
22// makeMRForList is an alias for mockMR1 kept for readability in this file.
23var makeMRForList = mockMR1
25func setupListCmd(t *testing.T, tc *gitlabtesting.TestClient) cmdtest.CmdExecFunc {
26 t.Helper()
27 return cmdtest.SetupCmdForTest(t, NewCmdNote, true,
28 cmdtest.WithGitLabClient(tc.Client),
29 cmdtest.WithBaseRepo("OWNER", "REPO", ""),
30 )
31}
33func ts(s string) *time.Time {
34 t, _ := time.Parse(time.DateTime, s)
35 return &t
36}
38func Test_NoteList(t *testing.T) {
39 t.Parallel()
41 t.Run("lists all discussions using shared TTY format", func(t *testing.T) {
42 t.Parallel()
44 tc := gitlabtesting.NewTestClient(t)
45 makeMRForList(t, tc)
47 tc.MockDiscussions.EXPECT().
48 ListMergeRequestDiscussions("OWNER/REPO", int64(1), gomock.Any(), gomock.Any()).
49 Return([]*gitlab.Discussion{
50 {
51 ID: "abcdef1234567890abcdef1234567890abcdef12",
52 IndividualNote: true,
53 Notes: []*gitlab.Note{
54 {
55 ID: 100,
56 Body: "General comment",
57 Author: gitlab.NoteAuthor{Username: "alice"},
58 CreatedAt: ts("2025-01-15 10:30:00"),
59 },
60 },
61 },
62 {
63 ID: "12345678abcdef90abcdef1234567890abcdef12",
64 IndividualNote: true,
65 Notes: []*gitlab.Note{
66 {
67 ID: 200,
68 Body: "Diff note",
69 Author: gitlab.NoteAuthor{Username: "bob"},
70 CreatedAt: ts("2025-01-15 11:00:00"),
71 Position: &gitlab.NotePosition{NewPath: "main.go", OldPath: "main.go", NewLine: 42},
72 Resolvable: true,
73 Resolved: false,
74 },
75 },
76 },
77 }, nil, nil)
79 exec := setupListCmd(t, tc)
80 output, err := exec(`list 1`)
81 require.NoError(t, err)
83 out := stripansi.Strip(output.String())
84 // Uses shared PrintDiscussions renderer
85 assert.Contains(t, out, "@alice commented")
86 assert.Contains(t, out, "[note #100] [discussion: abcdef12…]")
87 assert.Contains(t, out, "General comment")
88 assert.Contains(t, out, "@bob commented")
89 assert.Contains(t, out, "[note #200] [discussion: 12345678…]")
90 assert.Contains(t, out, "Diff note")
91 assert.Contains(t, out, "main.go")
92 assert.Contains(t, out, ":42")
93 })
95 t.Run("lists a single note non-individual discussion with a prefix", func(t *testing.T) {
96 t.Parallel()
98 tc := gitlabtesting.NewTestClient(t)
99 makeMRForList(t, tc)
101 tc.MockDiscussions.EXPECT().
102 ListMergeRequestDiscussions("OWNER/REPO", int64(1), gomock.Any(), gomock.Any()).
103 Return([]*gitlab.Discussion{
104 {
105 ID: "fedcba9876543210fedcba9876543210fedcba98",
106 IndividualNote: false,
107 Notes: []*gitlab.Note{
108 {
109 ID: 301,
110 Body: "Single-note discussion",
111 Author: gitlab.NoteAuthor{Username: "carol"},
112 CreatedAt: ts("2025-01-15 12:00:00"),
113 },
114 },
115 },
116 }, nil, nil)
118 exec := setupListCmd(t, tc)
119 output, err := exec(`list 1`)
120 require.NoError(t, err)
122 out := stripansi.Strip(output.String())
123 assert.Contains(t, out, "[note #301] [discussion: fedcba98…]")
124 })
126 t.Run("no discussions found", func(t *testing.T) {
127 t.Parallel()
129 tc := gitlabtesting.NewTestClient(t)
130 makeMRForList(t, tc)
132 tc.MockDiscussions.EXPECT().
133 ListMergeRequestDiscussions("OWNER/REPO", int64(1), gomock.Any(), gomock.Any()).
134 Return([]*gitlab.Discussion{}, nil, nil)
136 exec := setupListCmd(t, tc)
137 output, err := exec(`list 1`)
138 require.NoError(t, err)
139 assert.Contains(t, output.String(), "No discussions found.")
140 })
142 t.Run("filter by diff", func(t *testing.T) {
143 t.Parallel()
145 tc := gitlabtesting.NewTestClient(t)
146 makeMRForList(t, tc)
148 tc.MockDiscussions.EXPECT().
149 ListMergeRequestDiscussions("OWNER/REPO", int64(1), gomock.Any(), gomock.Any()).
150 Return([]*gitlab.Discussion{
151 {
152 ID: "general1234567890abcdef1234567890abcdef12",
153 IndividualNote: true,
154 Notes: []*gitlab.Note{
155 {ID: 100, Body: "General", Author: gitlab.NoteAuthor{Username: "alice"}, CreatedAt: ts("2025-01-15 10:00:00")},
156 },
157 },
158 {
159 ID: "diffnote234567890abcdef1234567890abcdef12",
160 IndividualNote: true,
161 Notes: []*gitlab.Note{
162 {
163 ID: 200, Body: "Diff comment", Author: gitlab.NoteAuthor{Username: "bob"},
164 Position: &gitlab.NotePosition{NewPath: "main.go", OldPath: "main.go", NewLine: 5},
165 CreatedAt: ts("2025-01-15 11:00:00"),
166 },
167 },
168 },
169 }, nil, nil)
171 exec := setupListCmd(t, tc)
172 output, err := exec(`list 1 --type diff`)
173 require.NoError(t, err)
175 out := output.String()
176 assert.NotContains(t, out, "General")
177 assert.Contains(t, out, "Diff comment")
178 assert.Contains(t, out, "main.go")
179 assert.Contains(t, out, ":5")
180 })
182 t.Run("filter by general", func(t *testing.T) {
183 t.Parallel()
185 tc := gitlabtesting.NewTestClient(t)
186 makeMRForList(t, tc)
188 tc.MockDiscussions.EXPECT().
189 ListMergeRequestDiscussions("OWNER/REPO", int64(1), gomock.Any(), gomock.Any()).
190 Return([]*gitlab.Discussion{
191 {
192 ID: "general1234567890abcdef1234567890abcdef12",
193 IndividualNote: true,
194 Notes: []*gitlab.Note{
195 {ID: 100, Body: "General note", Author: gitlab.NoteAuthor{Username: "alice"}, CreatedAt: ts("2025-01-15 10:00:00")},
196 },
197 },
198 {
199 ID: "diffnote234567890abcdef1234567890abcdef12",
200 IndividualNote: true,
201 Notes: []*gitlab.Note{
202 {
203 ID: 200, Body: "Diff", Author: gitlab.NoteAuthor{Username: "bob"},
204 Position: &gitlab.NotePosition{NewPath: "main.go", OldPath: "main.go", NewLine: 5},
205 CreatedAt: ts("2025-01-15 11:00:00"),
206 },
207 },
208 },
209 }, nil, nil)
211 exec := setupListCmd(t, tc)
212 output, err := exec(`list 1 --type general`)
213 require.NoError(t, err)
215 out := output.String()
216 assert.Contains(t, out, "General note")
217 assert.NotContains(t, out, "@bob")
218 })
220 t.Run("filter by system shows system notes", func(t *testing.T) {
221 t.Parallel()
223 tc := gitlabtesting.NewTestClient(t)
224 makeMRForList(t, tc)
226 tc.MockDiscussions.EXPECT().
227 ListMergeRequestDiscussions("OWNER/REPO", int64(1), gomock.Any(), gomock.Any()).
228 Return([]*gitlab.Discussion{
229 {
230 ID: "general1234567890abcdef1234567890abcdef12",
231 IndividualNote: true,
232 Notes: []*gitlab.Note{
233 {ID: 100, Body: "General", Author: gitlab.NoteAuthor{Username: "alice"}, CreatedAt: ts("2025-01-15 10:00:00")},
234 },
235 },
236 {
237 ID: "systemnote34567890abcdef1234567890abcdef12",
238 IndividualNote: true,
239 Notes: []*gitlab.Note{
240 {ID: 300, Body: "merged", Author: gitlab.NoteAuthor{Username: "bot"}, System: true, CreatedAt: ts("2025-01-15 12:00:00")},
241 },
242 },
243 }, nil, nil)
245 exec := setupListCmd(t, tc)
246 output, err := exec(`list 1 --type system`)
247 require.NoError(t, err)
249 out := output.String()
250 assert.NotContains(t, out, "General")
251 assert.Contains(t, out, "@bot")
252 assert.Contains(t, out, "merged")
253 })
255 t.Run("state resolved", func(t *testing.T) {
256 t.Parallel()
258 tc := gitlabtesting.NewTestClient(t)
259 makeMRForList(t, tc)
261 tc.MockDiscussions.EXPECT().
262 ListMergeRequestDiscussions("OWNER/REPO", int64(1), gomock.Any(), gomock.Any()).
263 Return([]*gitlab.Discussion{
264 {
265 ID: "resolved234567890abcdef1234567890abcdef12",
266 IndividualNote: true,
267 Notes: []*gitlab.Note{
268 {
269 ID: 100, Body: "Done", Author: gitlab.NoteAuthor{Username: "alice"},
270 Resolvable: true, Resolved: true, CreatedAt: ts("2025-01-15 10:00:00"),
271 },
272 },
273 },
274 {
275 ID: "unresolv234567890abcdef1234567890abcdef12",
276 IndividualNote: true,
277 Notes: []*gitlab.Note{
278 {
279 ID: 200, Body: "TODO", Author: gitlab.NoteAuthor{Username: "bob"},
280 Resolvable: true, Resolved: false, CreatedAt: ts("2025-01-15 11:00:00"),
281 },
282 },
283 },
284 }, nil, nil)
286 exec := setupListCmd(t, tc)
287 output, err := exec(`list 1 --state resolved`)
288 require.NoError(t, err)
290 out := output.String()
291 assert.Contains(t, out, "Done")
292 assert.NotContains(t, out, "TODO")
293 })
295 t.Run("state unresolved", func(t *testing.T) {
296 t.Parallel()
298 tc := gitlabtesting.NewTestClient(t)
299 makeMRForList(t, tc)
301 tc.MockDiscussions.EXPECT().
302 ListMergeRequestDiscussions("OWNER/REPO", int64(1), gomock.Any(), gomock.Any()).
303 Return([]*gitlab.Discussion{
304 {
305 ID: "resolved234567890abcdef1234567890abcdef12",
306 IndividualNote: true,
307 Notes: []*gitlab.Note{
308 {
309 ID: 100, Body: "Done", Author: gitlab.NoteAuthor{Username: "alice"},
310 Resolvable: true, Resolved: true, CreatedAt: ts("2025-01-15 10:00:00"),
311 },
312 },
313 },
314 {
315 ID: "unresolv234567890abcdef1234567890abcdef12",
316 IndividualNote: true,
317 Notes: []*gitlab.Note{
318 {
319 ID: 200, Body: "TODO item", Author: gitlab.NoteAuthor{Username: "bob"},
320 Resolvable: true, Resolved: false, CreatedAt: ts("2025-01-15 11:00:00"),
321 },
322 },
323 },
324 }, nil, nil)
326 exec := setupListCmd(t, tc)
327 output, err := exec(`list 1 --state unresolved`)
328 require.NoError(t, err)
330 out := output.String()
331 assert.NotContains(t, out, "Done")
332 assert.Contains(t, out, "TODO item")
333 })
335 t.Run("filter by file", func(t *testing.T) {
336 t.Parallel()
338 tc := gitlabtesting.NewTestClient(t)
339 makeMRForList(t, tc)
341 tc.MockDiscussions.EXPECT().
342 ListMergeRequestDiscussions("OWNER/REPO", int64(1), gomock.Any(), gomock.Any()).
343 Return([]*gitlab.Discussion{
344 {
345 ID: "filemain234567890abcdef1234567890abcdef12",
346 IndividualNote: true,
347 Notes: []*gitlab.Note{
348 {
349 ID: 100, Body: "Comment on main", Author: gitlab.NoteAuthor{Username: "alice"},
350 Position: &gitlab.NotePosition{NewPath: "main.go", OldPath: "main.go", NewLine: 10},
351 CreatedAt: ts("2025-01-15 10:00:00"),
352 },
353 },
354 },
355 {
356 ID: "fileutil234567890abcdef1234567890abcdef12",
357 IndividualNote: true,
358 Notes: []*gitlab.Note{
359 {
360 ID: 200, Body: "Comment on utils", Author: gitlab.NoteAuthor{Username: "bob"},
361 Position: &gitlab.NotePosition{NewPath: "utils.go", OldPath: "utils.go", NewLine: 5},
362 CreatedAt: ts("2025-01-15 11:00:00"),
363 },
364 },
365 },
366 {
367 ID: "generalx234567890abcdef1234567890abcdef12",
368 IndividualNote: true,
369 Notes: []*gitlab.Note{
370 {ID: 300, Body: "General note", Author: gitlab.NoteAuthor{Username: "carol"}, CreatedAt: ts("2025-01-15 12:00:00")},
371 },
372 },
373 }, nil, nil)
375 exec := setupListCmd(t, tc)
376 output, err := exec(`list 1 --file main.go`)
377 require.NoError(t, err)
379 out := output.String()
380 assert.Contains(t, out, "Comment on main")
381 assert.NotContains(t, out, "Comment on utils")
382 assert.NotContains(t, out, "General note")
383 })
385 t.Run("json output", func(t *testing.T) {
386 t.Parallel()
388 tc := gitlabtesting.NewTestClient(t)
389 makeMRForList(t, tc)
391 tc.MockDiscussions.EXPECT().
392 ListMergeRequestDiscussions("OWNER/REPO", int64(1), gomock.Any(), gomock.Any()).
393 Return([]*gitlab.Discussion{
394 {
395 ID: "jsontest234567890abcdef1234567890abcdef12",
396 Notes: []*gitlab.Note{
397 {ID: 100, Body: "Hello", Author: gitlab.NoteAuthor{Username: "alice"}},
398 },
399 },
400 }, nil, nil)
402 exec := setupListCmd(t, tc)
403 output, err := exec(`list 1 -F json`)
404 require.NoError(t, err)
406 var parsed []struct {
407 ID string `json:"id"`
408 }
409 err = json.Unmarshal([]byte(output.String()), &parsed)
410 require.NoError(t, err)
411 require.Len(t, parsed, 1)
412 assert.Equal(t, "jsontest234567890abcdef1234567890abcdef12", parsed[0].ID)
413 })
415 t.Run("threaded discussion with replies", func(t *testing.T) {
416 t.Parallel()
418 tc := gitlabtesting.NewTestClient(t)
419 makeMRForList(t, tc)
421 tc.MockDiscussions.EXPECT().
422 ListMergeRequestDiscussions("OWNER/REPO", int64(1), gomock.Any(), gomock.Any()).
423 Return([]*gitlab.Discussion{
424 {
425 ID: "thread12345678901234567890abcdef12345678",
426 IndividualNote: false,
427 Notes: []*gitlab.Note{
428 {
429 ID: 100, Body: "First note", Author: gitlab.NoteAuthor{Username: "alice"},
430 CreatedAt: ts("2025-01-15 10:00:00"),
431 },
432 {
433 ID: 101, Body: "Reply here", Author: gitlab.NoteAuthor{Username: "bob"},
434 CreatedAt: ts("2025-01-15 10:05:00"),
435 },
436 },
437 },
438 }, nil, nil)
440 exec := setupListCmd(t, tc)
441 output, err := exec(`list 1`)
442 require.NoError(t, err)
444 out := output.String()
445 // Thread format from PrintDiscussions
446 assert.Contains(t, out, "Thread [discussion: thread12…]")
447 assert.Contains(t, out, "@alice commented")
448 assert.Contains(t, out, "[note #100]")
449 assert.Contains(t, out, "First note")
450 assert.Contains(t, out, "@bob replied")
451 assert.Contains(t, out, "[note #101]")
452 assert.Contains(t, out, "Reply here")
453 })
455 t.Run("combined filters", func(t *testing.T) {
456 t.Parallel()
458 tc := gitlabtesting.NewTestClient(t)
459 makeMRForList(t, tc)
461 tc.MockDiscussions.EXPECT().
462 ListMergeRequestDiscussions("OWNER/REPO", int64(1), gomock.Any(), gomock.Any()).
463 Return([]*gitlab.Discussion{
464 {
465 ID: "diffresol234567890abcdef1234567890abcdef12",
466 IndividualNote: true,
467 Notes: []*gitlab.Note{
468 {
469 ID: 100, Body: "Resolved diff", Author: gitlab.NoteAuthor{Username: "alice"},
470 Position: &gitlab.NotePosition{NewPath: "main.go", OldPath: "main.go", NewLine: 10},
471 Resolvable: true, Resolved: true, CreatedAt: ts("2025-01-15 10:00:00"),
472 },
473 },
474 },
475 {
476 ID: "diffunres234567890abcdef1234567890abcdef12",
477 IndividualNote: true,
478 Notes: []*gitlab.Note{
479 {
480 ID: 200, Body: "Unresolved diff", Author: gitlab.NoteAuthor{Username: "bob"},
481 Position: &gitlab.NotePosition{NewPath: "main.go", OldPath: "main.go", NewLine: 20},
482 Resolvable: true, Resolved: false, CreatedAt: ts("2025-01-15 11:00:00"),
483 },
484 },
485 },
486 {
487 ID: "genunres234567890abcdef1234567890abcdef12",
488 IndividualNote: true,
489 Notes: []*gitlab.Note{
490 {
491 ID: 300, Body: "Unresolved general", Author: gitlab.NoteAuthor{Username: "carol"},
492 Resolvable: true, Resolved: false, CreatedAt: ts("2025-01-15 12:00:00"),
493 },
494 },
495 },
496 }, nil, nil)
498 exec := setupListCmd(t, tc)
499 output, err := exec(`list 1 --type diff --state unresolved`)
500 require.NoError(t, err)
502 out := output.String()
503 assert.NotContains(t, out, "Resolved diff") // resolved, excluded
504 assert.Contains(t, out, "Unresolved diff") // unresolved diff, included
505 assert.NotContains(t, out, "Unresolved general") // general, excluded by type
506 })
508 t.Run("--type all includes system notes in text output", func(t *testing.T) {
509 t.Parallel()
511 tc := gitlabtesting.NewTestClient(t)
512 makeMRForList(t, tc)
514 tc.MockDiscussions.EXPECT().
515 ListMergeRequestDiscussions("OWNER/REPO", int64(1), gomock.Any(), gomock.Any()).
516 Return([]*gitlab.Discussion{
517 {
518 ID: "general1234567890abcdef1234567890abcdef12",
519 IndividualNote: true,
520 Notes: []*gitlab.Note{
521 {ID: 100, Body: "General comment", Author: gitlab.NoteAuthor{Username: "alice"}, CreatedAt: ts("2025-01-15 10:00:00")},
522 },
523 },
524 {
525 ID: "systemnote34567890abcdef1234567890abcdef12",
526 IndividualNote: true,
527 Notes: []*gitlab.Note{
528 {ID: 200, Body: "assigned to alice", Author: gitlab.NoteAuthor{Username: "bot"}, System: true, CreatedAt: ts("2025-01-15 11:00:00")},
529 },
530 },
531 }, nil, nil)
533 exec := setupListCmd(t, tc)
534 output, err := exec(`list 1 --type all`)
535 require.NoError(t, err)
537 out := output.String()
538 assert.Contains(t, out, "General comment")
539 assert.Contains(t, out, "assigned to alice")
540 })
542 t.Run("default (no --type flag) includes system notes in text output", func(t *testing.T) {
543 t.Parallel()
545 tc := gitlabtesting.NewTestClient(t)
546 makeMRForList(t, tc)
548 tc.MockDiscussions.EXPECT().
549 ListMergeRequestDiscussions("OWNER/REPO", int64(1), gomock.Any(), gomock.Any()).
550 Return([]*gitlab.Discussion{
551 {
552 ID: "general1234567890abcdef1234567890abcdef12",
553 IndividualNote: true,
554 Notes: []*gitlab.Note{
555 {ID: 100, Body: "General comment", Author: gitlab.NoteAuthor{Username: "alice"}, CreatedAt: ts("2025-01-15 10:00:00")},
556 },
557 },
558 {
559 ID: "systemnote34567890abcdef1234567890abcdef12",
560 IndividualNote: true,
561 Notes: []*gitlab.Note{
562 {ID: 200, Body: "assigned to alice", Author: gitlab.NoteAuthor{Username: "bot"}, System: true, CreatedAt: ts("2025-01-15 11:00:00")},
563 },
564 },
565 }, nil, nil)
567 exec := setupListCmd(t, tc)
568 output, err := exec(`list 1`)
569 require.NoError(t, err)
571 out := output.String()
572 assert.Contains(t, out, "General comment")
573 assert.Contains(t, out, "assigned to alice")
574 })
576 t.Run("non-resolvable excluded from state filter", func(t *testing.T) {
577 t.Parallel()
579 tc := gitlabtesting.NewTestClient(t)
580 makeMRForList(t, tc)
582 tc.MockDiscussions.EXPECT().
583 ListMergeRequestDiscussions("OWNER/REPO", int64(1), gomock.Any(), gomock.Any()).
584 Return([]*gitlab.Discussion{
585 {
586 ID: "nonresol234567890abcdef1234567890abcdef12",
587 IndividualNote: true,
588 Notes: []*gitlab.Note{
589 {
590 ID: 100, Body: "System note", Author: gitlab.NoteAuthor{Username: "bot"},
591 System: true, Resolvable: false, CreatedAt: ts("2025-01-15 10:00:00"),
592 },
593 },
594 },
595 {
596 ID: "resolvabl34567890abcdef1234567890abcdef12",
597 IndividualNote: true,
598 Notes: []*gitlab.Note{
599 {
600 ID: 200, Body: "Unresolved note", Author: gitlab.NoteAuthor{Username: "alice"},
601 Resolvable: true, Resolved: false, CreatedAt: ts("2025-01-15 11:00:00"),
602 },
603 },
604 },
605 }, nil, nil)
607 exec := setupListCmd(t, tc)
608 output, err := exec(`list 1 --state unresolved`)
609 require.NoError(t, err)
611 out := output.String()
612 assert.NotContains(t, out, "System note") // non-resolvable, excluded by filter
613 assert.Contains(t, out, "Unresolved note") // resolvable + unresolved, included
614 })
616 t.Run("help explains discussion IDs for replies", func(t *testing.T) {
617 t.Parallel()
619 var output bytes.Buffer
620 cmd := NewCmdNote(cmdtest.NewTestFactory(nil))
621 cmd.SetArgs([]string{"list", "--help"})
622 cmd.SetOut(&output)
623 require.NoError(t, cmd.Execute())
625 out := output.String()
626 assert.Contains(t, out, "eight-character prefix")
627 assert.Contains(t, out, "characters before the ellipsis")
628 assert.Contains(t, out, "glab mr note create --reply")
629 assert.Contains(t, out, "glab mr note list -F json | jq -r '.[].id'")
630 assert.Contains(t, out, "the `id` field of each discussion object")
631 assert.NotContains(t, out, "top-level `.id`")
632 assert.NotContains(t, out, "Uses the same output format as `glab mr view --comments`.")
633 })
634}
Diagnostics8 git calls · 185 ms
CallStatusSizeTime0185 ms
discover200185 B3 ms
git.upload-pack discover http.response.status_code=200 git.upstream.cf_ray=- git.upstream.phase=ls-refs git.upstream.dur_ms=3 git.response.bytes=185 git.server.agent=git/2.56.g1891de4-Linux git.server.object_format=sha1 git.server.caps=agent ls-refs fetch server-option object-format git.server.fetch=shallow wait-for-done filter git.protocol.version=2 git.pkt.frames=9 git.pkt.data=7 git.pkt.flush=2 git.pkt.delim=0 git.pkt.bytes=185 git.pkt.payload.max=35
ls-refs20058 KiB · hit3 ms
git.upload-pack ls-refs http.response.status_code=200 git.upstream.cf_ray=- git.upstream.phase=ls-refs git.upstream.dur_ms=3 git.response.bytes=59849 git.response.cache=HIT git.response.duration_ms=3 git.protocol.version=2 git.pkt.frames=731 git.pkt.data=730 git.pkt.flush=1 git.pkt.delim=0 git.pkt.bytes=59849 git.pkt.payload.max=143 git.ls_refs.count=730 git.ls_refs.head=refs/heads/main
fetchtree:0 · deepen 1020032 KiB · hit3 ms
git.upload-pack fetch http.response.status_code=200 git.upstream.cf_ray=- git.upstream.phase=fetch git.upstream.dur_ms=3 git.response.bytes=32926 git.response.cache=HIT git.response.duration_ms=3 git.fetch.filter=tree:0 git.fetch.wants=0dd7574dce9e385c5c30540e6c15657adc6bdce9 git.fetch.haves.count=0 git.fetch.deepen=10 git.fetch.thin_pack=false git.fetch.ofs_delta=true git.protocol.version=2 git.pkt.frames=22 git.pkt.data=20 git.pkt.flush=1 git.pkt.delim=1 git.pkt.bytes=32926 git.pkt.payload.max=32046 git.sideband.band1.bytes=32046 git.sideband.band2.bytes=0 git.sideband.band3.bytes=0 git.pack.objects=80 git.pack.bytes=32046 git.pack.ofs_delta=36 git.pack.ref_delta=0 git.pack.chain.max=2 git.pack.trailer=cb0bad5d7ffc514895d8b21c4dd470327f90bc91 git.pack.full=44Open pack map
fetchcombine:blob:none+tree:2 · deepen 12004.2 KiB · hit3 ms
git.upload-pack fetch http.response.status_code=200 git.upstream.cf_ray=- git.upstream.phase=fetch git.upstream.dur_ms=3 git.response.bytes=4273 git.response.cache=HIT git.response.duration_ms=3 git.fetch.filter=combine:blob:none+tree:2 git.fetch.wants=0dd7574dce9e385c5c30540e6c15657adc6bdce9 git.fetch.haves.count=0 git.fetch.deepen=1 git.fetch.thin_pack=false git.fetch.ofs_delta=true git.protocol.version=2 git.pkt.frames=7 git.pkt.data=5 git.pkt.flush=1 git.pkt.delim=1 git.pkt.bytes=4273 git.pkt.payload.max=4173 git.sideband.band1.bytes=4173 git.sideband.band2.bytes=0 git.sideband.band3.bytes=0 git.pack.objects=11 git.pack.bytes=4173 git.fetch.wide.objects=11 git.fetch.wide.extra_bytes=3930 git.fetch.wide.blobs=0
fetchtree:02001.8 KiB · hit4 ms
git.upload-pack fetch http.response.status_code=200 git.upstream.cf_ray=- git.upstream.phase=fetch git.upstream.dur_ms=4 git.response.bytes=1857 git.response.cache=HIT git.response.duration_ms=4 git.fetch.filter=tree:0 git.fetch.wants=dce174ff8c632a19d17eea99c8a9b7c37fb2b592 git.fetch.haves.count=0 git.fetch.deepen=0 git.fetch.thin_pack=false git.fetch.ofs_delta=true git.protocol.version=2 git.pkt.frames=4 git.pkt.data=3 git.pkt.flush=1 git.pkt.delim=0 git.pkt.bytes=1857 git.pkt.payload.max=1830 git.sideband.band1.bytes=1830 git.sideband.band2.bytes=0 git.sideband.band3.bytes=0 git.pack.objects=1 git.pack.bytes=1830 git.pack.trailer=fb03183b7909876778f740d196d7516811003517Open pack map
fetchtree:0200746 B · hit3 ms
git.upload-pack fetch http.response.status_code=200 git.upstream.cf_ray=- git.upstream.phase=fetch git.upstream.dur_ms=3 git.response.bytes=746 git.response.cache=HIT git.response.duration_ms=3 git.fetch.filter=tree:0 git.fetch.wants=f3d413a22af5a9c2fe9aa49709b1cb36d1351a7f git.fetch.haves.count=0 git.fetch.deepen=0 git.fetch.thin_pack=false git.fetch.ofs_delta=true git.protocol.version=2 git.pkt.frames=4 git.pkt.data=3 git.pkt.flush=1 git.pkt.delim=0 git.pkt.bytes=746 git.pkt.payload.max=719 git.sideband.band1.bytes=719 git.sideband.band2.bytes=0 git.sideband.band3.bytes=0 git.pack.objects=1 git.pack.bytes=719 git.pack.trailer=330baf80c59a4208b55120dff7dd824b7952b790Open pack map
fetchtree:0200540 B · hit2 ms
git.upload-pack fetch http.response.status_code=200 git.upstream.cf_ray=- git.upstream.phase=fetch git.upstream.dur_ms=2 git.response.bytes=540 git.response.cache=HIT git.response.duration_ms=2 git.fetch.filter=tree:0 git.fetch.wants=d1be7f980a856805fa31e30e01fff4db335cbe1b git.fetch.haves.count=0 git.fetch.deepen=0 git.fetch.thin_pack=false git.fetch.ofs_delta=true git.protocol.version=2 git.pkt.frames=4 git.pkt.data=3 git.pkt.flush=1 git.pkt.delim=0 git.pkt.bytes=540 git.pkt.payload.max=513 git.sideband.band1.bytes=513 git.sideband.band2.bytes=0 git.sideband.band3.bytes=0 git.pack.objects=1 git.pack.bytes=513 git.pack.trailer=6c82398efd91c9e023d583b948fde889bd4991b2Open pack map
fetch2002.5 KiB170 ms
git.upload-pack fetch http.response.status_code=200 git.upstream.cf_ray=- git.upstream.phase=fetch git.upstream.dur_ms=170 git.response.bytes=2535 git.response.cache=MISS git.response.duration_ms=170 git.fetch.wants=39a28f7afcf16c134657bd4c009cbdfd14f2f1c5 git.fetch.haves.count=0 git.fetch.deepen=0 git.fetch.thin_pack=false git.fetch.ofs_delta=true git.protocol.version=2 git.pkt.frames=4 git.pkt.data=3 git.pkt.flush=1 git.pkt.delim=0 git.pkt.bytes=2535 git.pkt.payload.max=2508 git.sideband.band1.bytes=2508 git.sideband.band2.bytes=0 git.sideband.band3.bytes=0
Each row is one HTTP round trip ply made to the git server for this page, on one timeline. discover asks what the server speaks, ls-refs lists branch tips, fetch brings objects by id. A hit was served by Workers Cache. Tap a row for its wire details.
- Remote
- https://gitlab.com/gitlab-org/cli
- Ref
- refs/heads/main
- Commit
- 0dd7574dce9e385c5c30540e6c15657adc6bdce9
- cf-ray
- a5e2cab879ff4b67
- Request
- ec3c8533…
- Protocol
- v2 · sha1
- Agent
- git/2.56.g1891de4-Linux
- Filter
- advertised
- Fetch
- shallow wait-for-done filter
- Capabilities
- agent ls-refs fetch server-option object-format