Skip to content

🐛 [fix] github-read, approval: diff line splitting and non-default-base links - #67

Merged
EricTechPro merged 2 commits into
mainfrom
fix/github-read-approval
Oct 19, 2026
Merged

EricTechPro merged 2 commits into
mainfrom
fix/github-read-approval

Conversation

@EricTechPro

Copy link
Copy Markdown
Owner

Note

⏳ In review · round 1 · ✅ 4/4 AC · Closes #62 · Closes #63

Problem

Solution

  • github-read splits a diff on \n only; splitlines() also broke on VT, FF, U+2028 and friends
  • github-read decodes gh output by hand; text=True universal newlines turned a lone \r into \n
  • approval reads baseRefName, body and defaultBranchRef in the same head-pinned snapshot
  • Off the default base, approval also takes same-repo close/fix/resolve #N references from the body; other-repo refs are ignored

Acceptance criteria

  • A diff with VT, FF, FS, NEL, U+2028/9, a lone CR and CRLF in changed lines passes on the first read
    ↳ tests/test_github_reads.py test_diff_lines_with_line_like_characters_are_complete_evidence (fails on main)
  • A PR into a non-default base with Closes #N in its body approves
    ↳ tests/test_approval.py test_non_default_base_takes_closing_keywords_from_body (fails on main)
  • No keyword, other-repo refs and default-base body keywords still do not link
    ↳ tests/test_approval.py GitHubTests non-default/default-base cases
  • Offline suite green
    ↳ bash tests/run-safety.sh → PASS: 57 safety suites

Iteration history

Lane Done Time Details
🔨 builder ✅ Oct 18 bfbef1c #62 · 9802af6 #63

Risk

🟢 Low · diff validation only gets more permissive about in-line characters; approval adds a body fallback only when base differs from default, all other checks unchanged. Closing-keyword parsing still exists separately in the merge gate and pre-flight (not unified here).

Closes #62
Closes #63

🤖 Generated with Claude Code

EricTechPro and others added 2 commits October 18, 2026 11:19
- validate() split with splitlines(), which also breaks on VT, FF, FS/GS/RS, NEL, U+2028/9, so valid diffs read as 'diff hunk data missing' and halted the board
- read() ran gh with text=True; universal newlines turned a lone \r into \n; decode stdout/stderr by hand instead
- regression test: a diff whose changed lines hold those characters and a lone CR is complete evidence

Closes #62

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
- GitHub fills closingIssuesReferences only for PRs into the default branch, so a done reply on a PR into e.g. staging was refused as 'request issue is not linked to this PR'
- read baseRefName, body and defaultBranchRef in the same head-pinned snapshot; off the default base, also take same-repo close/fix/resolve #N references from the body
- other-repo references are ignored; trust, permission, pinned-head and newest-request checks are unchanged
- regression tests for body keywords, no keyword, other-repo refs and default-base behaviour; GraphQL stubs carry the new fields

Closes #63

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@qodo-code-review

Copy link
Copy Markdown

Qodo reviews are paused for this user.

Troubleshooting steps vary by plan Learn more →

On a Teams plan?
Reviews resume once this user has a paid seat and their Git account is linked in Qodo.
Link Git account →

Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center?
These require an Enterprise plan - Contact us
Contact us →

@EricTechPro
EricTechPro merged commit 419f5e3 into main Oct 19, 2026
13 checks passed
@EricTechPro
EricTechPro deleted the fix/github-read-approval branch October 19, 2026 06:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant