-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #139 from woowacourse-teams/BE/dev
[BE] BE/main 브랜치로 BE/dev변경 사항 적용
- Loading branch information
Showing
8 changed files
with
172 additions
and
22 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
name: PULL_REQUEST | ||
|
||
on: | ||
pull_request: | ||
types: [opened] | ||
|
||
env: | ||
koust6u: U07D1PWSLSG | ||
kelly6bf: U07DSB12K99 | ||
JiHyeonL: U07E3T9PMA4 | ||
yechop: U07E3TG6CHE | ||
reddevilmidzy: U07DF0QPUKV | ||
dle234: U07E48NCK4G | ||
greetings1012: U07DPGSCXRA | ||
anttiey: U07DPGSCXRA | ||
|
||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Send HTTP request and extract GitHub IDs | ||
id: extract_github_ids | ||
run: | | ||
response=$(curl -s -H "Content-Type: application/json" \ | ||
-H "Github_id: ${{ github.event.pull_request.user.login }}" \ | ||
http://43.200.237.127:8080/member) | ||
GITHUB_IDS=$(echo "$response" | jq -r 'map(.githubId) | join(" ")') | ||
echo "GITHUB_IDS=$GITHUB_IDS" >> $GITHUB_ENV | ||
- name: Prepare GitHub IDs for Slack message | ||
id: prepare_slack_message | ||
run: | | ||
GITHUB_IDS_ARRAY=($GITHUB_IDS) | ||
SLACK_USER_MENTIONS="" | ||
for GITHUB_ID in "${GITHUB_IDS_ARRAY[@]}"; do | ||
SLACK_ID="${!GITHUB_ID}" | ||
if [ -n "$SLACK_ID" ]; then | ||
SLACK_USER_MENTIONS+="<@$SLACK_ID> " | ||
fi | ||
done | ||
echo "SLACK_USER_MENTIONS=$SLACK_USER_MENTIONS" >> $GITHUB_ENV | ||
- name: PR opened | ||
id: slack-pr-opened | ||
uses: slackapi/[email protected] | ||
with: | ||
channel-id: 'C07DN3TETSL' | ||
payload: | | ||
{ | ||
"text": "Backend PR opened: ${{ github.event.pull_request.html_url }}", | ||
"blocks": [ | ||
{ | ||
"type": "section", | ||
"text": { | ||
"type": "mrkdwn", | ||
"text": "🔔*PR 요청 왔어요. 코드 리뷰해주세요*🔔 \n<${{ github.event.pull_request.html_url }}|`${{github.event.pull_request.title}}`에 대한 코드 리뷰를 해주세요.>\n${{ env.SLACK_USER_MENTIONS }}" | ||
} | ||
} | ||
] | ||
} | ||
env: | ||
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} | ||
|
||
- name: thread store api request | ||
run: | | ||
curl -X POST http://43.200.237.127:8080/github/thread \ | ||
-H "Content-Type: application/json" \ | ||
-d '{"ts": "${{steps.slack-pr-opened.outputs.ts}}", "url": "${{github.event.pull_request.html_url}}"}' |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
name: Notify Slack on Pull Request Review Request | ||
|
||
on: | ||
pull_request_review: | ||
types: [submitted] | ||
|
||
env: | ||
koust6u: U07D1PWSLSG | ||
kelly6bf: U07DSB12K99 | ||
JiHyeonL: U07E3T9PMA4 | ||
yechop: U07E3TG6CHE | ||
reddevilmidzy: U07DF0QPUKV | ||
dle234: U07E48NCK4G | ||
greetings1012: U07DPGSCXRA | ||
anttiey: U07DPGSCXRA | ||
|
||
jobs: | ||
notify: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Get Thread TS from API | ||
id: get_ts | ||
run: | | ||
RESPONSE=$(curl -s -X GET "http://43.200.237.127:8080/github/thread" -H "GITHUB_URL: ${{ github.event.pull_request.html_url }}") | ||
TS=$(echo "$RESPONSE" | jq -r '.ts') | ||
echo "THREAD_TS=$TS" >> $GITHUB_ENV | ||
- name: Send Slack notification | ||
uses: slackapi/[email protected] | ||
with: | ||
channel-id: 'C07DN3TETSL' | ||
payload: | | ||
{ | ||
"text": "Code review requested for Backend PR: ${{ github.event.pull_request.html_url }}", | ||
"blocks": [ | ||
{ | ||
"type": "section", | ||
"text": { | ||
"type": "mrkdwn", | ||
"text": "📫<@${{ env[format('{0}', env.GITHUB_UID)] }}>님 PR에 대한 리뷰가 도착했어요.📫" | ||
} | ||
} | ||
], | ||
"thread_ts": "${{ env.THREAD_TS }}" | ||
} | ||
env: | ||
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} | ||
GITHUB_UID: ${{ github.event.pull_request.user.login }} |
This file contains 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
11 changes: 9 additions & 2 deletions
11
backend/src/main/java/site/coduo/pairroom/dto/PairRoomCreateRequest.java
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,17 @@ | ||
package site.coduo.pairroom.dto; | ||
|
||
import jakarta.validation.constraints.NotBlank; | ||
|
||
import io.swagger.v3.oas.annotations.media.Schema; | ||
|
||
@Schema(description = "페어룸 생성 요청 바디") | ||
public record PairRoomCreateRequest( | ||
@Schema(description = "첫 번째 페어의 이름") String firstPair, | ||
@Schema(description = "두 번째 페어의 이름") String secondPair | ||
@Schema(description = "첫 번째 페어의 이름") | ||
@NotBlank | ||
String firstPair, | ||
|
||
@Schema(description = "두 번째 페어의 이름") | ||
@NotBlank | ||
String secondPair | ||
) { | ||
} |
6 changes: 5 additions & 1 deletion
6
backend/src/main/java/site/coduo/pairroom/dto/PairRoomDeleteRequest.java
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,13 @@ | ||
package site.coduo.pairroom.dto; | ||
|
||
import jakarta.validation.constraints.NotBlank; | ||
|
||
import io.swagger.v3.oas.annotations.media.Schema; | ||
|
||
@Schema(description = "페어룸 삭제 요청 바디") | ||
public record PairRoomDeleteRequest( | ||
@Schema(description = "페어룸 접근 코드", example = "abcdef") String accessCode | ||
@Schema(description = "페어룸 접근 코드", example = "abcdef") | ||
@NotBlank | ||
String accessCode | ||
) { | ||
} |
6 changes: 5 additions & 1 deletion
6
backend/src/main/java/site/coduo/pairroom/dto/PairRoomReadRequest.java
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,13 @@ | ||
package site.coduo.pairroom.dto; | ||
|
||
import jakarta.validation.constraints.NotBlank; | ||
|
||
import io.swagger.v3.oas.annotations.media.Schema; | ||
|
||
@Schema(description = "페어룸 조회 요청 바디") | ||
public record PairRoomReadRequest( | ||
@Schema(description = "페어룸 접근 코드", example = "abcdef") String accessCode | ||
@Schema(description = "페어룸 접근 코드", example = "abcdef") | ||
@NotBlank | ||
String accessCode | ||
) { | ||
} |
This file contains 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
This file contains 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