-
Notifications
You must be signed in to change notification settings - Fork 0
[25.07.13 / TASK-232] Feature/weekly batch and gitaction #36
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
Walkthrough์ฌ๋ฌ ์ผ์ผ ์ง๊ณ ์ํฌํ๋ก์ฐ์์ ์์ ์ฑ๊ณต ์ ์ฌ๋ ์๋ฆผ์ ๋ฐ์กํ๋ ๋จ๊ณ๋ฅผ ์ ๊ฑฐํ์ต๋๋ค. ์คํจ ์ ์ฌ๋ ์๋ฆผ์ ๊ทธ๋๋ก ์ ์ง๋ฉ๋๋ค. ๋ํ, ์ฃผ๊ฐ ๋ถ์ ๋ฐ ์ฃผ๊ฐ ๋ด์ค๋ ํฐ ๋ฐฐ์น ์ํฌํ๋ก์ฐ๊ฐ ์๋กญ๊ฒ ์ถ๊ฐ๋์์ผ๋ฉฐ, ์ด๋ค์ ์คํจ ์์๋ง ์ฌ๋ ์๋ฆผ์ ์ ์กํฉ๋๋ค. ๋ด์ค๋ ํฐ ๋ฐฐ์น ํ์ด์ฌ ์คํฌ๋ฆฝํธ์์๋ DEBUG ๋ชจ๋์ผ ๋ ๋ด์ค๋ ํฐ ๋ฐ์ก์ ๊ฑด๋๋ฐ๋ ์กฐ๊ฑด์ด ๋ค์ ํ์ฑํ๋์์ต๋๋ค. Changes
Sequence Diagram(s)sequenceDiagram
participant GitHubActions
participant Slack
participant PythonScript
Note over GitHubActions: Daily/Weekly ์ํฌํ๋ก์ฐ ์คํ
GitHubActions->>PythonScript: ๋ฐฐ์น ์คํฌ๋ฆฝํธ ์คํ
PythonScript-->>GitHubActions: ์คํ ๊ฒฐ๊ณผ ๋ฐํ
alt ์คํจ ๋ฐ์ ์
GitHubActions->>Slack: ์คํจ ์๋ฆผ ์ ์ก
end
Note over PythonScript: (weekly_newsletter_batch.py ๋ด๋ถ)
PythonScript->>PythonScript: if settings.DEBUG: return (๋ฐ์ก ๊ฑด๋๋)
Possibly related PRs
Suggested labels
Suggested reviewers
Poem
๐ Recent review detailsConfiguration used: CodeRabbit UI ๐ Files selected for processing (5)
โ Files skipped from review due to trivial changes (4)
๐ Additional comments (1)
โจ Finishing Touches
๐งช Generate unit tests
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. ๐ชง TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
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: 7
๐งน Nitpick comments (3)
insight/tasks/user_weekly_trend_analysis.py (1)
37-40
: ์ฃผ์ ์ฒ๋ฆฌ๋ ๋๋ฒ๊น ์ฝ๋๋ฅผ ์ ๊ฑฐํ์ธ์.์ฃผ์ ์ฒ๋ฆฌ๋ ๋๋ฒ๊น ์ฝ๋๊ฐ ํ๋ก๋์ ์ฝ๋์ ๋จ์์์ต๋๋ค. ์ด๋ฐ ์ฝ๋๋ ํผ๋์ ์ผ๊ธฐํ ์ ์์ผ๋ฏ๋ก ์ ๊ฑฐํ๋ ๊ฒ์ด ์ข์ต๋๋ค.
- # # week_start ๊ฐ์ 2025๋ 1์ 1์ผ KST๋ก ๊ณ ์ - # kst = timezone(timedelta(hours=9)) - # week_start = datetime(2025, 1, 1, 0, 0, 0, tzinfo=kst) - # print(f"[user_id={user_id}] Starting weekly trend analysis... ({week_start} ~ {week_end})").github/workflows/run-weekly-newsletter.yaml (1)
85-85
: ํ์ผ ๋์ ๊ฐํ ๋ฌธ์๋ฅผ ์ถ๊ฐํ์ธ์.YAML ํ์ผ์ ํ์ผ ๋์ ๊ฐํ ๋ฌธ์๊ฐ ์์ด์ผ ํฉ๋๋ค.
ํ์ผ ๋์ ๋น ์ค์ ์ถ๊ฐํ์ธ์.
.github/workflows/run-weekly-analysis.yaml (1)
89-89
: ํ์ผ ๋์ ๊ฐํ ๋ฌธ์๋ฅผ ์ถ๊ฐํ์ธ์.YAML ํ์ผ์ ํ์ผ ๋์ ๊ฐํ ๋ฌธ์๊ฐ ์์ด์ผ ํฉ๋๋ค.
ํ์ผ ๋์ ๋น ์ค์ ์ถ๊ฐํ์ธ์.
๐ Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
๐ Files selected for processing (24)
.github/workflows/run-daily-aggre-set1.yaml
(0 hunks).github/workflows/run-daily-aggre-set10.yaml
(0 hunks).github/workflows/run-daily-aggre-set11.yaml
(0 hunks).github/workflows/run-daily-aggre-set12.yaml
(0 hunks).github/workflows/run-daily-aggre-set13.yaml
(0 hunks).github/workflows/run-daily-aggre-set14.yaml
(0 hunks).github/workflows/run-daily-aggre-set15.yaml
(0 hunks).github/workflows/run-daily-aggre-set16.yaml
(0 hunks).github/workflows/run-daily-aggre-set17.yaml
(0 hunks).github/workflows/run-daily-aggre-set18.yaml
(0 hunks).github/workflows/run-daily-aggre-set19.yaml
(0 hunks).github/workflows/run-daily-aggre-set2.yaml
(0 hunks).github/workflows/run-daily-aggre-set20.yaml
(0 hunks).github/workflows/run-daily-aggre-set3.yaml
(0 hunks).github/workflows/run-daily-aggre-set4.yaml
(0 hunks).github/workflows/run-daily-aggre-set5.yaml
(0 hunks).github/workflows/run-daily-aggre-set6.yaml
(0 hunks).github/workflows/run-daily-aggre-set7.yaml
(0 hunks).github/workflows/run-daily-aggre-set8.yaml
(0 hunks).github/workflows/run-daily-aggre-set9.yaml
(0 hunks).github/workflows/run-weekly-analysis.yaml
(1 hunks).github/workflows/run-weekly-newsletter.yaml
(1 hunks)insight/tasks/user_weekly_trend_analysis.py
(8 hunks)insight/tasks/weekly_newsletter_batch.py
(2 hunks)
๐ค Files with no reviewable changes (20)
- .github/workflows/run-daily-aggre-set10.yaml
- .github/workflows/run-daily-aggre-set3.yaml
- .github/workflows/run-daily-aggre-set7.yaml
- .github/workflows/run-daily-aggre-set13.yaml
- .github/workflows/run-daily-aggre-set18.yaml
- .github/workflows/run-daily-aggre-set5.yaml
- .github/workflows/run-daily-aggre-set14.yaml
- .github/workflows/run-daily-aggre-set2.yaml
- .github/workflows/run-daily-aggre-set19.yaml
- .github/workflows/run-daily-aggre-set4.yaml
- .github/workflows/run-daily-aggre-set9.yaml
- .github/workflows/run-daily-aggre-set17.yaml
- .github/workflows/run-daily-aggre-set6.yaml
- .github/workflows/run-daily-aggre-set15.yaml
- .github/workflows/run-daily-aggre-set8.yaml
- .github/workflows/run-daily-aggre-set11.yaml
- .github/workflows/run-daily-aggre-set20.yaml
- .github/workflows/run-daily-aggre-set1.yaml
- .github/workflows/run-daily-aggre-set16.yaml
- .github/workflows/run-daily-aggre-set12.yaml
๐งฐ Additional context used
๐งฌ Code Graph Analysis (1)
insight/tasks/user_weekly_trend_analysis.py (3)
insight/tests/conftest.py (1)
user
(21-30)scraping/velog/client.py (1)
VelogClient
(7-289)insight/models.py (1)
UserWeeklyTrend
(85-125)
๐ช actionlint (1.7.7)
.github/workflows/run-weekly-newsletter.yaml
17-17: the runner of "actions/setup-python@v4" action is too old to run on GitHub Actions. update the action's version to fix this issue
(action)
.github/workflows/run-weekly-analysis.yaml
17-17: the runner of "actions/setup-python@v4" action is too old to run on GitHub Actions. update the action's version to fix this issue
(action)
๐ช YAMLlint (1.37.1)
.github/workflows/run-weekly-newsletter.yaml
[error] 85-85: no new line character at the end of file
(new-line-at-end-of-file)
.github/workflows/run-weekly-analysis.yaml
[error] 89-89: no new line character at the end of file
(new-line-at-end-of-file)
๐ Additional comments (6)
insight/tasks/weekly_newsletter_batch.py (2)
8-8
: ๋ฌธ์ํ ๊ฐ์ ์ด ์ข์ต๋๋ค.Poetry๋ฅผ ์ฌ์ฉํ ์คํ ๋ช ๋ น์ด๋ก ๋ฌธ์๋ฅผ ์ ๋ฐ์ดํธํ ๊ฒ์ด ์ข์ต๋๋ค. ์์กด์ฑ ๊ด๋ฆฌ ์ธก๋ฉด์์ ๋ ์์ ํ ๋ฐฉ๋ฒ์ ๋๋ค.
448-451
: DEBUG ๋ชจ๋ ๊ฑด๋๋ฐ๊ธฐ ๋ก์ง์ด ๋นํ์ฑํ๋์์ต๋๋ค.DEBUG ๋ชจ๋์์ ๋ด์ค๋ ํฐ ๋ฐ์ก์ ๊ฑด๋๋ฐ๋ ๋ก์ง์ด ์ฃผ์ ์ฒ๋ฆฌ๋์์ต๋๋ค. ์ด๋ ์๋์ ์ธ ๋ณ๊ฒฝ์ธ์ง ํ์ธ์ด ํ์ํฉ๋๋ค. ํ๋ก๋์ ํ๊ฒฝ์์๋ ๋ฌธ์ ์์ง๋ง, ๊ฐ๋ฐ/ํ ์คํธ ํ๊ฒฝ์์ ์๋์น ์์ ๋ด์ค๋ ํฐ ๋ฐ์ก์ด ๋ฐ์ํ ์ ์์ต๋๋ค.
์ด ๋ณ๊ฒฝ์ด ์๋์ ์ธ ๊ฒ์ธ์ง ํ์ธํด ์ฃผ์ธ์. ๋ง์ฝ ํ๊ฒฝ๋ณ๋ก ๋ค๋ฅธ ๋์์ด ํ์ํ๋ค๋ฉด ๋ค์๊ณผ ๊ฐ์ ๋์์ ๊ณ ๋ คํด๋ณด์ธ์:
# ํ๊ฒฝ ๋ณ์๋ฅผ ํตํ ์ ์ด if os.getenv("SKIP_NEWSLETTER_SENDING", "false").lower() == "true": logger.info("Newsletter sending skipped due to SKIP_NEWSLETTER_SENDING=true") returninsight/tasks/user_weekly_trend_analysis.py (2)
9-10
: ํ์ ์ด๋ ธํ ์ด์ ์ถ๊ฐ๊ฐ ์ข์ต๋๋ค.ํจ์ ๋งค๊ฐ๋ณ์์ ๋ช ์์ ์ธ ํ์ ์ด๋ ธํ ์ด์ ์ ์ถ๊ฐํ ๊ฒ์ด ์ฝ๋ ํ์ง๊ณผ ๊ฐ๋ ์ฑ์ ํฅ์์ํต๋๋ค.
Also applies to: 28-33
213-213
: ํ์ ์ด๋ ธํ ์ด์ ์ถ๊ฐ๊ฐ ์ข์ต๋๋ค.results ๋ฆฌ์คํธ์ ๋ช ์์ ์ธ ํ์ ์ด๋ ธํ ์ด์ ์ ์ถ๊ฐํ ๊ฒ์ด ์ฝ๋ ๋ช ํ์ฑ์ ํฅ์์ํต๋๋ค.
.github/workflows/run-weekly-newsletter.yaml (1)
1-85
: ์ํฌํ๋ก์ฐ ๊ตฌ์กฐ๊ฐ ์ ์ค๊ณ๋์์ต๋๋ค.ํ๊ฒฝ ์ค์ , ์์กด์ฑ ์ค์น, ๋ฐฐ์น ์คํ, ์คํจ ์ ์๋ฆผ ๋ฑ์ ๊ตฌ์กฐ๊ฐ ์ ์ค๊ณ๋์ด ์์ต๋๋ค. ์๋ ํธ๋ฆฌ๊ฑฐ ๋ฐฉ์๋ ์ ์ ํฉ๋๋ค.
.github/workflows/run-weekly-analysis.yaml (1)
62-74
: ๋ ๊ฐ์ ๋ถ์ ์คํฌ๋ฆฝํธ ์์ฐจ ์คํ์ด ์ ์ ํฉ๋๋ค.์ฃผ๊ฐ ํธ๋ ๋ ๋ถ์๊ณผ ์ฌ์ฉ์๋ณ ์ฃผ๊ฐ ํธ๋ ๋ ๋ถ์์ ์์ฐจ์ ์ผ๋ก ์คํํ๋ ๊ตฌ์กฐ๊ฐ ์ข์ต๋๋ค. ํ์์์ ์ค์ ๋ ๊ฐ ์์ ์ ํน์ฑ์ ๋ง๊ฒ ์ ์ ํ ์ค์ ๋์์ต๋๋ค.
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.
ํ์ผ ๊ฐฏ์๋ง ๋ณด๊ณ ์์ ์ด ์์ฒญ ๋ง๊ฒ ๊ฑฐ๋ ํ๋๋ฐ, ๋จ์ ๋ฉ์ธ์ง ์์
์ด ๋ง์ ๊ฑฐ์๋ค์;;
์ฝ๋๋๋น์ด ์ง์ ํ ๋ฐฐ์น ์ด๋ฆ ๊ด๋ จ ๋ฌธ์ ์ ํ๋์ฝ๋ฉ ๋ฌธ์ ๋บด๊ณ ํฌ๊ฒ ๋ณด์ด๋ ๋ฌธ์ ์ ์ ์๋ ๊ฒ ๊ฐ์ต๋๋ค!
์ข์๋ ์
- ๋ฐฐ์น ๋ฉ์ธ์ง๊ฐ ๊ณผ๋ํ๊ฒ ์์๋ ๊ฒ ๊ฐ์๋ฐ, ์ฐจ๋ผ๋ฆฌ ์ ๊ฑฐํ๊ธธ ์ ํ ๊ฒ ๊ฐ๋ค์!
๊ถ๊ธํ ์
- ์ด๋ฒ์ ํฐ ๊ธฐ๋ฅ ์์ ๋ณด๋ค๋ ๋ฆฐํ ์ค์ ์ ์์ ์ด ์๋ ๊ฒ ๊ฐ์๋ฐ, ๋ง์๊น์? (์ ์ฒด์ ์ผ๋ก ์ค๋ฐ๊ฟ์ด ๋ง์ด ๋ฐ๋ ๊ฒ ๊ฐ์ต๋๋ค!)
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: 0
๐งน Nitpick comments (6)
.github/workflows/run-weekly-newsletter.yaml (3)
31-36
: ์บ์ ํค์ Python ๋ฒ์ ์ ํฌํจํด ์ถฉ๋ ๋ฐฉ์ง
๋์ผ OS์์ 3.12 โ 3.13๋ก ์ ๊ทธ๋ ์ด๋ํ ๊ฒฝ์ฐ.venv
์บ์๊ฐ ๋ค์์ผ ์ ์์ต๋๋ค.-key: venv-${{ hashFiles('poetry.lock') }}-${{ runner.os }} +key: venv-${{ hashFiles('poetry.lock') }}-${{ runner.os }}-py${{ matrix.python-version || '3.13' }}
40-59
: ์ค๋ณตecho
๋ฅผ ๋ฃจํ/Here-doc๋ก ์ถ์ฝํ์ฌ ์ ์ง๋ณด์์ฑ ๊ฐ์-echo "AES_KEY_0=${{ secrets.AES_KEY_0 }}" >> .env -... -echo "AES_KEY_9=${{ secrets.AES_KEY_9 }}" >> .env +for i in {0..9}; do + echo "AES_KEY_${i}=${{ secrets[format('AES_KEY_{0}', i)] }}" >> .env +done๋๋
cat <<'EOF' >> .env
๋ธ๋ก์ ์ฌ์ฉํ๋ฉด ํ ๋จ๊ณ ๋ ๊น๋ํฉ๋๋ค.
85-85
: ๋ง์ง๋ง ์ค ๊ฐํ ๋๋ฝ
์ผ๋ถ YAML/๋ฆฌ๋ ์ค ํด์์ ๊ฒฝ๊ณ ๊ฐ ๋ฐ์ํ ์ ์์ผ๋ฏ๋ก EOF ์ง์ ์ ๊ฐํ์ ์ถ๊ฐํด์ฃผ์ธ์..github/workflows/run-weekly-analysis.yaml (3)
31-36
: ๊ฐ์ํ๊ฒฝ ์บ์ ํค์ Python ๋ฒ์ ํฌํจ ์ ์-key: venv-${{ hashFiles('poetry.lock') }}-${{ runner.os }} +key: venv-${{ hashFiles('poetry.lock') }}-${{ runner.os }}-py${{ matrix.python-version || '3.13' }}
40-61
:.env
์์ฑ ์คํฌ๋ฆฝํธ ์ค๋ณต ์ ๊ฑฐ
AES_KEY_*
10๊ฐ์ ๊ธฐํ ํ๊ฒฝ๋ณ์cat <<EOF
๋ธ๋ก ๋๋for
๋ฃจํ๋ฅผ ํ์ฉํ๋ฉด DRY ์์น์ ์งํฌ ์ ์์ต๋๋ค.
89-89
: EOF ๊ฐํ ์ถ๊ฐ ํ์
ํ์ผ ๋์ ๊ฐํ์ ์ถ๊ฐํด YAML lint ๊ฒฝ๊ณ ๋ฅผ ์ ๊ฑฐํด์ฃผ์ธ์.
๐ Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
๐ Files selected for processing (2)
.github/workflows/run-weekly-analysis.yaml
(1 hunks).github/workflows/run-weekly-newsletter.yaml
(1 hunks)
๐งฐ Additional context used
๐ช YAMLlint (1.37.1)
.github/workflows/run-weekly-analysis.yaml
[error] 89-89: no new line character at the end of file
(new-line-at-end-of-file)
.github/workflows/run-weekly-newsletter.yaml
[error] 85-85: no new line character at the end of file
(new-line-at-end-of-file)
๐ Additional comments (4)
.github/workflows/run-weekly-newsletter.yaml (2)
8-10
: ์์ (Job) ์ด๋ฆ์ด ๋ชฉ์ ์ ๋ง๊ฒ ์์ ๋ ์ ํ์ธํ์ต๋๋ค.
weekly-newsletter-batch
๋ก ๋ช ํํ๊ฒ ์ ๋ฆฌ๋์ด ๊ฐ๋ ์ฑ์ด ์ข์์ก์ต๋๋ค.
16-19
: Python 3.13.0 ์ฑํ ์ ์ด์ ํธํ์ฑ ์ฌ์ ๊ฒ ํ์
3.13.0์ ๋น๊ต์ ์ต์ ๋ฒ์ ์ด๋ผ GitHub Runner, Poetry lock, ๋ผ์ด๋ธ๋ฌ๋ฆฌ ๋ฐ์ด๋๋ฆฌ ํธํ์ฑ์ ๋ฌธ์ ๊ฐ ์๋์ง ๋ค์ ํ ๋ฒ ํ์ธํด์ฃผ์ธ์. ํ์ ์ 3.12 LTS๋ฅผ ์ฌ์ฉํ๊ฑฐ๋, ํ ์คํธ ๋งคํธ๋ฆญ์ค์ 3.12/3.13์ ๋ชจ๋ ๋๋ ค๋ณด๋ ๋ฐฉ์์ ๊ถ์ฅ๋๋ฆฝ๋๋ค..github/workflows/run-weekly-analysis.yaml (2)
8-10
: ์์ (Job) ์ด๋ฆ ๋ณ๊ฒฝ ์ฌํญ ํ์ธ ์๋ฃ
weekly-trend-analysis-batch
๋ก ์์ ๋ผ ๋ชฉ์ ์ด ๋ช ํํด์ก์ต๋๋ค.
16-19
: Python 3.13.0 ์ฌ์ฉ ์ ํธํ์ฑ ์ฒดํฌ ๊ถ์ฅ
CI ๋ฌ๋์ ์์กด ํจํค์ง๊ฐ 3.13์ ์์ ํ ์ง์ํ๋์ง ํ์ธ ๋ฐ๋๋๋ค. ํ์ ์ 3.12 ๋ณํ ํ ์คํธ๋ฅผ ๊ณ ๋ คํด์ฃผ์ธ์.
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.
๋ฉ์ธ ๋ฐฐ์น ์ก์
์์ ํ๋ ค๋ฉด 20๊ฐ๋ฅผ ๋ค ์ผ์ผํ ํด์ค์ผ ํ๋๊ตฐ์..?!ใ
ใ
ใ
ใ
ใ
์ฑ๊ณต์๋ฆผ ์ญ์ ๋ ๊ฑฐ ์ข์ ๊ฒ ๊ฐ์์!!
๋ฐ๋ก ์ด๊ฒฌ์ ์์ต๋๋ค! ์ค์ผ์ฅด์ ์์์ผ ์๋ฒฝ์ผ๋ก ๋ดค๋ ๊ฒ ๊ฐ์๋ฐ ์ถํ์ ์์ ํ์ค ์์ ์ด์ ๊ฑด๊ฐ์?
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.
์ฝ๋ ํ์ธํ์ต๋๋ค ๊ณ ์ํ์ จ์ต๋๋ค~!!
์ข์๋ ์
- ๋ฐ์ผ๋ฆฌ ํต๊ณ ๋ฐฐ์น ์ฌ๋ ์๋ฆผ ์ญ์ ํ์ ๋ถ๋ถ ์ข์ ๊ฒ ๊ฐ์ต๋๋ค!
- ๋ถ์ ๋ฐฐ์น ๋ฐ ๋ด์ค ๋ฐ์ก ๋ฐฐ์น ์คํจ ์, ์๋ฆผ ์ค๋๋ก ์ค์ ํ์ ๋ถ๋ถ๋ ์ข์ ๊ฒ ๊ฐ์ต๋๋ค!
๐ฅ ๋ณ๊ฒฝ ์ฌํญ
์ฃผ์
insight/tasks/user_weekly_trend_analysis.py
์insight/tasks/weekly_newsletter_batch.py
๋ณ๊ฒฝ ์ฌํญ์ ๋ฌด์๐ ์ฒดํฌ๋ฆฌ์คํธ
Summary by CodeRabbit
Chores
Bug Fixes
New Features