GitLabgitlab-org

cli

main
ply6 git calls31 ms99 KiB4 cachedprotocol v2
661 lines16 KiBRaw
1//go:build !integration
3package utils
5import (
6 "strings"
7 "testing"
8 "time"
10 "github.com/stretchr/testify/require"
12 gitlab "gitlab.com/gitlab-org/api/client-go/v3"
15func Test_RenderMarkdownLineBreaks(t *testing.T) {
16 tests := []struct {
17 name string
18 input string
19 want []string
20 }{
21 {
22 name: "hard break with two spaces",
23 input: "first \nsecond",
24 want: []string{"first", "second"},
25 },
26 {
27 name: "hard break with backslash",
28 input: "first\\\nsecond",
29 want: []string{"first", "second"},
30 },
31 {
32 name: "soft break collapses",
33 input: "first\nsecond",
34 want: []string{"first second"},
35 },
36 {
37 name: "soft break with one trailing space collapses",
38 input: "first \nsecond",
39 want: []string{"first second"},
40 },
41 {
42 name: "mixed hard and soft breaks",
43 input: "first \nsecond\nthird",
44 want: []string{"first", "second third"},
45 },
46 {
47 name: "soft break in blockquote collapses",
48 input: "> first\n> second",
49 want: []string{"first second"},
50 },
51 {
52 name: "hard break in blockquote",
53 input: "> first \n> second",
54 want: []string{"first", "second"},
55 },
56 {
57 name: "soft break in tight list item collapses",
58 input: "- first\n second",
59 want: []string{"first second"},
60 },
61 {
62 name: "hard break in list item",
63 input: "- first \n second",
64 want: []string{"first", "second"},
65 },
66 {
67 name: "fenced code keeps hard breaks",
68 input: "```\nfirst \nsecond\n```",
69 want: []string{"first", "second"},
70 },
71 {
72 name: "inline code is not a hard break",
73 input: "`first\nsecond`",
74 want: []string{"first second"},
75 },
76 {
77 name: "crlf hard break",
78 input: "first \r\nsecond",
79 want: []string{"first", "second"},
80 },
81 {
82 // A newline inside a code span is not a line break in CommonMark.
83 name: "inline code spanning a newline stays on one line",
84 input: "a `b\nc` d",
85 want: []string{"a b c d"},
86 },
87 {
88 name: "term and definition form a definition list",
89 input: "Term\n: Definition",
90 want: []string{"Term", "Definition"},
91 },
92 {
93 name: "indented block keeps its angle bracket",
94 input: "a\n > not quote",
95 want: []string{"a > not quote"},
96 },
97 {
98 name: "list item indented block keeps its angle bracket",
99 input: "- a\n > b",
100 want: []string{"a > b"},
101 },
102 {
103 name: "soft break in definition description collapses",
104 input: "Term\n: first\n second",
105 want: []string{"Term", "first second"},
106 },
107 {
108 // A hard break keeps the next line in the paragraph, so the
109 // indentation that makes ">" literal must survive the rewrite.
110 name: "hard break before indented blockquote stays literal",
111 input: "a \n > not quote",
112 want: []string{"a", "> not quote"},
113 },
114 {
115 name: "hard break before indented heading stays literal",
116 input: "a \n # not heading",
117 want: []string{"a", "# not heading"},
118 },
119 {
120 // Removing the indentation would turn this continuation into a
121 // setext heading underline for the preceding line.
122 name: "hard break before indented dashes is not a heading",
123 input: "a \n ---",
124 want: []string{"a", "---"},
125 },
126 {
127 name: "hard break before indented list marker stays literal",
128 input: "a \n - not a list",
129 want: []string{"a", "- not a list"},
130 },
131 {
132 name: "hard break before indented continuation in list item",
133 input: "- a \n > b",
134 want: []string{"a", "> b"},
135 },
136 {
137 name: "heading and following text are separate lines",
138 input: "# head \ntext",
139 want: []string{"# head", "text"},
140 },
141 {
142 name: "blockquote heading is not lazily continued by unmarked text",
143 input: "> # head \ntext",
144 want: []string{"| # head", "text"},
145 },
146 {
147 name: "blockquote in list item keeps its hard break",
148 input: "- > quote \n > cont",
149 want: []string{"•", "| quote", "| cont"},
150 },
151 }
153 for _, tt := range tests {
154 t.Run(tt.name, func(t *testing.T) {
155 rendered, err := RenderMarkdown(tt.input, "notty")
156 require.NoError(t, err)
158 lines := nonEmptyTrimmedLines(rendered)
159 require.Len(t, lines, len(tt.want))
160 for i, want := range tt.want {
161 require.Contains(t, lines[i], want)
162 }
163 })
164 }
167// Test_CollapseSoftLineBreaks checks the rewritten Markdown itself. A hard line
168// break must leave the source untouched: the line following it keeps the
169// indentation and container markers that keep it a paragraph continuation.
170func Test_CollapseSoftLineBreaks(t *testing.T) {
171 tests := []struct {
172 name string
173 input string
174 want string
175 }{
176 {
177 name: "soft break becomes a space",
178 input: "first\nsecond",
179 want: "first second",
180 },
181 {
182 name: "soft break drops trailing space and indentation",
183 input: "first \n second",
184 want: "first second",
185 },
186 {
187 name: "hard break with two spaces is untouched",
188 input: "first \nsecond",
189 want: "first \nsecond",
190 },
191 {
192 name: "hard break with backslash is untouched",
193 input: "first\\\nsecond",
194 want: "first\\\nsecond",
195 },
196 {
197 name: "indented continuation after hard break is untouched",
198 input: "a \n > not quote",
199 want: "a \n > not quote",
200 },
201 {
202 name: "indented heading after hard break is untouched",
203 input: "a \n # not heading",
204 want: "a \n # not heading",
205 },
206 {
207 name: "indented setext underline after hard break is untouched",
208 input: "a \n ---",
209 want: "a \n ---",
210 },
211 {
212 name: "indented list marker after hard break is untouched",
213 input: "a \n - not a list",
214 want: "a \n - not a list",
215 },
216 {
217 name: "hard break inside blockquote is untouched",
218 input: "> a \n> b",
219 want: "> a \n> b",
220 },
221 {
222 name: "soft break inside blockquote collapses",
223 input: "> a\n> b",
224 want: "> a b",
225 },
226 {
227 name: "lazy blockquote continuation collapses",
228 input: "> a\nb",
229 want: "> a b",
230 },
231 {
232 name: "hard break inside list item is untouched",
233 input: "- a \n b",
234 want: "- a \n b",
235 },
236 {
237 name: "soft break inside list item collapses",
238 input: "- a\n b",
239 want: "- a b",
240 },
241 {
242 name: "indented code after heading in blockquote is untouched",
243 input: "> # a \n> b",
244 want: "> # a \n> b",
245 },
246 {
247 name: "hard break inside blockquote in list is untouched",
248 input: "- > a \n > b",
249 want: "- > a \n > b",
250 },
251 {
252 name: "only the soft break of a mixed paragraph changes",
253 input: "one\ntwo \nthree",
254 want: "one two \nthree",
255 },
256 {
257 name: "hard break followed by a soft break",
258 input: "one \ntwo\nthree",
259 want: "one \ntwo three",
260 },
261 {
262 name: "newline inside code span becomes a space",
263 input: "a `b\nc` d",
264 want: "a `b c` d",
265 },
266 {
267 name: "code span keeps its trailing spaces",
268 input: "a `b \nc` d",
269 want: "a `b c` d",
270 },
271 {
272 name: "fenced code is untouched",
273 input: "```\na \nb\n```",
274 want: "```\na \nb\n```",
275 },
276 {
277 name: "heading and following text are left as written",
278 input: "# a \ntext",
279 want: "# a \ntext",
280 },
281 {
282 name: "soft break inside tight list item among siblings collapses",
283 input: "- a\n b\n- c",
284 want: "- a b\n- c",
285 },
286 {
287 name: "soft break in definition description collapses",
288 input: "Term\n: def\n cont",
289 want: "Term\n: def cont",
290 },
291 {
292 name: "hard break in definition description is untouched",
293 input: "Term\n: def \n cont",
294 want: "Term\n: def \n cont",
295 },
296 }
298 for _, tt := range tests {
299 t.Run(tt.name, func(t *testing.T) {
300 require.Equal(t, tt.want, string(collapseSoftLineBreaks([]byte(tt.input))))
301 })
302 }
305func nonEmptyTrimmedLines(s string) []string {
306 var lines []string
307 for line := range strings.SplitSeq(strings.TrimSpace(s), "\n") {
308 line = strings.TrimSpace(line)
309 if line != "" {
310 lines = append(lines, line)
311 }
312 }
313 return lines
316func Test_PrettyTimeAgo(t *testing.T) {
317 cases := map[string]string{
318 "1s": "less than a minute ago",
319 "30s": "less than a minute ago",
320 "1m08s": "about 1 minute ago",
321 "15m0s": "about 15 minutes ago",
322 "59m10s": "about 59 minutes ago",
323 "1h10m02s": "about 1 hour ago",
324 "15h0m01s": "about 15 hours ago",
325 "30h10m": "about 1 day ago",
326 "50h": "about 2 days ago",
327 "720h05m": "about 1 month ago",
328 "3000h10m": "about 4 months ago",
329 "8760h59m": "about 1 year ago",
330 "17601h59m": "about 2 years ago",
331 "262800h19m": "about 30 years ago",
332 }
334 for duration, expected := range cases {
335 d, e := time.ParseDuration(duration)
336 if e != nil {
337 t.Errorf("failed to create a duration: %s", e)
338 }
340 fuzzy := PrettyTimeAgo(d)
341 require.Equal(t, expected, fuzzy, "unexpected fuzzy duration value: %s for %s")
342 }
345func Test_Pluralize(t *testing.T) {
346 testCases := []struct {
347 name string
348 word string
349 amount int
350 want string
351 }{
352 {
353 name: "singular",
354 word: "label",
355 amount: 1,
356 want: "1 label",
357 },
358 {
359 name: "plural",
360 word: "label",
361 amount: 3,
362 want: "3 labels",
363 },
364 }
365 for _, tC := range testCases {
366 t.Run(tC.name, func(t *testing.T) {
367 got := Pluralize(tC.amount, tC.word)
368 require.Equal(t, tC.want, got, "Pluralize() got = %s, want = %s")
369 })
370 }
373func Test_PresentInStringSlice(t *testing.T) {
374 testCases := []struct {
375 name string
376 hay []string
377 needle string
378 want bool
379 }{
380 {"simple true", []string{"foo", "bar", "baz"}, "bar", true},
381 {"simple false", []string{"foo", "bar", "baz"}, "qux", false},
382 }
383 for _, tC := range testCases {
384 t.Run(tC.name, func(t *testing.T) {
385 got := PresentInStringSlice(tC.hay, tC.needle)
386 require.Equal(t, tC.want, got, "PresentInStringSlice() got = %t, want = %t")
387 })
388 }
391func Test_SanitizePathName(t *testing.T) {
392 tests := []struct {
393 name string
394 filename string
395 want string
396 }{
397 {
398 name: "A regular filename",
399 filename: "cli-v1.22.0.json",
400 want: "/cli-v1.22.0.json",
401 },
402 {
403 name: "A regular filename in a directory",
404 filename: "cli/cli-v1.22.0.json",
405 want: "/cli/cli-v1.22.0.json",
406 },
407 {
408 name: "A filename with directory traversal",
409 filename: "cli-v1.../../22.0.zip",
410 want: "/22.0.zip",
411 },
412 {
413 name: "A particularly nasty filename",
414 filename: "..././..././..././etc/password_file",
415 want: "/.../.../.../etc/password_file",
416 },
417 }
418 for _, tt := range tests {
419 t.Run(tt.name, func(t *testing.T) {
420 filePathWanted := SanitizePathName(tt.filename)
421 require.Equal(t, filePathWanted, tt.want, "SanitizePathName() got = %s, want = %s")
422 })
423 }
426func Test_CommonElementsInStringSlice(t *testing.T) {
427 testCases := []struct {
428 name string
429 array1 []string
430 array2 []string
431 want []string
432 }{
433 {
434 name: "simple no matching elements",
435 array1: []string{"foo", "bar", "baz"},
436 array2: []string{"qux", "quux", "quz"},
437 want: []string{},
438 },
439 {
440 name: "simple matching elements",
441 array1: []string{"foo", "quux", "baz"},
442 array2: []string{"qux", "quux", "baz"},
443 want: []string{"quux", "baz"},
444 },
445 }
446 for _, tC := range testCases {
447 t.Run(tC.name, func(t *testing.T) {
448 got := CommonElementsInStringSlice(tC.array1, tC.array2)
449 require.Len(t, tC.want, len(got), "CommonElementsInStringSlice() size of got (%d) and wanted (%d) arrays differ")
450 for i := range got {
451 require.Equal(t, got[i], tC.want[i], "CommonElementsInStringSlice() got = %s, want = %s")
452 }
453 })
454 }
457func Test_Map(t *testing.T) {
458 type SomeType struct {
459 name string
460 }
462 type Tests[T1, T2 any] struct {
463 name string
464 slice []T1
465 fn func(T1) T2
466 want []T2
467 }
469 tests := []Tests[any, any]{
470 {
471 "list of strings",
472 []any{"foo", "bar", "baz"},
473 func(e any) any { return e },
474 []any{"foo", "bar", "baz"},
475 },
476 {
477 "list of structs",
478 []any{SomeType{"foo"}, SomeType{"bar"}, SomeType{"baz"}},
479 func(e any) any { s, _ := e.(SomeType); return s.name },
480 []any{"foo", "bar", "baz"},
481 },
482 {
483 "no elements",
484 []any{},
485 func(e any) any { return e },
486 []any{},
487 },
488 }
490 for _, tt := range tests {
491 t.Run(tt.name, func(t *testing.T) {
492 got := Map(tt.slice, tt.fn)
493 require.Equal(t, tt.want, got, "Test_Map() want %v; but got %v")
494 })
495 }
498func TestIsValidURL(t *testing.T) {
499 tests := []struct {
500 name string
501 input string
502 expected bool
503 }{
504 {
505 name: "invalid empty url",
506 input: "",
507 expected: false,
508 },
509 {
510 name: "invalid url without correct scheme",
511 input: "https:/gitlab.com/group",
512 expected: false,
513 },
514 {
515 name: "ok with correct url",
516 input: "https://gitlab.com/group",
517 expected: true,
518 },
519 }
521 for _, test := range tests {
522 t.Run(test.name, func(t *testing.T) {
523 actualIsValid := IsValidURL(test.input)
524 require.Equal(t, test.expected, actualIsValid, "TestIsValidURL() got = %s, want = %s")
525 })
526 }
529func TestParseEditorCommand(t *testing.T) {
530 t.Parallel()
532 tests := []struct {
533 name string
534 editor string
535 expected []string
536 }{
537 {
538 name: "empty string",
539 editor: "",
540 expected: nil,
541 },
542 {
543 name: "simple editor",
544 editor: "vim",
545 expected: []string{"vim"},
546 },
547 {
548 name: "editor with flags",
549 editor: "nano -w",
550 expected: []string{"nano", "-w"},
551 },
552 {
553 name: "emacsclient with flags",
554 editor: "emacsclient -t -a emacs",
555 expected: []string{"emacsclient", "-t", "-a", "emacs"},
556 },
557 {
558 name: "emacsclient with quoted fallback",
559 editor: `emacsclient -t -a "emacs -nw"`,
560 expected: []string{"emacsclient", "-t", "-a", "emacs -nw"},
561 },
562 {
563 name: "vscode with flags",
564 editor: `code --wait --new-window`,
565 expected: []string{"code", "--wait", "--new-window"},
566 },
567 {
568 name: "vim with complex flags",
569 editor: "vim -c 'set spell'",
570 expected: []string{"vim", "-c", "set spell"},
571 },
572 {
573 name: "full path editor",
574 editor: "/usr/local/bin/nvim -u NONE",
575 expected: []string{"/usr/local/bin/nvim", "-u", "NONE"},
576 },
577 }
579 for _, tt := range tests {
580 t.Run(tt.name, func(t *testing.T) {
581 t.Parallel()
582 got := ParseEditorCommand(tt.editor)
583 require.Equal(t, tt.expected, got)
584 })
585 }
588func Test_HelperFuncs(t *testing.T) {
589 t.Run("StringToInt()", func(t *testing.T) {
590 t.Run("success", func(t *testing.T) {
591 got := StringToInt("200")
592 require.Equal(t, 200, got)
593 })
594 t.Run("failed-return-0", func(t *testing.T) {
595 got := StringToInt("NotAnInt")
596 require.Equal(t, 0, got)
597 })
598 })
599 t.Run("ReplaceNonAlphaNumericChars()", func(t *testing.T) {
600 got := ReplaceNonAlphaNumericChars("profclems-glab", "/")
601 require.Equal(t, "profclems/glab", got)
602 })
605func TestFormatTimeStats(t *testing.T) {
606 tests := []struct {
607 name string
608 ts *gitlab.TimeStats
609 want string
610 }{
611 {name: "nil", ts: nil, want: ""},
612 {name: "nothing tracked", ts: &gitlab.TimeStats{}, want: ""},
613 {
614 name: "time spent only",
615 ts: &gitlab.TimeStats{HumanTotalTimeSpent: "1h 30m", TotalTimeSpent: 5400},
616 want: "1h 30m spent",
617 },
618 {
619 name: "estimate only",
620 ts: &gitlab.TimeStats{HumanTimeEstimate: "2d", TimeEstimate: 57600},
621 want: "2d estimated",
622 },
623 {
624 name: "time spent and estimate",
625 ts: &gitlab.TimeStats{
626 HumanTotalTimeSpent: "1h 30m", TotalTimeSpent: 5400,
627 HumanTimeEstimate: "2d", TimeEstimate: 57600,
628 },
629 want: "1h 30m spent of 2d estimated",
630 },
631 }
633 for _, tt := range tests {
634 t.Run(tt.name, func(t *testing.T) {
635 require.Equal(t, tt.want, FormatTimeStats(tt.ts))
636 })
637 }
640func TestFormatTimeSpent(t *testing.T) {
641 tests := []struct {
642 name string
643 seconds int64
644 want string
645 }{
646 {name: "zero", seconds: 0, want: "0h"},
647 {name: "minutes", seconds: 45 * 60, want: "45m"},
648 {name: "hours and minutes", seconds: 5400, want: "1h 30m"},
649 {name: "a working day is 8 hours", seconds: 8 * 3600, want: "1d"},
650 {name: "a week is 5 working days", seconds: 5*8*3600 + 2*8*3600 + 3*3600 + 30*60, want: "1w 2d 3h 30m"},
651 {name: "a month is 4 weeks", seconds: 4 * 5 * 8 * 3600, want: "1mo"},
652 {name: "seconds", seconds: 90, want: "1m 30s"},
653 {name: "negative", seconds: -5400, want: "-1h 30m"},
654 }
656 for _, tt := range tests {
657 t.Run(tt.name, func(t *testing.T) {
658 require.Equal(t, tt.want, FormatTimeSpent(tt.seconds))
659 })
660 }
Diagnostics6 git calls · 31 ms
CallStatusSizeTime031 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 KiB9 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=9
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=4
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 · 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=32926
git.response.cache=HIT
git.response.duration_ms=4
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
fetchtree:0200307 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=307
git.response.cache=HIT
git.response.duration_ms=2
git.fetch.filter=tree:0
git.fetch.wants=a37f1d670e91d25a83dd8509fb549df805c58f38
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=307
git.pkt.payload.max=280
git.sideband.band1.bytes=280
git.sideband.band2.bytes=0
git.sideband.band3.bytes=0
git.pack.objects=1
git.pack.bytes=280
git.pack.trailer=1d8da1d6ced05f2d435b7a3203f70deda031ad4a
Open pack map
fetch2003.8 KiB · hit17 ms
git.upload-pack fetch
http.response.status_code=200
git.upstream.cf_ray=-
git.upstream.phase=fetch
git.upstream.dur_ms=16
git.response.bytes=3942
git.response.cache=HIT
git.response.duration_ms=17
git.fetch.wants=33fb4b8075ca37d586a0d000f6b3a55ca8d07857
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=3942
git.pkt.payload.max=3915
git.sideband.band1.bytes=3915
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
a5e1514f8c690acb
Request
97d4513b…
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