GitLabgitlab-org
cli
main
1//go:build !integration
3package sync
5import (
6 "encoding/json"
7 "io"
8 "os"
9 "path/filepath"
10 "slices"
11 "strings"
12 "testing"
14 "github.com/stretchr/testify/assert"
15 "github.com/stretchr/testify/require"
17 "gitlab.com/gitlab-org/cli/internal/commands/govern/internal/fallbacksync"
18 "gitlab.com/gitlab-org/cli/internal/testing/cmdtest"
19)
21type detachedStart struct {
22 dir string
23 env []string
24 args []string
25}
27// runHookWithInput runs the hook for agent with stdin, and returns what it
28// printed and the glab it started, if any.
29func runHookWithInput(t *testing.T, agent, stdin string) (string, *detachedStart) {
30 t.Helper()
31 t.Setenv("GLAB_CONFIG_DIR", t.TempDir())
32 require.NoError(t, fallbacksync.SetDiscoveredAgents([]string{agent}))
33 return runHookEnabled(t, agent, stdin)
34}
36// runHookEnabled runs agent's hook with the agents that setup enabled left as
37// they are.
38func runHookEnabled(t *testing.T, agent, stdin string) (string, *detachedStart) {
39 t.Helper()
41 ios, _, stdout, stderr := cmdtest.TestIOStreams()
42 ios.In = io.NopCloser(strings.NewReader(stdin))
43 var started *detachedStart
44 opts := &options{io: ios, hook: agent, startDetached: func(dir string, env []string, args ...string) error {
45 started = &detachedStart{dir: dir, env: env, args: args}
46 return nil
47 }}
49 require.NoError(t, runSync(t.Context(), opts))
50 return stdout.String() + stderr.String(), started
51}
53func TestRunHook_StartsSyncForCodexSession(t *testing.T) {
54 t.Setenv("CLAUDE_CODE_SESSION_ID", "claude-1")
55 t.Setenv("OPENCODE_SESSION_ID", "ses_1")
57 out, started := runHookWithInput(t, "codex", `{"session_id":"th-1","turn_id":"turn-1","transcript_path":"/home/me/.codex/sessions/rollout-th-1.jsonl","cwd":"/work/repo","hook_event_name":"Stop","last_assistant_message":"done"}`)
59 assert.Empty(t, out, "Codex reads a Stop hook's output as a reason to continue")
60 require.NotNil(t, started)
61 assert.Equal(t, "/work/repo", started.dir, "the project comes from the session's directory")
62 assert.Equal(t, []string{"minder", "audit", "sync", "--silent"}, started.args)
63 assert.Subset(t, started.env, []string{
64 "GLAB_MINDER_HOOK_AGENT=codex",
65 "GLAB_MINDER_HOOK_SESSION_ID=th-1",
66 "GLAB_MINDER_HOOK_TRANSCRIPT=/home/me/.codex/sessions/rollout-th-1.jsonl",
67 })
68 assert.False(t, slices.ContainsFunc(started.env, func(kv string) bool {
69 return strings.HasPrefix(kv, "CLAUDE_CODE_SESSION_ID=") || strings.HasPrefix(kv, "OPENCODE_SESSION_ID=")
70 }), "a Claude Code or OpenCode session that started Codex is not synced in its place")
71}
73func TestRunHook_SkipsAgentThatIsNotEnabled(t *testing.T) {
74 t.Setenv("GLAB_CONFIG_DIR", t.TempDir())
75 require.NoError(t, fallbacksync.SetDiscoveredAgents([]string{"cursor"}))
77 out, started := runHookEnabled(t, "codex", `{"session_id":"th-1","transcript_path":"/home/me/.codex/sessions/rollout-th-1.jsonl","cwd":"/work/repo"}`)
79 assert.Empty(t, out)
80 assert.Nil(t, started, "--all skips the sessions of an agent that is not enabled, so the hook does too")
81}
83func TestRunHook_StartsSyncForCursorSession(t *testing.T) {
84 transcript := "/home/me/.cursor/projects/work-repo/agent-transcripts/conv-1/conv-1.jsonl"
85 for _, event := range []string{"stop", "sessionEnd"} {
86 t.Run(event, func(t *testing.T) {
87 out, started := runHookWithInput(t, "cursor", `{"conversation_id":"conv-1","session_id":"other-id","status":"completed","hook_event_name":"`+event+`","workspace_roots":["/work/docs","/work/repo"],"transcript_path":"`+transcript+`"}`)
89 assert.Empty(t, out, "Cursor reads a hook's output as a follow-up message")
90 require.NotNil(t, started)
91 assert.Equal(t, "/work/repo", started.dir, "the root the transcript's workspace slug names, not the first one")
92 assert.Subset(t, started.env, []string{
93 "GLAB_MINDER_HOOK_AGENT=cursor",
94 "GLAB_MINDER_HOOK_SESSION_ID=conv-1",
95 "GLAB_MINDER_HOOK_TRANSCRIPT=" + transcript,
96 }, "the session ID matches the one discovery uses")
97 })
98 }
99}
101func TestRunHook_SkipsACursorWorkspaceItCannotPlace(t *testing.T) {
102 transcript := "/home/me/.cursor/projects/work-both-code-workspace/agent-transcripts/conv-1/conv-1.jsonl"
104 out, started := runHookWithInput(t, "cursor", `{"hook_event_name":"stop","workspace_roots":["/work/docs","/work/repo"],"transcript_path":"`+transcript+`"}`)
106 assert.Empty(t, out)
107 assert.Nil(t, started, "uploading to the wrong root would send the session to another project")
108}
110func TestCursorWorkspaceRoot(t *testing.T) {
111 transcript := func(slug string) string {
112 return "/home/me/.cursor/projects/" + slug + "/agent-transcripts/conv-1/conv-1.jsonl"
113 }
114 tests := []struct {
115 name string
116 path string
117 roots []string
118 want string
119 }{
120 {"the root the slug names", transcript("work-repo"), []string{"/work/docs", "/work/repo"}, "/work/repo"},
121 {"a slug with a leading dash", transcript("-work-repo"), []string{"/work/docs", "/work/repo"}, "/work/repo"},
122 {"the only root", transcript("work-both-code-workspace"), []string{"/work/repo"}, "/work/repo"},
123 {"no root the slug names", transcript("work-both-code-workspace"), []string{"/work/docs", "/work/repo"}, ""},
124 {"two roots the slug names", transcript("work-a-b"), []string{"/work/a-b", "/work/a_b"}, ""},
125 {"a transcript outside agent-transcripts", "/elsewhere/conv-1.jsonl", []string{"/work/docs", "/work/repo"}, ""},
126 }
127 for _, tt := range tests {
128 t.Run(tt.name, func(t *testing.T) {
129 assert.Equal(t, tt.want, cursorWorkspaceRoot(tt.path, tt.roots))
130 })
131 }
132}
134func TestCursorWorkspaceRoot_UsesTheToolCallPaths(t *testing.T) {
135 work := t.TempDir()
136 docs, repo := filepath.Join(work, "docs"), filepath.Join(work, "repo")
137 roots := []string{docs, repo}
138 tests := []struct {
139 name string
140 slug string
141 reads []string
142 want string
143 }{
144 {"a workspace file slug", "work-both-code-workspace", []string{filepath.Join(repo, "main.go")}, repo},
145 {"a slug the tool calls contradict", nonAlphanumeric.ReplaceAllString(docs, "-"), []string{filepath.Join(repo, "main.go")}, ""},
146 {"a slug the tool calls confirm", nonAlphanumeric.ReplaceAllString(docs, "-"), []string{filepath.Join(docs, "a.md"), filepath.Join(repo, "main.go")}, docs},
147 {"both roots used, the slug decides", nonAlphanumeric.ReplaceAllString(repo, "-"), []string{filepath.Join(docs, "a.md"), filepath.Join(repo, "main.go")}, repo},
148 {"both roots used and no slug match", "work-both-code-workspace", []string{filepath.Join(docs, "a.md"), filepath.Join(repo, "main.go")}, ""},
149 {"only paths outside the roots", nonAlphanumeric.ReplaceAllString(repo, "-"), []string{"/tmp/scratch.txt"}, ""},
150 }
151 for _, tt := range tests {
152 t.Run(tt.name, func(t *testing.T) {
153 dir := filepath.Join(t.TempDir(), "projects", tt.slug, "agent-transcripts", "conv-1")
154 require.NoError(t, os.MkdirAll(dir, 0o755))
155 var lines []byte
156 for _, p := range tt.reads {
157 line, err := json.Marshal(map[string]any{"role": "assistant", "message": map[string]any{"content": []any{
158 map[string]any{"type": "tool_use", "name": "Read", "input": map[string]any{"path": p}},
159 }}})
160 require.NoError(t, err)
161 lines = append(append(lines, line...), '\n')
162 }
163 path := filepath.Join(dir, "conv-1.jsonl")
164 require.NoError(t, os.WriteFile(path, lines, 0o600))
166 assert.Equal(t, tt.want, cursorWorkspaceRoot(path, roots))
167 })
168 }
169}
171func TestRunHook_CodexDefaultsToHookDirectory(t *testing.T) {
172 _, started := runHookWithInput(t, "codex", `{"session_id":"th-1","transcript_path":"/rollout-th-1.jsonl"}`)
174 require.NotNil(t, started)
175 assert.Equal(t, ".", started.dir)
176}
178func TestRunHook_PassesAnAbsoluteTranscriptPath(t *testing.T) {
179 home := t.TempDir()
180 t.Setenv("HOME", home)
181 cwd, err := os.Getwd()
182 require.NoError(t, err)
184 for path, want := range map[string]string{
185 "~/.codex/sessions/rollout-th-1.jsonl": filepath.Join(home, ".codex", "sessions", "rollout-th-1.jsonl"),
186 "rollout-th-1.jsonl": filepath.Join(cwd, "rollout-th-1.jsonl"),
187 } {
188 _, started := runHookWithInput(t, "codex", `{"session_id":"th-1","transcript_path":"`+path+`","cwd":"/work/repo"}`)
190 require.NotNil(t, started, path)
191 assert.Contains(t, started.env, "GLAB_MINDER_HOOK_TRANSCRIPT="+want, "the glab started in the session's directory reopens it")
192 }
193}
195func TestRunHook_IgnoresInputWithoutSession(t *testing.T) {
196 tests := map[string]string{
197 "not JSON": "not json",
198 "empty": "",
199 "no session ID": `{"transcript_path":"/rollout.jsonl","cwd":"/work"}`,
200 "no transcript": `{"session_id":"th-1","cwd":"/work"}`,
201 "null transcript": `{"session_id":"th-1","transcript_path":null,"cwd":"/work"}`,
202 }
203 for name, stdin := range tests {
204 t.Run(name, func(t *testing.T) {
205 out, started := runHookWithInput(t, "codex", stdin)
207 assert.Empty(t, out)
208 assert.Nil(t, started)
209 })
210 }
212 cursorTests := map[string]string{
213 "aborted turn with no transcript": `{"conversation_id":"conv-1","status":"aborted","transcript_path":null,"workspace_roots":["/work/repo"]}`,
214 "no workspace": `{"conversation_id":"conv-1","transcript_path":"/t/conv-1/conv-1.jsonl","workspace_roots":[]}`,
215 }
216 for name, stdin := range cursorTests {
217 t.Run(name, func(t *testing.T) {
218 out, started := runHookWithInput(t, "cursor", stdin)
220 assert.Empty(t, out)
221 assert.Nil(t, started)
222 })
223 }
224}
226func TestRunSync_CodexHookSession(t *testing.T) {
227 env := newSyncAllEnv(t, true)
228 require.NoError(t, fallbacksync.SetDiscoveredAgents([]string{"codex"}))
229 path := writeCodexRollout(t, env.home, "th-1", jsonLines(t,
230 codexSessionMetaLine("th-1", "/work", ""),
231 codexItem(recentTimestamp(), map[string]any{"type": "function_call", "name": "exec_command", "call_id": "call_1"}),
232 ))
233 t.Setenv(hookAgentEnv, "codex")
234 t.Setenv(hookSessionEnv, "th-1")
235 t.Setenv(hookTranscriptEnv, path)
237 out, err := env.exec("--silent -R " + testHost + "/my-group/my-project")
238 require.NoError(t, err)
240 assert.Empty(t, out.String())
241 assert.Equal(t, []string{"th-1"}, env.fake.sessionsCreated)
242 assert.Equal(t, []string{"codex"}, env.fake.agentTypes)
243 assert.Equal(t, []string{"hook"}, env.fake.syncTypes)
244 assert.Equal(t, 1, env.fake.eventsPosted)
245 meta, err := readSessionMeta("th-1")
246 require.NoError(t, err)
247 assert.Equal(t, sessionMeta{AgentType: "codex", PathWithNamespace: "my-group/my-project", Host: testHost, Transcript: path}, *meta)
248}
250func TestSyncAll_CodexHookSessionIsNotDiscoveredAgain(t *testing.T) {
251 env := newSyncAllEnv(t, true)
252 require.NoError(t, fallbacksync.SetDiscoveredAgents([]string{"codex"}))
253 path := writeCodexRollout(t, env.home, "th-1", jsonLines(t,
254 codexSessionMetaLine("th-1", "/work", "git@"+testHost+":my-group/my-project.git"),
255 codexItem(recentTimestamp(), map[string]any{"type": "function_call", "name": "exec_command", "call_id": "call_1"}),
256 ))
257 t.Setenv(hookAgentEnv, "codex")
258 t.Setenv(hookSessionEnv, "th-1")
259 t.Setenv(hookTranscriptEnv, path)
260 _, err := env.exec("--silent -R " + testHost + "/my-group/my-project")
261 require.NoError(t, err)
262 t.Setenv(hookAgentEnv, "")
264 _, err = env.exec("--all")
265 require.NoError(t, err)
267 assert.Equal(t, []string{"th-1"}, env.fake.sessionsCreated)
268 assert.Equal(t, 1, env.fake.eventsPosted, "--all sends only what the hook has not")
269}
271func TestRunSync_CodexHookSessionIDMustMatchRollout(t *testing.T) {
272 env := newSyncAllEnv(t, true)
273 require.NoError(t, fallbacksync.SetDiscoveredAgents([]string{"codex"}))
274 path := writeCodexRollout(t, env.home, "th-1", jsonLines(t, codexSessionMetaLine("th-1", "/work", "")))
275 t.Setenv(hookAgentEnv, "codex")
276 t.Setenv(hookSessionEnv, "th-other")
277 t.Setenv(hookTranscriptEnv, path)
279 _, err := env.exec("--silent -R " + testHost + "/my-group/my-project")
280 require.Error(t, err)
282 assert.Empty(t, env.fake.sessionsCreated)
283}
285func TestRunSync_CodexHookSkipsSubagentThreads(t *testing.T) {
286 env := newSyncAllEnv(t, true)
287 require.NoError(t, fallbacksync.SetDiscoveredAgents([]string{"codex"}))
288 meta := codexSessionMetaLine("th-child", "/work", "")
289 meta["payload"].(map[string]any)["parent_thread_id"] = "th-parent" //nolint:forcetypeassert // built above
290 path := writeCodexRollout(t, env.home, "th-child", jsonLines(t, meta))
291 t.Setenv(hookAgentEnv, "codex")
292 t.Setenv(hookSessionEnv, "th-child")
293 t.Setenv(hookTranscriptEnv, path)
295 _, err := env.exec("--silent -R my-group/my-project")
296 require.Error(t, err)
298 assert.Empty(t, env.fake.sessionsCreated)
299 _, err = readSessionMeta("th-child")
300 require.ErrorIs(t, err, errNoSessionMeta)
301}
303func TestHookFlagExcludesOtherModes(t *testing.T) {
304 t.Parallel()
306 for _, other := range []string{"--all", "--complete", "-R my-group/my-project"} {
307 exec := cmdtest.SetupCmdForTest(t, NewCmd, false)
308 _, err := exec("--hook codex " + other)
309 require.Error(t, err, other)
310 }
311}
313// writeCursorTranscript writes a Cursor transcript with one tool call, and
314// returns its path.
315func writeCursorTranscript(t *testing.T, home, id string) string {
316 t.Helper()
317 path := filepath.Join(home, ".cursor", "projects", "work-repo", "agent-transcripts", id, id+".jsonl")
318 require.NoError(t, os.MkdirAll(filepath.Dir(path), 0o755))
319 require.NoError(t, os.WriteFile(path, []byte(jsonLines(t,
320 map[string]any{"role": "user", "message": map[string]any{"content": []any{map[string]any{"type": "text", "text": "<user_query>list the files</user_query>"}}}},
321 map[string]any{"role": "assistant", "message": map[string]any{"content": []any{map[string]any{"type": "tool_use", "name": "Shell"}}}},
322 )), 0o644))
323 return path
324}
326func TestRunSync_CursorHookSession(t *testing.T) {
327 env := newSyncAllEnv(t, true)
328 require.NoError(t, fallbacksync.SetDiscoveredAgents([]string{"cursor"}))
329 path := writeCursorTranscript(t, env.home, "conv-1")
330 t.Setenv(hookAgentEnv, "cursor")
331 t.Setenv(hookSessionEnv, "conv-1")
332 t.Setenv(hookTranscriptEnv, path)
334 out, err := env.exec("--silent -R " + testHost + "/my-group/my-project")
335 require.NoError(t, err)
337 assert.Empty(t, out.String())
338 assert.Equal(t, []string{"conv-1"}, env.fake.sessionsCreated)
339 assert.Equal(t, []string{"cursor"}, env.fake.agentTypes)
340 assert.Equal(t, []string{"hook"}, env.fake.syncTypes)
341 assert.Equal(t, 2, env.fake.eventsPosted)
342 assert.Zero(t, env.fake.completed, "sessionEnd fires after every cursor-agent -p run, so the session stays open")
343 meta, err := readSessionMeta("conv-1")
344 require.NoError(t, err)
345 assert.Equal(t, sessionMeta{AgentType: "cursor", PathWithNamespace: "my-group/my-project", Host: testHost, Transcript: path}, *meta)
346}
348func TestRunSync_CursorHookSkipsSubagentTranscripts(t *testing.T) {
349 env := newSyncAllEnv(t, true)
350 require.NoError(t, fallbacksync.SetDiscoveredAgents([]string{"cursor"}))
351 path := filepath.Join(env.home, ".cursor", "projects", "work-repo", "agent-transcripts", "conv-1", "subagents", "sub-1.jsonl")
352 require.NoError(t, os.MkdirAll(filepath.Dir(path), 0o755))
353 require.NoError(t, os.WriteFile(path, []byte(""), 0o644))
354 t.Setenv(hookAgentEnv, "cursor")
355 t.Setenv(hookSessionEnv, "sub-1")
356 t.Setenv(hookTranscriptEnv, path)
358 _, err := env.exec("--silent -R " + testHost + "/my-group/my-project")
359 require.Error(t, err)
361 assert.Empty(t, env.fake.sessionsCreated)
362}
Diagnostics9 git calls · 274 ms
CallStatusSizeTime0274 ms
discover200185 B4 ms
git.upload-pack discover http.response.status_code=200 git.upstream.cf_ray=- git.upstream.phase=ls-refs git.upstream.dur_ms=4 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 KiB4 ms
git.upload-pack ls-refs http.response.status_code=200 git.upstream.cf_ray=- git.upstream.phase=ls-refs git.upstream.dur_ms=4 git.response.bytes=59849 git.response.cache=UPDATING git.response.duration_ms=4 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:0200261 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=261 git.response.cache=HIT git.response.duration_ms=3 git.fetch.filter=tree:0 git.fetch.wants=3bb9946301aa8c0dc8d202b83bc9f84bf0400f6d 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=261 git.pkt.payload.max=234 git.sideband.band1.bytes=234 git.sideband.band2.bytes=0 git.sideband.band3.bytes=0 git.pack.objects=1 git.pack.bytes=234 git.pack.trailer=e0a52f164f79506da6b0dcc275ed62911f5383bfOpen pack map
fetchtree:0200139 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=139 git.response.cache=HIT git.response.duration_ms=3 git.fetch.filter=tree:0 git.fetch.wants=f91da6c620e9fe39086f689d1ae91b87356cda50 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=139 git.pkt.payload.max=112 git.sideband.band1.bytes=112 git.sideband.band2.bytes=0 git.sideband.band3.bytes=0 git.pack.objects=1 git.pack.bytes=112 git.pack.trailer=a35549813b2a01d473947912b5773e993ce7c2e2Open pack map
fetchtree:0200638 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=638 git.response.cache=HIT git.response.duration_ms=3 git.fetch.filter=tree:0 git.fetch.wants=02089b627a9895becfd23127f25e46df629ce9b2 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=638 git.pkt.payload.max=611 git.sideband.band1.bytes=611 git.sideband.band2.bytes=0 git.sideband.band3.bytes=0 git.pack.objects=1 git.pack.bytes=611 git.pack.trailer=f2a6246e346c2fa34e54ecb04cb1dd1c524f65bcOpen pack map
fetch2003.7 KiB254 ms
git.upload-pack fetch http.response.status_code=200 git.upstream.cf_ray=- git.upstream.phase=fetch git.upstream.dur_ms=254 git.response.bytes=3786 git.response.cache=MISS git.response.duration_ms=254 git.fetch.wants=d900642940f464f17f10c599099f6593bcf7ff61 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=3786 git.pkt.payload.max=3759 git.sideband.band1.bytes=3759 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
- a5e2d543cadf689d
- Request
- 5bc566c6…
- 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