rio-cli 0.2.0__tar.gz → 0.2.1__tar.gz
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.
- {rio_cli-0.2.0 → rio_cli-0.2.1}/PKG-INFO +1 -1
- {rio_cli-0.2.0 → rio_cli-0.2.1}/pyproject.toml +1 -1
- {rio_cli-0.2.0 → rio_cli-0.2.1}/rio_cli/config.py +5 -1
- {rio_cli-0.2.0 → rio_cli-0.2.1}/rio_cli/post.py +12 -5
- {rio_cli-0.2.0 → rio_cli-0.2.1}/.gitignore +0 -0
- {rio_cli-0.2.0 → rio_cli-0.2.1}/LICENSE +0 -0
- {rio_cli-0.2.0 → rio_cli-0.2.1}/README.md +0 -0
- {rio_cli-0.2.0 → rio_cli-0.2.1}/rio_cli/__init__.py +0 -0
- {rio_cli-0.2.0 → rio_cli-0.2.1}/rio_cli/auth.py +0 -0
- {rio_cli-0.2.0 → rio_cli-0.2.1}/rio_cli/git.py +0 -0
- {rio_cli-0.2.0 → rio_cli-0.2.1}/rio_cli/main.py +0 -0
- {rio_cli-0.2.0 → rio_cli-0.2.1}/rio_cli/output.py +0 -0
- {rio_cli-0.2.0 → rio_cli-0.2.1}/rio_cli/rio_config.py +0 -0
- {rio_cli-0.2.0 → rio_cli-0.2.1}/rio_cli/utils.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: rio-cli
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.1
|
|
4
4
|
Summary: Command-line client for Rio, an automated code review tool.
|
|
5
5
|
Project-URL: Homepage, https://github.com/JayTheCoder77/rio
|
|
6
6
|
Project-URL: Repository, https://github.com/JayTheCoder77/rio
|
|
@@ -1,10 +1,14 @@
|
|
|
1
|
+
import os
|
|
1
2
|
from pathlib import Path
|
|
2
3
|
|
|
3
4
|
import tomllib
|
|
4
5
|
|
|
5
6
|
from rio_cli.utils import _fail
|
|
6
7
|
|
|
7
|
-
DEFAULT_AI_ENGINE_URL =
|
|
8
|
+
DEFAULT_AI_ENGINE_URL = os.environ.get(
|
|
9
|
+
"RIO_API_URL", "https://rio-ai-engine.onrender.com"
|
|
10
|
+
)
|
|
11
|
+
# DEFAULT_AI_ENGINE_URL = "http://localhost:8000"
|
|
8
12
|
CONFIG_PATH = Path.home() / ".config" / "rio" / "config.toml"
|
|
9
13
|
|
|
10
14
|
def get_ai_engine_url() -> str:
|
|
@@ -7,11 +7,12 @@ from rio_cli.utils import _fail
|
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
def _post_review(diff_text : str) -> list[Finding]:
|
|
10
|
-
headers : dict = {}
|
|
11
10
|
api_key = get_api_key()
|
|
12
|
-
if api_key:
|
|
13
|
-
|
|
14
|
-
|
|
11
|
+
if not api_key:
|
|
12
|
+
_fail("Error: not authenticated. Run `rio auth` first.")
|
|
13
|
+
|
|
14
|
+
headers = {"Authorization": f"Bearer {api_key}"}
|
|
15
|
+
|
|
15
16
|
rio_config = load_rio_config()
|
|
16
17
|
ai_engine_url = get_ai_engine_url()
|
|
17
18
|
try:
|
|
@@ -26,7 +27,13 @@ def _post_review(diff_text : str) -> list[Finding]:
|
|
|
26
27
|
|
|
27
28
|
except httpx.TimeoutException:
|
|
28
29
|
_fail("Error: ai-engine request timed out.")
|
|
29
|
-
|
|
30
|
+
|
|
31
|
+
if response.status_code == 401:
|
|
32
|
+
_fail("Error: not authenticated. Run `rio auth` first.")
|
|
33
|
+
if response.status_code == 412:
|
|
34
|
+
_fail(f"Error: {response.json().get('detail', response.text)}")
|
|
35
|
+
if response.status_code == 422:
|
|
36
|
+
_fail(f"Error: {response.json().get('detail', response.text)}")
|
|
30
37
|
if response.status_code != 200:
|
|
31
38
|
_fail(f"Error: ai-engine returned {response.status_code}: {response.text}")
|
|
32
39
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|