Commit 799727e
authored
feat: add storage control to DocumentDeleter and refactor service exports
This pull request introduces several improvements and refactors to the
`admin-api-lib` and `extractor-api-lib` libraries, focusing on better
modularization through re-exports, enhanced document deletion logic, and
improved development and testing workflows. The most significant changes
are grouped below.
**1. Codebase Modularization and Re-exports**
- The `FileService`, `S3Service`, and `S3Settings` classes in
`admin-api-lib` and `extractor-api-lib` now re-export their
implementations from `rag-core-lib`, removing local duplicate
definitions and ensuring consistency across libraries.
[[1]](diffhunk://#diff-fb36b82cd5dc6c295361b85e59ed77dba4bad6a8e53d9d9e79392e48bb38861aL1-R5)
[[2]](diffhunk://#diff-cc8cac6dab28e557fdb760b7827590c39bb1b739f1f480913235c45c01f14cc3L1-R5)
[[3]](diffhunk://#diff-32903fe42be8331be09b17e8c3f0184d74e84e4c7b71ed37b9e707ac8b47a54aL1-R5)
**2. Document Deletion API Enhancements**
- The `DocumentDeleter` interface and its default implementation now
accept a new `remove_from_storage` argument, allowing callers to control
whether the file is deleted from storage in addition to the key-value
store. The logic for file deletion was refactored to handle storage keys
more robustly and to provide clearer error handling and logging.
[[1]](diffhunk://#diff-d841957e5971661a4b5d8cd4a648283115db1a26e067a2dd7349bafd45dc4753L10-R15)
[[2]](diffhunk://#diff-d841957e5971661a4b5d8cd4a648283115db1a26e067a2dd7349bafd45dc4753R25-R26)
[[3]](diffhunk://#diff-0ff2bf24abd3de9d5ff96aed7ba588f84b6eeba77d74cc692570f2aaea305b6cL44-R58)
[[4]](diffhunk://#diff-0ff2bf24abd3de9d5ff96aed7ba588f84b6eeba77d74cc692570f2aaea305b6cR74-R75)
[[5]](diffhunk://#diff-0ff2bf24abd3de9d5ff96aed7ba588f84b6eeba77d74cc692570f2aaea305b6cL70-R91)
[[6]](diffhunk://#diff-0ff2bf24abd3de9d5ff96aed7ba588f84b6eeba77d74cc692570f2aaea305b6cR101-R111)
**3. Upstream Usage and Test Updates**
- All usages of `adelete_document` in file and source uploaders, as well
as related tests, have been updated to use the new `remove_from_storage`
parameter, ensuring correct behavior and test coverage for the enhanced
deletion API.
[[1]](diffhunk://#diff-2f472a7af7eccd952a8fc1daa5e849c9cd0649fae490380ff2c421bb57e16feeL191-R195)
[[2]](diffhunk://#diff-3c2003f1db64f5b9610d691e451bb2ea5f65a92f1a81b5b210588931a4ecb455L200-R204)
[[3]](diffhunk://#diff-0228f4f920d182dd8dae216a018d88c345d3aa732337348ad1c0030060450f55L56-R60)
[[4]](diffhunk://#diff-83cebf407211b80a50570753869679e1eb801b09712b51f121a440548296aa30L76-R80)
**4. Docker and Build System Improvements**
- The Docker build configuration for the extractor service and the
`libs/Dockerfile` have been updated to include and install
`rag-core-lib` as a dependency where needed, improving development
workflows and ensuring all necessary dependencies are available for
testing and running the services.
[[1]](diffhunk://#diff-c2ee8653e1d6b85f0aadf87cd438a9250806c052877248442be4d434cbc52425L397-R405)
[[2]](diffhunk://#diff-4886ca734bb30da5c5ab3bca8bac9607d0a7c7a80c399eea76b24ae67c8509b1L26-R33)
[[3]](diffhunk://#diff-dede389bcfb615c4b45cd1da7ac14cbe9535305f41f19cce09e321c91a8bb323R96)
These changes collectively improve code maintainability, modularity, and
the flexibility of document management operations across the codebase.
** issue:
#2241 parent 3b7693c commit 799727e
File tree
32 files changed
+2001
-714
lines changed- libs
- admin-api-lib
- src/admin_api_lib
- api_endpoints
- file_services
- impl
- api_endpoints
- file_services
- settings
- tests
- extractor-api-lib
- src/extractor_api_lib
- file_services
- impl
- file_services
- settings
- rag-core-api
- rag-core-lib
- src/rag_core_lib
- file_services
- impl
- file_services
- settings
- services
- admin-backend
- document-extractor
- mcp-server
- rag-backend
32 files changed
+2001
-714
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
394 | 394 | | |
395 | 395 | | |
396 | 396 | | |
397 | | - | |
| 397 | + | |
398 | 398 | | |
399 | 399 | | |
400 | 400 | | |
401 | 401 | | |
402 | 402 | | |
403 | 403 | | |
404 | 404 | | |
| 405 | + | |
405 | 406 | | |
406 | 407 | | |
407 | 408 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
26 | | - | |
| 26 | + | |
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
31 | 34 | | |
32 | 35 | | |
33 | 36 | | |
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 8 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
11 | 16 | | |
12 | 17 | | |
13 | 18 | | |
| |||
17 | 22 | | |
18 | 23 | | |
19 | 24 | | |
| 25 | + | |
| 26 | + | |
20 | 27 | | |
21 | 28 | | |
22 | 29 | | |
| |||
Lines changed: 3 additions & 75 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | | - | |
4 | | - | |
5 | | - | |
6 | | - | |
| 3 | + | |
7 | 4 | | |
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 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | | - | |
| 5 | + | |
Lines changed: 34 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
44 | | - | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
45 | 59 | | |
46 | 60 | | |
47 | 61 | | |
| |||
57 | 71 | | |
58 | 72 | | |
59 | 73 | | |
| 74 | + | |
| 75 | + | |
60 | 76 | | |
61 | 77 | | |
62 | 78 | | |
| |||
67 | 83 | | |
68 | 84 | | |
69 | 85 | | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
76 | 92 | | |
77 | 93 | | |
78 | 94 | | |
| |||
82 | 98 | | |
83 | 99 | | |
84 | 100 | | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
Lines changed: 5 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
188 | 188 | | |
189 | 189 | | |
190 | 190 | | |
191 | | - | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
192 | 196 | | |
193 | 197 | | |
194 | 198 | | |
| |||
Lines changed: 5 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
197 | 197 | | |
198 | 198 | | |
199 | 199 | | |
200 | | - | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
201 | 205 | | |
202 | 206 | | |
203 | 207 | | |
| |||
Lines changed: 3 additions & 128 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | | - | |
4 | | - | |
5 | | - | |
| 3 | + | |
6 | 4 | | |
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 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | | - | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | | - | |
85 | | - | |
86 | | - | |
87 | | - | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | | - | |
93 | | - | |
94 | | - | |
95 | | - | |
96 | | - | |
97 | | - | |
98 | | - | |
99 | | - | |
100 | | - | |
101 | | - | |
102 | | - | |
103 | | - | |
104 | | - | |
105 | | - | |
106 | | - | |
107 | | - | |
108 | | - | |
109 | | - | |
110 | | - | |
111 | | - | |
112 | | - | |
113 | | - | |
114 | | - | |
115 | | - | |
116 | | - | |
117 | | - | |
118 | | - | |
119 | | - | |
120 | | - | |
121 | | - | |
122 | | - | |
123 | | - | |
124 | | - | |
125 | | - | |
126 | | - | |
127 | | - | |
128 | | - | |
129 | | - | |
130 | | - | |
| 5 | + | |
0 commit comments