hermes: match canonical Forgejo PR URL
This commit is contained in:
parent
cf3e46c2b6
commit
2c1d97e551
@ -337,13 +337,12 @@ def _require_create_response(
|
|||||||
raise PolicyError("Forgejo omitted a valid pull-request number")
|
raise PolicyError("Forgejo omitted a valid pull-request number")
|
||||||
full_name = f"{ALLOWED_OWNER}/{repo}"
|
full_name = f"{ALLOWED_OWNER}/{repo}"
|
||||||
expected_html = f"{CANONICAL_BASE_URL}/{full_name}/pulls/{number}"
|
expected_html = f"{CANONICAL_BASE_URL}/{full_name}/pulls/{number}"
|
||||||
expected_api = f"{CANONICAL_BASE_URL}/api/v1/repos/{full_name}/pulls/{number}"
|
|
||||||
checks = (
|
checks = (
|
||||||
document.get("state") == "open",
|
document.get("state") == "open",
|
||||||
document.get("draft") is True,
|
document.get("draft") is True,
|
||||||
document.get("merged") is False,
|
document.get("merged") is False,
|
||||||
document.get("html_url") == expected_html,
|
document.get("html_url") == expected_html,
|
||||||
document.get("url") == expected_api,
|
document.get("url") == expected_html,
|
||||||
document.get("title") == title,
|
document.get("title") == title,
|
||||||
document.get("body") == body,
|
document.get("body") == body,
|
||||||
_nested(document, "base", "ref") == base,
|
_nested(document, "base", "ref") == base,
|
||||||
|
|||||||
@ -43,7 +43,7 @@ def _draft_response(**updates):
|
|||||||
"draft": True,
|
"draft": True,
|
||||||
"merged": False,
|
"merged": False,
|
||||||
"html_url": "https://scm.bstein.dev/atlas/cassandra/pulls/3",
|
"html_url": "https://scm.bstein.dev/atlas/cassandra/pulls/3",
|
||||||
"url": "https://scm.bstein.dev/api/v1/repos/atlas/cassandra/pulls/3",
|
"url": "https://scm.bstein.dev/atlas/cassandra/pulls/3",
|
||||||
"title": "WIP: Focused fix",
|
"title": "WIP: Focused fix",
|
||||||
"body": "Review evidence",
|
"body": "Review evidence",
|
||||||
"base": {"ref": "main", "repo": {"full_name": "atlas/cassandra"}},
|
"base": {"ref": "main", "repo": {"full_name": "atlas/cassandra"}},
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user