This repository was archived by the owner on Oct 19, 2026. It is now read-only.
Repository navigation
Commit 683c28d
refactor(lfs): improve API structure and add docs/tests (#1716)
* refactor(lfs): improve API structure and add docs/tests
- Refactored parts of LFS API handlers for better structure
- Added OpenAPI documentation and developer notes
- Added unit tests for LFS batch and object endpoints
- Ensured compatibility with GitHub LFS behavior
Signed-off-by: WiedersehenM <your_email@example.com>
Signed-off-by: Hongze Gao <15101764808@163.com>
* fix(lfs): resolve clippy, rustfmt and test failures
- Remove unused `routes` import from utoipa_axum
- Rename unused variables to underscore prefix (router, expected_code)
- Reorder imports to satisfy rustfmt
- Split long use statements into multiple lines
- Trim trailing whitespaces and normalize blank lines
- Derive PartialEq for lfs_structs::Ref to enable assert_eq! in tests
Signed-off-by: Hongze Gao <15101764808@163.com>
* fix(lfs): address clippy, fmt, naming, tests and docs
- Remove unused `put` import (method comes from Route trait)
- Let rustfmt reorder imports automatically
- Rename `router()` -> `routers()` to keep consistent with other modules
- Update callers in http_server.rs
- test_error_response_format: assert against expected_code directly
- test_map_lfs_error_priority: correct logic & comments for "Not found" priority
- OpenAPI: fix download/chunk content-type to application/octet-stream
- Correct chunk-download path template in docs: .../{oid}/chunks/{chunk_id}
Signed-off-by: Hongze Gao <15101764808@163.com>
* style(lfs): reorder imports to satisfy cargo fmt
- Move ahead of the block
- Keep order: std -> axum::routing -> axum -> futures -> utoipa_axum
Signed-off-by: Hongze Gao <15101764808@163.com>
* Integrated Buck2-Change-Detector to orion-server and orion workflow (#1721)
* feat: integrate buck2-change-detector into orion build progress
Signed-off-by: Acfboy <acfboyu@outlook.com>
* fix: some implementation issues
Signed-off-by: Acfboy <acfboyu@outlook.com>
* fix: clippy
Signed-off-by: Acfboy <acfboyu@outlook.com>
---------
Signed-off-by: Acfboy <acfboyu@outlook.com>
Co-authored-by: Quanyi Ma <eli@patch.sh>
* [antares]: change server router bind and add func for orion (#1725)
Signed-off-by: Luxian <lux1an@qq.com>
* feat(lfs): sync upstream and align error handling, docs, tests
1. Merge latest upstream main
2. Introduce `lfs_error_response` helper – all routes now consistently
return JSON `{"message": "..."}` instead of mixed `(code, msg)` or plain text
- Keep `map_lfs_error` with TODO for future typed-error refactor
3. Remove LFS OpenAPI tags/paths/schemas append in http_server.rs;
stick to project-wide convention
4. Adjust `test_map_lfs_error_priority` to real precedence ("Not found" first)
5. OpenAPI & responses polish
- Set download/chunk Content-Type to application/octet-stream
- Add 400/404 responses for every route:
list_locks, list_locks_for_verification, create_lock, delete_lock,
batch, fetch_chunk_ids, download_object, download_chunk, upload_object
- Document dual-path support: /info/lfs and /api/v1/lfs
Signed-off-by: Hongze Gao <15101764808@163.com>
* fix: resolve all clippy warnings
Signed-off-by: Hongze Gao <15101764808@163.com>
Signed-off-by: Hongze Gao <15101764808@163.com>
* fix: resolve all Testing Mono errors
Signed-off-by: Hongze Gao <15101764808@163.com>
Signed-off-by: Hongze Gao <15101764808@163.com>
* fix(lfs): correct error handling & response format
1. delete_lock: replace hard-coded INTERNAL_SERVER_ERROR with map_lfs_error,
now returns 404/400 as documented in OpenAPI.
2. lfs_upload_object: use lfs_error_response to guarantee correct
Content-Type: application/vnd.git-lfs+json and JSON body.
3. test_error_response_format: add unit tests for status code, header and
body structure of lfs_error_response.
4. annotate smoke tests (test_lfs_routes_structure, test_lfs_router_paths)
to clarify they only ensure routes compile without panic.
5. unify rustdoc comment format across all touched functions.
6. move User struct doc comment above derive macro in lfs_structs.rs.
Signed-off-by: Hongze Gao <15101764808@163.com>
* refactor(lfs): improve API documentation and fix OpenAPI registration
- Add LFS_TAG constant to http_server.rs for consistency with other routers
- Remove non-standard tags from ApiDoc struct
- Fix path duplication issue by using relative paths in utoipa::path annotations
- Register only /api/v1/lfs paths in OpenAPI, /info/lfs for runtime only
- Switch from .route() to routes! macro for better OpenAPI collection
- Add descriptions to all LFS endpoints documenting dual path support
- Fix chunk download error format to use standard LFS JSON response
- Fix compilation errors (unused imports, api_state borrowing)
This ensures LFS API endpoints are properly displayed in Swagger UI with
correct paths (/api/v1/lfs/*) while maintaining runtime compatibility
with standard Git LFS paths (/info/lfs/*).
Signed-off-by: Hongze Gao <15101764808@163.com>
* resolve Rustfmt Check errors
Signed-off-by: Hongze Gao <15101764808@163.com>
Signed-off-by: Hongze Gao <15101764808@163.com>
---------
Signed-off-by: WiedersehenM <your_email@example.com>
Signed-off-by: Hongze Gao <15101764808@163.com>
Signed-off-by: Acfboy <acfboyu@outlook.com>
Signed-off-by: Luxian <lux1an@qq.com>
Co-authored-by: Acfboy <acfboyu@outlook.com>
Co-authored-by: Quanyi Ma <eli@patch.sh>
Co-authored-by: Xiaoyang Han <lux1an@qq.com>1 parent 74044f6 commit 683c28d
6 files changed
Lines changed: 1577 additions & 854 deletions
File tree
- ceres/src/lfs
- docs
- mono/src
- api/router
- server
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
676 | 676 | | |
677 | 677 | | |
678 | 678 | | |
| 679 | + | |
| 680 | + | |
| 681 | + | |
| 682 | + | |
| 683 | + | |
| 684 | + | |
| 685 | + | |
| 686 | + | |
| 687 | + | |
| 688 | + | |
| 689 | + | |
| 690 | + | |
| 691 | + | |
| 692 | + | |
| 693 | + | |
| 694 | + | |
| 695 | + | |
| 696 | + | |
| 697 | + | |
| 698 | + | |
| 699 | + | |
| 700 | + | |
| 701 | + | |
| 702 | + | |
| 703 | + | |
| 704 | + | |
| 705 | + | |
| 706 | + | |
| 707 | + | |
| 708 | + | |
| 709 | + | |
| 710 | + | |
| 711 | + | |
| 712 | + | |
| 713 | + | |
| 714 | + | |
| 715 | + | |
| 716 | + | |
| 717 | + | |
| 718 | + | |
| 719 | + | |
| 720 | + | |
| 721 | + | |
| 722 | + | |
| 723 | + | |
| 724 | + | |
| 725 | + | |
| 726 | + | |
| 727 | + | |
| 728 | + | |
| 729 | + | |
| 730 | + | |
| 731 | + | |
| 732 | + | |
| 733 | + | |
| 734 | + | |
| 735 | + | |
| 736 | + | |
| 737 | + | |
| 738 | + | |
| 739 | + | |
| 740 | + | |
| 741 | + | |
| 742 | + | |
| 743 | + | |
| 744 | + | |
| 745 | + | |
| 746 | + | |
| 747 | + | |
| 748 | + | |
| 749 | + | |
| 750 | + | |
| 751 | + | |
| 752 | + | |
| 753 | + | |
| 754 | + | |
| 755 | + | |
| 756 | + | |
| 757 | + | |
| 758 | + | |
| 759 | + | |
| 760 | + | |
| 761 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
7 | 8 | | |
8 | | - | |
| 9 | + | |
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
| |||
16 | 17 | | |
17 | 18 | | |
18 | 19 | | |
19 | | - | |
| 20 | + | |
20 | 21 | | |
21 | 22 | | |
22 | 23 | | |
| |||
28 | 29 | | |
29 | 30 | | |
30 | 31 | | |
31 | | - | |
| 32 | + | |
32 | 33 | | |
33 | 34 | | |
34 | 35 | | |
| |||
84 | 85 | | |
85 | 86 | | |
86 | 87 | | |
87 | | - | |
| 88 | + | |
| 89 | + | |
88 | 90 | | |
89 | 91 | | |
90 | 92 | | |
| |||
98 | 100 | | |
99 | 101 | | |
100 | 102 | | |
101 | | - | |
| 103 | + | |
| 104 | + | |
102 | 105 | | |
103 | 106 | | |
104 | 107 | | |
105 | 108 | | |
106 | 109 | | |
107 | 110 | | |
108 | 111 | | |
109 | | - | |
| 112 | + | |
| 113 | + | |
110 | 114 | | |
111 | 115 | | |
112 | 116 | | |
113 | 117 | | |
114 | | - | |
| 118 | + | |
| 119 | + | |
115 | 120 | | |
116 | 121 | | |
117 | 122 | | |
| |||
122 | 127 | | |
123 | 128 | | |
124 | 129 | | |
125 | | - | |
| 130 | + | |
| 131 | + | |
126 | 132 | | |
127 | 133 | | |
128 | 134 | | |
129 | 135 | | |
130 | 136 | | |
131 | 137 | | |
132 | | - | |
133 | | - | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
134 | 141 | | |
135 | 142 | | |
136 | 143 | | |
137 | 144 | | |
138 | 145 | | |
139 | | - | |
| 146 | + | |
| 147 | + | |
140 | 148 | | |
141 | 149 | | |
142 | 150 | | |
| |||
160 | 168 | | |
161 | 169 | | |
162 | 170 | | |
163 | | - | |
| 171 | + | |
| 172 | + | |
164 | 173 | | |
165 | 174 | | |
166 | 175 | | |
167 | 176 | | |
168 | 177 | | |
169 | | - | |
| 178 | + | |
| 179 | + | |
170 | 180 | | |
171 | 181 | | |
172 | 182 | | |
| |||
261 | 271 | | |
262 | 272 | | |
263 | 273 | | |
264 | | - | |
| 274 | + | |
| 275 | + | |
265 | 276 | | |
266 | 277 | | |
267 | 278 | | |
268 | 279 | | |
269 | 280 | | |
270 | 281 | | |
271 | 282 | | |
272 | | - | |
| 283 | + | |
| 284 | + | |
273 | 285 | | |
274 | 286 | | |
275 | 287 | | |
276 | 288 | | |
277 | | - | |
| 289 | + | |
| 290 | + | |
278 | 291 | | |
279 | 292 | | |
280 | 293 | | |
281 | 294 | | |
282 | 295 | | |
283 | 296 | | |
284 | | - | |
| 297 | + | |
| 298 | + | |
285 | 299 | | |
286 | 300 | | |
287 | 301 | | |
288 | 302 | | |
289 | 303 | | |
290 | | - | |
| 304 | + | |
| 305 | + | |
291 | 306 | | |
292 | 307 | | |
293 | 308 | | |
294 | 309 | | |
295 | 310 | | |
296 | 311 | | |
297 | | - | |
| 312 | + | |
| 313 | + | |
298 | 314 | | |
299 | 315 | | |
300 | 316 | | |
301 | 317 | | |
302 | 318 | | |
303 | | - | |
| 319 | + | |
| 320 | + | |
304 | 321 | | |
305 | 322 | | |
306 | 323 | | |
307 | 324 | | |
308 | 325 | | |
309 | | - | |
| 326 | + | |
| 327 | + | |
310 | 328 | | |
311 | 329 | | |
312 | 330 | | |
313 | 331 | | |
314 | 332 | | |
315 | 333 | | |
316 | 334 | | |
317 | | - | |
| 335 | + | |
| 336 | + | |
318 | 337 | | |
319 | 338 | | |
320 | 339 | | |
321 | 340 | | |
322 | 341 | | |
323 | 342 | | |
324 | | - | |
| 343 | + | |
| 344 | + | |
325 | 345 | | |
326 | 346 | | |
327 | 347 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
0 commit comments