validio-cli 0.27.5__tar.gz → 0.27.7__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.
- {validio_cli-0.27.5 → validio_cli-0.27.7}/PKG-INFO +1 -1
- {validio_cli-0.27.5 → validio_cli-0.27.7}/pyproject.toml +12 -3
- {validio_cli-0.27.5 → validio_cli-0.27.7}/validio_cli/bin/entities/code.py +9 -2
- {validio_cli-0.27.5 → validio_cli-0.27.7}/validio_cli/bin/entities/resources.py +2 -2
- {validio_cli-0.27.5 → validio_cli-0.27.7}/validio_cli/bin/main.py +0 -4
- validio_cli-0.27.5/validio_cli/bin/entities/recommendations.py +0 -110
- {validio_cli-0.27.5 → validio_cli-0.27.7}/LICENSE +0 -0
- {validio_cli-0.27.5 → validio_cli-0.27.7}/README_PUBLIC.md +0 -0
- {validio_cli-0.27.5 → validio_cli-0.27.7}/validio_cli/__init__.py +0 -0
- {validio_cli-0.27.5 → validio_cli-0.27.7}/validio_cli/bin/entities/channels.py +0 -0
- {validio_cli-0.27.5 → validio_cli-0.27.7}/validio_cli/bin/entities/config.py +0 -0
- {validio_cli-0.27.5 → validio_cli-0.27.7}/validio_cli/bin/entities/credentials.py +0 -0
- {validio_cli-0.27.5 → validio_cli-0.27.7}/validio_cli/bin/entities/dbt.py +0 -0
- {validio_cli-0.27.5 → validio_cli-0.27.7}/validio_cli/bin/entities/filters.py +0 -0
- {validio_cli-0.27.5 → validio_cli-0.27.7}/validio_cli/bin/entities/incidents.py +0 -0
- {validio_cli-0.27.5 → validio_cli-0.27.7}/validio_cli/bin/entities/metrics.py +0 -0
- {validio_cli-0.27.5 → validio_cli-0.27.7}/validio_cli/bin/entities/namespaces.py +0 -0
- {validio_cli-0.27.5 → validio_cli-0.27.7}/validio_cli/bin/entities/notification_rules.py +0 -0
- {validio_cli-0.27.5 → validio_cli-0.27.7}/validio_cli/bin/entities/segmentations.py +0 -0
- {validio_cli-0.27.5 → validio_cli-0.27.7}/validio_cli/bin/entities/segments.py +0 -0
- {validio_cli-0.27.5 → validio_cli-0.27.7}/validio_cli/bin/entities/sources.py +0 -0
- {validio_cli-0.27.5 → validio_cli-0.27.7}/validio_cli/bin/entities/users.py +0 -0
- {validio_cli-0.27.5 → validio_cli-0.27.7}/validio_cli/bin/entities/validators.py +0 -0
- {validio_cli-0.27.5 → validio_cli-0.27.7}/validio_cli/bin/entities/windows.py +0 -0
- {validio_cli-0.27.5 → validio_cli-0.27.7}/validio_cli/components.py +0 -0
- {validio_cli-0.27.5 → validio_cli-0.27.7}/validio_cli/metadata.py +0 -0
- {validio_cli-0.27.5 → validio_cli-0.27.7}/validio_cli/namespace.py +0 -0
- {validio_cli-0.27.5 → validio_cli-0.27.7}/validio_cli/schema.py +0 -0
|
@@ -3,7 +3,7 @@ name = "validio-cli"
|
|
|
3
3
|
# This version does not represent the released version or any tag. For each
|
|
4
4
|
# release we automatically bump this before building and publishing so this
|
|
5
5
|
# should be kept at 0.0.1dev1
|
|
6
|
-
version = "0.27.
|
|
6
|
+
version = "0.27.7"
|
|
7
7
|
description = "CLI tool to interact with the Validio platform"
|
|
8
8
|
authors = ["Validio <support@validio.io>"]
|
|
9
9
|
license = "Apache-2.0"
|
|
@@ -25,10 +25,10 @@ validio-sdk = "*"
|
|
|
25
25
|
[tool.poetry.group.dev.dependencies]
|
|
26
26
|
ruff = "^0.9.6"
|
|
27
27
|
mypy = "^1.2.0"
|
|
28
|
-
licensecheck = "^
|
|
28
|
+
licensecheck = "^2025.1.0"
|
|
29
29
|
pytest = "^7.4.3"
|
|
30
30
|
flameprof = "^0.4"
|
|
31
|
-
validio-sdk = { path = "../validio-sdk" }
|
|
31
|
+
validio-sdk = { path = "../validio-sdk", develop = true }
|
|
32
32
|
|
|
33
33
|
[build-system]
|
|
34
34
|
requires = ["poetry-core"]
|
|
@@ -79,3 +79,12 @@ disallow_untyped_defs = true
|
|
|
79
79
|
disallow_incomplete_defs = true
|
|
80
80
|
check_untyped_defs = true
|
|
81
81
|
disallow_untyped_decorators = true
|
|
82
|
+
|
|
83
|
+
[tool.licensecheck]
|
|
84
|
+
license = "Apache-2.0"
|
|
85
|
+
ignore_packages = [
|
|
86
|
+
# Does not provide any license but uses same as mypy (MIT)
|
|
87
|
+
# https://github.com/python/mypy_extensions/issues/67
|
|
88
|
+
"MYPY-EXTENSIONS"
|
|
89
|
+
]
|
|
90
|
+
zero = true
|
|
@@ -210,6 +210,12 @@ async def apply(
|
|
|
210
210
|
validator: list[str] = target_option("validator"),
|
|
211
211
|
window: list[str] = target_option("window"),
|
|
212
212
|
progress: bool = show_progress_option,
|
|
213
|
+
test_credentials: bool = typer.Option(
|
|
214
|
+
True,
|
|
215
|
+
help=(
|
|
216
|
+
f"{BETA_BANNER} Test that credentials are valid before creating or updating"
|
|
217
|
+
),
|
|
218
|
+
),
|
|
213
219
|
dry_run_sql: bool = typer.Option(
|
|
214
220
|
False,
|
|
215
221
|
help=f"""
|
|
@@ -268,6 +274,7 @@ async def apply(
|
|
|
268
274
|
show_secrets=show_secrets,
|
|
269
275
|
show_progress=progress,
|
|
270
276
|
dry_run_sql=dry_run_sql,
|
|
277
|
+
test_credentials=test_credentials,
|
|
271
278
|
)
|
|
272
279
|
|
|
273
280
|
print(
|
|
@@ -298,7 +305,7 @@ async def _import(
|
|
|
298
305
|
),
|
|
299
306
|
),
|
|
300
307
|
credential: list[str] = typer.Option(
|
|
301
|
-
|
|
308
|
+
[],
|
|
302
309
|
help=(
|
|
303
310
|
f"{BETA_BANNER} Target credential resources to move into "
|
|
304
311
|
f"the current project's namespace. "
|
|
@@ -308,7 +315,7 @@ async def _import(
|
|
|
308
315
|
),
|
|
309
316
|
),
|
|
310
317
|
channel: list[str] = typer.Option(
|
|
311
|
-
|
|
318
|
+
[],
|
|
312
319
|
help=(
|
|
313
320
|
f"{BETA_BANNER} Target channel resources to move into "
|
|
314
321
|
f"the current project's namespace. "
|
|
@@ -32,10 +32,10 @@ async def move(
|
|
|
32
32
|
..., "--target-namespace", help="Namespace to move the resources to"
|
|
33
33
|
),
|
|
34
34
|
credential: list[str] = typer.Option(
|
|
35
|
-
|
|
35
|
+
[], help="Credential resources to move to the target namespace"
|
|
36
36
|
),
|
|
37
37
|
channel: list[str] = typer.Option(
|
|
38
|
-
|
|
38
|
+
[], help="Channel resources to move to the target namespace"
|
|
39
39
|
),
|
|
40
40
|
) -> None:
|
|
41
41
|
resource_names = ResourceNamesToMove(
|
|
@@ -21,7 +21,6 @@ from validio_cli.bin.entities import (
|
|
|
21
21
|
metrics,
|
|
22
22
|
namespaces,
|
|
23
23
|
notification_rules,
|
|
24
|
-
recommendations,
|
|
25
24
|
resources,
|
|
26
25
|
segmentations,
|
|
27
26
|
segments,
|
|
@@ -49,9 +48,6 @@ app.add_typer(metrics.app, no_args_is_help=True, name="metrics")
|
|
|
49
48
|
app.add_typer(namespaces.app, no_args_is_help=True, name="namespaces")
|
|
50
49
|
app.add_typer(resources.app, no_args_is_help=True, name="resources")
|
|
51
50
|
app.add_typer(notification_rules.app, no_args_is_help=True, name="notification-rules")
|
|
52
|
-
app.add_typer(
|
|
53
|
-
recommendations.app, no_args_is_help=True, name="recommendations", deprecated=True
|
|
54
|
-
)
|
|
55
51
|
app.add_typer(segmentations.app, no_args_is_help=True, name="segmentations")
|
|
56
52
|
app.add_typer(segments.app, no_args_is_help=True, name="segments")
|
|
57
53
|
app.add_typer(sources.app, no_args_is_help=True, name="sources")
|
|
@@ -1,110 +0,0 @@
|
|
|
1
|
-
from dataclasses import dataclass
|
|
2
|
-
|
|
3
|
-
import typer
|
|
4
|
-
|
|
5
|
-
from validio_cli import (
|
|
6
|
-
AsyncTyper,
|
|
7
|
-
ConfigDir,
|
|
8
|
-
Namespace,
|
|
9
|
-
OutputFormat,
|
|
10
|
-
OutputFormatOption,
|
|
11
|
-
OutputSettings,
|
|
12
|
-
get_client,
|
|
13
|
-
output_json,
|
|
14
|
-
output_text,
|
|
15
|
-
)
|
|
16
|
-
from validio_cli.bin.entities import sources
|
|
17
|
-
|
|
18
|
-
app = AsyncTyper(help="Recommended validators for your Sources")
|
|
19
|
-
|
|
20
|
-
APPLY_RESULT_SUCCEEDED = "SUCCEEDED"
|
|
21
|
-
APPLY_RESULT_FAILED = "FAILED"
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
@dataclass
|
|
25
|
-
class ApplyResult:
|
|
26
|
-
"""Result from applying recommendation"""
|
|
27
|
-
|
|
28
|
-
id: str
|
|
29
|
-
state: str
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
@app.async_command(help="List all recommendations")
|
|
33
|
-
async def get(
|
|
34
|
-
config_dir: str = ConfigDir,
|
|
35
|
-
output_format: OutputFormat = OutputFormatOption,
|
|
36
|
-
# ruff: noqa: ARG001
|
|
37
|
-
namespace: str = Namespace(),
|
|
38
|
-
source: str = typer.Option(
|
|
39
|
-
..., help="List recommendations for this Source (ID or name)"
|
|
40
|
-
),
|
|
41
|
-
) -> None:
|
|
42
|
-
vc, cfg = get_client(config_dir)
|
|
43
|
-
|
|
44
|
-
source_id = await sources.get_source_id(vc, cfg, source, namespace)
|
|
45
|
-
if source_id is None:
|
|
46
|
-
return None
|
|
47
|
-
|
|
48
|
-
recommendations = await vc.get_recommendations(source_id=source_id)
|
|
49
|
-
|
|
50
|
-
if output_format == OutputFormat.JSON:
|
|
51
|
-
return output_json(recommendations)
|
|
52
|
-
|
|
53
|
-
return output_text(
|
|
54
|
-
recommendations,
|
|
55
|
-
fields={
|
|
56
|
-
"id": None,
|
|
57
|
-
"name": None,
|
|
58
|
-
"type": OutputSettings.trimmed_upper_snake(
|
|
59
|
-
attribute_name="__typename", trim="Validator"
|
|
60
|
-
),
|
|
61
|
-
"age": OutputSettings.string_as_datetime(attribute_name="createdAt"),
|
|
62
|
-
},
|
|
63
|
-
)
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
@app.async_command(help="Apply recommendations")
|
|
67
|
-
async def apply(
|
|
68
|
-
config_dir: str = ConfigDir,
|
|
69
|
-
output_format: OutputFormat = OutputFormatOption,
|
|
70
|
-
ids: list[str] = typer.Option(
|
|
71
|
-
..., "--id", help="Recommendations to apply (IDs), supports multiple values"
|
|
72
|
-
),
|
|
73
|
-
) -> None:
|
|
74
|
-
vc, _ = get_client(config_dir)
|
|
75
|
-
|
|
76
|
-
api_result = await vc.apply_recommendations(recommendation_ids=ids)
|
|
77
|
-
|
|
78
|
-
result = []
|
|
79
|
-
seen_ids = set()
|
|
80
|
-
|
|
81
|
-
for r, state in [
|
|
82
|
-
(api_result["failedIds"], APPLY_RESULT_FAILED),
|
|
83
|
-
(api_result["successIds"], APPLY_RESULT_SUCCEEDED),
|
|
84
|
-
]:
|
|
85
|
-
for id in r:
|
|
86
|
-
seen_ids.add(id)
|
|
87
|
-
result.append(ApplyResult(id=id, state=state))
|
|
88
|
-
|
|
89
|
-
# TODO: The API silently accepts unknown ids but we want to add them as
|
|
90
|
-
# failed in the output so the caller know they've not been applied.
|
|
91
|
-
for id in ids:
|
|
92
|
-
if id in seen_ids:
|
|
93
|
-
continue
|
|
94
|
-
|
|
95
|
-
result.append(ApplyResult(id=id, state=APPLY_RESULT_FAILED))
|
|
96
|
-
|
|
97
|
-
if output_format == OutputFormat.JSON:
|
|
98
|
-
return output_json(result)
|
|
99
|
-
|
|
100
|
-
return output_text(
|
|
101
|
-
result,
|
|
102
|
-
fields={
|
|
103
|
-
"id": None,
|
|
104
|
-
"state": None,
|
|
105
|
-
},
|
|
106
|
-
)
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
if __name__ == "__main__":
|
|
110
|
-
typer.run(app())
|
|
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
|
|
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
|
|
File without changes
|
|
File without changes
|