fix(tools): read multi-line Depends on lists in pr_overlap #819
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/819"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by ebosido444-ai on 2026-10-06T06:37:17Z.
What
The capture continues over consecutive
- #N/* #Nlist items only (dashes or asterisks), so- PR #12,1. #12, or a paragraph break before the list are not read — matching the template's list form.Tested
Windows 11, Python 3.14 (no build). Assert checks: list form
Depends on:\n- #12\n- #13yields{12, 13}(was{}), single-line form unchanged, theDepends on: nonetemplate row andDepends on: <!-- #PR, or none -->yield no dependencies (no false#Nfrom the#PRplaceholder). Exact reproducer (run at6a42906; onmainwithout the fix asserts 1–2 fail — both lists read as{}):Assert results:
Checklist
main; no other open PR implements the same functions.mdfiles or images added to the repositoryImported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-06T09:27:41Z.
Good catch on the list form. There's one problem with the new pattern: PR bodies written in the GitHub web editor are stored with CRLF line endings. 31 of the 106 open PRs have them. For those bodies
\n\nnever matches\r\n\r\n, so the capture runs to the end of the body. Any#Nwritten after the checklist then counts as a dependency and hides the overlap row for that pair. #811's body is an example: the capture continues into the paragraph after its checklist. No open PR's dependency set changes today, so the bug is latent for now, but a hidden overlap is the failure the tool exists to catch.Capturing the line plus any following list items that start with
#Nhandles both forms without touching the rest of the body:That pattern gives
{12, 13}forDepends on:\n- #12\n- #13, for the CRLF and indented checklist variants, and forDepends on: #12, #13. It gives nothing fornone, the template's "#PR, or none" placeholder comment, or a#700in a later paragraph. On the current open PRs it gives the same sets asmain.Imported from boykopovar/AnyPS5. Originally posted by ebosido444-ai on 2026-10-06T09:50:31Z.
Applied your CRLF-safe pattern verbatim (
999da59a). Behaviour matrix re-run against the file line on the branch, samples built with explicit CR/LF so no escape can lie: list form LF {12,13}, list form CRLF with a later #700 paragraph {12,13}, indented star form {12}, single-line {12,13}, none {}, template placeholder {}, later-paragraph #700 ignored {}. 7/7. Thanks for catching the CRLF class — 31/106 bodies would have been poisoned quietly.Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-07T16:08:18Z.
Review: CHANGES_REQUESTED
Checked the new
DEPENDSpattern against LF and CRLF bodies (template row + list, bare list, single line,none,#PRplaceholder, later#Nparagraph): all read as described. One thing to fix:tools/pr_overlap.py:11: the pattern is now a plain string literal containing\d, which emitsSyntaxWarning: invalid escape sequence '\d'(aSyntaxErrorin future Python versions). Keep it a raw string, as the original was:re.compile(r'Depends on:...').Minor, optional: the description says the capture runs "until a blank line", but the regex only continues over
- #N/* #Nitems, so- PR #12,1. #12or a blank line before the list are not read. Either describe it that way or widen the item pattern.Imported from boykopovar/AnyPS5. Originally posted by ebosido444-ai on 2026-10-07T17:49:56Z.
Both handled (
5a4d8b6f): the pattern is a raw string again (re.compile(r'...')) with the 7-case behaviour matrix re-run green and a warning-trip assertion (any invalid-escape SyntaxWarning fails the check); and the description now says what the regex really does — continuation over consecutive- #N/* #Nlist items only, not blanket until-a-blank-line. Kept the narrower item pattern rather than widening to- PR #12forms, per your either/or.Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-07T20:03:29Z.
Review: APPROVED
Checked the new
DEPENDSpattern on the PR head (merged onto currentmain) withpython -W error(noSyntaxWarning): LF and CRLF bodies with a later#Nparagraph, template row + list, single-line form,none, the#PRplaceholder and an indented*list all read as described. CI is green; merging.