salla-gitpuller 1.2.0__tar.gz → 1.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.
- {salla_gitpuller-1.2.0 → salla_gitpuller-1.2.1}/PKG-INFO +1 -1
- {salla_gitpuller-1.2.0 → salla_gitpuller-1.2.1}/gitpuller/__init__.py +1 -1
- {salla_gitpuller-1.2.0 → salla_gitpuller-1.2.1}/gitpuller/slack_notifier.py +37 -23
- {salla_gitpuller-1.2.0 → salla_gitpuller-1.2.1}/pyproject.toml +1 -1
- {salla_gitpuller-1.2.0 → salla_gitpuller-1.2.1}/salla_gitpuller.egg-info/PKG-INFO +1 -1
- {salla_gitpuller-1.2.0 → salla_gitpuller-1.2.1}/LICENSE +0 -0
- {salla_gitpuller-1.2.0 → salla_gitpuller-1.2.1}/README.md +0 -0
- {salla_gitpuller-1.2.0 → salla_gitpuller-1.2.1}/gitpuller/alert_manager.py +0 -0
- {salla_gitpuller-1.2.0 → salla_gitpuller-1.2.1}/gitpuller/gitpull.py +0 -0
- {salla_gitpuller-1.2.0 → salla_gitpuller-1.2.1}/gitpuller/state_manager.py +0 -0
- {salla_gitpuller-1.2.0 → salla_gitpuller-1.2.1}/gitpuller/utils.py +0 -0
- {salla_gitpuller-1.2.0 → salla_gitpuller-1.2.1}/salla_gitpuller.egg-info/SOURCES.txt +0 -0
- {salla_gitpuller-1.2.0 → salla_gitpuller-1.2.1}/salla_gitpuller.egg-info/dependency_links.txt +0 -0
- {salla_gitpuller-1.2.0 → salla_gitpuller-1.2.1}/salla_gitpuller.egg-info/requires.txt +0 -0
- {salla_gitpuller-1.2.0 → salla_gitpuller-1.2.1}/salla_gitpuller.egg-info/top_level.txt +0 -0
- {salla_gitpuller-1.2.0 → salla_gitpuller-1.2.1}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: salla_gitpuller
|
|
3
|
-
Version: 1.2.
|
|
3
|
+
Version: 1.2.1
|
|
4
4
|
Summary: A lightweight utility to git pull a repository using SSH deploy keys stored in environment variables
|
|
5
5
|
Author-email: Mohammed Junaid <safijunaid.ss@gmail.com>, Muhammad Zahid <zahidmuhammad127@gmail.com>
|
|
6
6
|
License: MIT
|
|
@@ -10,9 +10,6 @@ import requests
|
|
|
10
10
|
SLACK_POST_MESSAGE_URL = "https://slack.com/api/chat.postMessage"
|
|
11
11
|
SLACK_CONVERSATIONS_HISTORY_URL = "https://slack.com/api/conversations.history"
|
|
12
12
|
DEFAULT_SLACK_CHANNEL = "C05MLHR55JT"
|
|
13
|
-
|
|
14
|
-
# Unified across every Mage deployment — do not prefix with MAGE_WORKSPACE_NAME.
|
|
15
|
-
# One hash per channel per day; field = gitpuller workspace, value = Slack thread_ts.
|
|
16
13
|
REDIS_THREAD_KEY_PREFIX = "gitpuller:slack_thread"
|
|
17
14
|
REDIS_CREATE_LOCK_TTL_SECONDS = 120
|
|
18
15
|
REDIS_ERROR_MAX_CHARS = 1500
|
|
@@ -22,8 +19,16 @@ _redis_client = None
|
|
|
22
19
|
_redis_init_attempted = False
|
|
23
20
|
|
|
24
21
|
|
|
22
|
+
def _env(*names: str, default: str = "") -> str:
|
|
23
|
+
for name in names:
|
|
24
|
+
value = (os.environ.get(name) or "").strip()
|
|
25
|
+
if value:
|
|
26
|
+
return value
|
|
27
|
+
return default
|
|
28
|
+
|
|
29
|
+
|
|
25
30
|
def _get_redis_client():
|
|
26
|
-
"""
|
|
31
|
+
"""WP_REDIS_* env vars first, then Mage io_config.yaml, then REDIS_*."""
|
|
27
32
|
global _redis_client, _redis_init_attempted
|
|
28
33
|
if _redis_client is not None:
|
|
29
34
|
return _redis_client
|
|
@@ -37,27 +42,32 @@ def _get_redis_client():
|
|
|
37
42
|
print("⚠️ redis package not installed; Slack thread_ts will not persist across pods")
|
|
38
43
|
return None
|
|
39
44
|
|
|
40
|
-
host =
|
|
41
|
-
password = None
|
|
42
|
-
port = 6379
|
|
43
|
-
try:
|
|
44
|
-
from mage_ai.io.config import ConfigFileLoader
|
|
45
|
-
from mage_ai.settings.repo import get_repo_path
|
|
45
|
+
host = _env("WP_REDIS_HOST")
|
|
46
|
+
password = _env("WP_REDIS_PASSWORD") or None
|
|
47
|
+
port = int(_env("WP_REDIS_PORT") or "6379")
|
|
46
48
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
49
|
+
if not host:
|
|
50
|
+
try:
|
|
51
|
+
from mage_ai.io.config import ConfigFileLoader
|
|
52
|
+
from mage_ai.settings.repo import get_repo_path
|
|
53
|
+
|
|
54
|
+
loader = ConfigFileLoader(os.path.join(get_repo_path(), "io_config.yaml"), "default")
|
|
55
|
+
host = loader["REDIS_HOST"]
|
|
56
|
+
password = loader["REDIS_PASSWORD"] or None
|
|
57
|
+
port = int(loader["REDIS_PORT"])
|
|
58
|
+
except Exception:
|
|
59
|
+
host = None
|
|
53
60
|
|
|
54
61
|
if not host:
|
|
55
|
-
host = (
|
|
56
|
-
password = (
|
|
57
|
-
port = int(
|
|
62
|
+
host = _env("REDIS_HOST") or None
|
|
63
|
+
password = _env("REDIS_PASSWORD") or None
|
|
64
|
+
port = int(_env("REDIS_PORT") or "6379")
|
|
58
65
|
|
|
59
66
|
if not host:
|
|
60
|
-
print(
|
|
67
|
+
print(
|
|
68
|
+
"⚠️ Redis is not configured; Slack thread_ts will not persist across pods "
|
|
69
|
+
"(set WP_REDIS_HOST / WP_REDIS_PORT / WP_REDIS_PASSWORD)"
|
|
70
|
+
)
|
|
61
71
|
return None
|
|
62
72
|
|
|
63
73
|
try:
|
|
@@ -94,7 +104,11 @@ class SlackNotifier:
|
|
|
94
104
|
bot_token: Optional[str] = None,
|
|
95
105
|
channel: Optional[str] = None,
|
|
96
106
|
):
|
|
97
|
-
self.bot_token = (
|
|
107
|
+
self.bot_token = (
|
|
108
|
+
bot_token
|
|
109
|
+
or _env("WP_SLACK_DB_ALERTS_TOKEN", "CDM_PROD_SLACK_BOT_TOKEN")
|
|
110
|
+
or None
|
|
111
|
+
)
|
|
98
112
|
self.channel = (
|
|
99
113
|
(channel or os.environ.get("CDM_PROD_DB_SLACK_CHANNEL") or "").strip()
|
|
100
114
|
or DEFAULT_SLACK_CHANNEL
|
|
@@ -105,11 +119,11 @@ class SlackNotifier:
|
|
|
105
119
|
if not self.bot_token and not self.webhook_url:
|
|
106
120
|
print(
|
|
107
121
|
"⚠️ Slack not configured; skipping alerts "
|
|
108
|
-
"(set
|
|
122
|
+
"(set WP_SLACK_DB_ALERTS_TOKEN, or CDM_SLACK_WEBHOOK_URL as fallback)"
|
|
109
123
|
)
|
|
110
124
|
elif not self.bot_token:
|
|
111
125
|
print(
|
|
112
|
-
"⚠️
|
|
126
|
+
"⚠️ WP_SLACK_DB_ALERTS_TOKEN is not set; using webhook "
|
|
113
127
|
"(alerts will not be threaded)"
|
|
114
128
|
)
|
|
115
129
|
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "salla_gitpuller"
|
|
7
|
-
version = "1.2.
|
|
7
|
+
version = "1.2.1"
|
|
8
8
|
description = "A lightweight utility to git pull a repository using SSH deploy keys stored in environment variables"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
authors = [
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: salla_gitpuller
|
|
3
|
-
Version: 1.2.
|
|
3
|
+
Version: 1.2.1
|
|
4
4
|
Summary: A lightweight utility to git pull a repository using SSH deploy keys stored in environment variables
|
|
5
5
|
Author-email: Mohammed Junaid <safijunaid.ss@gmail.com>, Muhammad Zahid <zahidmuhammad127@gmail.com>
|
|
6
6
|
License: MIT
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{salla_gitpuller-1.2.0 → salla_gitpuller-1.2.1}/salla_gitpuller.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|