GitLabgitlab-org

cli

main
ply8 git calls274 ms99 KiB5 cachedprotocol v2
413 lines14 KiBRaw
1//go:build !integration
3package export
5import (
6 "bytes"
7 "fmt"
8 "testing"
10 "github.com/google/shlex"
11 "github.com/spf13/cobra"
12 "github.com/stretchr/testify/assert"
13 "github.com/stretchr/testify/require"
14 "go.uber.org/mock/gomock"
16 gitlab "gitlab.com/gitlab-org/api/client-go/v3"
17 gitlabtesting "gitlab.com/gitlab-org/api/client-go/v3/testing"
19 "gitlab.com/gitlab-org/cli/internal/api"
20 "gitlab.com/gitlab-org/cli/internal/cmdutils"
21 "gitlab.com/gitlab-org/cli/internal/glinstance"
22 "gitlab.com/gitlab-org/cli/internal/testing/cmdtest"
25func Test_NewCmdExport(t *testing.T) {
26 tests := []struct {
27 name string
28 cli string
29 wants options
30 wantsErr bool
31 }{
32 {
33 name: "no arguments",
34 cli: "",
35 wantsErr: false,
36 },
37 {
38 name: "with group",
39 cli: "--group STH",
40 wantsErr: false,
41 wants: options{
42 group: "STH",
43 },
44 },
45 {
46 name: "missing group",
47 cli: "--group",
48 wantsErr: true,
49 wants: options{
50 group: "STH",
51 },
52 },
53 {
54 name: "with pagination",
55 cli: "--page 11 --per-page 12",
56 wantsErr: false,
57 },
58 {
59 name: "with invalid pagination",
60 cli: "--page aa --per-page bb",
61 wantsErr: true,
62 },
63 }
65 for _, test := range tests {
66 t.Run(test.name, func(t *testing.T) {
67 io, _, _, _ := cmdtest.TestIOStreams()
68 f := cmdtest.NewTestFactory(io)
70 argv, err := shlex.Split(test.cli)
71 require.NoError(t, err)
73 var gotOpts *options
74 cmd := NewCmdExport(f, func(opts *options) error {
75 gotOpts = opts
76 return nil
77 })
78 cmd.SetArgs(argv)
79 cmd.SetIn(&bytes.Buffer{})
80 cmd.SetOut(&bytes.Buffer{})
81 cmd.SetErr(&bytes.Buffer{})
83 _, err = cmd.ExecuteC()
84 if test.wantsErr {
85 assert.Error(t, err)
86 return
87 }
88 require.NoError(t, err)
90 assert.Equal(t, test.wants.group, gotOpts.group)
91 })
92 }
95func Test_exportRun_project(t *testing.T) {
96 mockProjectVariables := []*gitlab.ProjectVariable{
97 {
98 Key: "VAR1",
99 Value: "value1",
100 EnvironmentScope: "dev",
101 },
102 {
103 Key: "VAR2",
104 Value: "value2.1",
105 EnvironmentScope: "prod",
106 },
107 {
108 Key: "VAR2",
109 Value: "value2.2",
110 EnvironmentScope: "*",
111 },
112 {
113 Key: "VAR3",
114 Value: "value3",
115 EnvironmentScope: "dev/a",
116 },
117 {
118 Key: "VAR4",
119 Value: "value4.1",
120 EnvironmentScope: "dev/b",
121 },
122 {
123 Key: "VAR4",
124 Value: "value4.2",
125 EnvironmentScope: "feature-1",
126 },
127 {
128 Key: "VAR4",
129 Value: "value4.3",
130 EnvironmentScope: "feature-2",
131 },
132 {
133 Key: "VAR5",
134 Value: "value5",
135 EnvironmentScope: "feature-*",
136 },
137 }
139 tests := []struct {
140 scope string
141 format string
142 expectedStderr string
143 expectedStdout string
144 }{
145 {
146 scope: "*",
147 format: "json",
148 expectedStderr: "Exporting variables from the owner/repo project:\n",
149 expectedStdout: `[{"key":"VAR1","value":"value1","variable_type":"","protected":false,"masked":false,"hidden":false,"raw":false,"environment_scope":"dev","description":""},{"key":"VAR2","value":"value2.1","variable_type":"","protected":false,"masked":false,"hidden":false,"raw":false,"environment_scope":"prod","description":""},{"key":"VAR2","value":"value2.2","variable_type":"","protected":false,"masked":false,"hidden":false,"raw":false,"environment_scope":"*","description":""},{"key":"VAR3","value":"value3","variable_type":"","protected":false,"masked":false,"hidden":false,"raw":false,"environment_scope":"dev/a","description":""},{"key":"VAR4","value":"value4.1","variable_type":"","protected":false,"masked":false,"hidden":false,"raw":false,"environment_scope":"dev/b","description":""},{"key":"VAR4","value":"value4.2","variable_type":"","protected":false,"masked":false,"hidden":false,"raw":false,"environment_scope":"feature-1","description":""},{"key":"VAR4","value":"value4.3","variable_type":"","protected":false,"masked":false,"hidden":false,"raw":false,"environment_scope":"feature-2","description":""},{"key":"VAR5","value":"value5","variable_type":"","protected":false,"masked":false,"hidden":false,"raw":false,"environment_scope":"feature-*","description":""}]` + "\n",
150 },
151 {
152 scope: "dev/b",
153 format: "json",
154 expectedStderr: "Exporting variables from the owner/repo project:\n",
155 expectedStdout: `[{"key":"VAR2","value":"value2.2","variable_type":"","protected":false,"masked":false,"hidden":false,"raw":false,"environment_scope":"*","description":""},{"key":"VAR4","value":"value4.1","variable_type":"","protected":false,"masked":false,"hidden":false,"raw":false,"environment_scope":"dev/b","description":""}]` + "\n",
156 },
157 {
158 scope: "*",
159 format: "env",
160 expectedStderr: "Exporting variables from the owner/repo project:\n",
161 expectedStdout: "VAR1=\"value1\"\nVAR2=\"value2.1\"\nVAR3=\"value3\"\nVAR4=\"value4.1\"\nVAR4=\"value4.2\"\nVAR4=\"value4.3\"\nVAR5=\"value5\"\n",
162 },
163 {
164 scope: "*",
165 format: "export",
166 expectedStderr: "Exporting variables from the owner/repo project:\n",
167 expectedStdout: "export VAR1=\"value1\"\nexport VAR2=\"value2.1\"\nexport VAR3=\"value3\"\nexport VAR4=\"value4.1\"\nexport VAR4=\"value4.2\"\nexport VAR4=\"value4.3\"\nexport VAR5=\"value5\"\n",
168 },
169 {
170 scope: "dev",
171 format: "env",
172 expectedStderr: "Exporting variables from the owner/repo project:\n",
173 expectedStdout: "VAR1=\"value1\"\nVAR2=\"value2.2\"\n",
174 },
175 {
176 scope: "dev",
177 format: "export",
178 expectedStderr: "Exporting variables from the owner/repo project:\n",
179 expectedStdout: "export VAR1=\"value1\"\nexport VAR2=\"value2.2\"\n",
180 },
181 {
182 scope: "prod",
183 format: "env",
184 expectedStderr: "Exporting variables from the owner/repo project:\n",
185 expectedStdout: "VAR2=\"value2.1\"\n",
186 },
187 {
188 scope: "prod",
189 format: "export",
190 expectedStderr: "Exporting variables from the owner/repo project:\n",
191 expectedStdout: "export VAR2=\"value2.1\"\n",
192 },
193 {
194 scope: "dev/a",
195 format: "env",
196 expectedStderr: "Exporting variables from the owner/repo project:\n",
197 expectedStdout: "VAR3=\"value3\"\nVAR2=\"value2.2\"\n",
198 },
199 {
200 scope: "dev/a",
201 format: "export",
202 expectedStderr: "Exporting variables from the owner/repo project:\n",
203 expectedStdout: "export VAR3=\"value3\"\nexport VAR2=\"value2.2\"\n",
204 },
205 {
206 scope: "feature-1",
207 format: "env",
208 expectedStderr: "Exporting variables from the owner/repo project:\n",
209 expectedStdout: "VAR4=\"value4.2\"\nVAR2=\"value2.2\"\nVAR5=\"value5\"\n",
210 },
211 {
212 scope: "feature-1",
213 format: "export",
214 expectedStderr: "Exporting variables from the owner/repo project:\n",
215 expectedStdout: "export VAR4=\"value4.2\"\nexport VAR2=\"value2.2\"\nexport VAR5=\"value5\"\n",
216 },
217 {
218 scope: "feature-2",
219 format: "env",
220 expectedStderr: "Exporting variables from the owner/repo project:\n",
221 expectedStdout: "VAR4=\"value4.3\"\nVAR2=\"value2.2\"\nVAR5=\"value5\"\n",
222 },
223 {
224 scope: "feature-2",
225 format: "export",
226 expectedStderr: "Exporting variables from the owner/repo project:\n",
227 expectedStdout: "export VAR4=\"value4.3\"\nexport VAR2=\"value2.2\"\nexport VAR5=\"value5\"\n",
228 },
229 }
231 for _, test := range tests {
232 t.Run(test.scope+"_"+test.format, func(t *testing.T) {
233 tc := gitlabtesting.NewTestClient(t)
235 tc.MockProjectVariables.EXPECT().ListVariables("owner/repo", gomock.Any(), gomock.Any()).Return(mockProjectVariables, nil, nil)
237 exec := cmdtest.SetupCmdForTest(
238 t,
239 func(f cmdutils.Factory) *cobra.Command {
240 return NewCmdExport(f, nil)
241 },
242 false,
243 cmdtest.WithApiClient(cmdtest.NewTestApiClient(t, nil, "testtoken", "gitlab.example.com", api.WithGitLabClient(tc.Client))),
244 cmdtest.WithBaseRepo("owner", "repo", glinstance.DefaultHostname),
245 )
247 out, err := exec(fmt.Sprintf("--page 1 --per-page 10 --format %s --scope %s", test.format, test.scope))
248 require.NoError(t, err)
249 assert.Equal(t, test.expectedStderr, out.ErrBuf.String())
250 assert.Equal(t, test.expectedStdout, out.OutBuf.String())
251 })
252 }
255func Test_exportRun_group(t *testing.T) {
256 mockGroupVariables := []*gitlab.GroupVariable{
257 {
258 Key: "VAR1",
259 Value: "\"value1\"",
260 EnvironmentScope: "dev",
261 },
262 {
263 Key: "VAR2",
264 Value: "value2.1",
265 EnvironmentScope: "prod",
266 },
267 {
268 Key: "VAR2",
269 Value: "value2.2",
270 EnvironmentScope: "*",
271 },
272 {
273 Key: "VAR3",
274 Value: "value3",
275 EnvironmentScope: "dev/a",
276 },
277 {
278 Key: "VAR4",
279 Value: "value4.1",
280 EnvironmentScope: "dev/b",
281 },
282 {
283 Key: "VAR4",
284 Value: "value4.2",
285 EnvironmentScope: "feature-1",
286 },
287 {
288 Key: "VAR4",
289 Value: "value4.3",
290 EnvironmentScope: "feature-2",
291 },
292 {
293 Key: "VAR5",
294 Value: "value5",
295 EnvironmentScope: "feature-*",
296 },
297 }
299 tests := []struct {
300 scope string
301 format string
302 expectedStderr string
303 expectedStdout string
304 }{
305 {
306 scope: "*",
307 format: "json",
308 expectedStderr: "Exporting variables from the group group:\n",
309 expectedStdout: `[{"key":"VAR1","value":"\"value1\"","variable_type":"","protected":false,"masked":false,"hidden":false,"raw":false,"environment_scope":"dev","description":""},{"key":"VAR2","value":"value2.1","variable_type":"","protected":false,"masked":false,"hidden":false,"raw":false,"environment_scope":"prod","description":""},{"key":"VAR2","value":"value2.2","variable_type":"","protected":false,"masked":false,"hidden":false,"raw":false,"environment_scope":"*","description":""},{"key":"VAR3","value":"value3","variable_type":"","protected":false,"masked":false,"hidden":false,"raw":false,"environment_scope":"dev/a","description":""},{"key":"VAR4","value":"value4.1","variable_type":"","protected":false,"masked":false,"hidden":false,"raw":false,"environment_scope":"dev/b","description":""},{"key":"VAR4","value":"value4.2","variable_type":"","protected":false,"masked":false,"hidden":false,"raw":false,"environment_scope":"feature-1","description":""},{"key":"VAR4","value":"value4.3","variable_type":"","protected":false,"masked":false,"hidden":false,"raw":false,"environment_scope":"feature-2","description":""},{"key":"VAR5","value":"value5","variable_type":"","protected":false,"masked":false,"hidden":false,"raw":false,"environment_scope":"feature-*","description":""}]` + "\n",
310 },
311 {
312 scope: "dev/b",
313 format: "json",
314 expectedStderr: "Exporting variables from the group group:\n",
315 expectedStdout: `[{"key":"VAR2","value":"value2.2","variable_type":"","protected":false,"masked":false,"hidden":false,"raw":false,"environment_scope":"*","description":""},{"key":"VAR4","value":"value4.1","variable_type":"","protected":false,"masked":false,"hidden":false,"raw":false,"environment_scope":"dev/b","description":""}]` + "\n",
316 },
317 {
318 scope: "*",
319 format: "env",
320 expectedStderr: "Exporting variables from the group group:\n",
321 expectedStdout: "VAR1=\"value1\"\nVAR2=value2.1\nVAR3=value3\nVAR4=value4.1\nVAR4=value4.2\nVAR4=value4.3\nVAR5=value5\n",
322 },
323 {
324 scope: "*",
325 format: "export",
326 expectedStderr: "Exporting variables from the group group:\n",
327 expectedStdout: "export VAR1=\"value1\"\nexport VAR2=value2.1\nexport VAR3=value3\nexport VAR4=value4.1\nexport VAR4=value4.2\nexport VAR4=value4.3\nexport VAR5=value5\n",
328 },
329 {
330 scope: "dev",
331 format: "env",
332 expectedStderr: "Exporting variables from the group group:\n",
333 expectedStdout: "VAR1=\"value1\"\nVAR2=value2.2\n",
334 },
335 {
336 scope: "dev",
337 format: "export",
338 expectedStderr: "Exporting variables from the group group:\n",
339 expectedStdout: "export VAR1=\"value1\"\nexport VAR2=value2.2\n",
340 },
341 {
342 scope: "prod",
343 format: "env",
344 expectedStderr: "Exporting variables from the group group:\n",
345 expectedStdout: "VAR2=value2.1\n",
346 },
347 {
348 scope: "prod",
349 format: "export",
350 expectedStderr: "Exporting variables from the group group:\n",
351 expectedStdout: "export VAR2=value2.1\n",
352 },
353 {
354 scope: "dev/a",
355 format: "env",
356 expectedStderr: "Exporting variables from the group group:\n",
357 expectedStdout: "VAR3=value3\nVAR2=value2.2\n",
358 },
359 {
360 scope: "dev/a",
361 format: "export",
362 expectedStderr: "Exporting variables from the group group:\n",
363 expectedStdout: "export VAR3=value3\nexport VAR2=value2.2\n",
364 },
365 {
366 scope: "feature-1",
367 format: "env",
368 expectedStderr: "Exporting variables from the group group:\n",
369 expectedStdout: "VAR4=value4.2\nVAR2=value2.2\nVAR5=value5\n",
370 },
371 {
372 scope: "feature-1",
373 format: "export",
374 expectedStderr: "Exporting variables from the group group:\n",
375 expectedStdout: "export VAR4=value4.2\nexport VAR2=value2.2\nexport VAR5=value5\n",
376 },
377 {
378 scope: "feature-2",
379 format: "env",
380 expectedStderr: "Exporting variables from the group group:\n",
381 expectedStdout: "VAR4=value4.3\nVAR2=value2.2\nVAR5=value5\n",
382 },
383 {
384 scope: "feature-2",
385 format: "export",
386 expectedStderr: "Exporting variables from the group group:\n",
387 expectedStdout: "export VAR4=value4.3\nexport VAR2=value2.2\nexport VAR5=value5\n",
388 },
389 }
391 for _, test := range tests {
392 t.Run(test.scope+"_"+test.format, func(t *testing.T) {
393 tc := gitlabtesting.NewTestClient(t)
395 tc.MockGroupVariables.EXPECT().ListVariables("group", gomock.Any(), gomock.Any()).Return(mockGroupVariables, nil, nil)
397 exec := cmdtest.SetupCmdForTest(
398 t,
399 func(f cmdutils.Factory) *cobra.Command {
400 return NewCmdExport(f, nil)
401 },
402 false,
403 cmdtest.WithApiClient(cmdtest.NewTestApiClient(t, nil, "testtoken", "gitlab.example.com", api.WithGitLabClient(tc.Client))),
404 cmdtest.WithBaseRepo("owner", "repo", glinstance.DefaultHostname),
405 )
407 out, err := exec(fmt.Sprintf("--page 1 --per-page 10 --group group --format %s --scope %s", test.format, test.scope))
408 require.NoError(t, err)
409 assert.Equal(t, test.expectedStderr, out.ErrBuf.String())
410 assert.Equal(t, test.expectedStdout, out.OutBuf.String())
411 })
412 }
Diagnostics8 git calls · 274 ms
CallStatusSizeTime0274 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=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 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 · hit3 ms
git.upload-pack fetch
http.response.status_code=200
git.upstream.cf_ray=-
git.upstream.phase=fetch
git.upstream.dur_ms=3
git.response.bytes=32926
git.response.cache=HIT
git.response.duration_ms=3
git.fetch.filter=tree:0
git.fetch.wants=0dd7574dce9e385c5c30540e6c15657adc6bdce9
git.fetch.haves.count=0
git.fetch.deepen=10
git.fetch.thin_pack=false
git.fetch.ofs_delta=true
git.protocol.version=2
git.pkt.frames=22
git.pkt.data=20
git.pkt.flush=1
git.pkt.delim=1
git.pkt.bytes=32926
git.pkt.payload.max=32046
git.sideband.band1.bytes=32046
git.sideband.band2.bytes=0
git.sideband.band3.bytes=0
git.pack.objects=80
git.pack.bytes=32046
git.pack.ofs_delta=36
git.pack.ref_delta=0
git.pack.chain.max=2
git.pack.trailer=cb0bad5d7ffc514895d8b21c4dd470327f90bc91
git.pack.full=44
Open pack map
fetchcombine:blob:none+tree:2 · deepen 12004.2 KiB · hit3 ms
git.upload-pack fetch
http.response.status_code=200
git.upstream.cf_ray=-
git.upstream.phase=fetch
git.upstream.dur_ms=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: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=3
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:0200375 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=375
git.response.cache=HIT
git.response.duration_ms=3
git.fetch.filter=tree:0
git.fetch.wants=210e8ccdc9766a94adae919c6922ea88d77a8fb1
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=375
git.pkt.payload.max=348
git.sideband.band1.bytes=348
git.sideband.band2.bytes=0
git.sideband.band3.bytes=0
git.pack.objects=1
git.pack.bytes=348
git.pack.trailer=8c3972a32424b06b4c572b8aa869b28eca201985
Open pack map
fetchtree:0200137 B · hit4 ms
git.upload-pack fetch
http.response.status_code=200
git.upstream.cf_ray=-
git.upstream.phase=fetch
git.upstream.dur_ms=257
git.response.bytes=137
git.response.cache=HIT
git.response.duration_ms=4
git.fetch.filter=tree:0
git.fetch.wants=30fdb831f7f814c1838cf2fb64d016995e2e281b
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=137
git.pkt.payload.max=110
git.sideband.band1.bytes=110
git.sideband.band2.bytes=0
git.sideband.band3.bytes=0
git.pack.objects=1
git.pack.bytes=110
git.pack.trailer=d3d91cd62371efa2c9a2879eca0209c6b764a6e3
Open pack map
fetch2001.9 KiB257 ms
git.upload-pack fetch
http.response.status_code=200
git.response.bytes=1934
git.response.cache=MISS
git.response.duration_ms=257
git.fetch.wants=6d42e6e4d52bd27383678c9a78eced3c7cd075e9
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=1934
git.pkt.payload.max=1907
git.sideband.band1.bytes=1907
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
a5e21791dd47ecd4
Request
89f30a69…
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