feat(robomp): accept github issue urls in manual triage

parse_issue_ref now accepts owner/repo#NN or a github issue url (with or without scheme, www., trailing slash, query, fragment). The dashboard trigger, CLI, and replay endpoint pick this up automatically; UI hints updated to match.
This commit is contained in:
can1357
2026-05-25 19:33:39 +02:00
parent d351512b2b
commit aca68ad3a9
3 changed files with 39 additions and 7 deletions
+25 -1
View File
@@ -271,8 +271,32 @@ def test_parse_issue_ref_accepts_owner_repo_hash_number() -> None:
assert parse_issue_ref(" octo/widget#42 ") == ("octo/widget", 42)
def test_parse_issue_ref_accepts_github_issue_urls() -> None:
cases = (
"https://github.com/can1357/oh-my-pi/issues/1348",
"http://github.com/can1357/oh-my-pi/issues/1348",
"github.com/can1357/oh-my-pi/issues/1348",
"https://www.github.com/can1357/oh-my-pi/issues/1348",
"https://github.com/can1357/oh-my-pi/issues/1348/",
"https://github.com/can1357/oh-my-pi/issues/1348?foo=bar",
"https://github.com/can1357/oh-my-pi/issues/1348#issuecomment-99",
" https://github.com/can1357/oh-my-pi/issues/1348 ",
)
for case in cases:
assert parse_issue_ref(case) == ("can1357/oh-my-pi", 1348), case
def test_parse_issue_ref_rejects_garbage() -> None:
for bad in ("widget#1", "octo/widget", "octo/widget#abc", "octo widget#1", ""):
for bad in (
"widget#1",
"octo/widget",
"octo/widget#abc",
"octo widget#1",
"",
"https://github.com/octo/widget/pull/1",
"https://github.com/octo/widget/issues/",
"https://gitlab.com/octo/widget/issues/1",
):
with pytest.raises(InvalidIssueRef):
parse_issue_ref(bad)