-
Notifications
You must be signed in to change notification settings - Fork 0
[Feat] 리뷰 리마인더 시스템 도입 #10
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
Conversation
📝 WalkthroughWalkthroughGitHub Actions 워크플로우와 스크립트를 추가하여 12시간 이상 검토 대기 중인 PR에 대한 Slack 알림을 자동으로 전송합니다. GitHub 사용자를 Slack ID로 매핑하고 정해진 일정(KST 14:00)에 실행됩니다. Changes
Sequence Diagram(s)sequenceDiagram
participant GH as GitHub<br/>(Scheduled)
participant WF as Workflow<br/>(github-script)
participant Script as review-reminder.js
participant GHAPI as GitHub API
participant Map as User Mapping
participant Slack as Slack Webhook
GH->>WF: Trigger (매일 14:00 KST)
WF->>Script: Execute script
Script->>GHAPI: Fetch open PRs
GHAPI-->>Script: Return PR list
Script->>Script: Filter (age >= 12h)
Script->>Map: Map reviewers & author
Map-->>Script: Slack IDs
Script->>Script: Build message payload
Script->>Slack: POST formatted message
Slack-->>Script: 200 OK
Script-->>WF: Complete
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related issues
Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
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. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In @.github/scripts/review-reminder.js:
- Around line 25-31: The current call to github.rest.pulls.list returns only the
first page (30 PRs); replace it with github.paginate to fetch all open PRs: call
github.paginate with github.rest.pulls.list and the same params (owner:
context.repo.owner, repo: context.repo.repo, state: 'open', sort: 'created',
direction: 'asc') and collect the returned array into the variable used as prs
so downstream logic iterates over all PRs instead of just the first page.
🧹 Nitpick comments (2)
.github/scripts/review-reminder.js (1)
36-40: Draft PR은 리마인더 대상에서 제외하는 것이 안전합니다.초안 PR까지 알림 대상에 포함되면 노이즈가 커질 수 있어
pr.draft는 건너뛰는 걸 권장합니다.♻️ 제안 수정
for (const pr of prs) { + if (pr.draft) continue; const createdDate = new Date(pr.created_at); const diffTime = now - createdDate; // PR 생성 시간 차이 (ms).github/workflows/common-slack-review-reminder.yml (1)
9-12: 권한을 명시해 실행 실패를 방지하세요.조직 기본 권한이 제한된 경우 PR 조회가 실패할 수 있으므로
contents: read,pull-requests: read를 명시하는 편이 안전합니다.🔧 제안 수정
jobs: remind: + permissions: + contents: read + pull-requests: read runs-on: ubuntu-latest
| const {data: prs} = await github.rest.pulls.list({ | ||
| owner: context.repo.owner, | ||
| repo: context.repo.repo, | ||
| state: 'open', // 오픈 PR | ||
| sort: 'created', // 정렬 기준 | ||
| direction: 'asc' // 오름차순 | ||
| }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
cd /tmp/repo && find . -name "review-reminder.js" -type f 2>/dev/null | head -5Repository: festabook/kotlin-multiplatform
Length of output: 133
🏁 Script executed:
cd /tmp/repo && cat -n ".github/scripts/review-reminder.js" | head -50Repository: festabook/kotlin-multiplatform
Length of output: 133
🏁 Script executed:
cd /tmp/repo && cat -n ".github/scripts/review-reminder.js" | sed -n '20,40p'Repository: festabook/kotlin-multiplatform
Length of output: 133
🌐 Web query:
Octokit github.rest.pulls.list pagination default page size limit
💡 Result:
Short answer: Octokit (REST) follows the GitHub REST API defaults — 30 items per page by default and you can set per_page up to 100. Some endpoints have additional limits/notes (e.g. certain PR file lists/commit lists have their own total caps). [1][2][3]
Sources:
- GitHub REST API pagination (default 30, per_page up to 100). [1]
- octokit/plugin-paginate-rest README (notes: per_page defaults to 30, max 100). [2]
- Octokit REST endpoint docs showing per_page parameter (max 100). [3]
🌐 Web query:
Octokit github.paginate method usage pulls.list
💡 Result:
Use octokit.paginate to iterate all pages of the pulls.list endpoint and (optionally) map each page to items you want. Example patterns:
Node / JavaScript (modern @octokit/rest/@octokit/core + plugin-paginate-rest)
- return all pull objects:
const pulls = await octokit.paginate("GET /repos/{owner}/{repo}/pulls", { owner, repo, per_page: 100 }); - stream/map only needed fields (reduces memory):
const titles = await octokit.paginate(
"GET /repos/{owner}/{repo}/pulls",
{ owner, repo, per_page: 100 },
response => response.data.map(p => ({ number: p.number, title: p.title }))
);
If using octokit.rest convenience method (same effect):
const pulls = await octokit.paginate(octokit.rest.pulls.list, { owner, repo, per_page: 100 });
Notes:
- Use per_page up to 100 to reduce requests.
- octokit.paginate only paginates "List ..." endpoints that return Link headers; otherwise it behaves like a single request. [1][2][3]
Sources:
[1] octokit/plugin-paginate-rest.js (paginate() docs).
[2] octokit.rest.pulls.list — Octokit REST docs.
[3] octokit.js / REST examples (pulls.list) documentation.
🏁 Script executed:
git ls-files | grep -i "review-reminder"Repository: festabook/kotlin-multiplatform
Length of output: 159
🏁 Script executed:
find . -name "review-reminder.js" -type f 2>/dev/nullRepository: festabook/kotlin-multiplatform
Length of output: 110
🏁 Script executed:
git log --oneline --all -- "*review-reminder*" | head -5Repository: festabook/kotlin-multiplatform
Length of output: 110
🏁 Script executed:
cat -n .github/scripts/review-reminder.js | head -60Repository: festabook/kotlin-multiplatform
Length of output: 2455
🏁 Script executed:
cat -n .github/scripts/review-reminder.js | sed -n '20,45p'Repository: festabook/kotlin-multiplatform
Length of output: 1118
🏁 Script executed:
cat -n .github/scripts/review-reminder.js | sed -n '1,100p' | tail -50Repository: festabook/kotlin-multiplatform
Length of output: 2043
🏁 Script executed:
# Check if github.paginate is available/used elsewhere in the codebase
rg "github\.paginate" --type jsRepository: festabook/kotlin-multiplatform
Length of output: 222
🏁 Script executed:
# Check if there are any other calls to github.rest.pulls in this or similar files
rg "github\.rest\.pulls" --type js -B 2 -A 5Repository: festabook/kotlin-multiplatform
Length of output: 222
🏁 Script executed:
rg "paginate" .github/scripts/Repository: festabook/kotlin-multiplatform
Length of output: 56
🏁 Script executed:
rg "github\.rest\.pulls" .github/scripts/Repository: festabook/kotlin-multiplatform
Length of output: 167
🏁 Script executed:
cat .github/scripts/review-reminder.jsRepository: festabook/kotlin-multiplatform
Length of output: 3888
오픈 PR 조회가 기본 페이지 크기(30개)로 제한되어 일부 누락 가능합니다.
github.rest.pulls.list는 페이지 매김 없이 호출하면 기본적으로 첫 번째 페이지(30개 항목)만 반환합니다. 저장소에 30개 이상의 오픈 PR이 있으면 나머지 PR에 대한 리마인더가 전송되지 않습니다. 모든 PR을 조회하려면 github.paginate를 사용하세요.
🔧 제안 수정
- const {data: prs} = await github.rest.pulls.list({
+ const prs = await github.paginate(github.rest.pulls.list, {
owner: context.repo.owner,
repo: context.repo.repo,
state: 'open', // 오픈 PR
sort: 'created', // 정렬 기준
- direction: 'asc' // 오름차순
+ direction: 'asc', // 오름차순
+ per_page: 100
});📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| const {data: prs} = await github.rest.pulls.list({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| state: 'open', // 오픈 PR | |
| sort: 'created', // 정렬 기준 | |
| direction: 'asc' // 오름차순 | |
| }); | |
| const prs = await github.paginate(github.rest.pulls.list, { | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| state: 'open', // 오픈 PR | |
| sort: 'created', // 정렬 기준 | |
| direction: 'asc', // 오름차순 | |
| per_page: 100 | |
| }); |
🤖 Prompt for AI Agents
In @.github/scripts/review-reminder.js around lines 25 - 31, The current call to
github.rest.pulls.list returns only the first page (30 PRs); replace it with
github.paginate to fetch all open PRs: call github.paginate with
github.rest.pulls.list and the same params (owner: context.repo.owner, repo:
context.repo.repo, state: 'open', sort: 'created', direction: 'asc') and collect
the returned array into the variable used as prs so downstream logic iterates
over all PRs instead of just the first page.
parkjiminnnn
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
고마워요 비타 !
누릴게요~
#️⃣ 이슈 번호
🛠️ 작업 내용
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.