@misterhuydo/sentinel 1.4.64 → 1.4.66
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.
package/.cairn/.hint-lock
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
2026-03-
|
|
1
|
+
2026-03-25T16:26:53.611Z
|
package/.cairn/session.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
|
-
"message": "Auto-checkpoint at 2026-03-
|
|
3
|
-
"checkpoint_at": "2026-03-
|
|
2
|
+
"message": "Auto-checkpoint at 2026-03-25T16:15:37.097Z",
|
|
3
|
+
"checkpoint_at": "2026-03-25T16:15:37.098Z",
|
|
4
4
|
"active_files": [],
|
|
5
5
|
"notes": [],
|
|
6
6
|
"mtime_snapshot": {}
|
package/lib/generate.js
CHANGED
|
@@ -75,8 +75,8 @@ if [[ "$_claude_pro" != "false" ]]; then
|
|
|
75
75
|
fi
|
|
76
76
|
mkdir -p "$DIR/logs" "$WORKSPACE/logs" "$DIR/workspace/fetched" "$DIR/workspace/patches" "$DIR/issues"
|
|
77
77
|
cd "$DIR"
|
|
78
|
-
# Ensure npm-global bin (cairn-mcp, claude)
|
|
79
|
-
export PATH="$HOME/.npm-global/bin:$PATH"
|
|
78
|
+
# Ensure npm-global bin (cairn-mcp, claude) and ~/.local/bin (auto-installed tools) are on PATH
|
|
79
|
+
export PATH="$HOME/.npm-global/bin:$HOME/.local/bin:$PATH"
|
|
80
80
|
PYTHONPATH="${codeDir}" "${codeDir}/.venv/bin/python3" -m sentinel.main --config ./config \\
|
|
81
81
|
>> "$DIR/logs/sentinel.log" 2>&1 &
|
|
82
82
|
echo $! > "$PID_FILE"
|
package/package.json
CHANGED
|
@@ -6,6 +6,8 @@ triggered by the normal GitHub merge webhook.
|
|
|
6
6
|
"""
|
|
7
7
|
|
|
8
8
|
import logging
|
|
9
|
+
import re
|
|
10
|
+
from pathlib import Path
|
|
9
11
|
|
|
10
12
|
import requests
|
|
11
13
|
|
|
@@ -22,6 +24,8 @@ def trigger(repo: RepoConfig, store: StateStore, fingerprint: str) -> bool:
|
|
|
22
24
|
cicd_type = repo.cicd_type.lower()
|
|
23
25
|
if cicd_type == "jenkins":
|
|
24
26
|
return _trigger_jenkins(repo)
|
|
27
|
+
elif cicd_type in ("jenkins_release", "jenkins-release"):
|
|
28
|
+
return _trigger_jenkins_release(repo)
|
|
25
29
|
elif cicd_type in ("github_actions", "github-actions"):
|
|
26
30
|
return _trigger_github_actions(repo, fingerprint)
|
|
27
31
|
else:
|
|
@@ -34,12 +38,53 @@ def _trigger_jenkins(repo: RepoConfig) -> bool:
|
|
|
34
38
|
resp = requests.post(url, auth=("sentinel", repo.cicd_token), timeout=15)
|
|
35
39
|
success = resp.status_code in (200, 201, 204)
|
|
36
40
|
if success:
|
|
37
|
-
logger.info("Jenkins triggered: %s", repo.cicd_job_url)
|
|
41
|
+
logger.info("Jenkins build triggered: %s", repo.cicd_job_url)
|
|
38
42
|
else:
|
|
39
43
|
logger.error("Jenkins trigger failed (%s): %s", resp.status_code, resp.text[:200])
|
|
40
44
|
return success
|
|
41
45
|
|
|
42
46
|
|
|
47
|
+
def _trigger_jenkins_release(repo: RepoConfig) -> bool:
|
|
48
|
+
# Maven Release Plugin — POST to /m2release/submit with release + dev versions
|
|
49
|
+
release_ver, dev_ver = _maven_release_versions(repo.local_path)
|
|
50
|
+
url = f"{repo.cicd_job_url.rstrip('/')}/m2release/submit"
|
|
51
|
+
resp = requests.post(
|
|
52
|
+
url,
|
|
53
|
+
auth=(repo.cicd_user or "sentinel", repo.cicd_token),
|
|
54
|
+
data={
|
|
55
|
+
"releaseVersion": release_ver,
|
|
56
|
+
"developmentVersion": dev_ver,
|
|
57
|
+
"isDryRun": "false",
|
|
58
|
+
"specifyScmCredentials": "false",
|
|
59
|
+
"specifyCustomScmCommentPrefix": "false",
|
|
60
|
+
"specifyCustomScmTag": "false",
|
|
61
|
+
},
|
|
62
|
+
timeout=15,
|
|
63
|
+
)
|
|
64
|
+
success = resp.status_code in (200, 201, 204)
|
|
65
|
+
if success:
|
|
66
|
+
logger.info("Jenkins Maven Release triggered: %s → %s (next: %s)", repo.cicd_job_url, release_ver, dev_ver)
|
|
67
|
+
else:
|
|
68
|
+
logger.error("Jenkins release trigger failed (%s): %s", resp.status_code, resp.text[:200])
|
|
69
|
+
return success
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
def _maven_release_versions(local_path: str) -> tuple[str, str]:
|
|
73
|
+
"""Read current SNAPSHOT version from pom.xml and compute release + next dev versions."""
|
|
74
|
+
pom = Path(local_path) / "pom.xml"
|
|
75
|
+
if not pom.exists():
|
|
76
|
+
return ("", "")
|
|
77
|
+
text = pom.read_text(encoding="utf-8", errors="ignore")
|
|
78
|
+
m = re.search(r"<version>(\d+\.\d+\.\d+)-SNAPSHOT</version>", text)
|
|
79
|
+
if not m:
|
|
80
|
+
return ("", "")
|
|
81
|
+
parts = m.group(1).split(".")
|
|
82
|
+
release_ver = m.group(1) # e.g. 3.0.11
|
|
83
|
+
next_patch = int(parts[2]) + 1
|
|
84
|
+
dev_ver = f"{parts[0]}.{parts[1]}.{next_patch}-SNAPSHOT" # e.g. 3.0.12-SNAPSHOT
|
|
85
|
+
return release_ver, dev_ver
|
|
86
|
+
|
|
87
|
+
|
|
43
88
|
def _trigger_github_actions(repo: RepoConfig, fingerprint: str) -> bool:
|
|
44
89
|
owner_repo = _owner_repo(repo.repo_url)
|
|
45
90
|
url = f"https://api.github.com/repos/{owner_repo}/dispatches"
|
|
@@ -106,6 +106,7 @@ class RepoConfig:
|
|
|
106
106
|
auto_publish: bool = False
|
|
107
107
|
cicd_type: str = ""
|
|
108
108
|
cicd_job_url: str = ""
|
|
109
|
+
cicd_user: str = "" # Jenkins username for Basic auth (defaults to "sentinel")
|
|
109
110
|
health_url: str = "" # optional: HTTP endpoint returning {"Status": "true"}
|
|
110
111
|
cicd_token: str = ""
|
|
111
112
|
ssh_key_file: str = "" # path to SSH private key; sets GIT_SSH_COMMAND when present
|
|
@@ -238,6 +239,7 @@ class ConfigLoader:
|
|
|
238
239
|
r.auto_publish = d.get("AUTO_PUBLISH", "false").lower() == "true"
|
|
239
240
|
r.cicd_type = d.get("CICD_TYPE", "")
|
|
240
241
|
r.cicd_job_url = d.get("CICD_JOB_URL", "")
|
|
242
|
+
r.cicd_user = d.get("CICD_USER", "")
|
|
241
243
|
r.cicd_token = d.get("CICD_TOKEN", "")
|
|
242
244
|
r.health_url = d.get("HEALTH_URL", "")
|
|
243
245
|
r.ssh_key_file = os.path.expanduser(d.get("SSH_KEY_FILE", ""))
|