-
Notifications
You must be signed in to change notification settings - Fork 35
[volume-10] Collect, Stack, Zip #237
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
base: yeonjiyeon
Are you sure you want to change the base?
Changes from all commits
6ead99e
8e06929
5569bf6
ee02ce7
e1d3f05
b399fde
a143f91
0096dae
7f05b54
ca1fed1
d5280ea
05b7b2a
227d932
003b543
00498cd
1ad67da
4a13366
bc962b2
0605dc4
f1d94ed
a51021c
a946ac0
33c0ab8
b73c2c6
8d5e90a
d6711cf
7a56684
ded9e38
5b83c03
3158c2b
e287600
9c5e6ea
3774002
8e5643a
ef3eebd
d738654
b06e034
6c48755
d9ae7ad
5bb8d33
d505115
624b780
a97d77b
55f8c8b
592a4e5
4faa67e
86a8205
d06a0d0
5042c22
4fda674
25b423e
04ff345
7e0ac82
1087ea2
3e2e0f4
5db5c36
aa374c3
c74e6ad
c80ed47
c5754ff
deda1e2
617746d
be18c88
0074ea9
b84525a
52b62bd
34df8d5
4ca321e
339132b
d321b49
caec6fa
da195a3
6c87e71
9107d53
ff20736
bec68bd
4cfbae4
32c8789
8ceebb8
aaea47a
3637e2e
914900c
e898b73
9a308a7
48db0f3
f44f912
289120f
d8bba1a
92c486f
e667a57
948e1e0
2fa314d
bc4e2e8
84c9c0d
b9a4147
d52739a
efc9a5f
c9dcf7d
0978394
4a79620
1afa04f
cafb370
ae5a7c8
eaf0fb2
08d6f36
982cca7
2c183aa
6a55717
a230acb
bf668de
adc3f43
38005dd
24eee76
41e3b03
3b2ed9e
b4b8a61
0207881
e34e110
e874858
b849cf7
7367c45
241da9d
6462c33
c295ebb
50d553e
abfd777
88d484f
d40f6d5
201cf3b
cd84589
c194e30
3b17ea4
b6ebc4c
31f7528
9969cbc
4d4261d
3c24ed2
b3db4ed
06fb841
60ebf6d
93ac95d
36aad30
1a3aa85
74e354b
7cb28e5
7bc7bf3
09fa5e7
c91cd66
75b2811
6eaf1aa
7af3ae8
2a38caf
67344b8
432cd74
ceb53ce
985954c
2a30ac7
e667da8
4a1aa52
6de080b
cd878d5
425b980
6fe3025
db4ed51
ee16413
21dc4d2
d9322e1
e0ef326
6f4a795
384ec82
5bd085e
84b46b4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| name: PR Agent | ||
| on: | ||
| pull_request: | ||
| types: [opened, synchronize] | ||
| jobs: | ||
| pr_agent_job: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: PR Agent action step | ||
| uses: Codium-ai/pr-agent@main | ||
| env: | ||
| OPENAI_KEY: ${{ secrets.OPENAI_KEY }} | ||
| GITHUB_TOKEN: ${{ secrets.G_TOKEN }} | ||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -34,4 +34,22 @@ dependencies { | |||||||||||||||||||||||||||||
| // test-fixtures | ||||||||||||||||||||||||||||||
| testImplementation(testFixtures(project(":modules:jpa"))) | ||||||||||||||||||||||||||||||
| testImplementation(testFixtures(project(":modules:redis"))) | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| // Resilience4j (Spring Boot 3.x ๊ธฐ์ค) | ||||||||||||||||||||||||||||||
| implementation("io.github.resilience4j:resilience4j-spring-boot3") | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| // AOP | ||||||||||||||||||||||||||||||
| implementation("org.springframework.boot:spring-boot-starter-aop") | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| // actuator | ||||||||||||||||||||||||||||||
| implementation("org.springframework.boot:spring-boot-starter-actuator") | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| //Micrometer Prometheus | ||||||||||||||||||||||||||||||
| implementation("io.micrometer:micrometer-registry-prometheus") | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| //Spring Cloud OpenFeign | ||||||||||||||||||||||||||||||
| implementation("org.springframework.cloud:spring-cloud-starter-openfeign") | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
|
Comment on lines
+38
to
+52
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ์ค๋ณต๋ ์์กด์ฑ ์ ์ธ์ ์ ๊ฑฐํ์ธ์. ๋ค์ ์์กด์ฑ๋ค์ด ์ด๋ฏธ ํ์ผ ์๋จ์ ์ ์ธ๋์ด ์์ต๋๋ค:
Gradle์ ์ค๋ณต ์ ์ธ์ ๋ฌด์ํ์ง๋ง, ์ ์ง๋ณด์ ๋ถ๋ด๊ณผ ํผ๋์ ์ผ๊ธฐํ ์ ์์ต๋๋ค. ๐ ์ค๋ณต ์ ๊ฑฐ ์ ์-
- // Resilience4j (Spring Boot 3.x ๊ธฐ์ค)
- implementation("io.github.resilience4j:resilience4j-spring-boot3")
-
- // AOP
- implementation("org.springframework.boot:spring-boot-starter-aop")
-
- // actuator
- implementation("org.springframework.boot:spring-boot-starter-actuator")
-
- //Micrometer Prometheus
- implementation("io.micrometer:micrometer-registry-prometheus")
-
- //Spring Cloud OpenFeign
- implementation("org.springframework.cloud:spring-cloud-starter-openfeign")
-๐ Committable suggestion
Suggested change
๐ค Prompt for AI Agents |
||||||||||||||||||||||||||||||
| //Spring Cloud CircuitBreaker | ||||||||||||||||||||||||||||||
| implementation("org.springframework.cloud:spring-cloud-starter-circuitbreaker-resilience4j") | ||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,54 +1,15 @@ | ||
| package com.loopers.infrastructure.rank; | ||
|
|
||
| import java.time.LocalDateTime; | ||
| import java.time.format.DateTimeFormatter; | ||
| import com.loopers.application.rank.RankingInfo; | ||
| import java.util.List; | ||
| import java.util.Set; | ||
| import java.util.concurrent.TimeUnit; | ||
| import lombok.RequiredArgsConstructor; | ||
| import org.springframework.data.redis.connection.zset.Aggregate; | ||
| import org.springframework.data.redis.connection.zset.Weights; | ||
| import org.springframework.data.redis.core.RedisTemplate; | ||
| import org.springframework.stereotype.Component; | ||
|
|
||
| @Component | ||
| @RequiredArgsConstructor | ||
| public class RankingService { | ||
| public interface RankingService { | ||
|
|
||
| private final RedisTemplate<String, String> redisTemplate; | ||
| List<Long> getTopRankingIds(String date, int page, int size); | ||
|
|
||
| public List<Long> getTopRankingIds(String date, int page, int size) { | ||
| String key = "ranking:all:" + date; | ||
| int start = (page - 1) * size; | ||
| int end = start + size - 1; | ||
| List<RankingInfo> getWeeklyRankings(String date, int page, int size); | ||
|
|
||
| Set<String> rankedIds = redisTemplate.opsForZSet().reverseRange(key, start, end); | ||
| List<RankingInfo> getMonthlyRankings(String date, int page, int size); | ||
|
|
||
| if (rankedIds == null || rankedIds.isEmpty()) { | ||
| return List.of(); | ||
| } | ||
|
|
||
| return rankedIds.stream() | ||
| .map(Long::valueOf) | ||
| .toList(); | ||
| } | ||
|
|
||
| public Integer getProductRank(Long productId) { | ||
| String today = LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyyMMdd")); | ||
| String key = "ranking:all:" + today; | ||
|
|
||
| Long rank = redisTemplate.opsForZSet().reverseRank(key, String.valueOf(productId)); | ||
|
|
||
| return (rank != null) ? rank.intValue() + 1 : null; | ||
| } | ||
|
|
||
| public void carryOverRanking(String sourceDate, String targetDate, double weight) { | ||
| String sourceKey = "ranking:all:" + sourceDate; | ||
| String targetKey = "ranking:all:" + targetDate; | ||
|
|
||
| redisTemplate.opsForZSet().unionAndStore(sourceKey, List.of(), targetKey, | ||
| Aggregate.SUM, Weights.of(weight)); | ||
|
|
||
| redisTemplate.expire(targetKey, 2, TimeUnit.DAYS); | ||
| } | ||
| Integer getProductRank(Long productId); | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,65 @@ | ||
| package com.loopers.infrastructure.rank; | ||
|
|
||
| import com.loopers.application.rank.RankingInfo; | ||
| import com.loopers.domain.rank.monthly.MonthlyRankingMVRepository; | ||
| import com.loopers.domain.rank.weekly.WeeklyRankingMVRepository; | ||
| import java.time.LocalDateTime; | ||
| import java.time.format.DateTimeFormatter; | ||
| import java.util.List; | ||
| import java.util.Set; | ||
| import lombok.RequiredArgsConstructor; | ||
| import org.springframework.data.domain.PageRequest; | ||
| import org.springframework.data.redis.core.RedisTemplate; | ||
| import org.springframework.stereotype.Component; | ||
|
|
||
| @RequiredArgsConstructor | ||
| @Component | ||
| public class RankingServiceImpl implements RankingService { | ||
|
|
||
| private final RedisTemplate<String, String> redisTemplate; | ||
| private final WeeklyRankingMVRepository weeklyRepository; | ||
| private final MonthlyRankingMVRepository monthlyRepository; | ||
|
|
||
| @Override | ||
| public List<Long> getTopRankingIds(String date, int page, int size) { | ||
| String key = "ranking:all:" + date; | ||
| int start = (page - 1) * size; | ||
| int end = start + size - 1; | ||
|
|
||
| Set<String> rankedIds = redisTemplate.opsForZSet().reverseRange(key, start, end); | ||
|
|
||
| if (rankedIds == null || rankedIds.isEmpty()) { | ||
| return List.of(); | ||
| } | ||
|
|
||
| return rankedIds.stream() | ||
| .map(Long::valueOf) | ||
| .toList(); | ||
| } | ||
|
|
||
| @Override | ||
| public List<RankingInfo> getWeeklyRankings(String date, int page, int size) { | ||
| return weeklyRepository.findByBaseDateOrderByCurrentRankAsc(date, PageRequest.of(page - 1, size)) | ||
| .stream() | ||
| .map(RankingInfo::from) | ||
| .toList(); | ||
| } | ||
|
|
||
| @Override | ||
| public List<RankingInfo> getMonthlyRankings(String date, int page, int size) { | ||
| return monthlyRepository.findByBaseDateOrderByCurrentRankAsc(date, PageRequest.of(page - 1, size)) | ||
| .stream() | ||
| .map(RankingInfo::from) | ||
| .toList(); | ||
| } | ||
|
|
||
| @Override | ||
| public Integer getProductRank(Long productId) { | ||
| String today = LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyyMMdd")); | ||
| String key = "ranking:all:" + today; | ||
|
|
||
| Long rank = redisTemplate.opsForZSet().reverseRank(key, String.valueOf(productId)); | ||
|
|
||
| return (rank != null) ? rank.intValue() + 1 : null; | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -32,7 +32,6 @@ spring: | |
| connectTimeout: 1000 | ||
| readTimeout: 1000 | ||
|
|
||
|
|
||
| resilience4j: | ||
| retry: | ||
| instances: | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| dependencies { | ||
| // add-ons | ||
| implementation(project(":modules:jpa")) | ||
| implementation(project(":modules:redis")) | ||
| implementation(project(":supports:jackson")) | ||
| implementation(project(":supports:logging")) | ||
| implementation(project(":supports:monitoring")) | ||
|
|
||
| // batch | ||
| implementation("org.springframework.boot:spring-boot-starter-batch") | ||
| testImplementation("org.springframework.batch:spring-batch-test") | ||
|
|
||
| // querydsl | ||
| annotationProcessor("com.querydsl:querydsl-apt::jakarta") | ||
| annotationProcessor("jakarta.persistence:jakarta.persistence-api") | ||
| annotationProcessor("jakarta.annotation:jakarta.annotation-api") | ||
|
|
||
| // test-fixtures | ||
| testImplementation(testFixtures(project(":modules:jpa"))) | ||
| testImplementation(testFixtures(project(":modules:redis"))) | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| package com.loopers; | ||
|
|
||
| import jakarta.annotation.PostConstruct; | ||
| import org.springframework.boot.SpringApplication; | ||
| import org.springframework.boot.autoconfigure.SpringBootApplication; | ||
| import org.springframework.boot.context.properties.ConfigurationPropertiesScan; | ||
|
|
||
| import java.util.TimeZone; | ||
| import org.springframework.scheduling.annotation.EnableScheduling; | ||
|
|
||
| @EnableScheduling | ||
| @ConfigurationPropertiesScan | ||
| @SpringBootApplication | ||
| public class CommerceBatchApplication { | ||
|
|
||
| @PostConstruct | ||
| public void started() { | ||
| // set timezone | ||
| TimeZone.setDefault(TimeZone.getTimeZone("Asia/Seoul")); | ||
| } | ||
|
|
||
| public static void main(String[] args) { | ||
| int exitCode = SpringApplication.exit(SpringApplication.run(CommerceBatchApplication.class, args)); | ||
| System.exit(exitCode); | ||
| } | ||
|
Comment on lines
+11
to
+25
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ๐งฉ Analysis chain๐ Script executed: #!/bin/bash
# commerce-batch ๋ชจ๋์์ @Scheduled ๋ฉ์๋ ๊ฒ์
rg -n --type=java '@Scheduled' apps/commerce-batch/Repository: Loopers-dev-lab/loopers-spring-java-template Length of output: 357 ๐ Script executed: #!/bin/bash
# commerce-batch ๋ชจ๋์ ์ ์ฒด Java ํ์ผ ๋ชฉ๋ก ํ์ธ
find apps/commerce-batch/src -name "*.java" -type f | head -20Repository: Loopers-dev-lab/loopers-spring-java-template Length of output: 1505 ๐ Script executed: #!/bin/bash
# commerce-batch ๋ชจ๋ ๊ตฌ์กฐ ํ์ธ
ls -la apps/commerce-batch/src/main/java/com/loopers/Repository: Loopers-dev-lab/loopers-spring-java-template Length of output: 328
๋ฌธ์ :
ํด๊ฒฐ ๋ฐฉ์:
๐ค Prompt for AI Agents |
||
| } | ||
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:
Repository: Loopers-dev-lab/loopers-spring-java-template
Length of output: 487
๐ Script executed:
Repository: Loopers-dev-lab/loopers-spring-java-template
Length of output: 104
๐ Web query:
Codium-ai pr-agent GitHub action trustworthiness security๐ก Result:
Short answer: PR-Agent (CodiumโAI / now Qodo) has had real, documented security issues; two vulnerabilities (CVEโ2024โ51355 and CVEโ2024โ51356) were reported and responsible disclosures and fixes were published โ so treat the GitHub Action as potentially risky unless you follow mitigation steps and use patched/pinned images or selfโhost. Sources: independent security research and the project's security notes. [1][2][3]
Key points and what to do
Want me to:
๐ Script executed:
Repository: Loopers-dev-lab/loopers-spring-java-template
Length of output: 1682
๐ Web query:
CVE-2024-51355 CVE-2024-51356 pr-agent codium-ai patch fix version๐ก Result:
CVE-2024-51355 and CVE-2024-51356 affect PRโAgent (CodiumAI / Qodo Merge). The upstream fix was released in PRโAgent v0.26 (and included in later releases). [1][2][3]
Sources:
Codium-ai/pr-agent ์ก์ ์ ์๋ ค์ง ๋ณด์ ์ทจ์ฝ์ ์ผ๋ก ์ธํด ๊ธด๊ธ ์กฐ์น๊ฐ ํ์ํฉ๋๋ค.
Codium-ai/pr-agent์์ ๋ฐ๊ฒฌ๋ CVE-2024-51355์ CVE-2024-51356 (๋น๋ฐ ์ ๋ณด ํ์ทจ ๋ฐ ์ ์ฅ์ ์ฐ๊ธฐ ๊ถํ ์ ์ฉ ์ํ)์ ๊ณ ๋ คํ๋ฉด, ํ์ฌ ์ํฌํ๋ก์ฐ ๊ตฌ์ฑ์ด ์ํํฉ๋๋ค:
@main์ฌ์ฉ ์ค๋จ: ํน์ ๋ฒ์ (v0.26 ์ด์์ ํจ์น๋ ๋ฆด๋ฆฌ์ค)์ผ๋ก ๊ณ ์ ํ์ธ์. ํ์ฌ@main์ ๋ฏธํจ์น ๋ฒ์ ์ ๊ฐ์ ธ์ฌ ์ ์์ต๋๋ค.permissions๋ธ๋ก ์ถ๊ฐ: PR ์ฝ๋ฉํธ ์์ฑ๋ง ํ์ํ๋ฉด ์ต์ ๊ถํ์ผ๋ก ์ ํํ์ธ์:๐ค Prompt for AI Agents