Incomplete repository branches request
parent: tbd commit: 6872fbf
1 | |
2 | |
3 | use Arc; |
4 | |
5 | use OperationError; |
6 | use Instance; |
7 | use ; |
8 | use ObjectBackend; |
9 | use GiteratedOperation; |
10 | use Repository; |
11 | use User; |
12 | use GiteratedBackend; |
13 | use ; |
14 | use Debug; |
15 | use Mutex; |
16 | |
17 | use crate; |
18 | |
19 | use |
20 | instance_authentication_request, instance_create_repository_request, |
21 | instance_registration_request, repository_commit_before, repository_diff, |
22 | repository_diff_patch, repository_file_from_id, repository_file_from_path, |
23 | repository_get_setting, repository_get_value, repository_info, repository_set_setting, |
24 | user_get_repositories, user_get_setting, user_get_value, user_set_setting, repository_commit_by_id, repository_last_commit_of_file, repository_get_statistics, repository_get_branches, |
25 | ; |
26 | |
27 | |
28 | |
29 | |
30 | |
31 | |
32 | async |
33 | &self, |
34 | _object: O, |
35 | _operation: &str, |
36 | _payload: D, |
37 | _operation_state: &StackOperationState, |
38 | |
39 | // We don't handle operations with this backend |
40 | Err |
41 | |
42 | |
43 | async |
44 | &self, |
45 | _object_str: &str, |
46 | _operation_state: &StackOperationState, |
47 | |
48 | Err |
49 | |
50 | |
51 | |
52 | /// A backend implementation which attempts to resolve data from the instance's database. |
53 | |
54 | |
55 | pub(self) our_instance: Instance, |
56 | pub(self) user_backend: , |
57 | pub(self) repository_backend: , |
58 | |
59 | |
60 | |
61 | |
62 | instance: Instance, |
63 | user_backend: , |
64 | repository_backend: , |
65 | |
66 | Self |
67 | our_instance: instance, |
68 | user_backend, |
69 | repository_backend, |
70 | |
71 | |
72 | |
73 | |
74 | let mut handlers = default; |
75 | |
76 | handlers |
77 | .insert |
78 | .insert |
79 | .insert |
80 | .insert |
81 | .insert |
82 | .insert |
83 | .insert |
84 | .insert |
85 | .insert |
86 | .insert |
87 | .insert |
88 | .insert |
89 | .insert |
90 | .insert |
91 | .insert |
92 | .insert |
93 | .insert |
94 | .insert |
95 | .insert |
96 | .insert |
97 | . |
98 | . |
99 | .; |
100 | |
101 | new |
102 | |
103 | |
104 | |
105 | |
106 | |
107 | f.debug_struct .finish |
108 | |
109 | |
110 | |
111 | // TODO: These should be on the stack |
112 | // These tests verify that the essential handling of the database backend is |
113 | // functional and correct. |
114 | |
115 | |
116 | use ; |
117 | |
118 | use Error; |
119 | |
120 | use UserAuthenticationToken; |
121 | |
122 | use |
123 | AuthenticationTokenRequest, Instance, RegisterAccountRequest, RepositoryCreateRequest, |
124 | ; |
125 | |
126 | use ObjectBackend; |
127 | |
128 | use |
129 | Commit, Description, Repository, RepositoryCommitBeforeRequest, RepositoryDiff, |
130 | RepositoryDiffPatchRequest, RepositoryDiffRequest, RepositoryFile, |
131 | RepositoryFileFromIdRequest, RepositoryFileFromPathRequest, RepositoryFileInspectRequest, |
132 | RepositorySummary, RepositoryTreeEntry, RepositoryCommitFromIdRequest, RepositoryLastCommitOfFileRequest, RepositoryStatisticsRequest, RepositoryStatistics, RepositoryBranch, RepositoryBranchesRequest, |
133 | ; |
134 | use AnySetting; |
135 | use ; |
136 | use ; |
137 | use GiteratedBackend; |
138 | use ; |
139 | use Value; |
140 | use Mutex; |
141 | |
142 | use crate; |
143 | |
144 | use DatabaseBackend; |
145 | ; |
146 | |
147 | |
148 | |
149 | async |
150 | assert_eq!; |
151 | |
152 | Ok |
153 | & to_vec .unwrap, |
154 | |
155 | .unwrap |
156 | |
157 | async |
158 | Ok |
159 | & to_vec .unwrap, |
160 | |
161 | .unwrap |
162 | |
163 | async |
164 | &mut self, |
165 | _user: &User, |
166 | _name: &str, |
167 | _setting: &Value, |
168 | |
169 | Ok |
170 | |
171 | async |
172 | Ok |
173 | |
174 | async |
175 | &mut self, |
176 | _requester: & , |
177 | _user: &User, |
178 | |
179 | todo! |
180 | |
181 | |
182 | |
183 | |
184 | |
185 | async |
186 | &mut self, |
187 | _request: RegisterAccountRequest, |
188 | |
189 | todo! |
190 | |
191 | |
192 | async |
193 | &mut self, |
194 | _source: &Instance, |
195 | _request: AuthenticationTokenRequest, |
196 | |
197 | todo! |
198 | |
199 | |
200 | |
201 | ; |
202 | |
203 | |
204 | |
205 | async |
206 | &mut self, |
207 | _user: &AuthenticatedUser, |
208 | _request: &RepositoryCreateRequest, |
209 | |
210 | todo! |
211 | |
212 | async |
213 | &mut self, |
214 | _requester: & , |
215 | _repository: &Repository, |
216 | _request: &RepositoryFileInspectRequest, |
217 | |
218 | todo! |
219 | |
220 | async |
221 | &mut self, |
222 | _requester: & , |
223 | _repository: &Repository, |
224 | _request: &RepositoryFileFromIdRequest, |
225 | |
226 | todo! |
227 | |
228 | async |
229 | &mut self, |
230 | _requester: & , |
231 | _repository: &Repository, |
232 | _request: &RepositoryFileFromPathRequest, |
233 | |
234 | todo! |
235 | |
236 | async |
237 | &mut self, |
238 | _requester: & , |
239 | _repository: &Repository, |
240 | _request: &RepositoryLastCommitOfFileRequest, |
241 | |
242 | todo! |
243 | |
244 | async |
245 | &mut self, |
246 | _requester: & , |
247 | _repository: &Repository, |
248 | _request: &RepositoryCommitFromIdRequest, |
249 | |
250 | todo! |
251 | |
252 | async |
253 | &mut self, |
254 | _requester: & , |
255 | _repository: &Repository, |
256 | _request: &RepositoryDiffRequest, |
257 | |
258 | todo! |
259 | |
260 | async |
261 | &mut self, |
262 | _requester: & , |
263 | _repository: &Repository, |
264 | _request: &RepositoryDiffPatchRequest, |
265 | |
266 | todo! |
267 | |
268 | async |
269 | &mut self, |
270 | _requester: & , |
271 | _repository: &Repository, |
272 | _request: &RepositoryCommitBeforeRequest, |
273 | |
274 | todo! |
275 | |
276 | async |
277 | &mut self, |
278 | _requester: & , |
279 | _repository: &Repository, |
280 | _request: &RepositoryStatisticsRequest, |
281 | |
282 | todo! |
283 | |
284 | async |
285 | &mut self, |
286 | _requester: & , |
287 | _repository: &Repository, |
288 | _request: &RepositoryBranchesRequest, |
289 | |
290 | todo! |
291 | |
292 | async |
293 | &mut self, |
294 | _repository: &Repository, |
295 | _name: &str, |
296 | |
297 | Ok |
298 | & to_vec .unwrap, |
299 | |
300 | .unwrap |
301 | |
302 | async |
303 | &mut self, |
304 | _repository: &Repository, |
305 | _name: &str, |
306 | |
307 | Ok |
308 | & to_vec .unwrap, |
309 | |
310 | .unwrap |
311 | |
312 | async |
313 | &mut self, |
314 | _repository: &Repository, |
315 | _name: &str, |
316 | _setting: &Value, |
317 | |
318 | Ok |
319 | |
320 | |
321 | async |
322 | &mut self, |
323 | _requester: & , |
324 | repository: &Repository, |
325 | |
326 | // Ok(true) |
327 | Ok |
328 | == & from_str |
329 | "test_user:test.giterated.dev/[email protected]", |
330 | |
331 | .unwrap |
332 | |
333 | |
334 | |
335 | |
336 | DatabaseBackend |
337 | our_instance: from_str .unwrap, |
338 | user_backend: new as _, |
339 | repository_backend: new as _, |
340 | |
341 | .into_backend |
342 | |
343 | |
344 | |
345 | todo! |
346 | |
347 | |
348 | |
349 | async |
350 | let backend = test_backend; |
351 | let operation_state = operation_state; |
352 | |
353 | let mut user = backend |
354 | . |
355 | .await |
356 | .expect; |
357 | |
358 | user. |
359 | .await |
360 | .expect; |
361 | |
362 | |
363 | |
364 | async |
365 | let backend = test_backend; |
366 | let operation_state = operation_state; |
367 | |
368 | let mut user = backend |
369 | . |
370 | .await |
371 | .expect; |
372 | |
373 | user. |
374 | .await |
375 | .expect; |
376 | |
377 | |
378 | |
379 | async |
380 | let backend = test_backend; |
381 | let operation_state = operation_state; |
382 | |
383 | let mut user = backend |
384 | . |
385 | .await |
386 | .expect; |
387 | |
388 | user. |
389 | .await |
390 | .expect; |
391 | |
392 | |
393 | |
394 | async |
395 | let backend = test_backend; |
396 | let operation_state = operation_state; |
397 | |
398 | let mut repository = backend |
399 | . |
400 | "test_user:test.giterated.dev/[email protected]", |
401 | &operation_state, |
402 | |
403 | .await |
404 | .expect; |
405 | |
406 | repository |
407 | . |
408 | .await |
409 | .expect; |
410 | |
411 | |
412 | |
413 | async |
414 | let backend = test_backend; |
415 | let operation_state = operation_state; |
416 | |
417 | let mut repository = backend |
418 | . |
419 | "test_user:test.giterated.dev/[email protected]", |
420 | &operation_state, |
421 | |
422 | .await |
423 | .expect; |
424 | |
425 | repository |
426 | . |
427 | .await |
428 | .expect; |
429 | |
430 | |
431 | |
432 | async |
433 | let backend = test_backend; |
434 | let operation_state = operation_state; |
435 | |
436 | let mut repository = backend |
437 | . |
438 | "test_user:test.giterated.dev/[email protected]", |
439 | &operation_state, |
440 | |
441 | .await |
442 | .expect; |
443 | |
444 | repository |
445 | . |
446 | .await |
447 | .expect; |
448 | |
449 | |
450 |