shared-pre-deployment 0.1.0__tar.gz → 1.0.0__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.
- shared_pre_deployment-1.0.0/.gitignore +19 -0
- {shared_pre_deployment-0.1.0 → shared_pre_deployment-1.0.0}/PKG-INFO +1 -1
- {shared_pre_deployment-0.1.0 → shared_pre_deployment-1.0.0}/pyproject.toml +1 -1
- {shared_pre_deployment-0.1.0 → shared_pre_deployment-1.0.0}/release.py +2 -3
- shared_pre_deployment-1.0.0/src/shared_pre_deployment/__init__.py +55 -0
- {shared_pre_deployment-0.1.0 → shared_pre_deployment-1.0.0}/src/shared_pre_deployment/cli.py +3 -6
- shared_pre_deployment-1.0.0/src/shared_pre_deployment/exceptions.py +26 -0
- {shared_pre_deployment-0.1.0 → shared_pre_deployment-1.0.0}/src/shared_pre_deployment/runner.py +52 -7
- shared_pre_deployment-1.0.0/src/shared_pre_deployment/validators.py +514 -0
- shared_pre_deployment-1.0.0/tests/test_runner.py +527 -0
- {shared_pre_deployment-0.1.0 → shared_pre_deployment-1.0.0}/uv.lock +1 -1
- shared_pre_deployment-0.1.0/.gitignore +0 -47
- shared_pre_deployment-0.1.0/src/shared_pre_deployment/__init__.py +0 -35
- shared_pre_deployment-0.1.0/src/shared_pre_deployment/checks/__init__.py +0 -66
- shared_pre_deployment-0.1.0/src/shared_pre_deployment/checks/callback.py +0 -76
- shared_pre_deployment-0.1.0/src/shared_pre_deployment/checks/command.py +0 -106
- shared_pre_deployment-0.1.0/src/shared_pre_deployment/checks/env.py +0 -64
- shared_pre_deployment-0.1.0/src/shared_pre_deployment/checks/postgres.py +0 -97
- shared_pre_deployment-0.1.0/src/shared_pre_deployment/checks/redis.py +0 -95
- shared_pre_deployment-0.1.0/src/shared_pre_deployment/logging.py +0 -67
- shared_pre_deployment-0.1.0/tests/conftest.py +0 -49
- shared_pre_deployment-0.1.0/tests/test_checks.py +0 -237
- shared_pre_deployment-0.1.0/tests/test_cli.py +0 -68
- shared_pre_deployment-0.1.0/tests/test_logging.py +0 -58
- shared_pre_deployment-0.1.0/tests/test_runner.py +0 -96
- {shared_pre_deployment-0.1.0 → shared_pre_deployment-1.0.0}/README.md +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: shared-pre-deployment
|
|
3
|
-
Version:
|
|
3
|
+
Version: 1.0.0
|
|
4
4
|
Summary: A modular pre-deployment verification gate and orchestration runner for services.
|
|
5
5
|
Author-email: Film Review Platform Engineering <dev@example.com>
|
|
6
6
|
License-Expression: MIT
|
|
@@ -95,9 +95,8 @@ def verify_artifacts() -> bool:
|
|
|
95
95
|
"shared_pre_deployment/__init__.py",
|
|
96
96
|
"shared_pre_deployment/runner.py",
|
|
97
97
|
"shared_pre_deployment/cli.py",
|
|
98
|
-
"shared_pre_deployment/
|
|
99
|
-
"shared_pre_deployment/
|
|
100
|
-
"shared_pre_deployment/checks/redis.py",
|
|
98
|
+
"shared_pre_deployment/validators.py",
|
|
99
|
+
"shared_pre_deployment/exceptions.py",
|
|
101
100
|
]
|
|
102
101
|
for req in required_whl_files:
|
|
103
102
|
if not any(req in n for n in names):
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"""
|
|
2
|
+
shared-pre-deployment: A modular pre-deployment verification gate and orchestration runner.
|
|
3
|
+
"""
|
|
4
|
+
|
|
5
|
+
from __future__ import annotations
|
|
6
|
+
|
|
7
|
+
from .exceptions import (
|
|
8
|
+
ConfigurationError,
|
|
9
|
+
ConnectivityError,
|
|
10
|
+
PreDeploymentError,
|
|
11
|
+
ValidationError,
|
|
12
|
+
)
|
|
13
|
+
from .runner import Logger, PreDeploymentRunner
|
|
14
|
+
from .validators import (
|
|
15
|
+
BaseCheck,
|
|
16
|
+
CallbackCheck,
|
|
17
|
+
CallbackValidator,
|
|
18
|
+
CheckResult,
|
|
19
|
+
CheckStatus,
|
|
20
|
+
CommandCheck,
|
|
21
|
+
CommandValidator,
|
|
22
|
+
EnvCheck,
|
|
23
|
+
EnvValidator,
|
|
24
|
+
PostgresCheck,
|
|
25
|
+
PostgresValidator,
|
|
26
|
+
RedisCheck,
|
|
27
|
+
RedisValidator,
|
|
28
|
+
mask_url_password,
|
|
29
|
+
)
|
|
30
|
+
|
|
31
|
+
__version__ = "1.0.0"
|
|
32
|
+
|
|
33
|
+
__all__ = [
|
|
34
|
+
"__version__",
|
|
35
|
+
"BaseCheck",
|
|
36
|
+
"CheckResult",
|
|
37
|
+
"CheckStatus",
|
|
38
|
+
"CallbackCheck",
|
|
39
|
+
"CallbackValidator",
|
|
40
|
+
"CommandCheck",
|
|
41
|
+
"CommandValidator",
|
|
42
|
+
"EnvCheck",
|
|
43
|
+
"EnvValidator",
|
|
44
|
+
"PostgresCheck",
|
|
45
|
+
"PostgresValidator",
|
|
46
|
+
"RedisCheck",
|
|
47
|
+
"RedisValidator",
|
|
48
|
+
"Logger",
|
|
49
|
+
"mask_url_password",
|
|
50
|
+
"PreDeploymentRunner",
|
|
51
|
+
"PreDeploymentError",
|
|
52
|
+
"ValidationError",
|
|
53
|
+
"ConfigurationError",
|
|
54
|
+
"ConnectivityError",
|
|
55
|
+
]
|
{shared_pre_deployment-0.1.0 → shared_pre_deployment-1.0.0}/src/shared_pre_deployment/cli.py
RENAMED
|
@@ -12,12 +12,9 @@ from typing import Optional, Sequence
|
|
|
12
12
|
|
|
13
13
|
import click
|
|
14
14
|
|
|
15
|
-
from
|
|
16
|
-
from
|
|
17
|
-
from
|
|
18
|
-
from shared_pre_deployment.checks.postgres import PostgresCheck
|
|
19
|
-
from shared_pre_deployment.checks.redis import RedisCheck
|
|
20
|
-
from shared_pre_deployment.runner import PreDeploymentRunner
|
|
15
|
+
from . import __version__
|
|
16
|
+
from .runner import PreDeploymentRunner
|
|
17
|
+
from .validators import CommandCheck, EnvCheck, PostgresCheck, RedisCheck
|
|
21
18
|
|
|
22
19
|
|
|
23
20
|
def _load_env_file(path: Optional[str]) -> None:
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Custom exceptions for shared-pre-deployment.
|
|
3
|
+
Provides standardized exception types for pre-deployment gate failures.
|
|
4
|
+
"""
|
|
5
|
+
|
|
6
|
+
from __future__ import annotations
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class PreDeploymentError(Exception):
|
|
10
|
+
"""Base exception for all pre-deployment gate errors."""
|
|
11
|
+
pass
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
class ValidationError(PreDeploymentError):
|
|
15
|
+
"""Raised or recorded when a validation check fails."""
|
|
16
|
+
pass
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
class ConfigurationError(PreDeploymentError):
|
|
20
|
+
"""Raised when required environment configuration is missing or invalid."""
|
|
21
|
+
pass
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
class ConnectivityError(PreDeploymentError):
|
|
25
|
+
"""Raised when an external service (PostgreSQL, Redis) is unreachable."""
|
|
26
|
+
pass
|
{shared_pre_deployment-0.1.0 → shared_pre_deployment-1.0.0}/src/shared_pre_deployment/runner.py
RENAMED
|
@@ -6,15 +6,60 @@ Coordinates check execution, formats log outputs, and manages exit statuses.
|
|
|
6
6
|
from __future__ import annotations
|
|
7
7
|
|
|
8
8
|
import asyncio
|
|
9
|
+
import sys
|
|
9
10
|
from typing import Callable, Optional, Sequence
|
|
10
11
|
|
|
11
|
-
from
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
12
|
+
from .validators import (
|
|
13
|
+
BaseCheck,
|
|
14
|
+
CheckResult,
|
|
15
|
+
CheckStatus,
|
|
16
|
+
CallbackCheck,
|
|
17
|
+
CommandCheck,
|
|
18
|
+
EnvCheck,
|
|
19
|
+
PostgresCheck,
|
|
20
|
+
RedisCheck,
|
|
21
|
+
)
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
class Logger:
|
|
25
|
+
"""Standard console logger formatting pre-deployment gate output."""
|
|
26
|
+
|
|
27
|
+
@staticmethod
|
|
28
|
+
def header(title: str) -> None:
|
|
29
|
+
border = "=" * max(65, len(title) + 4)
|
|
30
|
+
print(f"\n{border}")
|
|
31
|
+
print(f" {title}")
|
|
32
|
+
print(f"{border}\n")
|
|
33
|
+
|
|
34
|
+
@staticmethod
|
|
35
|
+
def info(msg: str) -> None:
|
|
36
|
+
print(f"[PRE-DEPLOYMENT] {msg}")
|
|
37
|
+
|
|
38
|
+
@staticmethod
|
|
39
|
+
def pass_(msg: str) -> None:
|
|
40
|
+
print(f"[PASS] {msg}")
|
|
41
|
+
|
|
42
|
+
@staticmethod
|
|
43
|
+
def fail(msg: str) -> None:
|
|
44
|
+
print(f"[FAIL] {msg}", file=sys.stderr)
|
|
45
|
+
|
|
46
|
+
@staticmethod
|
|
47
|
+
def warn(msg: str) -> None:
|
|
48
|
+
print(f"[WARN] {msg}")
|
|
49
|
+
|
|
50
|
+
@staticmethod
|
|
51
|
+
def summary_success(msg: str = "All pre-deployment safety gates passed successfully!") -> None:
|
|
52
|
+
border = "=" * 65
|
|
53
|
+
print(f"\n{border}")
|
|
54
|
+
print(f"[PASS] {msg}")
|
|
55
|
+
print(f"{border}\n")
|
|
56
|
+
|
|
57
|
+
@staticmethod
|
|
58
|
+
def summary_failure(failed_count: int, total_count: int) -> None:
|
|
59
|
+
border = "=" * 65
|
|
60
|
+
print(f"\n{border}", file=sys.stderr)
|
|
61
|
+
print(f"[FAIL] Pre-deployment verification failed: {failed_count}/{total_count} check(s) failed.", file=sys.stderr)
|
|
62
|
+
print(f"{border}\n", file=sys.stderr)
|
|
18
63
|
|
|
19
64
|
|
|
20
65
|
class PreDeploymentRunner:
|