Skip to content

Avoid upstream GitHub cross-reference notifications in digest issues#274

Open
brianluby wants to merge 2 commits into
gsscsd:mainfrom
brianluby:codex/defang-upstream-github-references
Open

Avoid upstream GitHub cross-reference notifications in digest issues#274
brianluby wants to merge 2 commits into
gsscsd:mainfrom
brianluby:codex/defang-upstream-github-references

Conversation

@brianluby
Copy link
Copy Markdown

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.

Copilot AI review requested due to automatic review settings April 30, 2026 04:06
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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#123 references, and @user mentions 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 thread src/github.ts Outdated
Comment thread src/github.ts
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");
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot update you suggestion or close this issue if no longer valid.

Comment thread src/github.ts
`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");
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot apply changes based on this feedback

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants