xai-review 0.6.0__py3-none-any.whl → 0.8.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of xai-review might be problematic. Click here for more details.
- ai_review/clients/gitlab/client.py +1 -1
- ai_review/services/prompt/adapter.py +1 -1
- ai_review/services/prompt/service.py +6 -6
- ai_review/tests/suites/services/prompt/test_service.py +8 -0
- {xai_review-0.6.0.dist-info → xai_review-0.8.0.dist-info}/METADATA +2 -2
- {xai_review-0.6.0.dist-info → xai_review-0.8.0.dist-info}/RECORD +10 -10
- {xai_review-0.6.0.dist-info → xai_review-0.8.0.dist-info}/WHEEL +0 -0
- {xai_review-0.6.0.dist-info → xai_review-0.8.0.dist-info}/entry_points.txt +0 -0
- {xai_review-0.6.0.dist-info → xai_review-0.8.0.dist-info}/licenses/LICENSE +0 -0
- {xai_review-0.6.0.dist-info → xai_review-0.8.0.dist-info}/top_level.txt +0 -0
|
@@ -13,7 +13,7 @@ class GitLabHTTPClient:
|
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
def get_gitlab_http_client() -> GitLabHTTPClient:
|
|
16
|
-
logger = get_logger("
|
|
16
|
+
logger = get_logger("GITLAB_HTTP_CLIENT")
|
|
17
17
|
logger_event_hook = LoggerEventHook(logger=logger)
|
|
18
18
|
retry_transport = RetryTransport(transport=AsyncHTTPTransport())
|
|
19
19
|
|
|
@@ -12,7 +12,7 @@ def build_prompt_context_from_mr_info(mr: MRInfoSchema) -> PromptContextSchema:
|
|
|
12
12
|
|
|
13
13
|
merge_request_reviewers=[reviewer.name for reviewer in mr.reviewers],
|
|
14
14
|
merge_request_reviewers_usernames=[reviewer.username for reviewer in mr.reviewers],
|
|
15
|
-
merge_request_reviewer=mr.reviewers[0].name if mr.reviewers else
|
|
15
|
+
merge_request_reviewer=mr.reviewers[0].name if mr.reviewers else "",
|
|
16
16
|
|
|
17
17
|
merge_request_assignees=[assignee.name for assignee in mr.assignees],
|
|
18
18
|
merge_request_assignees_usernames=[assignee.username for assignee in mr.assignees],
|
|
@@ -11,34 +11,34 @@ class PromptService:
|
|
|
11
11
|
@classmethod
|
|
12
12
|
def build_inline_request(cls, diff: DiffFileSchema, context: PromptContextSchema) -> str:
|
|
13
13
|
inline_prompts = "\n\n".join(settings.prompt.load_inline())
|
|
14
|
-
|
|
14
|
+
inline_prompts = context.apply_format(inline_prompts)
|
|
15
|
+
return (
|
|
15
16
|
f"{inline_prompts}\n\n"
|
|
16
17
|
f"## Diff\n\n"
|
|
17
18
|
f"{format_file(diff)}"
|
|
18
19
|
)
|
|
19
|
-
return context.apply_format(prompt)
|
|
20
20
|
|
|
21
21
|
@classmethod
|
|
22
22
|
def build_summary_request(cls, diffs: list[DiffFileSchema], context: PromptContextSchema) -> str:
|
|
23
23
|
changes = "\n\n".join(map(format_file, diffs))
|
|
24
24
|
summary_prompts = "\n\n".join(settings.prompt.load_summary())
|
|
25
|
-
|
|
25
|
+
summary_prompts = context.apply_format(summary_prompts)
|
|
26
|
+
return (
|
|
26
27
|
f"{summary_prompts}\n\n"
|
|
27
28
|
f"## Changes\n\n"
|
|
28
29
|
f"{changes}\n"
|
|
29
30
|
)
|
|
30
|
-
return context.apply_format(prompt)
|
|
31
31
|
|
|
32
32
|
@classmethod
|
|
33
33
|
def build_context_request(cls, diffs: list[DiffFileSchema], context: PromptContextSchema) -> str:
|
|
34
34
|
changes = "\n\n".join(map(format_file, diffs))
|
|
35
35
|
inline_prompts = "\n\n".join(settings.prompt.load_context())
|
|
36
|
-
|
|
36
|
+
inline_prompts = context.apply_format(inline_prompts)
|
|
37
|
+
return (
|
|
37
38
|
f"{inline_prompts}\n\n"
|
|
38
39
|
f"## Diff\n\n"
|
|
39
40
|
f"{changes}\n"
|
|
40
41
|
)
|
|
41
|
-
return context.apply_format(prompt)
|
|
42
42
|
|
|
43
43
|
@classmethod
|
|
44
44
|
def build_system_inline_request(cls, context: PromptContextSchema) -> str:
|
|
@@ -126,3 +126,11 @@ def test_build_system_summary_request_empty(
|
|
|
126
126
|
monkeypatch.setattr(PromptConfig, "load_system_summary", lambda self: [])
|
|
127
127
|
result = PromptService.build_system_summary_request(dummy_context)
|
|
128
128
|
assert result == ""
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
def test_diff_placeholders_are_not_replaced(dummy_context: PromptContextSchema) -> None:
|
|
132
|
+
diffs = [DiffFileSchema(file="x.py", diff='print("<<merge_request_title>>")')]
|
|
133
|
+
result = PromptService.build_summary_request(diffs, dummy_context)
|
|
134
|
+
|
|
135
|
+
assert "<<merge_request_title>>" in result
|
|
136
|
+
assert "Fix login bug" not in result
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: xai-review
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.8.0
|
|
4
4
|
Summary: AI-powered code review tool
|
|
5
5
|
Author-email: Nikita Filonov <nikita.filonov@example.com>
|
|
6
6
|
Maintainer-email: Nikita Filonov <nikita.filonov@example.com>
|
|
@@ -298,6 +298,6 @@ ai-review:
|
|
|
298
298
|
|
|
299
299
|
## 📂 Examples
|
|
300
300
|
|
|
301
|
-
- [./docs/ci
|
|
301
|
+
- [./docs/ci](./docs/ci) — ready-to-use CI snippets
|
|
302
302
|
- [./docs/configs](./docs/configs) — sample `.yaml`, `.json`, `.env` configs
|
|
303
303
|
- [./docs/prompts](./docs/prompts) — prompt templates for Python/Go (light & strict modes)
|
|
@@ -15,7 +15,7 @@ ai_review/clients/gemini/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZ
|
|
|
15
15
|
ai_review/clients/gemini/client.py,sha256=7ZPgqx77ER7gonxX0VoN4YrMpex3iBEQtd9Hi-bnDms,1780
|
|
16
16
|
ai_review/clients/gemini/schema.py,sha256=5oVvbI-h_sw8bFreS4JUmMj-aXa_frvxK3H8sg4iJIA,2264
|
|
17
17
|
ai_review/clients/gitlab/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
18
|
-
ai_review/clients/gitlab/client.py,sha256=
|
|
18
|
+
ai_review/clients/gitlab/client.py,sha256=acMflkHGp8mv0TVLdZ1gmdXkWQPcq609QjmkYWjEmys,1136
|
|
19
19
|
ai_review/clients/gitlab/mr/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
20
20
|
ai_review/clients/gitlab/mr/client.py,sha256=-4KHBie8NlHzX5LXdV9c9aL7UbHxuQ5XsDq701U-6q8,3844
|
|
21
21
|
ai_review/clients/gitlab/mr/schema/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -95,9 +95,9 @@ ai_review/services/llm/gemini/client.py,sha256=7FAOlTi8rV6b8g8aWcg-0LIP77AtbAoPt
|
|
|
95
95
|
ai_review/services/llm/openai/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
96
96
|
ai_review/services/llm/openai/client.py,sha256=WhMXNfH_G1NTlFkdRK5sgYvrCIE5ZQNfPhdYx49IXFk,1143
|
|
97
97
|
ai_review/services/prompt/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
98
|
-
ai_review/services/prompt/adapter.py,sha256=
|
|
98
|
+
ai_review/services/prompt/adapter.py,sha256=humGHLRVBu0JspeULgYHCs782BAy4YYKSf5yaG8aF24,1003
|
|
99
99
|
ai_review/services/prompt/schema.py,sha256=erAecUYzOWyZfixt-pjmPSnvcMDh5DajMd1b7_SPm_o,2052
|
|
100
|
-
ai_review/services/prompt/service.py,sha256=
|
|
100
|
+
ai_review/services/prompt/service.py,sha256=VsY8mj6UvY1a4Zsb8JlDJIg_8l7LBW6PXrObiHCwCzo,2128
|
|
101
101
|
ai_review/services/review/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
102
102
|
ai_review/services/review/service.py,sha256=8YhRFqhZAk2pAnkDaytKSCENlOeOti1brAJq3R9tVMY,8394
|
|
103
103
|
ai_review/services/review/inline/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -145,7 +145,7 @@ ai_review/tests/suites/services/diff/test_service.py,sha256=iFkGX9Vj2X44JU3eFsoH
|
|
|
145
145
|
ai_review/tests/suites/services/diff/test_tools.py,sha256=HBQ3eCn-kLeb_k5iTgyr09x0VwLYSegSbxm0Qk9ZrCc,3543
|
|
146
146
|
ai_review/tests/suites/services/prompt/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
147
147
|
ai_review/tests/suites/services/prompt/test_schema.py,sha256=XkJk4N9ovgod7G3i6oZwRBjpd71sv0vtVDJhSOfIwGA,2660
|
|
148
|
-
ai_review/tests/suites/services/prompt/test_service.py,sha256=
|
|
148
|
+
ai_review/tests/suites/services/prompt/test_service.py,sha256=M8vvBhEbyHnXCSiIRu7231odn89sPDyCiRMOc2XufC4,5570
|
|
149
149
|
ai_review/tests/suites/services/review/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
150
150
|
ai_review/tests/suites/services/review/inline/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
151
151
|
ai_review/tests/suites/services/review/inline/test_schema.py,sha256=tIz-1UA_GgwcdsyUqgrodiiVVmd_jhoOVmtEwzRVWiY,2474
|
|
@@ -155,9 +155,9 @@ ai_review/tests/suites/services/review/policy/test_service.py,sha256=kRWT550OjWY
|
|
|
155
155
|
ai_review/tests/suites/services/review/summary/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
156
156
|
ai_review/tests/suites/services/review/summary/test_schema.py,sha256=xSoydvABZldHaVDa0OBFvYrj8wMuZqUDN3MO-XdvxOI,819
|
|
157
157
|
ai_review/tests/suites/services/review/summary/test_service.py,sha256=8UMvi_NL9frm280vD6Q1NCDrdI7K8YbXzoViIus-I2g,541
|
|
158
|
-
xai_review-0.
|
|
159
|
-
xai_review-0.
|
|
160
|
-
xai_review-0.
|
|
161
|
-
xai_review-0.
|
|
162
|
-
xai_review-0.
|
|
163
|
-
xai_review-0.
|
|
158
|
+
xai_review-0.8.0.dist-info/licenses/LICENSE,sha256=p-v8m7Kmz4KKc7PcvsGiGEmCw9AiSXY4_ylOPy_u--Y,11343
|
|
159
|
+
xai_review-0.8.0.dist-info/METADATA,sha256=d7MEYbJjP_FPZpuZdbHmtaak6gyDbk72-BV07n3u67o,9617
|
|
160
|
+
xai_review-0.8.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
161
|
+
xai_review-0.8.0.dist-info/entry_points.txt,sha256=JyC5URanMi5io5P_PXQf7H_I1OGIpk5cZQhaPQ0g4Zs,53
|
|
162
|
+
xai_review-0.8.0.dist-info/top_level.txt,sha256=sTsZbfzLoqvRZKdKa-BcxWvjlHdrpbeJ6DrGY0EuR0E,10
|
|
163
|
+
xai_review-0.8.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|