GitLabgitlab-org
cli
main
1package doctor
3import (
4 "context"
5 "errors"
6 "fmt"
7 "io/fs"
8 "os"
9 "os/exec"
10 "path/filepath"
11 "runtime"
12 "slices"
13 "strings"
14 "time"
16 "github.com/MakeNowJust/heredoc/v2"
17 "github.com/spf13/cobra"
19 gitlab "gitlab.com/gitlab-org/api/client-go/v3"
21 "gitlab.com/gitlab-org/cli/internal/api"
22 "gitlab.com/gitlab-org/cli/internal/cmdutils"
23 "gitlab.com/gitlab-org/cli/internal/commands/govern/internal/claudehooks"
24 "gitlab.com/gitlab-org/cli/internal/commands/govern/internal/fallbacksync"
25 "gitlab.com/gitlab-org/cli/internal/commands/govern/internal/opencodeplugin"
26 "gitlab.com/gitlab-org/cli/internal/config"
27 "gitlab.com/gitlab-org/cli/internal/glinstance"
28 "gitlab.com/gitlab-org/cli/internal/iostreams"
29 "gitlab.com/gitlab-org/cli/internal/mcpannotations"
30 "gitlab.com/gitlab-org/cli/internal/text"
31)
33type checkResult struct {
34 name string
35 ok bool
36 message string
37 fix string
38}
40type options struct {
41 io *iostreams.IOStreams
42 config func() config.Config
43 apiClient func(repoHost string) (*api.Client, error)
44 executor cmdutils.Executor
45 buildInfo api.BuildInfo
46 hostname string
47}
49func NewCmd(f cmdutils.Factory) *cobra.Command {
50 opts := &options{
51 io: f.IO(),
52 config: f.Config,
53 apiClient: f.ApiClient,
54 executor: f.Executor(),
55 buildInfo: f.BuildInfo(),
56 hostname: f.DefaultHostname(),
57 }
59 cmd := &cobra.Command{
60 Use: "doctor",
61 Short: "Diagnose AI governance configuration, authentication, and hook setup. (EXPERIMENTAL)",
62 Long: heredoc.Doc(`
63 Check that AI governance is correctly configured on this machine.
65 Verifies:
67 - Authentication: glab is authenticated with a valid token
68 - glab in PATH: the binary is findable so hooks will work
69 - Agent session hooks: if Claude Code sessions are synced, the Stop and SessionEnd hooks are installed
70 - OpenCode plugin: if OpenCode sessions are synced, the glab plugin is installed and up to date
71 - API connectivity: can reach the GitLab API
72 - Fallback periodic sync: whether the scheduled job is installed and loaded, whether the glab binary it runs still exists and is the same build as this glab, and the result of its last run
74 Outputs a clear remediation command for any check that fails.
75 `) + text.ExperimentalString,
76 Example: heredoc.Doc(`
77 # Check AI agent governance configuration on this machine
78 $ glab minder doctor
79 `),
80 Args: cobra.NoArgs,
81 ValidArgsFunction: cobra.NoFileCompletions,
82 Annotations: map[string]string{
83 mcpannotations.Safe: "true",
84 },
85 RunE: func(cmd *cobra.Command, args []string) error {
86 return runDoctor(cmd.Context(), opts)
87 },
88 }
90 return cmd
91}
93func runDoctor(ctx context.Context, opts *options) error {
94 io := opts.io
95 c := io.Color()
97 checks := []checkResult{
98 checkGlabInPath(),
99 checkAuthentication(opts),
100 checkClaudeHooks(),
101 checkOpenCodePlugin(),
102 checkAPIConnectivity(ctx, opts),
103 checkFallbackSync(ctx, opts.executor, runtime.GOOS, opts.buildInfo, time.Now()),
104 }
106 allPassed := true
107 for _, check := range checks {
108 if check.ok {
109 io.LogInfof("%s %s: %s\n", c.GreenCheck(), check.name, check.message)
110 } else {
111 allPassed = false
112 io.LogInfof("%s %s: %s\n", c.FailedIcon(), check.name, check.message)
114 if check.fix != "" {
115 io.LogInfof(" Fix: %s\n", check.fix)
116 }
117 }
118 }
120 io.LogInfo("")
121 if allPassed {
122 io.LogInfof("%s All checks passed.\n", c.GreenCheck())
123 } else {
124 io.LogInfof("%s Some checks failed. Address the issues above and re-run 'glab minder doctor'.\n", c.FailedIcon())
126 return cmdutils.SilentError
127 }
129 return nil
130}
132func checkGlabInPath() checkResult {
133 path, err := exec.LookPath("glab")
134 if err != nil {
135 return checkResult{
136 name: "glab in PATH",
137 ok: false,
138 message: "glab binary not found in PATH -- hooks will not fire",
139 fix: "Add glab to your PATH. See https://gitlab.com/gitlab-org/cli#installation",
140 }
141 }
142 return checkResult{
143 name: "glab in PATH",
144 ok: true,
145 message: path,
146 }
147}
149func checkAuthentication(opts *options) checkResult {
150 cfg := opts.config()
151 hostname := opts.hostname
152 if hostname == "" {
153 hostname = glinstance.DefaultHostname
154 }
156 token, _, err := cfg.GetWithSource(hostname, "token", true)
157 if err != nil || token == "" {
158 return checkResult{
159 name: "Authentication",
160 ok: false,
161 message: fmt.Sprintf("not authenticated with %s", hostname),
162 fix: "Run: glab auth login",
163 }
164 }
166 return checkResult{
167 name: "Authentication",
168 ok: true,
169 message: fmt.Sprintf("authenticated with %s", hostname),
170 }
171}
173// agentsReadFix says how to fix err from hookAgentEnabled.
174func agentsReadFix(err error) string {
175 fix := fallbacksync.AgentsReadFix(err)
176 return strings.ToUpper(fix[:1]) + fix[1:]
177}
179// hookAgentEnabled reports whether a setup without --agents would set up
180// agent, so its hook or plugin should be installed.
181func hookAgentEnabled(agent string) (bool, error) {
182 settings, err := claudehooks.SettingsPath()
183 if err != nil {
184 return false, err
185 }
186 setUp, err := fallbacksync.ResolvedHookAgents(settings)
187 if err != nil {
188 return false, err
189 }
190 discovered, err := fallbacksync.DiscoveredAgents()
191 if err != nil {
192 return false, err
193 }
194 return slices.Contains(fallbacksync.DefaultHookAgents(setUp, discovered), agent), nil
195}
197func checkClaudeHooks() checkResult {
198 switch enabled, err := hookAgentEnabled("claude-code"); {
199 case err != nil:
200 return checkResult{name: "Agent session hooks", ok: false, message: fmt.Sprintf("could not tell which agents are set up: %v", err), fix: agentsReadFix(err)}
201 case !enabled:
202 return checkResult{name: "Agent session hooks", ok: true, message: "Claude Code sessions are not synced; run 'glab minder setup --agents claude-code' to sync them"}
203 }
205 home, err := os.UserHomeDir()
206 if err != nil {
207 return checkResult{
208 name: "Agent session hooks",
209 ok: false,
210 message: fmt.Sprintf("could not determine home directory: %v", err),
211 }
212 }
214 claudeDir := filepath.Join(home, ".claude")
215 if _, err := os.Stat(claudeDir); errors.Is(err, fs.ErrNotExist) {
216 return checkResult{
217 name: "Agent session hooks",
218 ok: true,
219 message: "No hook-based agent detected (~/.claude not found); run 'glab minder setup' after installing a supported agent",
220 }
221 }
223 path, err := claudehooks.SettingsPath()
224 if err != nil {
225 return checkResult{
226 name: "Agent session hooks",
227 ok: false,
228 message: fmt.Sprintf("could not determine home directory: %v", err),
229 }
230 }
232 if _, err := os.Stat(path); errors.Is(err, fs.ErrNotExist) {
233 return checkResult{
234 name: "Agent session hooks",
235 ok: false,
236 message: fmt.Sprintf("%s not found", claudehooks.SettingsFile),
237 fix: "Run: glab minder setup",
238 }
239 }
241 raw, err := claudehooks.LoadRawSettings(path)
242 if err != nil {
243 return checkResult{
244 name: "Agent session hooks",
245 ok: false,
246 message: fmt.Sprintf("could not parse %s", claudehooks.SettingsFile),
247 fix: "Run: glab minder setup",
248 }
249 }
251 hooks, err := claudehooks.HooksFromRaw(raw)
252 if err != nil {
253 return checkResult{
254 name: "Agent session hooks",
255 ok: false,
256 message: fmt.Sprintf("could not parse hooks in %s", claudehooks.SettingsFile),
257 fix: "Run: glab minder setup",
258 }
259 }
261 missingHooks := []string{}
262 if !claudehooks.GlabHookPresent(hooks, "Stop") {
263 missingHooks = append(missingHooks, "Stop")
264 }
265 if !claudehooks.GlabHookPresent(hooks, "SessionEnd") {
266 missingHooks = append(missingHooks, "SessionEnd")
267 }
269 if len(missingHooks) > 0 {
270 return checkResult{
271 name: "Agent session hooks",
272 ok: false,
273 message: fmt.Sprintf("missing hooks: %s", strings.Join(missingHooks, ", ")),
274 fix: "Run: glab minder setup",
275 }
276 }
278 if claudehooks.LegacyHookPresent(hooks) {
279 // The legacy hooks still sync, through the hidden glab govern command.
280 return checkResult{
281 name: "Agent session hooks",
282 ok: true,
283 message: "Stop and SessionEnd hooks installed, but they run 'glab govern'; run 'glab minder setup' to update them",
284 }
285 }
287 return checkResult{
288 name: "Agent session hooks",
289 ok: true,
290 message: "Stop and SessionEnd hooks installed",
291 }
292}
294func checkOpenCodePlugin() checkResult {
295 const name = "OpenCode plugin"
297 if runtime.GOOS == "windows" {
298 return checkResult{name: name, ok: true, message: "not supported on Windows"}
299 }
301 switch enabled, err := hookAgentEnabled("opencode"); {
302 case err != nil:
303 return checkResult{name: name, ok: false, message: fmt.Sprintf("could not tell which agents are set up: %v", err), fix: agentsReadFix(err)}
304 case !enabled:
305 if detected, err := opencodeplugin.Detected(); err == nil && detected {
306 return checkResult{name: name, ok: true, message: "OpenCode sessions are not synced; run 'glab minder setup --agents opencode' to sync them"}
307 }
308 return checkResult{name: name, ok: true, message: "OpenCode sessions are not synced"}
309 }
311 path, err := opencodeplugin.Path()
312 if err != nil {
313 return checkResult{name: name, ok: false, message: err.Error()}
314 }
315 state, err := opencodeplugin.Check(path)
316 display := opencodeplugin.Display(path)
317 if err != nil {
318 return checkResult{name: name, ok: false, message: fmt.Sprintf("could not read %s: %v", display, err), fix: "Fix the file, then run: glab minder setup --agents opencode"}
319 }
320 switch state {
321 case opencodeplugin.Current:
322 return checkResult{name: name, ok: true, message: "installed in " + display}
323 case opencodeplugin.Outdated:
324 return checkResult{name: name, ok: false, message: display + " is out of date", fix: "Run: glab minder setup"}
325 case opencodeplugin.Foreign:
326 return checkResult{name: name, ok: false, message: display + " was not installed by glab", fix: "Remove or rename it, then run: glab minder setup --agents opencode"}
327 }
328 return checkResult{name: name, ok: false, message: "not installed, so OpenCode sessions are not synced", fix: "Run: glab minder setup"}
329}
331func checkAPIConnectivity(ctx context.Context, opts *options) checkResult {
332 client, err := opts.apiClient(opts.hostname)
333 if err != nil {
334 return checkResult{
335 name: "API connectivity",
336 ok: false,
337 message: fmt.Sprintf("could not create API client: %v", err),
338 fix: "Run: glab auth login",
339 }
340 }
342 _, _, err = client.Lab().Metadata.GetMetadata(gitlab.WithContext(ctx))
343 if err != nil {
344 return checkResult{
345 name: "API connectivity",
346 ok: false,
347 message: fmt.Sprintf("could not reach %s: %v", opts.hostname, err),
348 fix: "Check your network connection and GitLab instance URL",
349 }
350 }
352 return checkResult{
353 name: "API connectivity",
354 ok: true,
355 message: fmt.Sprintf("connected to %s", opts.hostname),
356 }
357}
359func checkFallbackSync(ctx context.Context, executor cmdutils.Executor, goos string, running api.BuildInfo, now time.Time) checkResult {
360 const name = "Fallback periodic sync"
362 home, err := os.UserHomeDir()
363 if err != nil {
364 return checkResult{name: name, ok: false, message: fmt.Sprintf("could not determine home directory: %v", err)}
365 }
367 job, err := fallbacksync.ReadInstalled(goos, home)
368 glabPath := job.GlabPath
369 switch {
370 case errors.Is(err, fallbacksync.ErrUnsupportedOS):
371 return checkResult{
372 name: name,
373 ok: true,
374 message: fmt.Sprintf("not supported on %s; sessions sync only through the hooks", goos),
375 }
376 case errors.Is(err, fallbacksync.ErrNotInstalled):
377 return checkResult{
378 name: name,
379 ok: true,
380 message: "not installed; sessions sync only through the hooks. Run 'glab minder setup' to install it",
381 }
382 case err != nil:
383 return checkResult{
384 name: name,
385 ok: false,
386 message: fmt.Sprintf("could not read the installed job: %v", err),
387 fix: "Run: glab minder setup",
388 }
389 }
391 if _, err := os.Stat(glabPath); err != nil {
392 return checkResult{
393 name: name,
394 ok: false,
395 message: fmt.Sprintf("the job runs %s, which no longer exists", glabPath),
396 fix: "Run: glab minder setup",
397 }
398 }
400 // A job installed before the rename to glab minder runs the hidden glab
401 // govern command, which a glab from before the rename also has.
402 jobCommand, legacyNote := "minder", ""
403 if job.Legacy {
404 jobCommand, legacyNote = "govern", "; it runs 'glab govern', run 'glab minder setup' to update it"
405 }
407 state, err := fallbacksync.State(ctx, executor, goos, os.Getuid())
408 switch {
409 case err != nil:
410 return checkResult{
411 name: name,
412 ok: false,
413 message: fmt.Sprintf("could not check whether the job is loaded: %v", err),
414 fix: "Run: glab minder setup",
415 }
416 case !state.Loaded:
417 return checkResult{
418 name: name,
419 ok: false,
420 message: "the job is installed but not loaded, so it never runs",
421 fix: "Run: glab minder setup",
422 }
423 case state.Ran && state.ExitCode != 0:
424 return checkResult{
425 name: name,
426 ok: false,
427 message: fmt.Sprintf("the job's last run exited with code %d", state.ExitCode),
428 fix: fmt.Sprintf("Run '%s %s audit sync --all' to see the error, then 'glab minder setup' to reinstall the job", glabPath, jobCommand),
429 }
430 }
432 // The job runs the binary setup chose. Upgrading glab updates it only when
433 // that binary is the package manager's stable path.
434 got, err := fallbacksync.BinaryVersion(ctx, executor, glabPath)
435 want := fallbacksync.BuildVersion(running)
436 switch {
437 case err != nil:
438 return checkResult{
439 name: name,
440 ok: false,
441 message: fmt.Sprintf("could not run %s version: %v", glabPath, err),
442 fix: "Run: glab minder setup",
443 }
444 case got != want:
445 return checkResult{
446 name: name,
447 ok: false,
448 message: fmt.Sprintf("the job runs %s, which reports %q, not %q like this glab", glabPath, got, want),
449 fix: "Run: glab minder setup",
450 }
451 }
453 status, err := fallbacksync.ReadStatus()
454 switch {
455 case errors.Is(err, fallbacksync.ErrNoStatus):
456 return checkResult{name: name, ok: true, message: fmt.Sprintf("installed (%s); no run recorded yet%s", glabPath, legacyNote)}
457 case err != nil:
458 return checkResult{name: name, ok: true, message: fmt.Sprintf("installed (%s); could not read last run: %v%s", glabPath, err, legacyNote)}
459 }
461 // The job may run without the token of the shell that runs doctor, so a
462 // token check in doctor alone does not show that the job is logged in.
463 if len(status.NoToken) > 0 {
464 return checkResult{
465 name: name,
466 ok: false,
467 message: fmt.Sprintf("installed (%s), but the last run had no token for %s and could not sync some sessions there; %s", glabPath, strings.Join(status.NoToken, ", "), describeLastRun(status, now)),
468 fix: fmt.Sprintf("Run 'glab auth login --hostname %s'. Environment variables set only in your shell, such as GITLAB_TOKEN or GLAB_CONFIG_DIR, are not visible to the job, so a sync run from your shell does not show that the job can sync", status.NoToken[0]),
469 }
470 }
472 if len(status.Errors) > 0 && status.SessionsSynced == 0 && status.SessionsCompleted == 0 {
473 return checkResult{
474 name: name,
475 ok: false,
476 message: fmt.Sprintf("installed (%s), but the last run synced nothing; %s", glabPath, describeLastRun(status, now)),
477 fix: fmt.Sprintf("Run '%s %s audit sync --all' to see the errors", glabPath, jobCommand),
478 }
479 }
481 return checkResult{
482 name: name,
483 ok: true,
484 message: fmt.Sprintf("installed (%s); %s%s%s", glabPath, describeLastRun(status, now), describeDiscoveredAgents(), legacyNote),
485 }
486}
488func describeDiscoveredAgents() string {
489 agents, err := fallbacksync.DiscoveredAgents()
490 switch {
491 case err != nil:
492 return fmt.Sprintf("; could not read which agents are synced without hooks: %v", err)
493 case len(agents) == 0:
494 return ""
495 default:
496 return "; also syncing " + strings.Join(agents, ", ") + " sessions"
497 }
498}
500func plural(n int, noun string) string {
501 if n == 1 {
502 return "1 " + noun
503 }
504 return fmt.Sprintf("%d %ss", n, noun)
505}
507func describeLastRun(s *fallbacksync.Status, now time.Time) string {
508 ago := now.Sub(s.FinishedAt).Round(time.Minute)
509 desc := fmt.Sprintf("last run %s ago", ago)
510 if ago > 2*fallbacksync.Interval {
511 desc += fmt.Sprintf(" (expected every %d minutes; the job may not be running)", int(fallbacksync.Interval.Minutes()))
512 }
513 desc += fmt.Sprintf(": %s synced, %d completed, %s posted", plural(s.SessionsSynced, "session"), s.SessionsCompleted, plural(s.EventsPosted, "event"))
514 if s.EventsTooLarge > 0 {
515 desc += fmt.Sprintf(", %s too large to post", plural(s.EventsTooLarge, "event"))
516 }
517 if len(s.Errors) > 0 {
518 desc += fmt.Sprintf(", %s (first: %s)", plural(len(s.Errors), "error"), s.Errors[0])
519 }
520 if len(s.Paused) > 0 {
521 desc += "; paused for " + strings.Join(s.Paused, "; ")
522 }
523 if len(s.AgentTypeNotSupported) > 0 {
524 desc += "; not supported by GitLab yet: " + strings.Join(s.AgentTypeNotSupported, ", ")
525 }
526 if len(s.Skipped) > 0 {
527 desc += "; not synced: " + strings.Join(s.Skipped, "; ")
528 }
529 if n := len(s.GovernanceNotEnabled); n > 0 {
530 desc += fmt.Sprintf("; governance not enabled for %s (%s), ask a group Owner or administrator to turn it on "+
531 "(not available for personal projects on GitLab.com)",
532 plural(n, "project"), strings.Join(s.GovernanceNotEnabled, ", "))
533 }
534 if n := len(s.ProjectNotFound); n > 0 {
535 desc += fmt.Sprintf("; %s not found or not accessible (%s)", plural(n, "project"), strings.Join(s.ProjectNotFound, ", "))
536 }
537 return desc
538}
Diagnostics8 git calls · 436 ms
CallStatusSizeTime0436 ms
discover200185 B3 ms
git.upload-pack discover http.response.status_code=200 git.upstream.cf_ray=- git.upstream.phase=ls-refs git.upstream.dur_ms=3 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 KiB180 ms
git.upload-pack ls-refs http.response.status_code=200 git.upstream.cf_ray=- git.upstream.phase=ls-refs git.upstream.dur_ms=177 git.response.bytes=59849 git.response.cache=EXPIRED git.response.duration_ms=180 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 · 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:0 · deepen 1020032 KiB · hit6 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=6 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
fetchtree:02001.8 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=1857 git.response.cache=HIT git.response.duration_ms=2 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 · 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=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=e0a52f164f79506da6b0dcc275ed62911f5383bfOpen pack map
fetchtree:0200166 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=166 git.response.cache=HIT git.response.duration_ms=3 git.fetch.filter=tree:0 git.fetch.wants=80253e44f30f16fe5863321899003ff50f0609ce 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=166 git.pkt.payload.max=139 git.sideband.band1.bytes=139 git.sideband.band2.bytes=0 git.sideband.band3.bytes=0 git.pack.objects=1 git.pack.bytes=139 git.pack.trailer=6218fb7fe13d59e0a344caa8ba4fe78bdec166bdOpen pack map
fetch2004.6 KiB246 ms
git.upload-pack fetch http.response.status_code=200 git.upstream.cf_ray=- git.upstream.phase=fetch git.upstream.dur_ms=246 git.response.bytes=4711 git.response.cache=MISS git.response.duration_ms=246 git.fetch.wants=8f695cc44a9c3788fd0146f06b0a35072d531bb1 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=4711 git.pkt.payload.max=4684 git.sideband.band1.bytes=4684 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
- a5e34dddbeee14c2
- Request
- daa40b51…
- 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