mirror of
https://github.com/pewdiepie-archdaemon/odysseus.git
synced 2026-09-16 12:48:05 +00:00
fix(ci): match the screenshot checkbox by wording, not emphasis (#6073)
Some checks failed
CI / Focused test guidance (report-only) (push) Has been cancelled
CI / Python syntax (compileall) (push) Has been cancelled
CI / JS syntax (node --check) (push) Has been cancelled
CI / Python tests (pytest) (push) Has been cancelled
CodeQL / Analyze (actions) (push) Has been cancelled
CodeQL / Analyze (javascript-typescript) (push) Has been cancelled
CodeQL / Analyze (python) (push) Has been cancelled
ci / docker publish / build (amd64) (push) Has been cancelled
ci / docker publish / build (arm64) (push) Has been cancelled
ci / docker publish / merge manifest + tag (push) Has been cancelled
Some checks failed
CI / Focused test guidance (report-only) (push) Has been cancelled
CI / Python syntax (compileall) (push) Has been cancelled
CI / JS syntax (node --check) (push) Has been cancelled
CI / Python tests (pytest) (push) Has been cancelled
CodeQL / Analyze (actions) (push) Has been cancelled
CodeQL / Analyze (javascript-typescript) (push) Has been cancelled
CodeQL / Analyze (python) (push) Has been cancelled
ci / docker publish / build (amd64) (push) Has been cancelled
ci / docker publish / build (arm64) (push) Has been cancelled
ci / docker publish / merge manifest + tag (push) Has been cancelled
The PR-description check folded the template's asterisks into the pattern, so a ticked box written without them read as unchecked while rendering identically on the PR page. `ready for review` was silently withheld and the bot reported missing visual evidence even with screenshots attached, with no way to tell from the rendered PR what was wrong. The two attestations directly above it already anchor on the wording alone. This one now does the same, accepting `**bold**`, `*italic*`, `__underscores__` and plain text. Fixes #6071
This commit is contained in:
parent
d5514da3ab
commit
cc42f38a89
2 changed files with 19 additions and 1 deletions
6
.github/scripts/check-pr-description.js
vendored
6
.github/scripts/check-pr-description.js
vendored
|
|
@ -96,7 +96,11 @@ module.exports = async ({ github, context, core }) => {
|
|||
|
||||
const appRan = /- \[x\]\s+I actually ran the app\b/i.test(body);
|
||||
const appNotRun = /- \[x\]\s+I did not run the app\/runtime validation\b/i.test(body);
|
||||
const screenshotChecked = /- \[x\]\s+\*\*Screenshot or short clip\*\*/i.test(body);
|
||||
// Anchor on the wording, not the template's emphasis: a ticked box the author
|
||||
// retyped without the surrounding ** renders identically on the PR page, so
|
||||
// treating it as unchecked is invisible from their side. Matches the two
|
||||
// attestations above, which already ignore formatting.
|
||||
const screenshotChecked = /- \[x\]\s+[*_]{0,2}Screenshot or short clip[*_]{0,2}/i.test(body);
|
||||
const screenshotSection = section('Screenshots / clips');
|
||||
const hasVisualEvidence = /!\[[^\]]*\]\([^)]+\)|<(?:img|video|source)\b[^>]*(?:src|href)=|https?:\/\/[^\s)]+/i.test(screenshotSection);
|
||||
const evidenceGaps = [];
|
||||
|
|
|
|||
|
|
@ -169,6 +169,20 @@ def test_ui_checkbox_without_media_still_needs_visual_evidence():
|
|||
assert not any(call["method"] == "setFailed" for call in calls)
|
||||
|
||||
|
||||
def test_ticked_screenshot_box_counts_without_the_template_bolding():
|
||||
body = _body(
|
||||
app_ran=True,
|
||||
screenshot=True,
|
||||
media="https://github.com/user-attachments/assets/example",
|
||||
).replace("**Screenshot or short clip**", "Screenshot or short clip")
|
||||
|
||||
calls = _run_checker(["static/js/example.js"], body)
|
||||
|
||||
assert _added_labels(calls) == {"ready for review"}
|
||||
assert not _comment(calls)
|
||||
assert not any(call["method"] == "setFailed" for call in calls)
|
||||
|
||||
|
||||
def test_explicit_not_run_is_honest_but_not_ready():
|
||||
calls = _run_checker(
|
||||
["services/example.py"],
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue