GitLabgitlab-org

cli

main
ply8 git calls211 ms100 KiB6 cachedprotocol v2
524 lines16 KiBRaw
1package list
3import (
4 "encoding/json"
5 "testing"
6 "time"
8 "github.com/stretchr/testify/assert"
9 "github.com/stretchr/testify/require"
10 "go.uber.org/mock/gomock"
12 gitlab "gitlab.com/gitlab-org/api/client-go/v3"
13 gitlabtesting "gitlab.com/gitlab-org/api/client-go/v3/testing"
15 "gitlab.com/gitlab-org/cli/internal/api"
16 "gitlab.com/gitlab-org/cli/internal/testing/cmdtest"
19func Test_ListProjectMilestones(t *testing.T) {
20 type testCase struct {
21 Name string
22 ExpectedMsg []string
23 wantErr bool
24 cli string
25 wantStderr string
26 setupMock func(tc *gitlabtesting.TestClient)
27 }
29 testMilestone := &gitlab.Milestone{
30 ID: 123,
31 ProjectID: 456,
32 Title: "Milestone title",
33 Description: "Example description",
34 State: "closed",
35 DueDate: new(gitlab.ISOTime(time.Date(2025, 1, 15, 0, 0, 0, 0, time.UTC))),
36 }
38 testCases := []testCase{
39 {
40 Name: "List project milestones",
41 ExpectedMsg: []string{"Title\tDescription\tState\tDue Date\nMilestone title\tExample description\tclosed\t2025-01-15\n\n"},
42 cli: "--project 456",
43 setupMock: func(tc *gitlabtesting.TestClient) {
44 tc.MockMilestones.EXPECT().ListMilestones("456", gomock.Any()).Return([]*gitlab.Milestone{testMilestone}, nil, nil)
45 },
46 },
47 {
48 Name: "When --show-id is used shows a list of milestones with IDs",
49 ExpectedMsg: []string{"ID\tTitle\tDescription\tState\tDue Date\n123\tMilestone title\tExample description\tclosed\t2025-01-15\n\n"},
50 cli: "--project 456 --show-id",
51 setupMock: func(tc *gitlabtesting.TestClient) {
52 tc.MockMilestones.EXPECT().ListMilestones("456", gomock.Any()).Return([]*gitlab.Milestone{testMilestone}, nil, nil)
53 },
54 },
55 {
56 Name: "When no milestones are found returns a message",
57 ExpectedMsg: []string{"No milestones found.\n"},
58 cli: "--project 456",
59 setupMock: func(tc *gitlabtesting.TestClient) {
60 tc.MockMilestones.EXPECT().ListMilestones("456", gomock.Any()).Return([]*gitlab.Milestone{}, nil, nil)
61 },
62 },
63 {
64 Name: "When --include-descendants is used with --project returns error",
65 cli: "--project 456 --include-descendants",
66 wantErr: true,
67 wantStderr: "if any flags in the group [project include-descendants] are set none of the others can be",
68 setupMock: func(tc *gitlabtesting.TestClient) {},
69 },
70 }
72 for _, tc := range testCases {
73 t.Run(tc.Name, func(t *testing.T) {
74 // GIVEN
75 testClient := gitlabtesting.NewTestClient(t)
76 tc.setupMock(testClient)
77 exec := cmdtest.SetupCmdForTest(
78 t,
79 NewCmdList,
80 false,
81 cmdtest.WithApiClient(cmdtest.NewTestApiClient(t, nil, "", "", api.WithGitLabClient(testClient.Client))),
82 )
84 // WHEN
85 out, err := exec(tc.cli)
87 // THEN
88 if tc.wantErr {
89 require.Error(t, err)
90 assert.Contains(t, err.Error(), tc.wantStderr)
91 return
92 }
93 require.NoError(t, err)
94 for _, msg := range tc.ExpectedMsg {
95 assert.Equal(t, msg, out.OutBuf.String())
96 }
97 })
98 }
101func Test_ListGroupMilestones(t *testing.T) {
102 type testCase struct {
103 Name string
104 ExpectedMsg []string
105 wantErr bool
106 cli string
107 wantStderr string
108 clientOptions []gitlab.ClientOptionFunc
109 setupMock func(tc *gitlabtesting.TestClient)
110 }
112 testMilestone := &gitlab.GroupMilestone{
113 ID: 123,
114 GroupID: 456,
115 Title: "Milestone title",
116 Description: "Example description",
117 State: "closed",
118 DueDate: new(gitlab.ISOTime(time.Date(2025, 1, 15, 0, 0, 0, 0, time.UTC))),
119 }
121 groupMilestone := &gitlab.GroupMilestone{
122 ID: 123,
123 GroupID: 456,
124 Title: "Group milestone",
125 Description: "Group description",
126 State: "active",
127 DueDate: new(gitlab.ISOTime(time.Date(2025, 1, 15, 0, 0, 0, 0, time.UTC))),
128 WebURL: "https://gitlab.com/groups/example-group/-/milestones/123",
129 }
131 projectMilestone := &gitlab.GroupMilestone{
132 ID: 124,
133 ProjectID: 789,
134 Title: "Project milestone",
135 Description: "Project description",
136 State: "active",
137 DueDate: new(gitlab.ISOTime(time.Date(2025, 2, 20, 0, 0, 0, 0, time.UTC))),
138 WebURL: "https://gitlab.com/example-group/example-project/-/milestones/124",
139 }
141 fallbackMilestone := &gitlab.GroupMilestone{
142 ID: 125,
143 ProjectID: 790,
144 Title: "Fallback project milestone",
145 Description: "Fallback description",
146 State: "active",
147 DueDate: new(gitlab.ISOTime(time.Date(2025, 3, 25, 0, 0, 0, 0, time.UTC))),
148 }
150 testCases := []testCase{
151 {
152 Name: "List group milestones",
153 ExpectedMsg: []string{"Title\tDescription\tState\tDue Date\nMilestone title\tExample description\tclosed\t2025-01-15\n\n"},
154 cli: "--group 456",
155 setupMock: func(tc *gitlabtesting.TestClient) {
156 tc.MockGroupMilestones.EXPECT().ListGroupMilestones("456", gomock.Any()).Return([]*gitlab.GroupMilestone{testMilestone}, nil, nil)
157 },
158 },
159 {
160 Name: "When --show-id is used shows a list of milestones with IDs",
161 ExpectedMsg: []string{"ID\tTitle\tDescription\tState\tDue Date\n123\tMilestone title\tExample description\tclosed\t2025-01-15\n\n"},
162 cli: "--group 456 --show-id",
163 setupMock: func(tc *gitlabtesting.TestClient) {
164 tc.MockGroupMilestones.EXPECT().ListGroupMilestones("456", gomock.Any()).Return([]*gitlab.GroupMilestone{testMilestone}, nil, nil)
165 },
166 },
167 {
168 Name: "When no milestones are found returns a message",
169 ExpectedMsg: []string{"No milestones found.\n"},
170 cli: "--group 456",
171 setupMock: func(tc *gitlabtesting.TestClient) {
172 tc.MockGroupMilestones.EXPECT().ListGroupMilestones("456", gomock.Any()).Return([]*gitlab.GroupMilestone{}, nil, nil)
173 },
174 },
175 {
176 Name: "When --include-descendants is used lists group and descendant project milestones",
177 ExpectedMsg: []string{
178 "Title\tOwner\tDescription\tState\tDue Date\n" +
179 "Group milestone\texample-group\tGroup description\tactive\t2025-01-15\n" +
180 "Project milestone\texample-group/example-project\tProject description\tactive\t2025-02-20\n\n",
181 },
182 cli: "--group 456 --include-descendants",
183 setupMock: func(tc *gitlabtesting.TestClient) {
184 tc.MockGroupMilestones.EXPECT().ListGroupMilestones("456", &gitlab.ListGroupMilestonesOptions{
185 ListOptions: gitlab.ListOptions{
186 Page: 1,
187 PerPage: 20,
188 },
189 IncludeDescendents: new(true),
190 }).Return([]*gitlab.GroupMilestone{groupMilestone, projectMilestone}, nil, nil)
191 },
192 },
193 {
194 Name: "When --include-descendants and --show-id are used",
195 ExpectedMsg: []string{
196 "ID\tTitle\tOwner\tDescription\tState\tDue Date\n" +
197 "123\tGroup milestone\texample-group\tGroup description\tactive\t2025-01-15\n" +
198 "124\tProject milestone\texample-group/example-project\tProject description\tactive\t2025-02-20\n\n",
199 },
200 cli: "--group 456 --include-descendants --show-id",
201 setupMock: func(tc *gitlabtesting.TestClient) {
202 tc.MockGroupMilestones.EXPECT().ListGroupMilestones("456", &gitlab.ListGroupMilestonesOptions{
203 ListOptions: gitlab.ListOptions{
204 Page: 1,
205 PerPage: 20,
206 },
207 IncludeDescendents: new(true),
208 }).Return([]*gitlab.GroupMilestone{groupMilestone, projectMilestone}, nil, nil)
209 },
210 },
211 {
212 Name: "When --include-descendants is used and milestones have no WebURL",
213 ExpectedMsg: []string{
214 "Title\tOwner\tDescription\tState\tDue Date\n" +
215 "Fallback project milestone\tproject/790\tFallback description\tactive\t2025-03-25\n\n",
216 },
217 cli: "--group 456 --include-descendants",
218 setupMock: func(tc *gitlabtesting.TestClient) {
219 tc.MockGroupMilestones.EXPECT().ListGroupMilestones("456", &gitlab.ListGroupMilestonesOptions{
220 ListOptions: gitlab.ListOptions{
221 Page: 1,
222 PerPage: 20,
223 },
224 IncludeDescendents: new(true),
225 }).Return([]*gitlab.GroupMilestone{fallbackMilestone}, nil, nil)
226 },
227 },
228 {
229 Name: "When --include-descendants is used on sub-path instance",
230 ExpectedMsg: []string{
231 "Title\tOwner\tDescription\tState\tDue Date\n" +
232 "Group milestone\texample-group\tGroup description\tactive\t2025-01-15\n" +
233 "Project milestone\texample-group/example-project\tProject description\tactive\t2025-02-20\n\n",
234 },
235 cli: "--group 456 --include-descendants",
236 clientOptions: []gitlab.ClientOptionFunc{gitlab.WithBaseURL("https://example.com/gitlab/api/v4/")},
237 setupMock: func(tc *gitlabtesting.TestClient) {
238 tc.MockGroupMilestones.EXPECT().ListGroupMilestones("456", &gitlab.ListGroupMilestonesOptions{
239 ListOptions: gitlab.ListOptions{
240 Page: 1,
241 PerPage: 20,
242 },
243 IncludeDescendents: new(true),
244 }).Return([]*gitlab.GroupMilestone{
245 {
246 ID: 123,
247 GroupID: 456,
248 Title: "Group milestone",
249 Description: "Group description",
250 State: "active",
251 DueDate: new(gitlab.ISOTime(time.Date(2025, 1, 15, 0, 0, 0, 0, time.UTC))),
252 WebURL: "https://example.com/gitlab/groups/example-group/-/milestones/123",
253 },
254 {
255 ID: 124,
256 ProjectID: 789,
257 Title: "Project milestone",
258 Description: "Project description",
259 State: "active",
260 DueDate: new(gitlab.ISOTime(time.Date(2025, 2, 20, 0, 0, 0, 0, time.UTC))),
261 WebURL: "https://example.com/gitlab/example-group/example-project/-/milestones/124",
262 },
263 }, nil, nil)
264 },
265 },
266 }
268 for _, tc := range testCases {
269 t.Run(tc.Name, func(t *testing.T) {
270 // GIVEN
271 clientOpts := tc.clientOptions
272 if len(clientOpts) == 0 {
273 clientOpts = []gitlab.ClientOptionFunc{gitlab.WithBaseURL("https://gitlab.com/api/v4")}
274 }
275 testClient := gitlabtesting.NewTestClient(t, clientOpts...)
276 tc.setupMock(testClient)
277 exec := cmdtest.SetupCmdForTest(
278 t,
279 NewCmdList,
280 false,
281 cmdtest.WithApiClient(cmdtest.NewTestApiClient(t, nil, "", "", api.WithGitLabClient(testClient.Client))),
282 )
284 // WHEN
285 out, err := exec(tc.cli)
287 // THEN
288 if tc.wantErr {
289 require.Error(t, err)
290 assert.Contains(t, err.Error(), tc.wantStderr)
291 return
292 }
293 require.NoError(t, err)
294 for _, msg := range tc.ExpectedMsg {
295 assert.Equal(t, msg, out.OutBuf.String())
296 }
297 })
298 }
301func TestMilestoneList_JSON(t *testing.T) {
302 t.Parallel()
304 testMilestone := &gitlab.Milestone{
305 ID: 123,
306 ProjectID: 456,
307 Title: "Milestone title",
308 Description: "Example description",
309 State: "closed",
310 DueDate: new(gitlab.ISOTime(time.Date(2025, 1, 15, 0, 0, 0, 0, time.UTC))),
311 }
313 testClient := gitlabtesting.NewTestClient(t)
314 testClient.MockMilestones.EXPECT().
315 ListMilestones("456", gomock.Any()).
316 Return([]*gitlab.Milestone{testMilestone}, nil, nil)
318 exec := cmdtest.SetupCmdForTest(
319 t,
320 NewCmdList,
321 false,
322 cmdtest.WithApiClient(cmdtest.NewTestApiClient(t, nil, "", "", api.WithGitLabClient(testClient.Client))),
323 )
325 out, err := exec("--project 456 --output json")
326 require.NoError(t, err)
328 assert.Contains(t, out.String(), `"id":123`)
329 assert.Contains(t, out.String(), `"title":"Milestone title"`)
330 assert.Contains(t, out.String(), `"state":"closed"`)
331 assert.Empty(t, out.Stderr())
334func TestGroupMilestoneList_JSON(t *testing.T) {
335 t.Parallel()
337 testMilestones := []*gitlab.GroupMilestone{
338 {
339 ID: 123,
340 GroupID: 456,
341 Title: "Group milestone",
342 Description: "Group description",
343 State: "active",
344 },
345 {
346 ID: 124,
347 ProjectID: 789,
348 Title: "Descendant project milestone",
349 Description: "Project description",
350 State: "active",
351 },
352 }
354 testClient := gitlabtesting.NewTestClient(t)
355 testClient.MockGroupMilestones.EXPECT().
356 ListGroupMilestones("456", &gitlab.ListGroupMilestonesOptions{
357 ListOptions: gitlab.ListOptions{
358 Page: 1,
359 PerPage: 20,
360 },
361 IncludeDescendents: new(true),
362 }).
363 Return(testMilestones, nil, nil)
365 exec := cmdtest.SetupCmdForTest(
366 t,
367 NewCmdList,
368 false,
369 cmdtest.WithApiClient(cmdtest.NewTestApiClient(t, nil, "", "", api.WithGitLabClient(testClient.Client))),
370 )
372 out, err := exec("--group 456 --include-descendants --output json")
373 require.NoError(t, err)
375 var got []gitlab.GroupMilestone
376 require.NoError(t, json.Unmarshal(out.OutBuf.Bytes(), &got))
377 require.Len(t, got, 2)
378 assert.Equal(t, int64(456), got[0].GroupID)
379 assert.Equal(t, int64(0), got[0].ProjectID)
380 assert.Equal(t, "Group milestone", got[0].Title)
381 assert.Equal(t, int64(0), got[1].GroupID)
382 assert.Equal(t, int64(789), got[1].ProjectID)
383 assert.Equal(t, "Descendant project milestone", got[1].Title)
384 assert.Empty(t, out.Stderr())
387func Test_milestoneOwner(t *testing.T) {
388 tests := []struct {
389 name string
390 milestone *gitlab.GroupMilestone
391 basePath string
392 expected string
393 }{
394 {
395 name: "nil milestone",
396 milestone: nil,
397 expected: "",
398 },
399 {
400 name: "group milestone with standard web URL",
401 milestone: &gitlab.GroupMilestone{
402 GroupID: 5,
403 WebURL: "https://gitlab.com/groups/gitlab-org/-/milestones/42",
404 },
405 expected: "gitlab-org",
406 },
407 {
408 name: "subgroup milestone with standard web URL",
409 milestone: &gitlab.GroupMilestone{
410 GroupID: 15,
411 WebURL: "https://gitlab.com/groups/gitlab-org/subgroup/-/milestones/42",
412 },
413 expected: "gitlab-org/subgroup",
414 },
415 {
416 name: "project milestone with standard web URL",
417 milestone: &gitlab.GroupMilestone{
418 ProjectID: 9,
419 WebURL: "https://gitlab.com/gitlab-org/gitlab/-/milestones/1",
420 },
421 expected: "gitlab-org/gitlab",
422 },
423 {
424 name: "subgroup project milestone with standard web URL",
425 milestone: &gitlab.GroupMilestone{
426 ProjectID: 10,
427 WebURL: "https://gitlab.com/gitlab-org/subgroup/project/-/milestones/1",
428 },
429 expected: "gitlab-org/subgroup/project",
430 },
431 {
432 name: "milestone with legacy web URL without dash",
433 milestone: &gitlab.GroupMilestone{
434 GroupID: 5,
435 WebURL: "https://gitlab.example.com/groups/gitlab-org/milestones/42",
436 },
437 expected: "gitlab-org",
438 },
439 {
440 name: "group milestone on self-managed sub-path instance",
441 milestone: &gitlab.GroupMilestone{
442 GroupID: 5,
443 WebURL: "https://example.com/gitlab/groups/foo/-/milestones/1",
444 },
445 basePath: "/gitlab",
446 expected: "foo",
447 },
448 {
449 name: "project milestone on self-managed sub-path instance",
450 milestone: &gitlab.GroupMilestone{
451 ProjectID: 9,
452 WebURL: "https://example.com/gitlab/foo/proj/-/milestones/1",
453 },
454 basePath: "/gitlab",
455 expected: "foo/proj",
456 },
457 {
458 name: "nested subgroup milestone on self-managed sub-path instance",
459 milestone: &gitlab.GroupMilestone{
460 GroupID: 15,
461 WebURL: "https://example.com/gitlab/groups/foo/bar/-/milestones/1",
462 },
463 basePath: "/gitlab",
464 expected: "foo/bar",
465 },
466 {
467 name: "empty web URL fallback to project ID",
468 milestone: &gitlab.GroupMilestone{
469 ProjectID: 99,
470 },
471 expected: "project/99",
472 },
473 {
474 name: "empty web URL fallback to group ID",
475 milestone: &gitlab.GroupMilestone{
476 GroupID: 88,
477 },
478 expected: "group/88",
479 },
480 {
481 name: "empty milestone with no IDs or web URL",
482 milestone: &gitlab.GroupMilestone{},
483 expected: "",
484 },
485 }
487 for _, tt := range tests {
488 t.Run(tt.name, func(t *testing.T) {
489 assert.Equal(t, tt.expected, milestoneOwner(tt.milestone, tt.basePath))
490 })
491 }
494func Test_instanceBasePath(t *testing.T) {
495 tests := []struct {
496 name string
497 baseURL string
498 expected string
499 }{
500 {
501 name: "root gitlab instance",
502 baseURL: "https://gitlab.com/api/v4/",
503 expected: "",
504 },
505 {
506 name: "sub-path gitlab instance",
507 baseURL: "https://example.com/gitlab/api/v4/",
508 expected: "/gitlab",
509 },
510 {
511 name: "nested sub-path gitlab instance",
512 baseURL: "https://example.com/sub/gitlab/api/v4/",
513 expected: "/sub/gitlab",
514 },
515 }
517 for _, tt := range tests {
518 t.Run(tt.name, func(t *testing.T) {
519 client, err := gitlab.NewClient("", gitlab.WithBaseURL(tt.baseURL))
520 require.NoError(t, err)
521 assert.Equal(t, tt.expected, instanceBasePath(client))
522 })
523 }
Diagnostics8 git calls · 211 ms
CallStatusSizeTime0211 ms
discover200185 B3 ms
git.upload-pack discover
http.response.status_code=200
git.upstream.cf_ray=-
git.upstream.phase=fetch
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 · hit2 ms
git.upload-pack ls-refs
http.response.status_code=200
git.upstream.cf_ray=-
git.upstream.phase=ls-refs
git.upstream.dur_ms=2
git.response.bytes=59849
git.response.cache=HIT
git.response.duration_ms=2
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=44
Open 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 · 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=1857
git.response.cache=HIT
git.response.duration_ms=3
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=fb03183b7909876778f740d196d7516811003517
Open pack map
fetchtree:0200287 B · hit3 ms
git.upload-pack fetch
http.response.status_code=200
git.upstream.cf_ray=-
git.upstream.phase=fetch
git.upstream.dur_ms=5
git.response.bytes=287
git.response.cache=HIT
git.response.duration_ms=3
git.fetch.filter=tree:0
git.fetch.wants=4b2a62b649e97f7e66e5dd178207a12ec137d596
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=287
git.pkt.payload.max=260
git.sideband.band1.bytes=260
git.sideband.band2.bytes=0
git.sideband.band3.bytes=0
git.pack.objects=1
git.pack.bytes=260
git.pack.trailer=6593eafdcd01a12bbd3c8da0f75aaca8bc99568f
Open pack map
fetchtree:0200133 B · hit5 ms
git.upload-pack fetch
http.response.status_code=200
git.upstream.cf_ray=-
git.upstream.phase=fetch
git.upstream.dur_ms=194
git.response.bytes=133
git.response.cache=HIT
git.response.duration_ms=5
git.fetch.filter=tree:0
git.fetch.wants=04833289db4cc01186c55b0c646287b76a4b090e
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=133
git.pkt.payload.max=106
git.sideband.band1.bytes=106
git.sideband.band2.bytes=0
git.sideband.band3.bytes=0
git.pack.objects=1
git.pack.bytes=106
git.pack.trailer=d6fdc89fd5de86abfc32dcc9e6cda7ee8fe1971e
Open pack map
fetch2002.6 KiB194 ms
git.upload-pack fetch
http.response.status_code=200
git.response.bytes=2671
git.response.cache=MISS
git.response.duration_ms=194
git.fetch.wants=7095671709e935a22ac4877d92c0e52a3a0ed703
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=2671
git.pkt.payload.max=2644
git.sideband.band1.bytes=2644
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
a5e2df9bfbe92308
Request
5ae20dce…
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