fix(hermes): use partition instead of a magic length comparison
All checks were successful
Tests / Declarative: Post Actions passed: 1387

PLR2004. Pushed the previous commit with this gate failing - my check ran all
four gates in one block and the output of the passing ones scrolled the failure
off. Running them separately is the fix for that, not running them faster.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
codex 2026-08-07 00:05:56 -03:00
parent ee902354c2
commit 01759e309a

View File

@ -171,10 +171,10 @@ def issue_url(incident_id: str, ui_url: str) -> str:
text = str(incident_id or "")
if not base or not text.startswith(INCIDENT_PREFIX):
return ""
parts = text[len(INCIDENT_PREFIX) :].split("/", 1)
if len(parts) != 2 or not parts[0].strip() or not parts[1].strip():
project, separator, key = text[len(INCIDENT_PREFIX) :].partition("/")
if not separator or not project.strip() or not key.strip():
return ""
return base + _ISSUE_PATH.format(project=parts[0].strip(), key=parts[1].strip())
return base + _ISSUE_PATH.format(project=project.strip(), key=key.strip())
def _types(cfg: dict) -> tuple[str, ...]: