GitLabgitlab-org

cli

main
ply9 git calls432 ms102 KiB6 cachedprotocol v2
381 lines15 KiBRaw
1//go:build !integration
3package sync
5import (
6 "encoding/json"
7 "os"
8 "path/filepath"
9 "strings"
10 "testing"
11 "time"
12 "unicode/utf8"
14 "github.com/stretchr/testify/assert"
15 "github.com/stretchr/testify/require"
17 "gitlab.com/gitlab-org/cli/internal/commands/govern/internal/redact"
20// richClaudeTranscript is shaped like a real Claude Code transcript: a typed
21// prompt, a response streamed as two entries with the same message ID, a
22// failed tool result, and a second response.
23func richClaudeTranscript(t *testing.T, base time.Time) []byte {
24 t.Helper()
25 at := func(seconds int) string { return base.Add(time.Duration(seconds) * time.Second).Format(time.RFC3339) }
26 entries := []map[string]any{
27 {
28 "type": "user", "uuid": "u-1", "promptId": "p-1", "timestamp": at(0),
29 "message": map[string]any{"role": "user", "content": "run the tests"},
30 },
31 {
32 "type": "assistant", "timestamp": at(1),
33 "message": map[string]any{
34 "id": "msg_1", "model": "claude-opus-5-5",
35 "content": []any{map[string]any{"type": "text", "text": "Running them."}},
36 "usage": map[string]any{"input_tokens": 10, "output_tokens": 1},
37 },
38 },
39 {
40 "type": "assistant", "timestamp": at(2),
41 "message": map[string]any{
42 "id": "msg_1", "model": "claude-opus-5-5",
43 "content": []any{map[string]any{"type": "tool_use", "id": "toolu_1", "name": "Bash", "input": map[string]any{"command": "go test ./..."}}},
44 "usage": map[string]any{"input_tokens": 10, "output_tokens": 42, "cache_read_input_tokens": 500},
45 },
46 },
47 {
48 "type": "user", "uuid": "u-2", "promptId": "p-1", "timestamp": at(5),
49 "message": map[string]any{"role": "user", "content": []any{map[string]any{
50 "type": "tool_result", "tool_use_id": "toolu_1", "is_error": true,
51 "content": []any{map[string]any{"type": "text", "text": "exit status 1"}},
52 }}},
53 },
54 {
55 "type": "assistant", "timestamp": at(6),
56 "message": map[string]any{
57 "id": "msg_2", "model": "claude-opus-5-5",
58 "content": []any{map[string]any{"type": "text", "text": "A test failed."}},
59 "usage": map[string]any{"input_tokens": 60, "output_tokens": 5},
60 },
61 },
62 }
63 var content []byte
64 for _, e := range entries {
65 line, err := json.Marshal(e)
66 require.NoError(t, err)
67 content = append(append(content, line...), '\n')
68 }
69 return content
72func TestParseTranscript_RichEvents(t *testing.T) {
73 t.Parallel()
75 path := filepath.Join(t.TempDir(), "session.jsonl")
76 require.NoError(t, os.WriteFile(path, richClaudeTranscript(t, time.Date(2026, 10, 9, 1, 0, 0, 0, time.UTC)), 0o644))
78 data, _, err := parseTranscript(path, 0)
79 require.NoError(t, err)
81 require.Len(t, data.Prompts, 1)
82 assert.Equal(t, prompt{ID: "u-1", Text: "run the tests", Timestamp: time.Date(2026, 10, 9, 1, 0, 0, 0, time.UTC)}, data.Prompts[0])
83 assert.Equal(t, "run the tests", data.Goal)
85 require.Len(t, data.ToolCalls, 1)
86 assert.JSONEq(t, `{"command":"go test ./..."}`, string(data.ToolCalls[0].Input))
88 require.Len(t, data.ToolResults, 1)
89 assert.Equal(t, toolResult{
90 CallID: "toolu_1", Name: "Bash", IsError: true, Error: "exit status 1",
91 Duration: 3 * time.Second, Timestamp: time.Date(2026, 10, 9, 1, 0, 5, 0, time.UTC),
92 }, data.ToolResults[0])
94 require.Len(t, data.Responses, 2, "a response streamed as several entries is one response")
95 assert.Equal(t, llmResponse{
96 ID: "msg_1", Model: "claude-opus-5-5",
97 Usage: tokenUsage{InputTokens: 10, OutputTokens: 42, CacheReadInputTokens: 500},
98 Timestamp: time.Date(2026, 10, 9, 1, 0, 1, 0, time.UTC),
99 }, data.Responses[0], "the latest entry's usage, at the time the response started")
100 assert.Equal(t, "msg_2", data.Responses[1].ID)
103func TestAuditEvents(t *testing.T) {
104 t.Parallel()
106 at := time.Date(2026, 10, 9, 1, 0, 0, 0, time.UTC)
107 data := &sessionData{
108 Prompts: []prompt{{ID: "u-1", Text: "run the tests", Timestamp: at}},
109 ToolCalls: []toolCall{{ID: "toolu_1", Name: "Bash", Input: json.RawMessage(`{"command":"go test ./..."}`), Timestamp: at}},
110 ToolResults: []toolResult{
111 {CallID: "toolu_1", Name: "Bash", IsError: true, Error: strings.Repeat("e", 300), Duration: 1500 * time.Millisecond, Timestamp: at},
112 {CallID: "toolu_0", Timestamp: at},
113 },
114 Responses: []llmResponse{{ID: "msg_1", Model: "claude-opus-5-5", Usage: tokenUsage{InputTokens: 10, OutputTokens: 42}, Timestamp: at}},
115 }
117 events := auditEvents("claude-code", data, at.Add(time.Hour))
118 require.Len(t, events, 5)
119 byName := map[string][]auditEventRequest{}
120 for _, e := range events {
121 assert.Equal(t, "claude-code", e.Details["agent_name"])
122 byName[e.EventName] = append(byName[e.EventName], e)
123 }
125 invoked := byName[eventToolInvoked][0]
126 assert.Equal(t, deterministicUUID("toolu_1"), invoked.CloudEventID, "tool calls keep the ID they had before results were recorded")
127 assert.Equal(t, "Bash", invoked.Details["tool_name"])
128 assert.NotContains(t, invoked.Details, "tool_namespace", "agents that record only a name send no namespace")
129 assert.Equal(t, "pending", invoked.Details["outcome"])
130 assert.Equal(t, true, invoked.Details["agent_initiated"])
131 assert.JSONEq(t, `{"command":"go test ./..."}`, string(invoked.Details["tool_args"].(json.RawMessage))) //nolint:forcetypeassert // set by auditEvents
133 failed := byName[eventToolFailed][0]
134 assert.Equal(t, "error", failed.Details["outcome"])
135 assert.Len(t, failed.Details["error_message"], errorMessageLimit)
136 assert.InDelta(t, 1.5, failed.Details["duration_s"], 0.001)
137 assert.NotEqual(t, invoked.CloudEventID, failed.CloudEventID)
139 succeeded := byName[eventToolResponse][0]
140 assert.Equal(t, "success", succeeded.Details["outcome"])
141 assert.NotContains(t, succeeded.Details, "tool_name", "a result whose call was synced earlier has no name")
142 assert.NotContains(t, succeeded.Details, "duration_s")
144 userInput := byName[eventUserInput][0]
145 assert.Equal(t, "message", userInput.Details["input_type"])
146 assert.Equal(t, "run the tests", userInput.Details["content"])
147 assert.Equal(t, 13, userInput.Details["content_length"])
148 assert.NotContains(t, userInput.Details, "content_truncated")
150 response := byName[eventResponseReceived][0]
151 assert.Equal(t, "claude-opus-5-5", response.Details["model_name"])
152 assert.Equal(t, 10, response.Details["prompt_token_count"])
153 assert.Equal(t, 42, response.Details["completion_token_count"])
156func TestAuditEvents_ToolNamespace(t *testing.T) {
157 t.Parallel()
159 at := time.Date(2026, 10, 9, 1, 0, 0, 0, time.UTC)
160 data := &sessionData{
161 ToolCalls: []toolCall{{ID: "call_1", Name: "mcp__computer_use__click", Namespace: "mcp__computer_use", Timestamp: at}},
162 ToolResults: []toolResult{{CallID: "call_1", Name: "mcp__computer_use__click", Namespace: "mcp__computer_use", Outcome: "completed", Timestamp: at}},
163 }
165 events := auditEvents("codex", data, at.Add(time.Hour))
166 require.Len(t, events, 2)
167 for _, e := range events {
168 assert.Equal(t, "mcp__computer_use__click", e.Details["tool_name"])
169 assert.Equal(t, "mcp__computer_use", e.Details["tool_namespace"])
170 }
173func TestAuditEvents_Limits(t *testing.T) {
174 t.Parallel()
176 now := time.Date(2026, 10, 9, 1, 0, 0, 0, time.UTC)
177 huge := `{"content":"` + strings.Repeat("x", maxValueBytes) + `"}`
178 data := &sessionData{
179 Prompts: []prompt{{ID: "u-1", Text: strings.Repeat("é", maxValueBytes), Timestamp: now}},
180 ToolCalls: []toolCall{
181 {ID: "toolu_big", Name: "Write", Input: json.RawMessage(huge), Timestamp: now},
182 {ID: "toolu_old", Name: "Read", Timestamp: now.Add(-91 * 24 * time.Hour)},
183 },
184 }
186 events := auditEvents("claude-code", data, now)
187 require.Len(t, events, 2, "an event older than GitLab accepts is dropped")
189 content, ok := events[0].Details["content"].(string)
190 require.True(t, ok)
191 assert.LessOrEqual(t, len(content), maxValueBytes)
192 assert.True(t, strings.HasSuffix(content, "é"), "truncation does not split a character")
193 assert.Equal(t, true, events[0].Details["content_truncated"])
194 assert.Equal(t, maxValueBytes, events[0].Details["content_length"], "the length is of the whole prompt")
196 assert.Equal(t, argumentsOmitted, events[1].Details["tool_args"])
197 for _, e := range events {
198 details, err := json.Marshal(e.Details)
199 require.NoError(t, err)
200 assert.Less(t, len(details), 10*1024, "GitLab rejects details over 10 KB")
201 }
204func TestAuditEvents_RedactionDoesNotOmitArguments(t *testing.T) {
205 t.Parallel()
207 // Each marker is longer than the password it replaces.
208 command := strings.Repeat("curl https://u:Abc12345@example.com\n", 10)
209 padding := strings.Repeat("x", maxValueBytes-encodedLen(map[string]string{"command": command})-10)
210 arguments, err := json.Marshal(map[string]string{"command": command + padding})
211 require.NoError(t, err)
212 require.LessOrEqual(t, encodedLen(json.RawMessage(arguments)), maxValueBytes)
213 require.Greater(t, encodedLen(redact.JSON(arguments)), maxValueBytes, "redaction lengthens the arguments past the limit")
215 now := time.Date(2026, 10, 9, 1, 0, 0, 0, time.UTC)
216 events := auditEvents("claude-code", &sessionData{
217 ToolCalls: []toolCall{{ID: "toolu_1", Name: "Bash", Input: arguments, Timestamp: now}},
218 }, now)
219 require.Len(t, events, 1)
221 details, err := json.Marshal(events[0].Details)
222 require.NoError(t, err)
223 assert.NotContains(t, string(details), "Abc12345")
224 assert.Contains(t, string(details), redact.Marker("url_password"))
225 assert.NotContains(t, string(details), "omitted")
226 assert.LessOrEqual(t, encodedLen(events[0].Details), 10*1024, "GitLab measures the encoded details")
229func TestAuditEvents_OmitsArgumentsThatRedactionMakesTooLarge(t *testing.T) {
230 t.Parallel()
232 line := "curl https://u:Abc12345@example.com\n"
233 command := strings.Repeat(line, (maxValueBytes-20)/(len(line)+1))
234 arguments, err := json.Marshal(map[string]string{"command": command})
235 require.NoError(t, err)
236 require.LessOrEqual(t, encodedLen(json.RawMessage(arguments)), maxValueBytes)
238 now := time.Date(2026, 10, 9, 1, 0, 0, 0, time.UTC)
239 events := auditEvents("claude-code", &sessionData{
240 ToolCalls: []toolCall{{ID: "toolu_1", Name: "Bash", Input: arguments, Timestamp: now}},
241 }, now)
242 require.Len(t, events, 1)
244 assert.Equal(t, argumentsOmitted, events[0].Details["tool_args"])
245 assert.LessOrEqual(t, encodedLen(events[0].Details), 10*1024, "GitLab measures the encoded details")
248func TestSyncAll_PostsRichEvents(t *testing.T) {
249 env := newSyncAllEnv(t, true)
250 path := env.writeClaudeSession(t, "sess-1", "my-group/my-project")
251 // Relative to now, because the sync drops events older than GitLab accepts.
252 content := richClaudeTranscript(t, time.Now().Add(-time.Hour).Truncate(time.Second))
253 require.NoError(t, os.WriteFile(path, content, 0o644))
255 _, err := env.exec("--all")
256 require.NoError(t, err)
258 assert.ElementsMatch(t,
259 []string{eventUserInput, eventToolInvoked, eventToolFailed, eventResponseReceived, eventResponseReceived},
260 eventNames(env.fake.events))
261 assert.Equal(t, 5, readStatus(t).EventsPosted)
264func TestAuditEvents_OutcomeOverride(t *testing.T) {
265 t.Parallel()
267 at := time.Date(2026, 10, 9, 1, 0, 0, 0, time.UTC)
268 events := auditEvents("codex", &sessionData{
269 ToolResults: []toolResult{{CallID: "call_1", Outcome: "completed", Timestamp: at}},
270 }, at)
272 require.Len(t, events, 1)
273 assert.Equal(t, eventToolResponse, events[0].EventName)
274 assert.Equal(t, "completed", events[0].Details["outcome"], "agents that do not record success do not claim it")
277func TestAuditEvents_ToolArgsAreObjects(t *testing.T) {
278 t.Parallel()
280 at := time.Date(2026, 10, 9, 1, 0, 0, 0, time.UTC)
281 events := auditEvents("codex", &sessionData{ToolCalls: []toolCall{
282 {ID: "call_1", Name: "exec_command", Input: json.RawMessage(`"not json"`), Timestamp: at},
283 {ID: "call_2", Name: "tool_search", Input: json.RawMessage(` [1, 2]`), Timestamp: at},
284 {ID: "call_3", Name: "exec_command", Input: json.RawMessage(` {"cmd":"ls"}`), Timestamp: at},
285 {ID: "call_4", Name: "exec_command", Input: json.RawMessage(`"curl https://u:Abc12345@example.com"`), Timestamp: at},
286 }}, at)
287 require.Len(t, events, 4)
289 redacted := `{"input":"curl https://u:` + redact.Marker("url_password") + `@example.com"}`
290 for i, want := range []string{`{"input":"not json"}`, `{"input":[1, 2]}`, `{"cmd":"ls"}`, redacted} {
291 encoded, err := json.Marshal(events[i].Details["tool_args"])
292 require.NoError(t, err)
293 assert.JSONEq(t, want, string(encoded))
294 }
297func TestAuditEvents_CapsEncodedSize(t *testing.T) {
298 t.Parallel()
300 // Each of these encodes to more bytes than it takes: < > & become six
301 // bytes as GitLab escapes them, and quotes, backslashes, and newlines two.
302 escaped := strings.Repeat(`<a href="x">&\`+"\n", 400)
303 require.Less(t, len(escaped), maxValueBytes, "small enough before encoding")
304 arguments, err := json.Marshal(map[string]string{"contents": escaped})
305 require.NoError(t, err)
307 now := time.Date(2026, 10, 9, 1, 0, 0, 0, time.UTC)
308 events := auditEvents("claude-code", &sessionData{
309 Prompts: []prompt{{ID: "u-1", Text: escaped + "é", Timestamp: now}},
310 ToolCalls: []toolCall{{ID: "toolu_1", Name: "Write", Input: arguments, Timestamp: now}},
311 }, now)
312 require.Len(t, events, 2)
314 content, ok := events[0].Details["content"].(string)
315 require.True(t, ok)
316 assert.LessOrEqual(t, encodedLen(content), maxValueBytes, "the prompt is capped on its encoded size")
317 assert.True(t, utf8.ValidString(content))
318 assert.Equal(t, true, events[0].Details["content_truncated"])
319 assert.Equal(t, utf8.RuneCountInString(escaped)+1, events[0].Details["content_length"])
320 assert.Equal(t, argumentsOmitted, events[1].Details["tool_args"], "the arguments are too large once encoded")
322 for _, e := range events {
323 assert.LessOrEqual(t, encodedLen(e.Details), 10*1024, "GitLab measures the encoded details")
324 }
327func TestTruncateEncoded(t *testing.T) {
328 t.Parallel()
330 got, truncated := truncateEncoded("short", 100)
331 assert.Equal(t, "short", got)
332 assert.False(t, truncated)
334 got, truncated = truncateEncoded(strings.Repeat("é", 100), 52)
335 assert.True(t, truncated)
336 assert.Equal(t, strings.Repeat("é", 25), got, "two quotes plus 25 two-byte characters")
338 got, truncated = truncateEncoded(strings.Repeat("<", 10), 32)
339 assert.True(t, truncated)
340 assert.Equal(t, strings.Repeat("<", 5), got, "each < encodes to six bytes")
343func TestAuditEventElements(t *testing.T) {
344 event := auditEventRequest{
345 EventName: eventToolInvoked,
346 CloudEventID: "x",
347 OccurredAt: "2026-10-19T00:00:00Z",
348 Details: map[string]any{
349 "tool_name": "Edit",
350 "agent_initiated": true,
351 "arguments": json.RawMessage(
352 `{"edits":[{"old":"a","new":"b"},{"old":"c","new":"d"}],"flags":[1,2,3],"empty":{},"none":null}`,
353 ),
354 },
355 }
357 // Gitlab::Json::StreamValidator counts 41 elements in a request with only this event.
358 assert.Equal(t, 41, auditEventsRequestElements+auditEventElements(event))
361func TestJSONElements(t *testing.T) {
362 tests := []struct {
363 json string
364 want int
365 }{
366 {`1`, 0},
367 {`{}`, 0},
368 {`[]`, 0},
369 {`{"a":null}`, 2},
370 {`{"a":{}}`, 2},
371 {`{"a":[1]}`, 3},
372 {`{"a":[{}]}`, 3},
373 {`[1,"s",true]`, 3},
374 {`{"a":"s","b":1.5}`, 4},
375 }
376 for _, tt := range tests {
377 var v any
378 require.NoError(t, json.Unmarshal([]byte(tt.json), &v))
379 assert.Equal(t, tt.want, jsonElements(v), tt.json)
380 }
Diagnostics9 git calls · 432 ms
CallStatusSizeTime0432 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 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=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=4
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 · 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=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=fb03183b7909876778f740d196d7516811003517
Open pack map
fetchtree:0200261 B · hit2 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=2
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=e0a52f164f79506da6b0dcc275ed62911f5383bf
Open 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=a35549813b2a01d473947912b5773e993ce7c2e2
Open 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=414
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=f2a6246e346c2fa34e54ecb04cb1dd1c524f65bc
Open pack map
fetch2004.0 KiB414 ms
git.upload-pack fetch
http.response.status_code=200
git.response.bytes=4145
git.response.cache=MISS
git.response.duration_ms=414
git.fetch.wants=ac0fa997689514331a49af83a0918a0db2b2e99e
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=4145
git.pkt.payload.max=4118
git.sideband.band1.bytes=4118
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
a5e2f803ccb23a24
Request
7ecbbbdc…
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