fix: shorten PR walkthrough links and align shell branding (#2954)

This commit is contained in:
Carlos Florêncio
2026-08-23 13:39:07 +00:00
committed by GitHub
parent fff55f0579
commit b15bf00783
16 changed files with 389 additions and 71 deletions
+5 -1
View File
@@ -12,6 +12,7 @@ from typing import Any
START_MARKER = "<!-- kandev-pr-walkthrough-start -->"
END_MARKER = "<!-- kandev-pr-walkthrough-end -->"
SHA_PATTERN = re.compile(r"^[0-9a-f]{40}$")
PUBLIC_SHA_LENGTH = 12
UNCHANGED = 3
@@ -49,7 +50,10 @@ def validate_url(url: str, pr_number: int, head_sha: str) -> None:
raise ValueError("pull request number must be positive")
if not SHA_PATTERN.fullmatch(head_sha):
raise ValueError("head SHA must be 40 lowercase hexadecimal characters")
expected = f"https://walkthrough.kandev.ai/pr/{pr_number}/{head_sha}.html"
expected = (
"https://walkthrough.kandev.ai/"
f"pr/{pr_number}/{head_sha[:PUBLIC_SHA_LENGTH]}.html"
)
if url != expected:
raise ValueError(f"expected walkthrough URL {expected}")
+3 -2
View File
@@ -11,8 +11,9 @@ import unittest
REPO_ROOT = Path(__file__).resolve().parent.parent
SCRIPT = REPO_ROOT / "scripts" / "pr-walkthrough-pr-body"
PR_NUMBER = 2906
HEAD_SHA = "a" * 40
URL = f"https://walkthrough.kandev.ai/pr/{PR_NUMBER}/{HEAD_SHA}.html"
HEAD_SHA = "0123456789abcdef0123456789abcdef01234567"
SHORT_HEAD_SHA = HEAD_SHA[:12]
URL = f"https://walkthrough.kandev.ai/pr/{PR_NUMBER}/{SHORT_HEAD_SHA}.html"
START = "<!-- kandev-pr-walkthrough-start -->"
END = "<!-- kandev-pr-walkthrough-end -->"