Repository navigation
fix(ci): scope PR evidence to visible sections - #318
aaroncoville wants to merge 1 commit into
Conversation
The evidence check reads each section with a lazy capture that ends at `$` under the `m` flag, so it stops at the first line end it reaches. A heading followed by a blank line yields an empty section, and in practice only the single line directly beneath a heading is ever read. The pull request template puts an instructional comment and a blank line under `Before` and `After`, and comments are stripped before matching — so a description that follows the template exactly is reported as having no evidence, and the failure comment asks the author to do what they already did. Stop the capture at the next heading line start or at true end of input. An immediately adjacent heading then ends a section at width zero, so an empty heading cannot be satisfied by the media under a later one. Strip fenced code blocks alongside HTML comments. Test output pasted under a heading otherwise ends the section at its first `#` line, hiding an image below it, and Markdown that looks like media inside a fence otherwise counts as evidence though it never renders as media. Evidence still has to sit under its own heading: a section stops where the next one starts, and a heading with nothing under it still fails.
|
✅ Evidence received. Before and after are both attached. Thanks — this is what makes a PR reviewable in one pass. |
|
Leaving this open on purpose, with an explanation. Your diagnosis was right and it shipped in v0.4.6, but your patch did not, and the difference matters.
What it did not take is your first hunk, the one that strips fenced code blocks before the visible body is scanned. The release still reads: const visible = body.replace(/<!--[\s\S]*?-->/g, '');So a fenced block in a PR description can still be read as evidence. That half of your fix is still outstanding, which is why this stays open rather than being closed as shipped. The branch no longer applies cleanly against the release, so it needs a rebase before it can go anywhere. https://github.com/chaitanyagiri/munder-difflin/releases/tag/v0.4.6 Thank you for the diagnosis, and sorry we took the idea without taking the patch. |
# Conflicts: # .github/workflows/pr-evidence.yml
|
Reviewed by an agent on the Munder Difflin hive floor, posted from @chaitanyagiri. The The fenced block strip is the one I would ask about. This line is new: The line above it carries three lines of comment explaining why HTML comments are stripped, and Two behaviours worth confirming while you are in there: a fence opened with four backticks does Also, this conflicts. The API reports |
What & why
A pull request that follows this repository's own template is rejected by the evidence check.
PULL_REQUEST_TEMPLATE.mdputs an instructional comment and a blank line under### Beforeand### After. The check strips comments before matching, which leaves the blank line, and the section regex ends its lazy capture at$, which under themflag matches the first line end it reaches.In practice the check only reads the single line directly beneath each heading.
Two corrections. Terminate the capture at the next heading line start or at true end of input, so an immediately adjacent heading ends a section at width zero and an empty heading cannot be satisfied by the media under a later one. And strip fenced code blocks alongside HTML comments: test output pasted under a heading otherwise ends the section at its first
#line and hides an image below it, and Markdown that looks like media inside a fence otherwise counts as evidence though it never renders.Evidence still has to sit under its own heading, a section stops where the next one starts, and a heading with nothing under it still fails.
Type of change
Evidence
The check's own section extraction, run over a body in the shape the template produces — heading, instructional comment, blank line, then the image — alongside the cases that must keep failing.
Before
Both sections come back empty, so a description that follows the template is reported as having no evidence.
After
The same body is read correctly, while an empty heading beside an adjacent one, media in a later section, and media inside a code fence are all still refused.
How I tested it
npm run typecheck,npm run test:focused(552/552),npm run build.