Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PR review companion adds noisy GitHub links between issues and PRs #12211

Open
bsmth opened this issue Nov 29, 2024 · 1 comment · May be fixed by #12429
Open

PR review companion adds noisy GitHub links between issues and PRs #12211

bsmth opened this issue Nov 29, 2024 · 1 comment · May be fixed by #12429
Assignees
Labels
effort: small This task is a small effort. enhancement Improves an existing feature. has PR Issues that already have a PR p2 We want to address this but may have other higher priority items. pr-companion PR review companion for content PRs wx writer experience

Comments

@bsmth
Copy link
Member

bsmth commented Nov 29, 2024

On each new pull request, the PR companion leaves a comment with preview URLs. One of the features of the comment is a list of external links in each docs page. This has the unintended side effect that PRs will be linked on GitHub.com, even if the PR content / motivation is unrelated.

Example outcome:

Check https://github.com/httpwg/http-core/issues/26 for example. Have a look at the occurrences of [github-actions](https://github.com/apps/github-actions) bot mentioned this issue events. This HTTPWG issue is referenced in prose in a docs page. Every PR that modifies this page creates a link back to the PR because of the bot preview URLs comment. In most cases, this is not helpful.

Suggestion:

Consider wrapping github.com/*/*/pulls/[0-9]+ and github.com/*/*/issues/[0-9]+ links in backticks instead of allowing the raw URLs to be passed through.

Problem area:

if external_urls:
external_urls_list = []
for url in sorted(external_urls):
count = external_urls[url]
line = (
f" - {'🚨 ' if url.startswith('http://') else ''}"
f"<{url}> ({count} time{'' if count==1 else 's'})"
)
if diff_lines:
# If this was available and it _did_ fine a URL, then
# really make sure it's noticed.
line += " (Note! This may be a new URL 👀)"
external_urls_list.append(line)
comments.append((doc, "\n".join(external_urls_list)))
total_urls += len(external_urls_list)

@github-actions github-actions bot added the needs triage Triage needed by staff and/or partners. Automatically applied when an issue is opened. label Nov 29, 2024
@caugner caugner added the pr-companion PR review companion for content PRs label Nov 29, 2024
@argl argl added enhancement Improves an existing feature. p2 We want to address this but may have other higher priority items. effort: small This task is a small effort. wx writer experience and removed needs triage Triage needed by staff and/or partners. Automatically applied when an issue is opened. labels Dec 5, 2024
@Josh-Cena
Copy link
Member

Consider using redirect.github.com: https://redirect.github.com/httpwg/http-core/issues/26. It links to the same page but does not create a issue reference.

@github-actions github-actions bot added the idle label Jan 8, 2025
@caugner caugner linked a pull request Jan 10, 2025 that will close this issue
@caugner caugner added the has PR Issues that already have a PR label Jan 10, 2025
@caugner caugner self-assigned this Jan 10, 2025
@github-actions github-actions bot removed the idle label Jan 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
effort: small This task is a small effort. enhancement Improves an existing feature. has PR Issues that already have a PR p2 We want to address this but may have other higher priority items. pr-companion PR review companion for content PRs wx writer experience
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants