Repository navigation
fix(watch-pr): exclude fork PRs from child stack walk and sanitize terminal lines - #1194
Open
mangeshraut712 wants to merge 1 commit into
Open
mangeshraut712 wants to merge 1 commit into
mangeshraut712 wants to merge 1 commit into
Conversation
…rminal lines Exclude cross-repository PRs from children in orderStack so fork PRs cannot be attached to upstream stack branches during stack discovery. Sanitize review comment body text, file paths, and author logins in threadLine to strip ANSI escape sequences and C0/C1 control characters before rendering to the terminal. Fixes cursor#1193 Signed-off-by: Mangesh Raut <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This resolves both issues reported in #1193:
Exclude fork PRs from child stack discovery (
github.ts):orderStackpreviously built thechildrenmap from every open pull request (for (const pr of open)), allowing cross-repository (fork) PRs whose base ref matched an upstream branch to be indexed as children. AlthoughbyHeadexcluded fork PRs for downwards resolution, a fork PR targeting an upstream stack branch would still be traversed and pushed toup.pr.isCrossRepositorywhen building thechildrenmap (if (pr.isCrossRepository) continue;).visit:if (child.isCrossRepository) continue;.does not attach a fork PR as a child of a stack branchingithub.test.ts.Sanitize terminal blocker output (
render.ts):Review thread paths, author logins, and comment bodies rendered in blocker summaries could contain ANSI escape sequences (e.g.
\x1b[2K,\r, or formatting sequences) and control characters.sanitizeTextto strip ANSI escape sequences (/\\x1b\\[[0-9;]*[a-zA-Z]/g) and C0/C1 control characters (/[\\x00-\\x1f\\x7f-\\x9f]/g).path,authorLogin, andbodyLineinthreadLine.bodyLinebefore slicing to at most 180 characters.sanitizes review thread paths, authors, and comment bodies in blocker outputincli.test.ts.Harness Generation:
Regenerated
harness/pstack/claude-code/tree vianode scripts/generate-pstack-harness-trees.mjs.Verification
tsc --project watch-pr/tsconfig.json --noEmit --strict: 0 errors.bun test watch-pr: 56/56 passing (160 expectations).node scripts/generate-pstack-harness-trees.mjs --check: up to date.node scripts/validate-plugins.mjs: all plugins validated successfully.node scripts/check-pstack-docs.mjs: 0 problems.git diff --check: 0 errors.Fixes #1193