GitLabgitlab-org

cli

main
ply8 git calls211 ms100 KiB5 cachedprotocol v2
395 lines13 KiBRaw
1//go:build !integration
3package cli
5import (
6 "errors"
7 "os"
8 "path/filepath"
9 "testing"
11 "github.com/spf13/cobra"
12 "github.com/stretchr/testify/assert"
13 "github.com/stretchr/testify/require"
15 "gitlab.com/gitlab-org/cli/internal/binarymgr"
16 "gitlab.com/gitlab-org/cli/internal/binarymgr/binaries"
17 "gitlab.com/gitlab-org/cli/internal/cmdutils"
18 "gitlab.com/gitlab-org/cli/internal/commands/help"
19 "gitlab.com/gitlab-org/cli/internal/config"
20 "gitlab.com/gitlab-org/cli/internal/testing/cmdtest"
23func TestNewCmd_Structure(t *testing.T) {
24 t.Parallel()
26 ios, _, _, _ := cmdtest.TestIOStreams(cmdtest.WithTestIOStreamsAsTTY(false))
27 factory := cmdtest.NewTestFactory(ios)
28 cmd := NewCmd(factory)
30 assert.True(t, cmd.DisableFlagParsing, "DisableFlagParsing should be enabled for transparent pass-through")
31 require.NoError(t, cmd.Args(cmd, []string{"run", "--goal", "x"}), "Args should accept any arguments")
32 assert.NotNil(t, cmd.RunE, "RunE should be set")
34 // Verify glab-owned flags are registered for documentation
35 assert.NotNil(t, cmd.Flags().Lookup("install"), "--install flag should be registered")
36 assert.NotNil(t, cmd.Flags().Lookup("update"), "--update flag should be registered")
37 yesFlag := cmd.Flags().Lookup("yes")
38 assert.NotNil(t, yesFlag, "--yes flag should be registered")
39 assert.Equal(t, "y", yesFlag.Shorthand, "--yes should have -y shorthand")
42func TestRunWithCustomPath_Validation(t *testing.T) {
43 if _, err := binarymgr.ManagedBinaryPath(binaries.DuoCLI()); errors.Is(err, binarymgr.ErrUnsupportedPlatform) {
44 t.Skipf("skipping on unsupported platform: %v", err)
45 }
47 t.Run("non-existent path returns clear error", func(t *testing.T) {
48 ios, _, _, _ := cmdtest.TestIOStreams(cmdtest.WithTestIOStreamsAsTTY(false))
49 factory := cmdtest.NewTestFactory(ios)
51 t.Setenv("GLAB_DUO_CLI_BINARY_PATH", "/nonexistent/path/to/duo")
52 runner := newRunner(factory.IO(), factory.Config(), binaries.DuoCLI())
53 err := runner.Run(t.Context())
55 require.Error(t, err)
56 assert.Contains(t, err.Error(), "GLAB_DUO_CLI_BINARY_PATH")
57 assert.Contains(t, err.Error(), "duo_cli_binary_path")
58 assert.Contains(t, err.Error(), "/nonexistent/path/to/duo")
59 assert.Contains(t, err.Error(), "was not found")
60 })
62 t.Run("directory path returns clear error", func(t *testing.T) {
63 ios, _, _, _ := cmdtest.TestIOStreams(cmdtest.WithTestIOStreamsAsTTY(false))
64 factory := cmdtest.NewTestFactory(ios)
66 dir := t.TempDir()
67 t.Setenv("GLAB_DUO_CLI_BINARY_PATH", dir)
68 runner := newRunner(factory.IO(), factory.Config(), binaries.DuoCLI())
69 err := runner.Run(t.Context())
71 require.Error(t, err)
72 assert.Contains(t, err.Error(), "GLAB_DUO_CLI_BINARY_PATH")
73 assert.Contains(t, err.Error(), "duo_cli_binary_path")
74 assert.Contains(t, err.Error(), "is a directory, not an executable file")
75 })
77 t.Run("non-executable file returns clear error", func(t *testing.T) {
78 ios, _, _, _ := cmdtest.TestIOStreams(cmdtest.WithTestIOStreamsAsTTY(false))
79 factory := cmdtest.NewTestFactory(ios)
81 dir := t.TempDir()
82 nonExecFile := filepath.Join(dir, "duo")
83 require.NoError(t, os.WriteFile(nonExecFile, []byte("#!/bin/sh\n"), 0o644))
85 t.Setenv("GLAB_DUO_CLI_BINARY_PATH", nonExecFile)
86 runner := newRunner(factory.IO(), factory.Config(), binaries.DuoCLI())
87 err := runner.Run(t.Context())
89 require.Error(t, err)
90 assert.Contains(t, err.Error(), "GLAB_DUO_CLI_BINARY_PATH")
91 assert.Contains(t, err.Error(), "duo_cli_binary_path")
92 assert.Contains(t, err.Error(), "is not executable")
93 assert.Contains(t, err.Error(), "chmod +x")
94 })
97func TestHandleInstall_CustomPath(t *testing.T) {
98 if _, err := binarymgr.ManagedBinaryPath(binaries.DuoCLI()); errors.Is(err, binarymgr.ErrUnsupportedPlatform) {
99 t.Skipf("skipping on unsupported platform: %v", err)
100 }
102 t.Run("custom path reports the path and returns no error", func(t *testing.T) {
103 ios, _, stderr, _ := cmdtest.TestIOStreams(cmdtest.WithTestIOStreamsAsTTY(false))
104 factory := cmdtest.NewTestFactory(ios)
106 dir := t.TempDir()
107 execFile := filepath.Join(dir, "duo")
108 require.NoError(t, os.WriteFile(execFile, []byte("#!/bin/sh\n"), 0o755))
110 t.Setenv("GLAB_DUO_CLI_BINARY_PATH", execFile)
111 runner := newRunner(factory.IO(), factory.Config(), binaries.DuoCLI())
112 err := runner.HandleInstall(t.Context())
114 require.NoError(t, err)
115 assert.Contains(t, stderr.String(), "Using custom GitLab Duo CLI binary:")
116 assert.Contains(t, stderr.String(), execFile)
117 })
120func TestRunE_InstallAndUpdateAreMutuallyExclusive(t *testing.T) {
121 t.Parallel()
123 ios, _, _, _ := cmdtest.TestIOStreams(cmdtest.WithTestIOStreamsAsTTY(false))
124 factory := cmdtest.NewTestFactory(ios)
125 cmd := NewCmd(factory)
126 cmd.SetArgs([]string{"--install", "--update"})
128 err := cmd.Execute()
129 require.Error(t, err)
130 assert.Contains(t, err.Error(), "mutually exclusive")
133func TestWarnIfSnapConfined(t *testing.T) {
134 t.Run("warns on stderr when SNAP is set and command is a normal run", func(t *testing.T) {
135 t.Setenv("SNAP_NAME", "glab")
136 ios, _, stdout, stderr := cmdtest.TestIOStreams(cmdtest.WithTestIOStreamsAsTTY(false))
138 warnIfSnapConfined(ios, false, false)
140 out := stderr.String()
141 assert.Contains(t, out, "snap confinement")
142 assert.Contains(t, out, "glab auth credential-helper")
143 assert.Contains(t, out, "brew install glab")
144 assert.Empty(t, stdout.String(), "warning must not leak onto stdout")
145 })
147 t.Run("stays silent when SNAP is unset", func(t *testing.T) {
148 t.Setenv("SNAP_NAME", "")
149 ios, _, stdout, stderr := cmdtest.TestIOStreams(cmdtest.WithTestIOStreamsAsTTY(false))
151 warnIfSnapConfined(ios, false, false)
153 assert.Empty(t, stderr.String())
154 assert.Empty(t, stdout.String())
155 })
157 t.Run("stays silent under --install even when SNAP is set", func(t *testing.T) {
158 t.Setenv("SNAP_NAME", "glab")
159 ios, _, stdout, stderr := cmdtest.TestIOStreams(cmdtest.WithTestIOStreamsAsTTY(false))
161 warnIfSnapConfined(ios, true, false)
163 assert.Empty(t, stderr.String())
164 assert.Empty(t, stdout.String())
165 })
167 t.Run("stays silent under --update even when SNAP is set", func(t *testing.T) {
168 t.Setenv("SNAP_NAME", "glab")
169 ios, _, stdout, stderr := cmdtest.TestIOStreams(cmdtest.WithTestIOStreamsAsTTY(false))
171 warnIfSnapConfined(ios, false, true)
173 assert.Empty(t, stderr.String())
174 assert.Empty(t, stdout.String())
175 })
178func TestShouldForceUpdateCheck(t *testing.T) {
179 tests := []struct {
180 name string
181 envValue string
182 expected bool
183 }{
184 {"env var set to true", "true", true},
185 {"env var set to false", "false", false},
186 {"env var not set", "", false},
187 {"env var set to other value", "yes", false},
188 }
190 for _, tt := range tests {
191 t.Run(tt.name, func(t *testing.T) {
192 t.Setenv("GLAB_DUO_CLI_CHECK_UPDATE", tt.envValue)
194 ios, _, _, _ := cmdtest.TestIOStreams(cmdtest.WithTestIOStreamsAsTTY(false))
195 factory := cmdtest.NewTestFactory(ios)
196 runner := newRunner(factory.IO(), factory.Config(), binaries.DuoCLI())
197 assert.Equal(t, tt.expected, runner.ShouldForceUpdateCheck())
198 })
199 }
202func TestBinaryStatus(t *testing.T) {
203 if _, err := binarymgr.ManagedBinaryPath(binaries.DuoCLI()); errors.Is(err, binarymgr.ErrUnsupportedPlatform) {
204 t.Skipf("skipping on unsupported platform: %v", err)
205 }
207 t.Run("reports installed with the configured version", func(t *testing.T) {
208 execFile := filepath.Join(t.TempDir(), "duo")
209 require.NoError(t, os.WriteFile(execFile, []byte("#!/bin/sh\n"), 0o755))
210 t.Setenv("GLAB_DUO_CLI_BINARY_PATH", execFile)
212 cfg := config.NewBlankConfig()
213 require.NoError(t, cfg.Set("", "duo_cli_binary_version", "9.5.0"))
215 path, version, installed := binaryStatus(cfg)
216 assert.Equal(t, execFile, path)
217 assert.True(t, installed)
218 assert.Equal(t, "9.5.0", version)
219 })
221 t.Run("reports an empty version when duo_cli_binary_version is unset", func(t *testing.T) {
222 execFile := filepath.Join(t.TempDir(), "duo")
223 require.NoError(t, os.WriteFile(execFile, []byte("#!/bin/sh\n"), 0o755))
224 t.Setenv("GLAB_DUO_CLI_BINARY_PATH", execFile)
226 _, version, installed := binaryStatus(config.NewBlankConfig())
227 assert.True(t, installed)
228 assert.Empty(t, version)
229 })
231 t.Run("reports not installed for a missing binary", func(t *testing.T) {
232 t.Setenv("GLAB_DUO_CLI_BINARY_PATH", filepath.Join(t.TempDir(), "missing-duo"))
234 _, _, installed := binaryStatus(config.NewBlankConfig())
235 assert.False(t, installed)
236 })
239func TestAppendBinaryStatusFooter_BinaryStatus(t *testing.T) {
240 if _, err := binarymgr.ManagedBinaryPath(binaries.DuoCLI()); errors.Is(err, binarymgr.ErrUnsupportedPlatform) {
241 t.Skipf("skipping on unsupported platform: %v", err)
242 }
244 tests := []struct {
245 name string
246 managed bool
247 version string
248 }{
249 {name: "custom path with a recorded version", version: "9.5.0"},
250 {name: "custom path without a recorded version"},
251 {name: "managed path with a recorded version", managed: true, version: "9.5.0"},
252 }
253 for _, tt := range tests {
254 t.Run(tt.name, func(t *testing.T) {
255 t.Setenv("GLAB_CONFIG_DIR", t.TempDir())
256 t.Setenv("GLAB_DUO_CLI_BINARY_PATH", "")
257 path := filepath.Join(t.TempDir(), "duo")
258 if tt.managed {
259 var err error
260 path, err = binarymgr.ManagedBinaryPath(binaries.DuoCLI())
261 require.NoError(t, err)
262 }
263 require.NoError(t, os.MkdirAll(filepath.Dir(path), 0o755))
264 require.NoError(t, os.WriteFile(path, []byte("#!/bin/sh\n"), 0o755))
266 cfg := config.NewBlankConfig()
267 if tt.version != "" {
268 require.NoError(t, cfg.Set("", "duo_cli_binary_version", tt.version))
269 }
270 if !tt.managed {
271 require.NoError(t, cfg.Set("", "duo_cli_binary_path", path))
272 }
273 exec := cmdtest.SetupCmdForTest(t, func(f cmdutils.Factory) *cobra.Command {
274 root := &cobra.Command{Use: "glab"}
275 root.SetHelpFunc(func(*cobra.Command, []string) {})
276 root.AddCommand(NewCmd(f))
277 return root
278 }, false, cmdtest.WithConfig(cfg))
280 out, err := exec("cli --help")
281 require.NoError(t, err)
283 expectedLine := " Installed: " + path + "\n"
284 if tt.version != "" {
285 expectedLine = " Installed: " + tt.version + " (" + path + ")\n"
286 }
287 assert.Contains(t, out.String(), expectedLine)
288 assert.Contains(t, out.String(), "Run 'glab duo cli help'")
289 assert.NotContains(t, out.String(), "not installed yet")
290 })
291 }
294func TestAppendBinaryStatusFooter_ShowsSetupStepsWhenNotInstalled(t *testing.T) {
295 if _, err := binarymgr.ManagedBinaryPath(binaries.DuoCLI()); errors.Is(err, binarymgr.ErrUnsupportedPlatform) {
296 t.Skipf("skipping on unsupported platform: %v", err)
297 }
299 tests := []struct {
300 name string
301 managed bool
302 }{
303 {name: "missing binary"},
304 {name: "managed binary without a recorded version", managed: true},
305 }
306 for _, tt := range tests {
307 t.Run(tt.name, func(t *testing.T) {
308 t.Setenv("GLAB_CONFIG_DIR", t.TempDir())
309 t.Setenv("GLAB_DUO_CLI_BINARY_PATH", "")
310 cfg := config.NewBlankConfig()
311 if tt.managed {
312 path, err := binarymgr.ManagedBinaryPath(binaries.DuoCLI())
313 require.NoError(t, err)
314 require.NoError(t, os.MkdirAll(filepath.Dir(path), 0o755))
315 require.NoError(t, os.WriteFile(path, []byte("#!/bin/sh\n"), 0o755))
316 } else {
317 require.NoError(t, cfg.Set("", "duo_cli_binary_path", filepath.Join(t.TempDir(), "missing-duo")))
318 }
320 exec := cmdtest.SetupCmdForTest(t, func(f cmdutils.Factory) *cobra.Command {
321 root := &cobra.Command{Use: "glab"}
322 root.SetHelpFunc(func(*cobra.Command, []string) {})
323 root.AddCommand(NewCmd(f))
324 return root
325 }, false, cmdtest.WithConfig(cfg))
327 out, err := exec("cli --help")
328 require.NoError(t, err)
329 assert.Contains(t, out.String(), "not installed yet")
330 assert.Contains(t, out.String(), "glab duo cli --install")
331 assert.NotContains(t, out.String(), "Installed:")
332 })
333 }
336func TestNewCmd_UpdateRouting(t *testing.T) {
337 t.Parallel()
339 tests := []struct {
340 name string
341 args []string
342 want string
343 }{
344 {name: "update is glab's subcommand", args: []string{"update"}, want: "update"},
345 {name: "update after --yes is glab's subcommand", args: []string{"--yes", "update"}, want: "update"},
346 {name: "--update stays on the pass-through command", args: []string{"--update"}, want: "cli"},
347 {name: "update after another command passes through", args: []string{"run", "--goal", "update"}, want: "cli"},
348 }
349 for _, tc := range tests {
350 t.Run(tc.name, func(t *testing.T) {
351 t.Parallel()
352 ios, _, _, _ := cmdtest.TestIOStreams(cmdtest.WithTestIOStreamsAsTTY(false))
353 cmd := NewCmd(cmdtest.NewTestFactory(ios))
355 found, _, err := cmd.Find(tc.args)
356 require.NoError(t, err)
357 assert.Equal(t, tc.want, found.Name())
358 })
359 }
362func TestAppendBinaryStatusFooter_OmittedFromSubcommandHelp(t *testing.T) {
363 t.Setenv("GLAB_CONFIG_DIR", t.TempDir())
364 ios, _, stdout, _ := cmdtest.TestIOStreams(cmdtest.WithTestIOStreamsAsTTY(false))
365 cmd := NewCmd(cmdtest.NewTestFactory(ios))
366 root := &cobra.Command{Use: "glab"}
367 root.SetHelpFunc(func(*cobra.Command, []string) {})
368 root.AddCommand(cmd)
369 update, _, err := cmd.Find([]string{"update"})
370 require.NoError(t, err)
372 require.NoError(t, update.Help())
374 assert.NotContains(t, stdout.String(), "GITLAB DUO CLI")
377func TestAppendBinaryStatusFooter_KeepsAnnotationSections(t *testing.T) {
378 t.Setenv("GLAB_CONFIG_DIR", t.TempDir())
379 ios, _, stdout, _ := cmdtest.TestIOStreams(cmdtest.WithTestIOStreamsAsTTY(false))
380 cmd := NewCmd(cmdtest.NewTestFactory(ios))
381 duo := &cobra.Command{Use: "duo"}
382 duo.AddCommand(cmd)
383 root := &cobra.Command{Use: "glab"}
384 root.SetHelpFunc(func(*cobra.Command, []string) {})
385 root.SetOut(stdout)
386 root.AddCommand(duo)
387 help.AppendAnnotationSections(root, ios)
389 require.NoError(t, cmd.Help())
391 out := stdout.String()
392 assert.Contains(t, out, "ENVIRONMENT VARIABLES")
393 assert.Contains(t, out, "GLAB_DUO_CLI_BINARY_PATH")
394 assert.Contains(t, out, "GITLAB DUO CLI")
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=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 KiB3 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=UPDATING
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=4
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 · hit4 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=4
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=2
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:0200191 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=191
git.response.cache=HIT
git.response.duration_ms=2
git.fetch.filter=tree:0
git.fetch.wants=c3602e112f33dfaff92a8559e2993279d5c2f1ac
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=191
git.pkt.payload.max=164
git.sideband.band1.bytes=164
git.sideband.band2.bytes=0
git.sideband.band3.bytes=0
git.pack.objects=1
git.pack.bytes=164
git.pack.trailer=43874cd66e8aba9ccffcac699b3b9f515e08cf67
Open pack map
fetchtree:0200238 B · hit2 ms
git.upload-pack fetch
http.response.status_code=200
git.upstream.cf_ray=-
git.upstream.phase=fetch
git.upstream.dur_ms=197
git.response.bytes=238
git.response.cache=HIT
git.response.duration_ms=2
git.fetch.filter=tree:0
git.fetch.wants=c0d5012d80c7130de331a7d6bbd8da4757868e8d
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=238
git.pkt.payload.max=211
git.sideband.band1.bytes=211
git.sideband.band2.bytes=0
git.sideband.band3.bytes=0
git.pack.objects=1
git.pack.bytes=211
git.pack.trailer=3ab8f4d29d6b378c7200388b9a42af0739e36766
Open pack map
fetch2002.8 KiB197 ms
git.upload-pack fetch
http.response.status_code=200
git.response.bytes=2823
git.response.cache=MISS
git.response.duration_ms=197
git.fetch.wants=81d9cb5e22f51ca0198d4593e9902556b8bd2edd
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=2823
git.pkt.payload.max=2796
git.sideband.band1.bytes=2796
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
a5e23acef9b34bc2
Request
963c7eae…
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