@misterhuydo/sentinel 1.4.37 → 1.4.39
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 +1 -1
- package/.cairn/session.json +2 -2
- package/package.json +1 -1
- package/python/sentinel/main.py +5 -1
- package/python/sentinel/notify.py +36 -0
package/.cairn/.hint-lock
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
2026-03-25T07:
|
|
1
|
+
2026-03-25T07:51:06.248Z
|
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-25T08:01:16.107Z",
|
|
3
|
+
"checkpoint_at": "2026-03-25T08:01:16.109Z",
|
|
4
4
|
"active_files": [],
|
|
5
5
|
"notes": [],
|
|
6
6
|
"mtime_snapshot": {}
|
package/package.json
CHANGED
package/python/sentinel/main.py
CHANGED
|
@@ -29,7 +29,7 @@ from .log_parser import parse_all, scan_all_for_markers, ErrorEvent
|
|
|
29
29
|
from .issue_watcher import scan_issues, mark_done, IssueEvent
|
|
30
30
|
from .repo_router import route
|
|
31
31
|
from .reporter import build_and_send, send_fix_notification, send_failure_notification, send_confirmed_notification, send_regression_notification, send_startup_notification, send_upgrade_notification
|
|
32
|
-
from .notify import notify_fix_blocked
|
|
32
|
+
from .notify import notify_fix_blocked, notify_fix_applied
|
|
33
33
|
from .health_checker import evaluate_repos
|
|
34
34
|
from .state_store import StateStore
|
|
35
35
|
|
|
@@ -235,6 +235,10 @@ async def _handle_issue(event: IssueEvent, cfg_loader: ConfigLoader, store: Stat
|
|
|
235
235
|
"auto_publish": repo.auto_publish,
|
|
236
236
|
"files_changed": [],
|
|
237
237
|
})
|
|
238
|
+
submitter_uid = getattr(event, "submitter_user_id", "")
|
|
239
|
+
notify_fix_applied(sentinel, event.source, event.message,
|
|
240
|
+
repo_name=repo.repo_name, branch=branch, pr_url=pr_url,
|
|
241
|
+
submitter_user_id=submitter_uid)
|
|
238
242
|
mark_done(event.issue_file)
|
|
239
243
|
|
|
240
244
|
if repo.auto_publish:
|
|
@@ -228,6 +228,42 @@ def notify_fix_blocked(
|
|
|
228
228
|
logger.warning("notify_fix_blocked: email notification failed: %s", exc)
|
|
229
229
|
|
|
230
230
|
|
|
231
|
+
def notify_fix_applied(
|
|
232
|
+
cfg,
|
|
233
|
+
source: str,
|
|
234
|
+
message: str,
|
|
235
|
+
repo_name: str,
|
|
236
|
+
branch: str,
|
|
237
|
+
pr_url: str,
|
|
238
|
+
submitter_user_id: str = "",
|
|
239
|
+
) -> None:
|
|
240
|
+
"""
|
|
241
|
+
DM the submitter (if known) that their issue was fixed.
|
|
242
|
+
Falls back to posting in the Slack channel if no submitter.
|
|
243
|
+
"""
|
|
244
|
+
repo_line = f" in *{repo_name}*" if repo_name else ""
|
|
245
|
+
if pr_url:
|
|
246
|
+
action_line = f":arrow_right: <{pr_url}|Review PR>"
|
|
247
|
+
elif branch:
|
|
248
|
+
action_line = f":arrow_right: Pushed to `{branch}`"
|
|
249
|
+
else:
|
|
250
|
+
action_line = ""
|
|
251
|
+
|
|
252
|
+
slack_text = (
|
|
253
|
+
f":white_check_mark: *Fix applied{repo_line}*\n"
|
|
254
|
+
f"*Issue:* {message[:200]}\n"
|
|
255
|
+
+ (f"{action_line}\n" if action_line else "")
|
|
256
|
+
).rstrip()
|
|
257
|
+
|
|
258
|
+
if submitter_user_id:
|
|
259
|
+
slack_dm(cfg.slack_bot_token, submitter_user_id, slack_text)
|
|
260
|
+
# Also mention them in the channel
|
|
261
|
+
channel_text = f"<@{submitter_user_id}> {slack_text}"
|
|
262
|
+
slack_alert(cfg.slack_bot_token, cfg.slack_channel, channel_text)
|
|
263
|
+
else:
|
|
264
|
+
slack_alert(cfg.slack_bot_token, cfg.slack_channel, slack_text)
|
|
265
|
+
|
|
266
|
+
|
|
231
267
|
def alert_if_rate_limited(
|
|
232
268
|
bot_token: str,
|
|
233
269
|
channel: str,
|