GitLabgitlab-org

cli

main
ply8 git calls214 ms100 KiB6 cachedprotocol v2
460 lines15 KiBRaw
1//go:build !integration
3package status
5import (
6 "errors"
7 "testing"
9 "github.com/stretchr/testify/assert"
10 "github.com/stretchr/testify/require"
11 "go.uber.org/mock/gomock"
13 gitlab "gitlab.com/gitlab-org/api/client-go/v3"
14 gitlabtesting "gitlab.com/gitlab-org/api/client-go/v3/testing"
16 "gitlab.com/gitlab-org/cli/internal/commands/ci/ciutils"
17 "gitlab.com/gitlab-org/cli/internal/testing/cmdtest"
20func Test_getPipelineWithFallback(t *testing.T) {
21 tests := []struct {
22 name string
23 setupMocks func(*gitlabtesting.TestClient)
24 branch string
25 wantPipeline *gitlab.Pipeline
26 wantErr bool
27 expectedErrMsg string
28 }{
29 {
30 name: "successfully gets latest pipeline",
31 branch: "main",
32 setupMocks: func(tc *gitlabtesting.TestClient) {
33 tc.MockPipelines.EXPECT().
34 GetLatestPipeline("OWNER/REPO", &gitlab.GetLatestPipelineOptions{Ref: new("main")}, gomock.Any()).
35 Return(&gitlab.Pipeline{ID: 1, Status: "success"}, nil, nil)
37 // Mock job check to verify pipeline has jobs
38 tc.MockJobs.EXPECT().
39 ListPipelineJobs("OWNER/REPO", int64(1), gomock.Any(), gomock.Any()).
40 Return([]*gitlab.Job{{ID: 1, Name: "test"}}, nil, nil)
41 },
42 wantPipeline: &gitlab.Pipeline{ID: 1, Status: "success"},
43 wantErr: false,
44 },
45 {
46 name: "falls back to MR pipeline when branch pipeline has no jobs",
47 branch: "feature",
48 setupMocks: func(tc *gitlabtesting.TestClient) {
49 // Latest pipeline found but has no jobs (e.g., external pipeline)
50 tc.MockPipelines.EXPECT().
51 GetLatestPipeline("OWNER/REPO", &gitlab.GetLatestPipelineOptions{Ref: new("feature")}, gomock.Any()).
52 Return(&gitlab.Pipeline{ID: 1, Status: "success"}, nil, nil)
54 // Mock job check returns empty list
55 tc.MockJobs.EXPECT().
56 ListPipelineJobs("OWNER/REPO", int64(1), gomock.Any(), gomock.Any()).
57 Return([]*gitlab.Job{}, nil, nil)
59 // Find and get MR
60 tc.MockMergeRequests.EXPECT().
61 ListProjectMergeRequests("OWNER/REPO", gomock.Any()).
62 Return([]*gitlab.BasicMergeRequest{{IID: 1}}, nil, nil)
64 tc.MockMergeRequests.EXPECT().
65 GetMergeRequest("OWNER/REPO", int64(1), gomock.Any()).
66 Return(&gitlab.MergeRequest{
67 BasicMergeRequest: gitlab.BasicMergeRequest{IID: 1},
68 HeadPipeline: &gitlab.Pipeline{ID: 2, Status: "running"},
69 }, nil, nil)
71 tc.MockPipelines.EXPECT().
72 GetPipeline("OWNER/REPO", int64(2), gomock.Any()).
73 Return(&gitlab.Pipeline{
74 ID: 2,
75 Status: "running",
76 }, nil, nil)
77 },
78 wantPipeline: &gitlab.Pipeline{ID: 2, Status: "running"},
79 wantErr: false,
80 },
81 {
82 name: "falls back to MR pipeline when latest not found",
83 branch: "feature",
84 setupMocks: func(tc *gitlabtesting.TestClient) {
85 // Latest pipeline not found
86 tc.MockPipelines.EXPECT().
87 GetLatestPipeline("OWNER/REPO", &gitlab.GetLatestPipelineOptions{Ref: new("feature")}, gomock.Any()).
88 Return(nil, nil, errors.New("not found"))
90 // Find and get MR
91 tc.MockMergeRequests.EXPECT().
92 ListProjectMergeRequests("OWNER/REPO", gomock.Any()).
93 Return([]*gitlab.BasicMergeRequest{{IID: 1}}, nil, nil)
95 tc.MockMergeRequests.EXPECT().
96 GetMergeRequest("OWNER/REPO", int64(1), gomock.Any()).
97 Return(&gitlab.MergeRequest{
98 BasicMergeRequest: gitlab.BasicMergeRequest{IID: 1},
99 HeadPipeline: &gitlab.Pipeline{ID: 2, Status: "running"},
100 }, nil, nil)
102 tc.MockPipelines.EXPECT().
103 GetPipeline("OWNER/REPO", int64(2), gomock.Any()).
104 Return(&gitlab.Pipeline{
105 ID: 2,
106 Status: "running",
107 }, nil, nil)
108 },
109 wantPipeline: &gitlab.Pipeline{ID: 2, Status: "running"},
110 wantErr: false,
111 },
112 {
113 name: "returns error when no pipeline found",
114 branch: "feature",
115 setupMocks: func(tc *gitlabtesting.TestClient) {
116 // Latest pipeline not found
117 tc.MockPipelines.EXPECT().
118 GetLatestPipeline("OWNER/REPO", &gitlab.GetLatestPipelineOptions{Ref: new("feature")}, gomock.Any()).
119 Return(nil, nil, errors.New("not found"))
121 // No MRs found
122 tc.MockMergeRequests.EXPECT().
123 ListProjectMergeRequests("OWNER/REPO", gomock.Any()).
124 Return([]*gitlab.BasicMergeRequest{}, nil, nil)
125 },
126 wantPipeline: nil,
127 wantErr: true,
128 expectedErrMsg: "no pipeline found for branch feature and failed to find associated merge request",
129 },
130 {
131 name: "returns error when MR has no pipeline",
132 branch: "feature",
133 setupMocks: func(tc *gitlabtesting.TestClient) {
134 // Latest pipeline not found
135 tc.MockPipelines.EXPECT().
136 GetLatestPipeline("OWNER/REPO", &gitlab.GetLatestPipelineOptions{Ref: new("feature")}, gomock.Any()).
137 Return(nil, nil, errors.New("not found"))
139 // Find MR but no pipeline
140 tc.MockMergeRequests.EXPECT().
141 ListProjectMergeRequests("OWNER/REPO", gomock.Any()).
142 Return([]*gitlab.BasicMergeRequest{{IID: 1}}, nil, nil)
143 tc.MockMergeRequests.EXPECT().
144 GetMergeRequest("OWNER/REPO", int64(1), gomock.Any()).
145 Return(&gitlab.MergeRequest{
146 BasicMergeRequest: gitlab.BasicMergeRequest{IID: 1},
147 }, nil, nil)
148 },
149 wantPipeline: nil,
150 wantErr: true,
151 expectedErrMsg: "no pipeline found. It might not exist yet",
152 },
153 }
155 for _, tt := range tests {
156 t.Run(tt.name, func(t *testing.T) {
157 tc := gitlabtesting.NewTestClient(t)
158 tt.setupMocks(tc)
160 // Create test IO streams
161 ios, _, _, _ := cmdtest.TestIOStreams(cmdtest.WithTestIOStreamsAsTTY(false))
163 pipeline, err := ciutils.GetPipelineWithFallback(t.Context(), tc.Client, "OWNER/REPO", tt.branch, ios)
165 if tt.wantErr {
166 require.Error(t, err)
167 if tt.expectedErrMsg != "" {
168 assert.Contains(t, err.Error(), tt.expectedErrMsg)
169 }
170 assert.Nil(t, pipeline)
171 return
172 }
174 require.NoError(t, err)
175 assert.Equal(t, tt.wantPipeline.ID, pipeline.ID)
176 assert.Equal(t, tt.wantPipeline.Status, pipeline.Status)
177 })
178 }
181func TestCiStatusCommand_NoPrompt(t *testing.T) {
182 // Test that the command exits cleanly when NO_PROMPT is enabled
183 // and doesn't hang waiting for user input
184 tc := gitlabtesting.NewTestClient(t)
186 // Mock calls in expected order
187 gomock.InOrder(
188 // Mock a finished pipeline so the command doesn't loop
189 tc.MockPipelines.EXPECT().
190 GetLatestPipeline("OWNER/REPO", &gitlab.GetLatestPipelineOptions{Ref: new("main")}, gomock.Any()).
191 Return(&gitlab.Pipeline{ID: 1, Status: "success"}, nil, nil),
193 // Mock job check in GetPipelineWithFallback
194 tc.MockJobs.EXPECT().
195 ListPipelineJobs("OWNER/REPO", int64(1), gomock.Any()).
196 Return([]*gitlab.Job{{ID: 1, Name: "test"}}, nil, nil),
198 // Mock jobs for the pipeline - need to handle pagination
199 tc.MockJobs.EXPECT().
200 ListPipelineJobs("OWNER/REPO", int64(1), gomock.Any(), gomock.Any()).
201 Return([]*gitlab.Job{
202 {ID: 1, Name: "test", Stage: "test", Status: "success"},
203 }, &gitlab.Response{NextPage: 0}, nil),
204 )
206 exec := cmdtest.SetupCmdForTest(t, NewCmdStatus, true,
207 cmdtest.WithGitLabClient(tc.Client),
208 cmdtest.WithBranch("main"),
209 // Create custom option to disable prompts
210 func(f *cmdtest.Factory) {
211 f.IOStub.SetPrompt("true")
212 },
213 )
215 // This should complete without hanging
216 _, err := exec("")
217 require.NoError(t, err)
220func TestCiStatusCommand_WithPromptsEnabled_FinishedPipeline(t *testing.T) {
221 // Test that the command shows pipeline status and exits cleanly
222 // when dealing with a finished pipeline (no interactive prompts needed)
223 tc := gitlabtesting.NewTestClient(t)
225 // Mock calls in expected order
226 gomock.InOrder(
227 // Mock a finished pipeline
228 tc.MockPipelines.EXPECT().
229 GetLatestPipeline("OWNER/REPO", &gitlab.GetLatestPipelineOptions{Ref: new("main")}, gomock.Any()).
230 Return(&gitlab.Pipeline{ID: 1, Status: "success"}, nil, nil),
232 // Mock job check in GetPipelineWithFallback
233 tc.MockJobs.EXPECT().
234 ListPipelineJobs("OWNER/REPO", int64(1), gomock.Any()).
235 Return([]*gitlab.Job{{ID: 1, Name: "test"}}, nil, nil),
237 // Mock jobs for the pipeline - need to handle pagination
238 tc.MockJobs.EXPECT().
239 ListPipelineJobs("OWNER/REPO", int64(1), gomock.Any(), gomock.Any()).
240 Return([]*gitlab.Job{
241 {ID: 1, Name: "test", Stage: "test", Status: "success"},
242 }, &gitlab.Response{NextPage: 0}, nil),
243 )
245 exec := cmdtest.SetupCmdForTest(t, NewCmdStatus, false,
246 cmdtest.WithGitLabClient(tc.Client),
247 cmdtest.WithBranch("main"),
248 )
250 // This should complete without hanging since the pipeline is finished
251 _, err := exec("")
252 require.NoError(t, err)
255func TestCiStatusCommand_JSONWithWait_Error(t *testing.T) {
256 // Test that providing both `--output json` and `--wait`
257 // returns the "--output json cannot be used with --live, --wait, or --compact flags" error.
258 t.Parallel()
260 tc := gitlabtesting.NewTestClient(t)
262 exec := cmdtest.SetupCmdForTest(t, NewCmdStatus, false,
263 cmdtest.WithGitLabClient(tc.Client),
264 cmdtest.WithBranch("main"),
265 )
267 _, err := exec("--output json --wait")
268 require.Error(t, err)
269 assert.EqualError(t, err, "--output json cannot be used with --live, --wait, or --compact flags")
272func TestCiStatusCommand_Wait_NoPrompt(t *testing.T) {
273 // Test that --wait disables prompting and exits cleanly on a finished pipeline.
274 // This is the same as TestCiStatusCommand_NoPrompt, except using the --wait flag.
275 tc := gitlabtesting.NewTestClient(t)
277 gomock.InOrder(
278 tc.MockPipelines.EXPECT().
279 GetLatestPipeline("OWNER/REPO", &gitlab.GetLatestPipelineOptions{Ref: new("main")}, gomock.Any()).
280 Return(&gitlab.Pipeline{ID: 1, Status: "success"}, nil, nil),
282 tc.MockJobs.EXPECT().
283 ListPipelineJobs("OWNER/REPO", int64(1), gomock.Any()).
284 Return([]*gitlab.Job{{ID: 1, Name: "test"}}, nil, nil),
286 tc.MockJobs.EXPECT().
287 ListPipelineJobs("OWNER/REPO", int64(1), gomock.Any(), gomock.Any()).
288 Return([]*gitlab.Job{
289 {ID: 1, Name: "test", Stage: "test", Status: "success"},
290 }, &gitlab.Response{NextPage: 0}, nil),
291 )
293 exec := cmdtest.SetupCmdForTest(t, NewCmdStatus, true,
294 cmdtest.WithGitLabClient(tc.Client),
295 cmdtest.WithBranch("main"),
296 )
298 // This should complete without hanging. Unlike TestCiStatusCommand_NoPrompt,
299 // prompting is disabled via the --wait flag rather than f.IOStub.SetPrompt.
300 _, err := exec("--wait")
301 require.NoError(t, err)
304func Test_isLivePollableStatus(t *testing.T) {
305 t.Parallel()
307 // Source of truth: gitlab.BuildStateValue constants in client-go (types.go).
308 // "manual" is excluded because polling won't progress it; "canceled" is excluded
309 // because canceled pipelines don't transition back to running on their own —
310 // the canceled-supersede check in the live loop handles the rebase case.
311 tests := []struct {
312 status string
313 want bool
314 }{
315 {"created", true},
316 {"waiting_for_resource", true},
317 {"preparing", true},
318 {"pending", true},
319 {"running", true},
320 {"scheduled", true},
321 {"success", false},
322 {"failed", false},
323 {"canceled", false},
324 {"skipped", false},
325 {"manual", false},
326 {"", false},
327 {"unknown_future_status", false},
328 }
330 for _, tt := range tests {
331 t.Run(tt.status, func(t *testing.T) {
332 t.Parallel()
333 assert.Equal(t, tt.want, isLivePollableStatus(tt.status))
334 })
335 }
338func TestCiStatusCommand_Live_CanceledSuperseded(t *testing.T) {
339 // Intentionally not t.Parallel(): the live path enters uilive.New(), which
340 // writes to package-level globals in github.com/gosuri/uilive that the race
341 // detector flags when multiple tests run concurrently.
343 // When --live encounters a canceled pipeline AND a newer pipeline exists
344 // for the branch (e.g. rebase auto-canceled the previous run), switch to
345 // the new pipeline instead of exiting.
346 tc := gitlabtesting.NewTestClient(t)
348 gomock.InOrder(
349 // Initial fetch: returns canceled pipeline ID=1.
350 tc.MockPipelines.EXPECT().
351 GetLatestPipeline("OWNER/REPO", &gitlab.GetLatestPipelineOptions{Ref: new("main")}, gomock.Any()).
352 Return(&gitlab.Pipeline{ID: 1, Status: "canceled"}, nil, nil),
353 tc.MockJobs.EXPECT().
354 ListPipelineJobs("OWNER/REPO", int64(1), gomock.Any()).
355 Return([]*gitlab.Job{{ID: 1, Name: "test"}}, nil, nil),
357 // Loop iteration 1: list jobs for the canceled pipeline.
358 tc.MockJobs.EXPECT().
359 ListPipelineJobs("OWNER/REPO", int64(1), gomock.Any(), gomock.Any()).
360 Return([]*gitlab.Job{
361 {ID: 1, Name: "test", Stage: "test", Status: "canceled"},
362 }, &gitlab.Response{NextPage: 0}, nil),
364 // Canceled-supersede check: a newer pipeline now exists for the branch.
365 tc.MockPipelines.EXPECT().
366 GetLatestPipeline("OWNER/REPO", &gitlab.GetLatestPipelineOptions{Ref: new("main")}, gomock.Any()).
367 Return(&gitlab.Pipeline{ID: 2, Status: "success"}, nil, nil),
368 tc.MockJobs.EXPECT().
369 ListPipelineJobs("OWNER/REPO", int64(2), gomock.Any()).
370 Return([]*gitlab.Job{{ID: 2, Name: "test"}}, nil, nil),
371 )
373 exec := cmdtest.SetupCmdForTest(t, NewCmdStatus, false,
374 cmdtest.WithGitLabClient(tc.Client),
375 cmdtest.WithBranch("main"),
376 )
378 _, err := exec("--live")
379 require.NoError(t, err)
380 // gomock.InOrder above asserts that the canceled-supersede check re-queried
381 // for the latest pipeline after seeing the canceled status.
384func TestCiStatusCommand_Live_CanceledNoNewerPipeline(t *testing.T) {
385 // Intentionally not t.Parallel(): see comment in
386 // TestCiStatusCommand_Live_CanceledSuperseded.
388 // When --live encounters a canceled pipeline and no newer pipeline exists
389 // for the branch, exit cleanly instead of looping forever.
390 tc := gitlabtesting.NewTestClient(t)
392 gomock.InOrder(
393 // Initial fetch: returns canceled pipeline ID=1.
394 tc.MockPipelines.EXPECT().
395 GetLatestPipeline("OWNER/REPO", &gitlab.GetLatestPipelineOptions{Ref: new("main")}, gomock.Any()).
396 Return(&gitlab.Pipeline{ID: 1, Status: "canceled"}, nil, nil),
397 tc.MockJobs.EXPECT().
398 ListPipelineJobs("OWNER/REPO", int64(1), gomock.Any()).
399 Return([]*gitlab.Job{{ID: 1, Name: "test"}}, nil, nil),
401 // Loop iteration 1: list jobs.
402 tc.MockJobs.EXPECT().
403 ListPipelineJobs("OWNER/REPO", int64(1), gomock.Any(), gomock.Any()).
404 Return([]*gitlab.Job{
405 {ID: 1, Name: "test", Stage: "test", Status: "canceled"},
406 }, &gitlab.Response{NextPage: 0}, nil),
408 // Canceled-supersede check: same ID returned, so we exit.
409 tc.MockPipelines.EXPECT().
410 GetLatestPipeline("OWNER/REPO", &gitlab.GetLatestPipelineOptions{Ref: new("main")}, gomock.Any()).
411 Return(&gitlab.Pipeline{ID: 1, Status: "canceled"}, nil, nil),
412 tc.MockJobs.EXPECT().
413 ListPipelineJobs("OWNER/REPO", int64(1), gomock.Any()).
414 Return([]*gitlab.Job{{ID: 1, Name: "test"}}, nil, nil),
415 )
417 exec := cmdtest.SetupCmdForTest(t, NewCmdStatus, false,
418 cmdtest.WithGitLabClient(tc.Client),
419 cmdtest.WithBranch("main"),
420 )
422 _, err := exec("--live")
423 require.NoError(t, err)
426func TestCiStatus_JSON(t *testing.T) {
427 t.Parallel()
429 tc := gitlabtesting.NewTestClient(t)
431 // Mock a finished pipeline
432 tc.MockPipelines.EXPECT().
433 GetLatestPipeline("OWNER/REPO", &gitlab.GetLatestPipelineOptions{Ref: new("main")}, gomock.Any()).
434 Return(&gitlab.Pipeline{ID: 1, Status: "success", Ref: "main"}, nil, nil)
436 // Mock job check in GetPipelineWithFallback
437 tc.MockJobs.EXPECT().
438 ListPipelineJobs("OWNER/REPO", int64(1), gomock.Any()).
439 Return([]*gitlab.Job{{ID: 1, Name: "test"}}, nil, nil)
441 // Mock jobs for the pipeline with pagination
442 tc.MockJobs.EXPECT().
443 ListPipelineJobs("OWNER/REPO", int64(1), gomock.Any(), gomock.Any()).
444 Return([]*gitlab.Job{
445 {ID: 1, Name: "test", Stage: "test", Status: "success"},
446 }, &gitlab.Response{NextPage: 0}, nil)
448 exec := cmdtest.SetupCmdForTest(t, NewCmdStatus, false,
449 cmdtest.WithGitLabClient(tc.Client),
450 cmdtest.WithBranch("main"),
451 )
453 out, err := exec("--output json")
454 require.NoError(t, err)
456 assert.Contains(t, out.String(), `"id":1`)
457 assert.Contains(t, out.String(), `"status":"success"`)
458 assert.Contains(t, out.String(), `"jobs"`)
459 assert.Empty(t, out.Stderr())
Diagnostics8 git calls · 214 ms
CallStatusSizeTime0214 ms
discover200185 B2 ms
git.upload-pack discover
http.response.status_code=200
git.upstream.cf_ray=-
git.upstream.phase=ls-refs
git.upstream.dur_ms=2
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 · 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=32926
git.response.cache=HIT
git.response.duration_ms=2
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 · 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=4273
git.response.cache=HIT
git.response.duration_ms=2
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:0200635 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=635
git.response.cache=HIT
git.response.duration_ms=3
git.fetch.filter=tree:0
git.fetch.wants=517b073a0d5c32bc4e93f86de74b31d60ff8cf03
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=635
git.pkt.payload.max=608
git.sideband.band1.bytes=608
git.sideband.band2.bytes=0
git.sideband.band3.bytes=0
git.pack.objects=1
git.pack.bytes=608
git.pack.trailer=178abb9456d874b7fd38fa21ad5cf9ca3ebcccaa
Open pack map
fetchtree:0200138 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=138
git.response.cache=HIT
git.response.duration_ms=3
git.fetch.filter=tree:0
git.fetch.wants=150d1d755b9bc2f4f1fdb755cc45f63901b179d5
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=138
git.pkt.payload.max=111
git.sideband.band1.bytes=111
git.sideband.band2.bytes=0
git.sideband.band3.bytes=0
git.pack.objects=1
git.pack.bytes=111
git.pack.trailer=8ca095a643d59835d6950ca5f31d5b1cd99ecbde
Open pack map
fetch2002.8 KiB200 ms
git.upload-pack fetch
http.response.status_code=200
git.upstream.cf_ray=-
git.upstream.phase=fetch
git.upstream.dur_ms=199
git.response.bytes=2898
git.response.cache=MISS
git.response.duration_ms=200
git.fetch.wants=5fdb2a16b776f441fad950958263a88247413c25
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=2898
git.pkt.payload.max=2871
git.sideband.band1.bytes=2871
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
a5e2e3252ce54af4
Request
6303ae34…
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