@misterhuydo/sentinel 1.5.34 → 1.5.35
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/package.json +1 -1
- package/python/sentinel/__init__.py +1 -1
- package/python/sentinel/main.py +19 -11
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
__version__ = "1.5.
|
|
1
|
+
__version__ = "1.5.35"
|
package/python/sentinel/main.py
CHANGED
|
@@ -415,17 +415,25 @@ async def _handle_issue(event: IssueEvent, cfg_loader: ConfigLoader, store: Stat
|
|
|
415
415
|
elif len(cfg_loader.repos) == 1:
|
|
416
416
|
repo = next(iter(cfg_loader.repos.values()))
|
|
417
417
|
else:
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
418
|
+
# Try to infer repo from message content (e.g. "Service: STS" in bot alerts)
|
|
419
|
+
from .slack_bot import _infer_target_repo
|
|
420
|
+
inferred = _infer_target_repo(event.body, cfg_loader.repos)
|
|
421
|
+
if inferred:
|
|
422
|
+
repo = cfg_loader.repos[inferred]
|
|
423
|
+
logger.info("Auto-routed %s → %s (inferred from content)", event.source, inferred)
|
|
424
|
+
else:
|
|
425
|
+
logger.warning(
|
|
426
|
+
"Cannot auto-route %s -- add 'TARGET_REPO: <repo>' as first line in the file",
|
|
427
|
+
event.source,
|
|
428
|
+
)
|
|
429
|
+
_route_alert(
|
|
430
|
+
sentinel.slack_bot_token, _origin_ch,
|
|
431
|
+
f":warning: *Issue routing failed*{' — ' + '<@' + _submitter_id + '>' if _submitter_id else ''}\n"
|
|
432
|
+
f"Multiple repos configured — add `TARGET_REPO: <repo-name>` to the issue.\n"
|
|
433
|
+
f"_{event.message[:120]}_",
|
|
434
|
+
)
|
|
435
|
+
mark_done(event.issue_file) # archive so it doesn't re-prompt every poll
|
|
436
|
+
return
|
|
429
437
|
|
|
430
438
|
auto_commit = resolve_auto_commit(repo, sentinel)
|
|
431
439
|
auto_release = resolve_auto_release(repo, sentinel)
|