Skip to content

feat: 관리자 검수 결과에 따라 이모지를 남기도록 - #838

Open
whqtker wants to merge 2 commits into
developfrom
feat/836-discord-review-reaction
Open

feat: 관리자 검수 결과에 따라 이모지를 남기도록#838
whqtker wants to merge 2 commits into
developfrom
feat/836-discord-review-reaction

Conversation

@whqtker

@whqtker whqtker commented Aug 25, 2026

Copy link
Copy Markdown
Member

관련 이슈

작업 내용

특이 사항

리뷰 요구사항 (선택)

@whqtker whqtker self-assigned this Aug 25, 2026
@whqtker whqtker added 기능 최종 리뷰 최소 1명 필수 labels Aug 25, 2026
@coderabbitai

coderabbitai Bot commented Aug 25, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

Next included review available in 53 minutes.

View limit details

Limit details: You’ve used the included review currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 773f9b45-4180-4777-b8ae-fcc64d6e7482

📥 Commits

Reviewing files that changed from the base of the PR and between a7fd84e and b0ade22.

📒 Files selected for processing (20)
  • src/main/java/com/example/solidconnection/admin/service/AdminGpaScoreService.java
  • src/main/java/com/example/solidconnection/admin/service/AdminLanguageTestScoreService.java
  • src/main/java/com/example/solidconnection/admin/service/AdminMentorApplicationService.java
  • src/main/java/com/example/solidconnection/common/config/client/RestTemplateConfig.java
  • src/main/java/com/example/solidconnection/common/discord/DiscordMessageResponse.java
  • src/main/java/com/example/solidconnection/common/discord/DiscordNotifier.java
  • src/main/java/com/example/solidconnection/common/discord/DiscordReactionClient.java
  • src/main/java/com/example/solidconnection/common/discord/DiscordReactionEmoji.java
  • src/main/java/com/example/solidconnection/common/discord/DiscordWebhookSender.java
  • src/main/java/com/example/solidconnection/common/discord/domain/DiscordNotification.java
  • src/main/java/com/example/solidconnection/common/discord/repository/DiscordNotificationRepository.java
  • src/main/java/com/example/solidconnection/common/discord/service/DiscordNotificationService.java
  • src/main/java/com/example/solidconnection/mentor/service/MentorApplicationService.java
  • src/main/java/com/example/solidconnection/score/service/ScoreService.java
  • src/main/resources/db/migration/V59__add_discord_notification.sql
  • src/test/java/com/example/solidconnection/common/discord/DiscordNotificationServiceTest.java
  • src/test/java/com/example/solidconnection/common/discord/DiscordReactionClientTest.java
  • src/test/java/com/example/solidconnection/common/discord/DiscordWebhookSenderTest.java
  • src/test/java/com/example/solidconnection/mentor/service/MentorApplicationServiceTest.java
  • src/test/java/com/example/solidconnection/score/service/ScoreServiceTest.java
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/836-discord-review-reaction

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b0ade22209

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

if (webhookUrl.isBlank() || "local".equalsIgnoreCase(environment)) {
return;
}
DiscordMessageResponse response = discordWebhookSender.sendAndGetMessage(

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Isolate webhook delivery from submission transactions

When the configured Discord webhook times out or returns a non-2xx response, sendAndGetMessage propagates the RestClientException; this new overload is also not @Async, unlike the previous notification path. Because ScoreService.submitGpaScore, submitLanguageTestScore, and MentorApplicationService.submitMentorApplication invoke it inside their transactions, a Discord outage now rejects and rolls back user submissions instead of merely losing the optional notification. Catch and isolate delivery failures or move this work to an asynchronous post-commit flow.

Useful? React with 👍 / 👎.

String url = REACTION_URL.formatted(channelId, messageId, encodedEmoji);
HttpHeaders headers = new HttpHeaders();
headers.set("Authorization", "Bot " + botToken);
discordBotRestTemplate.exchange(url, HttpMethod.PUT, new HttpEntity<>(headers), Void.class);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Prevent reaction failures from rejecting review decisions

When a notification mapping exists and Discord returns 401/429/5xx or times out, this synchronous exchange throws into each transactional admin approval/rejection method. The resulting exception rolls back the GPA, language-test, or mentor review and returns an error solely because the cosmetic reaction could not be added; this is especially disruptive for a missing or rotated bot token. Isolate this client failure and preferably dispatch the reaction after the review transaction commits.

Useful? React with 👍 / 👎.

Comment on lines +54 to +56
case APPROVED -> DiscordReactionEmoji.APPROVED.getValue();
case REJECTED -> DiscordReactionEmoji.REJECTED.getValue();
case PENDING -> null;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Replace stale reactions when a score verdict changes

The score update APIs accept any VerifyStatus even for an already reviewed score, but this switch only adds the new verdict and does nothing for PENDING. Consequently, changing APPROVED to REJECTED leaves both ✅ and ❌ on the message, while resetting either verdict to PENDING leaves the old reaction visible. Remove the prior bot reaction, or otherwise synchronize reactions to the current status, before publishing the new result; the same issue exists in the language-test path.

Useful? React with 👍 / 👎.

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

Labels

기능 최종 리뷰 최소 1명 필수

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: 관리자 검수에 따라 디스코드 봇이 이모지를 남기도록

1 participant