GitLabgitlab-org
cli
main
1package view
3import (
4 "context"
5 "fmt"
6 "log"
7 "runtime/debug"
8 "slices"
9 "strings"
11 "charm.land/huh/v2"
12 "github.com/MakeNowJust/heredoc/v2"
13 "github.com/gdamore/tcell/v2"
14 "github.com/rivo/tview"
15 "github.com/spf13/cobra"
16 "golang.org/x/sync/errgroup"
17 "golang.org/x/text/cases"
18 "golang.org/x/text/language"
20 gitlab "gitlab.com/gitlab-org/api/client-go/v3"
22 "gitlab.com/gitlab-org/cli/internal/api"
23 "gitlab.com/gitlab-org/cli/internal/cmdutils"
24 "gitlab.com/gitlab-org/cli/internal/glrepo"
25 "gitlab.com/gitlab-org/cli/internal/iostreams"
26 "gitlab.com/gitlab-org/cli/internal/mcpannotations"
27)
29const (
30 closed string = "closed"
31 opened string = "opened"
33 // maxConcurrentListFetches caps the number of board lists whose issues
34 // are fetched in parallel, to avoid overwhelming the API.
35 maxConcurrentListFetches = 4
36)
38type issueBoardViewOptions struct {
39 assignee string
40 labels []string
41 milestone string
42 state string
43 paginate bool
44}
46type boardMeta struct {
47 name string
48 id int64
49 group *gitlab.Group
50 project *gitlab.Project
51}
53// listResult holds the issues fetched for a single board list, along with
54// the state used to fetch them (needed by filterIssues to render the list).
55type listResult struct {
56 issues []*gitlab.Issue
57 state string
58}
60func NewCmdView(f cmdutils.Factory) *cobra.Command {
61 opts := &issueBoardViewOptions{}
62 viewCmd := &cobra.Command{
63 Use: "view [flags]",
64 Short: `View project issue board.`,
65 Long: heredoc.Doc(`
66 Opens an interactive view of the project's issue boards in your
67 terminal, where you can browse issues by list.
68 `),
69 Example: heredoc.Doc(`
70 glab issue board view`),
71 Args: cobra.NoArgs,
72 ValidArgsFunction: cobra.NoFileCompletions,
73 Annotations: map[string]string{
74 mcpannotations.Safe: "true",
75 },
76 RunE: func(cmd *cobra.Command, args []string) error {
77 a := tview.NewApplication()
78 defer recoverPanic(a)
80 client, err := f.GitLabClient()
81 if err != nil {
82 return err
83 }
85 repo, err := f.BaseRepo()
86 if err != nil {
87 return err
88 }
90 project, err := api.GetProject(client, repo.FullName())
91 if err != nil {
92 return fmt.Errorf("failed to get project: %w", err)
93 }
95 // List the groups that are ancestors to project:
96 // https://docs.gitlab.com/api/projects/#list-groups
97 projectGroups, _, err := client.Projects.ListProjectsGroups(project.ID, &gitlab.ListProjectGroupOptions{})
98 if err != nil {
99 return err
100 }
102 menuOptions, boardMetaMap, err := fetchIssueBoards(cmd.Context(), client, repo, projectGroups)
103 if err != nil {
104 return err
105 }
107 selection, err := selectBoard(cmd.Context(), f.IO(), menuOptions)
108 if err != nil {
109 return fmt.Errorf("selecting issue board: %w", err)
110 }
111 selectedBoard := boardMetaMap[selection]
113 boardLists, err := getBoardLists(client, selectedBoard, repo)
114 if err != nil {
115 return fmt.Errorf("getting issue board lists: %w", err)
116 }
118 results, err := fetchAllListIssues(cmd.Context(), client, selectedBoard, repo, boardLists, opts)
119 if err != nil {
120 return err
121 }
123 root := buildBoardFlex(boardLists, results)
124 root.SetBorderPadding(1, 1, 2, 2).SetBorder(true).SetTitle(boardTitle(selectedBoard, project))
126 screen, err := tcell.NewScreen()
127 if err != nil {
128 return err
129 }
130 if err := a.SetScreen(screen).SetRoot(root, true).Run(); err != nil {
131 return err
132 }
133 return nil
134 },
135 }
137 viewCmd.Flags().
138 StringVarP(&opts.assignee, "assignee", "a", "", "Filter board issues by assignee username.")
139 viewCmd.Flags().
140 StringSliceVarP(&opts.labels, "labels", "l", []string{}, "Filter board issues by labels. Multiple labels can be comma-separated or specified by repeating the flag.")
141 viewCmd.Flags().
142 StringVarP(&opts.milestone, "milestone", "m", "", "Filter board issues by milestone.")
143 viewCmd.Flags().
144 BoolVar(&opts.paginate, "paginate", false, "Make additional HTTP requests to retrieve all board issues.")
145 return viewCmd
146}
148func (opts *issueBoardViewOptions) getListProjectIssueOptions() *gitlab.ListProjectIssuesOptions {
149 withLabelDetails := true
150 reqOpts := &gitlab.ListProjectIssuesOptions{
151 WithLabelDetails: &withLabelDetails,
152 }
154 if opts.assignee != "" {
155 reqOpts.AssigneeUsername = &opts.assignee
156 }
158 if len(opts.labels) != 0 {
159 labels := gitlab.LabelOptions(opts.labels)
160 reqOpts.Labels = &labels
161 }
163 if opts.state != "" {
164 reqOpts.State = &opts.state
165 }
167 if opts.milestone != "" {
168 reqOpts.Milestone = &opts.milestone
169 }
170 return reqOpts
171}
173func (opts *issueBoardViewOptions) getListGroupIssueOptions() *gitlab.ListGroupIssuesOptions {
174 withLabelDetails := true
175 reqOpts := &gitlab.ListGroupIssuesOptions{
176 WithLabelDetails: &withLabelDetails,
177 }
179 if opts.assignee != "" {
180 reqOpts.AssigneeUsername = &opts.assignee
181 }
183 if len(opts.labels) != 0 {
184 labels := gitlab.LabelOptions(opts.labels)
185 reqOpts.Labels = &labels
186 }
188 if opts.state != "" {
189 reqOpts.State = &opts.state
190 }
192 if opts.milestone != "" {
193 reqOpts.Milestone = &opts.milestone
194 }
195 return reqOpts
196}
198func recoverPanic(app *tview.Application) {
199 if r := recover(); r != nil {
200 app.Stop()
201 log.Fatalf("%s\n%s\n", r, string(debug.Stack()))
202 }
203}
205func buildLabelString(labelDetails []*gitlab.LabelDetails) string {
206 var labels string
207 for _, ld := range labelDetails {
208 labels += fmt.Sprintf("[white:%s:-]%s[white:-:-] ", ld.Color, ld.Name)
209 }
210 if labels != "" {
211 labels = strings.TrimSpace(labels) + "\n"
212 }
213 return labels
214}
216func selectBoard(ctx context.Context, io *iostreams.IOStreams, menuOptions []string) (string, error) {
217 options := make([]huh.Option[string], 0, len(menuOptions))
218 for _, opt := range menuOptions {
219 options = append(options, huh.NewOption(opt, opt))
220 }
222 var selectedOption string
223 selector := huh.NewSelect[string]().
224 Title("Select board:").
225 Options(options...).
226 Value(&selectedOption)
228 err := io.Run(ctx, selector)
229 if err != nil {
230 return "", err
231 }
232 return selectedOption, nil
233}
235// mapBoardData takes project and group issue board slices and
236// returns menu options for the user selection and a map of the board metadata keyed by the menu options
237func mapBoardData(
238 projectIssueBoards []*gitlab.IssueBoard,
239 projectGroupIssueBoards []*gitlab.GroupIssueBoard,
240) ([]string, map[string]boardMeta) {
241 // find longest board name to base padding on
242 maxNameLength := 0
243 for _, board := range projectIssueBoards {
244 if len(board.Name) > maxNameLength {
245 maxNameLength = len(board.Name)
246 }
247 }
248 for _, board := range projectGroupIssueBoards {
249 if len(board.Name) > maxNameLength {
250 maxNameLength = len(board.Name)
251 }
252 }
254 minPadding := 3
255 menuOptions := []string{}
256 boardMetaMap := map[string]boardMeta{}
258 formatMenuOption := func(boardName, parentName string, padding int, isGroupBoard bool) string {
259 sb := strings.Builder{}
260 sb.WriteString(boardName)
261 sb.WriteString(strings.Repeat(" ", padding))
262 kind := "PROJECT"
263 if isGroupBoard {
264 kind = "GROUP"
265 }
266 sb.WriteString(fmt.Sprintf("(%s: %s)", kind, parentName))
267 return sb.String()
268 }
270 // build menu entries and map metadata
271 for _, board := range projectGroupIssueBoards {
272 padding := max(maxNameLength-len(board.Name)+3, minPadding)
274 option := formatMenuOption(board.Name, board.Group.Name, padding, true)
275 menuOptions = append(menuOptions, option)
276 boardMetaMap[option] = boardMeta{
277 id: board.ID,
278 name: board.Name,
279 group: board.Group,
280 }
281 }
283 for _, board := range projectIssueBoards {
284 padding := max(maxNameLength-len(board.Name)+3, minPadding)
286 option := formatMenuOption(board.Name, board.Project.Name, padding, false)
287 menuOptions = append(menuOptions, option)
288 boardMetaMap[option] = boardMeta{
289 id: board.ID,
290 name: board.Name,
291 project: board.Project,
292 }
293 }
294 return menuOptions, boardMetaMap
295}
297// fetchIssueBoards retrieves project and group issue boards in parallel and
298// maps them into menu options for user selection.
299// https://docs.gitlab.com/api/group_boards/#list-group-issue-board-lists
300func fetchIssueBoards(
301 ctx context.Context,
302 client *gitlab.Client,
303 repo glrepo.Interface,
304 projectGroups []*gitlab.ProjectGroup,
305) ([]string, map[string]boardMeta, error) {
306 var projectIssueBoards []*gitlab.IssueBoard
307 var projectGroupIssueBoards []*gitlab.GroupIssueBoard
309 g, _ := errgroup.WithContext(ctx)
310 g.Go(func() error {
311 var err error
312 projectIssueBoards, err = getProjectIssueBoards(client, repo)
313 if err != nil {
314 return fmt.Errorf("getting project issue boards: %w", err)
315 }
316 return nil
317 })
318 g.Go(func() error {
319 var err error
320 projectGroupIssueBoards, err = getGroupIssueBoards(projectGroups, client)
321 if err != nil {
322 return fmt.Errorf("getting group issue boards: %w", err)
323 }
324 return nil
325 })
326 if err := g.Wait(); err != nil {
327 return nil, nil, err
328 }
330 menuOptions, boardMetaMap := mapBoardData(projectIssueBoards, projectGroupIssueBoards)
331 return menuOptions, boardMetaMap, nil
332}
334// fetchAllListIssues fetches the issues for every board list in parallel,
335// keeping results in the original board list order.
336func fetchAllListIssues(
337 ctx context.Context,
338 client *gitlab.Client,
339 board boardMeta,
340 repo glrepo.Interface,
341 boardLists []*gitlab.BoardList,
342 opts *issueBoardViewOptions,
343) ([]listResult, error) {
344 results := make([]listResult, len(boardLists))
346 g, _ := errgroup.WithContext(ctx)
347 g.SetLimit(maxConcurrentListFetches)
349 for i, l := range boardLists {
350 if l.Label == nil {
351 continue
352 }
353 listOpts := *opts
354 switch l.Label.Name {
355 case "Closed":
356 listOpts.state = closed
357 case "Open":
358 listOpts.state = opened
359 }
360 g.Go(func() error {
361 var issues []*gitlab.Issue
362 var err error
363 if board.group != nil {
364 issues, err = getGroupBoardIssues(client, board.group.ID, &listOpts)
365 } else {
366 issues, err = getProjectBoardIssues(client, repo, &listOpts)
367 }
368 if err != nil {
369 return fmt.Errorf("getting issues for list %s: %w", l.Label.Name, err)
370 }
371 results[i] = listResult{issues: issues, state: listOpts.state}
372 return nil
373 })
374 }
375 if err := g.Wait(); err != nil {
376 return nil, err
377 }
378 return results, nil
379}
381// buildBoardFlex renders the pre-fetched issues for each board list into a
382// horizontal tview.Flex, one bordered text view per list.
383func buildBoardFlex(boardLists []*gitlab.BoardList, results []listResult) *tview.Flex {
384 root := tview.NewFlex()
385 root.SetBackgroundColor(tcell.ColorDefault)
386 for i, l := range boardLists {
387 if l.Label == nil {
388 continue
389 }
390 boardIssues := filterIssues(boardLists, results[i].issues, l, results[i].state)
391 bx := tview.NewTextView()
392 bx.
393 SetDynamicColors(true).
394 SetText(boardIssues).
395 SetWrap(true).
396 SetBackgroundColor(tcell.ColorDefault).
397 SetBorder(true).
398 SetTitle(l.Label.Name).
399 SetTitleColor(tcell.GetColor(l.Label.Color))
400 root.AddItem(bx, 0, 1, false)
401 }
402 return root
403}
405// boardTitle formats the window title for the selected board, distinguishing
406// group boards from project boards.
407func boardTitle(board boardMeta, project *gitlab.Project) string {
408 boardType := "group"
409 boardContext := project.Namespace.Name
410 if board.group == nil {
411 boardType = "project"
412 boardContext = project.NameWithNamespace
413 }
414 caser := cases.Title(language.English)
415 return fmt.Sprintf(" %s • %s ", caser.String(boardType+" issue board"), boardContext)
416}
418func getProjectIssueBoards(apiClient *gitlab.Client, repo glrepo.Interface) ([]*gitlab.IssueBoard, error) {
419 projectIssueBoards, _, err := apiClient.Boards.ListIssueBoards(repo.FullName(), &gitlab.ListIssueBoardsOptions{})
420 if err != nil {
421 return nil, fmt.Errorf("retrieving issue board: %w", err)
422 }
423 return projectIssueBoards, nil
424}
426func getGroupIssueBoards(
427 projectGroups []*gitlab.ProjectGroup,
428 gitlabClient *gitlab.Client,
429) ([]*gitlab.GroupIssueBoard, error) {
430 if len(projectGroups) == 0 {
431 return []*gitlab.GroupIssueBoard{}, nil
432 }
434 results := make([][]*gitlab.GroupIssueBoard, len(projectGroups))
435 g, _ := errgroup.WithContext(context.Background())
437 for i, pg := range projectGroups {
438 g.Go(func() error {
439 boards, _, err := gitlabClient.GroupIssueBoards.ListGroupIssueBoards(
440 pg.ID,
441 &gitlab.ListGroupIssueBoardsOptions{},
442 )
443 if err != nil {
444 return fmt.Errorf("retrieving issue board: %w", err)
445 }
446 results[i] = boards
447 return nil
448 })
449 }
450 if err := g.Wait(); err != nil {
451 return nil, err
452 }
454 var out []*gitlab.GroupIssueBoard
455 for _, boards := range results {
456 out = append(out, boards...)
457 }
458 return out, nil
459}
461// getBoardLists fetches a board's lists from the group or project API and
462// pads them with synthetic 'Open'/'Closed' lists used to render issues that
463// don't carry a board-list label.
464func getBoardLists(apiClient *gitlab.Client, board boardMeta, repo glrepo.Interface) ([]*gitlab.BoardList, error) {
465 boardLists, err := fetchBoardLists(apiClient, board, repo)
466 if err != nil {
467 return nil, err
468 }
469 return withOpenClosedLists(boardLists), nil
470}
472func fetchBoardLists(apiClient *gitlab.Client, board boardMeta, repo glrepo.Interface) ([]*gitlab.BoardList, error) {
473 if board.group != nil {
474 boardLists, _, err := apiClient.GroupIssueBoards.ListGroupIssueBoardLists(board.group.ID, board.id, &gitlab.ListGroupIssueBoardListsOptions{})
475 if err != nil {
476 return nil, err
477 }
478 return boardLists, nil
479 }
481 boardLists, _, err := apiClient.Boards.GetIssueBoardLists(repo.FullName(), board.id, &gitlab.GetIssueBoardListsOptions{})
482 if err != nil {
483 return nil, err
484 }
485 return boardLists, nil
486}
488// withOpenClosedLists prepends/appends the empty 'opened' and 'closed' lists
489// used later when reading issues into the table view.
490func withOpenClosedLists(boardLists []*gitlab.BoardList) []*gitlab.BoardList {
491 opened := &gitlab.BoardList{
492 Label: &gitlab.Label{
493 Name: "Open",
494 Color: "#fabd2f",
495 TextColor: "#000000",
496 },
497 Position: 0,
498 }
499 boardLists = append([]*gitlab.BoardList{opened}, boardLists...)
501 closed := &gitlab.BoardList{
502 Label: &gitlab.Label{
503 Name: "Closed",
504 Color: "#8ec07c",
505 TextColor: "#000000",
506 },
507 Position: int64(len(boardLists)),
508 }
509 return append(boardLists, closed)
510}
512func getGroupBoardIssues(apiClient *gitlab.Client, groupID int64, opts *issueBoardViewOptions) ([]*gitlab.Issue, error) {
513 reqOpts := opts.getListGroupIssueOptions()
514 if reqOpts.PerPage == 0 {
515 reqOpts.PerPage = api.DefaultListLimit
516 }
517 var issues []*gitlab.Issue
518 var err error
519 if opts.paginate {
520 issues, err = gitlab.ScanAndCollect(func(p gitlab.PaginationOptionFunc) ([]*gitlab.Issue, *gitlab.Response, error) {
521 return apiClient.Issues.ListGroupIssues(groupID, reqOpts, p)
522 })
523 } else {
524 issues, _, err = apiClient.Issues.ListGroupIssues(groupID, reqOpts)
525 }
526 if err != nil {
527 return nil, fmt.Errorf("retrieving list issues: %w", err)
528 }
529 return issues, nil
530}
532func getProjectBoardIssues(apiClient *gitlab.Client, repo glrepo.Interface, opts *issueBoardViewOptions) ([]*gitlab.Issue, error) {
533 reqOpts := opts.getListProjectIssueOptions()
534 if reqOpts.PerPage == 0 {
535 reqOpts.PerPage = api.DefaultListLimit
536 }
537 var issues []*gitlab.Issue
538 var err error
539 if opts.paginate {
540 issues, err = gitlab.ScanAndCollect(func(p gitlab.PaginationOptionFunc) ([]*gitlab.Issue, *gitlab.Response, error) {
541 return apiClient.Issues.ListProjectIssues(repo.FullName(), reqOpts, p)
542 })
543 } else {
544 issues, _, err = apiClient.Issues.ListProjectIssues(repo.FullName(), reqOpts)
545 }
546 if err != nil {
547 return nil, fmt.Errorf("retrieving list issues: %w", err)
548 }
549 return issues, nil
550}
552// issueBelongsToOtherList reports whether issue carries a label matching any
553// board list, meaning it belongs on that list rather than the open list.
554func issueBelongsToOtherList(issue *gitlab.Issue, boardLists []*gitlab.BoardList) bool {
555 return slices.ContainsFunc(boardLists, func(boardList *gitlab.BoardList) bool {
556 return slices.Contains(issue.Labels, boardList.Label.Name)
557 })
558}
560// filterIssues scans through the issues passed to it, filtering for the ones that belong in targetList
561// This function returns a string representation of the issues for targetList which will be displayed in the table view
562func filterIssues(
563 boardLists []*gitlab.BoardList,
564 issues []*gitlab.Issue,
565 targetList *gitlab.BoardList,
566 state string,
567) string {
568 var boardIssues strings.Builder
569next:
570 for _, issue := range issues {
571 switch state {
572 // skip all issues that are not in the "closed" state for the "closed" list
573 case closed:
574 if issue.State != closed {
575 continue next
576 }
577 // skip issues labeled for other board lists when populating the "open" list
578 case opened:
579 if issueBelongsToOtherList(issue, boardLists) {
580 continue next
581 }
582 // filter labeled issues into board lists with corresponding labels
583 default:
584 var hasListLabel bool
585 if slices.Contains(issue.Labels, targetList.Label.Name) {
586 hasListLabel = true
587 }
588 if !hasListLabel || issue.State == closed {
589 continue next
590 }
591 }
593 var assignee, labelString string
594 if len(issue.Labels) > 0 {
595 labelString = buildLabelString(issue.LabelDetails)
596 }
597 if len(issue.Assignees) > 0 {
598 assignee = issue.Assignees[0].Username
599 }
601 boardIssues.WriteString(fmt.Sprintf("[white::b]%s\n%s[green:-:-]#%d[darkgray] - %s\n\n",
602 issue.Title, labelString, issue.IID, assignee))
603 }
604 return boardIssues.String()
605}
Diagnostics9 git calls · 277 ms
CallStatusSizeTime0277 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 KiB2 ms
git.upload-pack ls-refs http.response.status_code=200 git.upstream.cf_ray=- git.upstream.phase=ls-refs git.upstream.dur_ms=2 git.response.bytes=59849 git.response.cache=UPDATING git.response.duration_ms=2 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=44Open 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=3 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 · 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=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=fb03183b7909876778f740d196d7516811003517Open pack map
fetchtree:0200492 B · hit3 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=492 git.response.cache=HIT git.response.duration_ms=3 git.fetch.filter=tree:0 git.fetch.wants=409e7038e253494f94691a22a250deee77ba03bf 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=492 git.pkt.payload.max=465 git.sideband.band1.bytes=465 git.sideband.band2.bytes=0 git.sideband.band3.bytes=0 git.pack.objects=1 git.pack.bytes=465 git.pack.trailer=c8a67aa26d573734cf0c8f302f8c1dd08e47d76aOpen pack map
fetchtree:0200199 B · 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=199 git.response.cache=HIT git.response.duration_ms=4 git.fetch.filter=tree:0 git.fetch.wants=a1f66b0e40117fa2bfdc8be6d6391be5a122ec04 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=199 git.pkt.payload.max=172 git.sideband.band1.bytes=172 git.sideband.band2.bytes=0 git.sideband.band3.bytes=0 git.pack.objects=1 git.pack.bytes=172 git.pack.trailer=58a90817ea69bb3446d8835c6f1c2a46a892fda4Open pack map
fetchtree:0200148 B · hit3 ms
git.upload-pack fetch http.response.status_code=200 git.upstream.cf_ray=- git.upstream.phase=fetch git.upstream.dur_ms=259 git.response.bytes=148 git.response.cache=HIT git.response.duration_ms=3 git.fetch.filter=tree:0 git.fetch.wants=24f9ee986f260d4571e81224e5c1f58f30237166 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=148 git.pkt.payload.max=121 git.sideband.band1.bytes=121 git.sideband.band2.bytes=0 git.sideband.band3.bytes=0 git.pack.objects=1 git.pack.bytes=121 git.pack.trailer=65a7e0f1eb69e59888c2fc382c23e9573dda1da4Open pack map
fetch2004.8 KiB259 ms
git.upload-pack fetch http.response.status_code=200 git.response.bytes=4947 git.response.cache=MISS git.response.duration_ms=259 git.fetch.wants=a6fe0c0260546d38b1f15fed63d7438293f0a3a4 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=4947 git.pkt.payload.max=4920 git.sideband.band1.bytes=4920 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
- a5e2eacccb344bc2
- Request
- 9f0d47fc…
- 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