Skip to content

Conversation

Copy link

Copilot AI commented Jan 12, 2026

Discord forum threads for pull request reviews currently display the PR URL as the thread name (e.g., https://github.com/owner/repo/pull/123), making them difficult to scan.

Changes

Thread creation

  • Thread name now uses PR title from GitHub API
  • PR URL moved to initial message content
  • Removed redundant .setName() call

Thread parsing

  • Added getPullRequestFromThread() to extract PR URL from first message via getHistory().retrievePast(1)
  • Updated mentionReviewersOnAllReviewChannels(), isReviewPostCreatedInGuild(), and archiveMergedPullRequest() to use new helper
  • Added exception handling for ErrorResponseException and RateLimitedException

Before:

MessageCreateData createData = MessageCreateData.fromContent(pullRequestTitle);
forumChannel.createForumPost(pullRequestTitle, createData)
    .setName(pullRequest.toUrl())  // Thread name = URL

After:

MessageCreateData createData = MessageCreateData.fromContent(pullRequest.toUrl());
forumChannel.createForumPost(pullRequestTitle, createData)  // Thread name = title, URL in message

Threads created before this change will be skipped by background tasks (archival, reminder mentions) as the first message won't contain a parseable URL.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • jitpack.io
    • Triggering command: /usr/lib/jvm/temurin-17-jdk-amd64/bin/java /usr/lib/jvm/temurin-17-jdk-amd64/bin/java --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.invoke=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.prefs/java.util.prefs=ALL-UNNAMED --add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED --add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.prefs/java.util.prefs=ALL-UNNAMED --add-opens=java.base/java.nio.charset=ALL-UNNAMED --add-opens=java.base/java.net=ALL-UNNAMED --add-opens=java.base/java.util.concurrent.atomic=ALL-UNNAMED --add-opens=java.xml/javax.xml.namespace=ALL-UNNAMED -XX:MaxMetaspaceSize=384m -XX:+HeapDumpOnOutOfMemoryError -Xms256m -Xmx512m -Dfile.encoding=UTF-8 -Duser.country -Duser.language=en (dns block)
    • Triggering command: /usr/lib/jvm/temurin-21-jdk-amd64/bin/java /usr/lib/jvm/temurin-21-jdk-amd64/bin/java --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.invoke=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.prefs/java.util.prefs=ALL-UNNAMED --add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED --add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.prefs/java.util.prefs=ALL-UNNAMED --add-opens=java.base/java.nio.charset=ALL-UNNAMED --add-opens=java.base/java.net=ALL-UNNAMED --add-opens=java.base/java.util.concurrent.atomic=ALL-UNNAMED --add-opens=java.xml/javax.xml.namespace=ALL-UNNAMED -XX:MaxMetaspaceSize=384m -XX:+HeapDumpOnOutOfMemoryError -Xms256m -Xmx512m -Dfile.encoding=UTF-8 -Duser.country -Duser.language=en (dns block)
  • repo.eternalcode.pl
    • Triggering command: /usr/lib/jvm/temurin-17-jdk-amd64/bin/java /usr/lib/jvm/temurin-17-jdk-amd64/bin/java --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.invoke=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.prefs/java.util.prefs=ALL-UNNAMED --add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED --add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.prefs/java.util.prefs=ALL-UNNAMED --add-opens=java.base/java.nio.charset=ALL-UNNAMED --add-opens=java.base/java.net=ALL-UNNAMED --add-opens=java.base/java.util.concurrent.atomic=ALL-UNNAMED --add-opens=java.xml/javax.xml.namespace=ALL-UNNAMED -XX:MaxMetaspaceSize=384m -XX:+HeapDumpOnOutOfMemoryError -Xms256m -Xmx512m -Dfile.encoding=UTF-8 -Duser.country -Duser.language=en (dns block)
    • Triggering command: /usr/lib/jvm/temurin-21-jdk-amd64/bin/java /usr/lib/jvm/temurin-21-jdk-amd64/bin/java --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.invoke=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.prefs/java.util.prefs=ALL-UNNAMED --add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED --add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.prefs/java.util.prefs=ALL-UNNAMED --add-opens=java.base/java.nio.charset=ALL-UNNAMED --add-opens=java.base/java.net=ALL-UNNAMED --add-opens=java.base/java.util.concurrent.atomic=ALL-UNNAMED --add-opens=java.xml/javax.xml.namespace=ALL-UNNAMED -XX:MaxMetaspaceSize=384m -XX:+HeapDumpOnOutOfMemoryError -Xms256m -Xmx512m -Dfile.encoding=UTF-8 -Duser.country -Duser.language=en (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

Currently, name of new pull request threads on Discord consist of the PR Link. This looks ugly. Make so that the name of a pull request review thread is a PR title, and the link is sent in the thread rather than being in the title.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 4 commits January 12, 2026 12:22
Co-authored-by: Jakubk15 <77227023+Jakubk15@users.noreply.github.com>
Co-authored-by: Jakubk15 <77227023+Jakubk15@users.noreply.github.com>
Co-authored-by: Jakubk15 <77227023+Jakubk15@users.noreply.github.com>
Co-authored-by: Jakubk15 <77227023+Jakubk15@users.noreply.github.com>
Copilot AI changed the title [WIP] Change pull request review thread name to PR title Use PR title as Discord thread name instead of URL Jan 12, 2026
Copilot AI requested a review from Jakubk15 January 12, 2026 12:29
@Jakubk15 Jakubk15 marked this pull request as ready for review January 22, 2026 17:16
@Jakubk15 Jakubk15 marked this pull request as draft January 22, 2026 17:16
@Jakubk15
Copy link
Member

/gemini review

@Jakubk15 Jakubk15 added the 🔧 enhancement Enhancement to an existing feature label Jan 22, 2026
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request successfully changes how Discord review threads are created, using the pull request title for the thread name and placing the URL in the first message. This is a great improvement for readability. The new helper method getPullRequestFromThread is well-integrated to handle this new structure for background tasks. My review includes a few suggestions to enhance performance and robustness by adopting non-blocking API calls and refining exception handling, which I believe will make the implementation even better.

.setName(pullRequest.toUrl())
return forumChannel.createForumPost(pullRequestTitle, createData)
.setTags(ForumTagSnowflake.fromId(this.appConfig.reviewSystem.inReviewForumTagId))
.complete()
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

The use of .complete() makes this a blocking network call. While it's executed within a CompletableFuture, relying on blocking operations can lead to performance issues and thread pool exhaustion under high load. It would be more robust and scalable to use JDA's asynchronous queue() or submit() method and refactor the method to return a CompletableFuture<Long>. This would make the call non-blocking and more aligned with a reactive programming style.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🔧 enhancement Enhancement to an existing feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants