Avoid upstream GitHub cross-reference notifications in digest issues#274
Open
brianluby wants to merge 2 commits into
Open
Avoid upstream GitHub cross-reference notifications in digest issues#274brianluby wants to merge 2 commits into
brianluby wants to merge 2 commits into
Conversation
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Prevents generated digest GitHub Issues from creating upstream cross-reference noise by defanging upstream references before posting.
Changes:
- Add
defangGitHubNotifications()to rewrite upstream GitHub issue/PR URLs,owner/repo#123references, and@usermentions in the Issue body. - Apply defanging in
createGitHubIssue()prior to enforcing the GitHub Issue body length limit. - Document the behavior in both English and Chinese READMEs.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| src/github.ts | Adds and applies defanging logic to prevent upstream notification cross-references from posted digest issue bodies. |
| README.md | Documents that posted GitHub Issues defang upstream links while repo Markdown/UI keeps normal links. |
| README.zh.md | Same documentation update for Chinese README. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+187
to
+195
| function defangGitHubNotifications(body: string): string { | ||
| return body | ||
| .replace( | ||
| /https?:\/\/(?:www\.)?github\.com\/([A-Za-z0-9_.-]+)\/([A-Za-z0-9_.-]+)\/(issues|pull)\/(\d+)/g, | ||
| (_match, owner: string, repo: string, type: string, number: string) => | ||
| `github[.]com/${owner}/${repo}/${type}/${number}`, | ||
| ) | ||
| .replace(/\b([A-Za-z0-9_.-]+\/[A-Za-z0-9_.-]+)#(\d+)\b/g, "`$1#$2`") | ||
| .replace(/(^|[^\w`])@([A-Za-z0-9-]{1,39})\b/g, "$1@\u200B$2"); |
Author
There was a problem hiding this comment.
@copilot update you suggestion or close this issue if no longer valid.
| `github[.]com/${owner}/${repo}/${type}/${number}`, | ||
| ) | ||
| .replace(/\b([A-Za-z0-9_.-]+\/[A-Za-z0-9_.-]+)#(\d+)\b/g, "`$1#$2`") | ||
| .replace(/(^|[^\w`])@([A-Za-z0-9-]{1,39})\b/g, "$1@\u200B$2"); |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
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 prevents Big Model Radar's generated GitHub Issues from creating cross-repository backreference noise in tracked upstream projects.
The committed Markdown reports and Web UI can continue to use normal source links, but the body sent to createGitHubIssue now defangs GitHub issue/PR URLs, shorthand owner/repo#123 references, and @user mentions before posting.
Why
Digest issues currently include direct links to upstream issues and pull requests. GitHub turns those links into timeline events such as "mentioned this pull request" in the upstream repositories, which can be noisy for projects being monitored.
Validation
Full project typecheck was not run because this checkout does not have local Node dependencies installed.