GitLabgitlab-org

cli

main
ply8 git calls254 ms101 KiB6 cachedprotocol v2
509 lines15 KiBRaw
1//go:build !integration
3package fork
5import (
6 "bytes"
7 "context"
8 "errors"
9 "net/http"
10 "net/url"
11 "strings"
12 "testing"
13 "time"
15 "git.sr.ht/~timofurrer/ugh"
16 "github.com/stretchr/testify/assert"
17 "github.com/stretchr/testify/require"
18 "go.uber.org/mock/gomock"
20 gitlab "gitlab.com/gitlab-org/api/client-go/v3"
21 gitlabtesting "gitlab.com/gitlab-org/api/client-go/v3/testing"
23 "gitlab.com/gitlab-org/cli/internal/api"
24 "gitlab.com/gitlab-org/cli/internal/config"
25 "gitlab.com/gitlab-org/cli/internal/git"
26 "gitlab.com/gitlab-org/cli/internal/glinstance"
27 "gitlab.com/gitlab-org/cli/internal/glrepo"
28 "gitlab.com/gitlab-org/cli/internal/testing/cmdtest"
29 "gitlab.com/gitlab-org/cli/test"
32func TestProjectFork(t *testing.T) {
33 cloneShelloutStubs := []string{
34 "git clone -- git@gitlab.com:OWNER/baz.git REPO",
35 "git -C REPO remote add -f upstream -- git@gitlab.com:OWNER/REPO.git",
36 }
38 expectedCloneShellouts := []string{
39 "git clone -- git@gitlab.com:OWNER/baz.git",
40 "git -C baz remote add -f upstream -- git@gitlab.com:OWNER/REPO.git",
41 }
43 tests := []struct {
44 name string
45 commandArgs string
46 shelloutStubs []string
47 expectedShellouts []string
48 expectClonePrompt bool
49 expectClone bool
50 }{
51 {
52 name: "when a specified repository is forked and cloned",
53 commandArgs: "OWNER/REPO --name foo --path baz --clone",
54 shelloutStubs: cloneShelloutStubs,
55 expectedShellouts: expectedCloneShellouts,
56 expectClonePrompt: false,
57 expectClone: true,
58 },
59 {
60 name: "when a specified repository is forked user is prompted to clone",
61 commandArgs: "OWNER/REPO --name foo --path baz",
62 shelloutStubs: cloneShelloutStubs,
63 expectedShellouts: expectedCloneShellouts,
64 expectClonePrompt: true,
65 expectClone: true,
66 },
67 {
68 name: "when a specified repository is forked and clone is set to false",
69 commandArgs: "OWNER/REPO --name foo --path baz --clone=false",
70 shelloutStubs: []string{},
71 expectedShellouts: []string{},
72 expectClonePrompt: false,
73 expectClone: false,
74 },
75 }
77 for _, tt := range tests {
78 t.Run(tt.name, func(t *testing.T) {
79 cs, csTeardown := test.InitCmdStubber()
80 defer csTeardown()
82 for _, stub := range tt.shelloutStubs {
83 cs.Stub(stub)
84 }
86 tc := gitlabtesting.NewTestClient(t)
87 tc.MockProjects.EXPECT().
88 ForkProject("OWNER/REPO", gomock.Any(), gomock.Any()).
89 Return(&gitlab.Project{
90 ID: 99,
91 PathWithNamespace: "OWNER/baz",
92 HTTPURLToRepo: "https://gitlab.com/OWNER/baz.git",
93 SSHURLToRepo: "git@gitlab.com:OWNER/baz.git",
94 }, nil, nil)
95 if tt.expectClone {
96 tc.MockProjects.EXPECT().
97 GetProject("OWNER/REPO", gomock.Any(), gomock.Any()).
98 Return(&gitlab.Project{
99 ID: 100,
100 Description: "this is a test description",
101 Name: "foo",
102 NameWithNamespace: "OWNER / REPO",
103 Path: "REPO",
104 PathWithNamespace: "OWNER/REPO",
105 DefaultBranch: "main",
106 HTTPURLToRepo: "https://gitlab.com/OWNER/REPO.git",
107 SSHURLToRepo: "git@gitlab.com:OWNER/REPO.git",
108 }, nil, nil)
109 }
111 opts := []cmdtest.FactoryOption{
112 cmdtest.WithGitLabClient(tc.Client),
113 cmdtest.WithApiClient(
114 cmdtest.NewTestApiClient(
115 t,
116 nil,
117 "",
118 glinstance.DefaultHostname,
119 api.WithGitLabClient(tc.Client),
120 ),
121 ),
122 cmdtest.WithBaseRepo("OWNER", "REPO", glinstance.DefaultHostname),
123 func(f *cmdtest.Factory) {
124 f.RemotesStub = func() (glrepo.Remotes, error) {
125 remote := &git.Remote{
126 Name: "origin",
127 FetchURL: &url.URL{
128 Scheme: "https",
129 Host: "gitlab.com",
130 Path: "/OWNER/REPO.git",
131 },
132 PushURL: &url.URL{
133 Scheme: "https",
134 Host: "gitlab.com",
135 Path: "/OWNER/REPO.git",
136 },
137 }
139 repo := glrepo.New("OWNER", "REPO", glinstance.DefaultHostname)
141 return glrepo.Remotes{
142 &glrepo.Remote{
143 Remote: remote,
144 Repo: repo,
145 },
146 }, nil
147 }
148 },
149 }
151 // Set up prompt stub if needed
152 if tt.expectClonePrompt {
153 c := ugh.New(t)
154 c.Expect(ugh.Confirm("Would you like to clone the fork?")).
155 Do(ugh.Affirm)
156 opts = append(opts, cmdtest.WithConsole(t, c))
157 }
159 exec := cmdtest.SetupCmdForTest(
160 t,
161 NewCmdFork,
162 false,
163 opts...,
164 )
166 out, err := exec(tt.commandArgs)
168 if assert.NoErrorf(
169 t,
170 err,
171 "error running command `project fork %s`: %v",
172 tt.commandArgs,
173 err,
174 ) {
175 assert.Equal(t, "✓ Created fork OWNER/baz.\n", out.ErrBuf.String())
176 }
178 assert.Equal(t, len(tt.expectedShellouts), cs.Count)
179 for idx, expectedShellout := range tt.expectedShellouts {
180 assert.Equal(t, expectedShellout, strings.Join(cs.Calls[idx].Args, " "))
181 }
182 })
183 }
186func TestProjectForkReturnsTransportErrorWithoutResponse(t *testing.T) {
187 tc := gitlabtesting.NewTestClient(t)
188 tc.MockProjects.EXPECT().
189 ForkProject("OWNER/REPO", gomock.Any(), gomock.Any()).
190 Return(nil, nil, errors.New("network unavailable"))
192 exec := cmdtest.SetupCmdForTest(
193 t,
194 NewCmdFork,
195 false,
196 cmdtest.WithApiClient(
197 cmdtest.NewTestApiClient(
198 t,
199 nil,
200 "",
201 glinstance.DefaultHostname,
202 api.WithGitLabClient(tc.Client),
203 ),
204 ),
205 )
207 _, err := exec("OWNER/REPO --clone=false")
208 require.EqualError(t, err, "network unavailable")
211func TestProjectForkExistingRepo(t *testing.T) {
212 shelloutStubs := []string{
213 "git remote rename executed",
214 "git remote add executed",
215 }
217 expectedShellouts := []string{
218 "git remote rename origin upstream",
219 "git remote add -f origin -- git@gitlab.com:OWNER/REPO.git",
220 }
222 tests := []struct {
223 name string
224 commandArgs string
225 shelloutStubs []string
226 expectedShellouts []string
227 addRemoteFlag bool
228 promptResponse bool
229 expectError bool
230 expectNamespaceMessage bool
231 }{
232 {
233 name: "when fork exists and user wants to add a remote",
234 commandArgs: "", // Empty to simulate running in current directory
235 shelloutStubs: shelloutStubs,
236 expectedShellouts: expectedShellouts,
237 promptResponse: true,
238 expectError: false,
239 expectNamespaceMessage: false,
240 },
241 {
242 name: "when fork exists and remote flag is true",
243 commandArgs: "--remote",
244 shelloutStubs: shelloutStubs,
245 expectedShellouts: expectedShellouts,
246 addRemoteFlag: true,
247 expectError: false,
248 expectNamespaceMessage: false,
249 },
250 {
251 name: "when fork exists and remote flag is false",
252 commandArgs: "--remote=false",
253 shelloutStubs: []string{},
254 expectedShellouts: []string{},
255 addRemoteFlag: false,
256 expectError: false,
257 expectNamespaceMessage: false,
258 },
259 {
260 name: "when fork exists but project not found in user namespace (should error)",
261 commandArgs: "--remote",
262 shelloutStubs: []string{}, // No shellouts expected because operation errors out before git commands
263 expectedShellouts: []string{},
264 addRemoteFlag: true,
265 expectError: true,
266 expectNamespaceMessage: true,
267 },
268 }
270 for _, tt := range tests {
271 t.Run(tt.name, func(t *testing.T) {
272 git.InitGitRepo(t)
274 cs, csTeardown := test.InitCmdStubber()
275 defer csTeardown()
276 for _, stub := range tt.shelloutStubs {
277 cs.Stub(stub)
278 }
280 tc := gitlabtesting.NewTestClient(t)
281 tc.MockUsers.EXPECT().CurrentUser().Return(&gitlab.User{
282 Username: "OWNER",
283 ID: 123,
284 Name: "Test User",
285 NamespaceID: 123,
286 }, nil, nil).AnyTimes()
287 tc.MockProjects.EXPECT().
288 ForkProject("OWNER/REPO", gomock.Any(), gomock.Any()).
289 Return(nil, &gitlab.Response{Response: &http.Response{StatusCode: http.StatusConflict}}, errors.New(`{"message":"Project namespace name has already been taken"}`))
291 if tt.promptResponse || tt.addRemoteFlag {
292 // Register the projects search API that happens during the "repository already exists" flow
293 if tt.expectNamespaceMessage {
294 // Return an empty list to simulate no matching project in user's namespace
295 tc.MockProjects.EXPECT().
296 ListProjects(gomock.Any(), gomock.Any()).
297 Return(nil, nil, nil)
298 } else {
299 tc.MockProjects.EXPECT().ListProjects(gomock.Any(), gomock.Any()).Return([]*gitlab.Project{
300 {
301 ID: 123,
302 Name: "REPO",
303 Description: "Test repo",
304 Path: "REPO",
305 PathWithNamespace: "OWNER/REPO",
306 // Created_at": "2023-01-01T00:00:00Z",
307 DefaultBranch: "main",
308 SSHURLToRepo: "git@gitlab.com:OWNER/REPO.git",
309 HTTPURLToRepo: "https://gitlab.com/OWNER/REPO.git",
310 WebURL: "https://gitlab.com/OWNER/REPO",
311 Namespace: &gitlab.ProjectNamespace{
312 ID: 123,
313 Name: "OWNER",
314 Path: "OWNER",
315 Kind: "user",
316 FullPath: "OWNER",
317 },
318 },
319 }, nil, nil)
320 }
321 }
323 opts := []cmdtest.FactoryOption{
324 cmdtest.WithGitLabClient(tc.Client),
325 cmdtest.WithApiClient(
326 cmdtest.NewTestApiClient(
327 t,
328 nil,
329 "",
330 glinstance.DefaultHostname,
331 api.WithGitLabClient(tc.Client),
332 ),
333 ),
334 cmdtest.WithBaseRepo("OWNER", "REPO", glinstance.DefaultHostname),
335 func(f *cmdtest.Factory) {
336 f.RemotesStub = func() (glrepo.Remotes, error) {
337 remote := &git.Remote{
338 Name: "origin",
339 FetchURL: &url.URL{
340 Scheme: "https",
341 Host: "gitlab.com",
342 Path: "/OWNER/REPO.git",
343 },
344 PushURL: &url.URL{
345 Scheme: "https",
346 Host: "gitlab.com",
347 Path: "/OWNER/REPO.git",
348 },
349 }
351 repo := glrepo.New("OWNER", "REPO", glinstance.DefaultHostname)
353 return glrepo.Remotes{
354 &glrepo.Remote{
355 Remote: remote,
356 Repo: repo,
357 },
358 }, nil
359 }
360 },
361 }
362 // Set up prompt stub if needed
363 if tt.promptResponse {
364 c := ugh.New(t)
365 c.Expect(ugh.Confirm("Would you like to add this repository as a remote instead?")).
366 Do(ugh.Affirm)
367 opts = append(opts, cmdtest.WithConsole(t, c))
368 }
370 exec := cmdtest.SetupCmdForTest(
371 t,
372 NewCmdFork,
373 true,
374 opts...,
375 )
377 t.Logf("Running fork command with arguments: %q", tt.commandArgs)
378 out, err := exec(tt.commandArgs)
380 // Log stderr for debugging
382 if tt.expectError {
383 require.Error(t, err, "expected an error but got none")
384 if tt.expectNamespaceMessage {
385 assert.Contains(t, out.ErrBuf.String(), "Only user namespaces")
386 }
387 } else if assert.NoErrorf(t, err, "error running command `project fork %s`: %v", tt.commandArgs, err) {
388 if !tt.expectNamespaceMessage {
389 assert.NotContains(t, out.ErrBuf.String(), "Only user namespaces")
390 }
392 if tt.addRemoteFlag || tt.promptResponse {
393 assert.Contains(t, out.ErrBuf.String(), "Using existing repository")
394 if len(tt.expectedShellouts) > 0 {
395 assert.Contains(t, out.ErrBuf.String(), "Added remote")
396 }
397 }
398 }
400 // Assert shellouts
401 if len(tt.expectedShellouts) > 0 {
402 require.Equal(t, len(tt.expectedShellouts), cs.Count)
403 for idx, expectedShellout := range tt.expectedShellouts {
404 assert.Equal(t, expectedShellout, strings.Join(cs.Calls[idx].Args, " "))
405 }
406 } else {
407 assert.Equal(t, 0, cs.Count)
408 }
409 })
410 }
413func runForkImport(t *testing.T, statuses ...string) (*[]time.Duration, *bytes.Buffer, error) {
414 t.Helper()
416 tc := gitlabtesting.NewTestClient(t)
417 tc.MockProjects.EXPECT().
418 ForkProject("OWNER/REPO", gomock.Any(), gomock.Any()).
419 Return(&gitlab.Project{ID: 99, PathWithNamespace: "OWNER/baz", WebURL: "https://gitlab.example.com/OWNER/baz", ImportStatus: "scheduled"}, nil, nil)
420 for _, s := range statuses {
421 if s == "error" {
422 tc.MockProjects.EXPECT().
423 GetProject(int64(99), gomock.Any(), gomock.Any()).
424 Return(nil, nil, errors.New("boom"))
425 continue
426 }
427 p := &gitlab.Project{ID: 99, PathWithNamespace: "OWNER/baz", WebURL: "https://gitlab.example.com/OWNER/baz", ImportStatus: s}
428 if s == "failed" {
429 p.ImportError = "repository too large"
430 }
431 tc.MockProjects.EXPECT().
432 GetProject(int64(99), gomock.Any(), gomock.Any()).
433 Return(p, nil, nil)
434 }
436 ios, _, _, stderr := cmdtest.TestIOStreams()
437 var waits []time.Duration
438 opts := &options{
439 io: ios,
440 repo: "OWNER/REPO",
441 cloneSet: true,
442 config: config.NewBlankConfig,
443 defaultHostname: glinstance.DefaultHostname,
444 apiClient: func(string) (*api.Client, error) {
445 return cmdtest.NewTestApiClient(t, nil, "", glinstance.DefaultHostname, api.WithGitLabClient(tc.Client)), nil
446 },
447 waitFor: func(_ context.Context, d time.Duration) error {
448 waits = append(waits, d)
449 return nil
450 },
451 }
453 err := opts.run(t.Context())
454 return &waits, stderr, err
457func TestProjectForkWaitsBetweenImportPolls(t *testing.T) {
458 waits, stderr, err := runForkImport(t, "scheduled", "started", "started", "started", "finished")
460 require.NoError(t, err)
461 assert.Equal(t, []time.Duration{time.Second, 2 * time.Second, 4 * time.Second, 5 * time.Second, 5 * time.Second}, *waits)
462 assert.Contains(t, stderr.String(), "Created fork OWNER/baz")
465func TestProjectForkRetriesImportPollAfterError(t *testing.T) {
466 waits, stderr, err := runForkImport(t, "error", "finished")
468 require.NoError(t, err)
469 assert.Len(t, *waits, 2)
470 assert.Contains(t, stderr.String(), "- Retrying...")
471 assert.Contains(t, stderr.String(), "Created fork OWNER/baz")
474func TestProjectForkImportPollRetriesResetAfterSuccess(t *testing.T) {
475 _, stderr, err := runForkImport(t, "error", "error", "error", "started", "error", "error", "error", "finished")
477 require.NoError(t, err)
478 assert.Contains(t, stderr.String(), "Created fork OWNER/baz")
481func TestProjectForkImportPollFailsAfterRetries(t *testing.T) {
482 _, stderr, err := runForkImport(t, "error", "error", "error", "error")
484 require.ErrorContains(t, err, "checking import status of fork OWNER/baz: boom")
485 require.ErrorContains(t, err, "glab repo view https://gitlab.example.com/OWNER/baz --output json")
486 assert.NotContains(t, stderr.String(), "Created fork")
489func TestProjectForkImportFailed(t *testing.T) {
490 _, stderr, err := runForkImport(t, "started", "failed")
492 require.EqualError(t, err, "fork OWNER/baz failed to import: repository too large")
493 assert.NotContains(t, stderr.String(), "Created fork")
496func TestProjectForkImportPollTimesOut(t *testing.T) {
497 // 1+2+4 s, then 5 s per poll until 10 min.
498 polls := 3 + int((forkImportTimeout-7*time.Second+forkImportMaxPollInterval-1)/forkImportMaxPollInterval)
499 statuses := make([]string, polls)
500 for i := range statuses {
501 statuses[i] = "started"
502 }
504 waits, _, err := runForkImport(t, statuses...)
506 require.ErrorContains(t, err, "timed out after 10m0s waiting for fork OWNER/baz to finish importing")
507 require.ErrorContains(t, err, "glab repo view https://gitlab.example.com/OWNER/baz --output json")
508 assert.Len(t, *waits, polls)
Diagnostics8 git calls · 254 ms
CallStatusSizeTime0254 ms
discover200185 B4 ms
git.upload-pack discover
http.response.status_code=200
git.upstream.cf_ray=-
git.upstream.phase=fetch
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
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: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=1
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
fetchtree:02001.8 KiB · hit1 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=1
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:0200614 B · hit4 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=614
git.response.cache=HIT
git.response.duration_ms=4
git.fetch.filter=tree:0
git.fetch.wants=3a89d0cfc8e81880c982180388e42e561a0b7eee
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=614
git.pkt.payload.max=587
git.sideband.band1.bytes=587
git.sideband.band2.bytes=0
git.sideband.band3.bytes=0
git.pack.objects=1
git.pack.bytes=587
git.pack.trailer=eb8250f8e8340ff2fafc22c5aba90db34fd906a9
Open pack map
fetchtree:0200135 B · hit2 ms
git.upload-pack fetch
http.response.status_code=200
git.upstream.cf_ray=-
git.upstream.phase=fetch
git.upstream.dur_ms=241
git.response.bytes=135
git.response.cache=HIT
git.response.duration_ms=2
git.fetch.filter=tree:0
git.fetch.wants=61242e1c99581959d53d127c44fe3b7a850ec910
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=135
git.pkt.payload.max=108
git.sideband.band1.bytes=108
git.sideband.band2.bytes=0
git.sideband.band3.bytes=0
git.pack.objects=1
git.pack.bytes=108
git.pack.trailer=fb4b28ee8cfd7eb1dbbed1f8d8abfc22770a9415
Open pack map
fetch2003.5 KiB241 ms
git.upload-pack fetch
http.response.status_code=200
git.response.bytes=3634
git.response.cache=MISS
git.response.duration_ms=241
git.fetch.wants=e6dd8c7404119a10c1ea759bc9225730e86f6459
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=3634
git.pkt.payload.max=3607
git.sideband.band1.bytes=3607
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
a5ea565e7fdc7089
Request
c5547e60…
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