-
Notifications
You must be signed in to change notification settings - Fork 0
π¨chore : μ΄μμλ²μ λ§κ² μμ #90
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
The head ref may contain hidden characters: "feat/\uC778\uD504\uB77C-\uAD00\uB828-\uAE30\uB2A5-\uAD6C\uD604"
Conversation
Walkthroughνλ‘λμ νκ²½ μ€μ μ μ 리νλ λ³κ²½μ¬νμ λλ€. CI/CD μν¬νλ‘μ°λ₯Ό νλ‘λμ OAuth2 μν¬λ¦Ώ μ¬μ©μΌλ‘ μ λ°μ΄νΈνκ³ , Docker μ€μ μ μΈλΆ μ€μ νμΌ λ§μ΄ν λ°©μμΌλ‘ λ³κ²½νλ©°, νλ‘λμ Swagger μ€μ ν΄λμ€λ₯Ό μΆκ°ν©λλ€. Changes
Estimated code review effortπ― 2 (Simple) | β±οΈ ~12 minutes Poem
π₯ Pre-merge checks | β 1 | β 2β Failed checks (2 warnings)
β Passed checks (1 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: 2
Caution
Some comments are outside the diff and canβt be posted inline due to platform limitations.
β οΈ Outside diff range comments (2)
.github/workflows/main-ci-cd.yml (2)
55-64: νλ‘νμΌ include μ€μ κ³Ό μ€μ νμΌλͺ μ΄ λΆμΌμΉν©λλ€.
spring.profiles.includeκ°oauth2-devλ‘ μ€μ λμ΄ μμ§λ§, μ€μ λ‘ μμ±λλ νμΌμapplication-oauth2-prod.ymlμ λλ€. μ΄μ νκ²½μ λ§κ² includeλ₯Όoauth2-prodλ‘ λ³κ²½ν΄μΌ ν©λλ€.π μμ μ μ
cat <<EOF > ./src/main/resources/application.yml spring: profiles: active: prod include: - - oauth2-dev + - oauth2-prod EOF
145-152: μ΄μ μ€μ νμΌ λ°°ν¬ λ¨κ³κ° λλ½λμμ΅λλ€.
docker-compose.ymlμ/home/ubuntu/app/config/κ²½λ‘μμapplication-prod.ymlκ³Όapplication-oauth2-prod.ymlνμΌμ λ§μ΄νΈνλλ‘ μ€μ λμ΄ μμ§λ§, CD λ¨κ³μμλ.envμdocker-compose.ymlλ§ EC2λ‘ λ³΅μ¬ν©λλ€. μ€μ νμΌλ€μ΄ EC2 μλ²μ λ°°ν¬λμ§ μμΌλ©΄ 컨ν μ΄λ μμ μ μ€μ λ‘λμ μ€ν¨ν μ μμ΅λλ€.π μμ μ μ: μ€μ νμΌ μμ± λ° λ°°ν¬ λ¨κ³ μΆκ°
- name: env μμ± run: echo "${{ secrets.PROD_ENV }}" > .env + - name: config νμΌ μμ± + run: | + mkdir -p config + echo "${{ secrets.APPLICATION_PROD_YML }}" > config/application-prod.yml + echo "${{ secrets.APPLICATION_OAUTH2_PROD_YML }}" > config/application-oauth2-prod.yml - name: 3. docker-compose.yml μ λ¬ uses: appleboy/scp-action@master with: host: ${{ secrets.EC2_PROD_PUBLIC_IP }} username: ${{ secrets.SSH_USER }} key: ${{ secrets.EC2_PROD_PRIVATE_KEY }} - source: ".env,docker-compose.yml" + source: ".env,docker-compose.yml,config" target: "/home/ubuntu/app/"
π€ Fix all issues with AI agents
In
`@src/main/java/com/pinHouse/server/core/config/swaagger/ProdSwaggerConfig.java`:
- Line 1: ν¨ν€μ§ μ μΈμ μ€νκ° μμ΄ ProdSwaggerConfig ν΄λμ€μ package ꡬ문μ "package
com.pinHouse.server.core.config.swaagger;"μμ "package
com.pinHouse.server.core.config.swagger;"λ‘ λ³κ²½νκ³ , μμ€ νμΌμ΄ μμΉν λλ ν 리 μ΄λ¦λ swaagger β
swaggerλ‘ λ¦¬λ€μνμ¬ ν¨ν€μ§ κ²½λ‘μ μ€μ λλ ν λ¦¬κ° μΌμΉνλλ‘ μμ νμΈμ.
- Around line 43-48: The sortSchemasAlphabetically() OpenApiCustomizer can NPE
if openApi.getComponents() or openApi.getComponents().getSchemas() is null;
update the method to null-check components and schemas (in
sortSchemasAlphabetically) before creating a TreeMap and only replace schemas
when non-null, or set an empty map when schemas are null, using the existing
openApi.getComponents() and getSchemas() accessors to locate and guard the
calls.
π§Ή Nitpick comments (1)
src/main/java/com/pinHouse/server/core/config/swaagger/ProdSwaggerConfig.java (1)
16-20: μ£Όμ λ΄μ©κ³Ό μ€μ ꡬνμ΄ μΌμΉνμ§ μμ΅λλ€.μ£Όμμ "μ€μ¨κ±° λ΄λΆ JWT μ€μ μΆκ°"λΌκ³ λμ΄ μμ§λ§, μ€μ μ½λμλ JWT 보μ μ€μ μ΄ κ΅¬νλμ΄ μμ§ μμ΅λλ€. JWT μ€μ μ΄ νμνλ€λ©΄
SecuritySchemeμ μΆκ°νκ±°λ, νμ μλ€λ©΄ μ£Όμμ μμ ν΄ μ£ΌμΈμ.
| @@ -0,0 +1,49 @@ | |||
| package com.pinHouse.server.core.config.swaagger; | |||
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.
ν¨ν€μ§λͺ μ μ€νκ° μμ΅λλ€.
swaaggerκ° μλ swaggerκ° μ¬λ°λ₯Έ μ² μμ
λλ€.
π μμ μ μ
-package com.pinHouse.server.core.config.swaagger;
+package com.pinHouse.server.core.config.swagger;λλ ν 리λͺ λ ν¨κ» μμ ν΄μΌ ν©λλ€.
π 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.
| package com.pinHouse.server.core.config.swaagger; | |
| package com.pinHouse.server.core.config.swagger; |
π€ Prompt for AI Agents
In
`@src/main/java/com/pinHouse/server/core/config/swaagger/ProdSwaggerConfig.java`
at line 1, ν¨ν€μ§ μ μΈμ μ€νκ° μμ΄ ProdSwaggerConfig ν΄λμ€μ package ꡬ문μ "package
com.pinHouse.server.core.config.swaagger;"μμ "package
com.pinHouse.server.core.config.swagger;"λ‘ λ³κ²½νκ³ , μμ€ νμΌμ΄ μμΉν λλ ν 리 μ΄λ¦λ swaagger β
swaggerλ‘ λ¦¬λ€μνμ¬ ν¨ν€μ§ κ²½λ‘μ μ€μ λλ ν λ¦¬κ° μΌμΉνλλ‘ μμ νμΈμ.
| public OpenApiCustomizer sortSchemasAlphabetically() { | ||
| return openApi -> { | ||
| Map<String, Schema> schemas = openApi.getComponents().getSchemas(); | ||
| openApi.getComponents().setSchemas(new TreeMap<>(schemas)); | ||
| }; | ||
| } |
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.
getSchemas()κ° nullμ λ°νν κ²½μ° NPEκ° λ°μν μ μμ΅λλ€.
OpenAPI μ€νμ μ€ν€λ§κ° μλ κ²½μ° getSchemas()κ° nullμ λ°νν μ μμ΄ TreeMap μμ± μ NullPointerExceptionμ΄ λ°μν©λλ€.
π null μ²΄ν¬ μΆκ° μ μ
`@Bean`
public OpenApiCustomizer sortSchemasAlphabetically() {
return openApi -> {
- Map<String, Schema> schemas = openApi.getComponents().getSchemas();
- openApi.getComponents().setSchemas(new TreeMap<>(schemas));
+ if (openApi.getComponents() != null && openApi.getComponents().getSchemas() != null) {
+ Map<String, Schema> schemas = openApi.getComponents().getSchemas();
+ openApi.getComponents().setSchemas(new TreeMap<>(schemas));
+ }
};
}π 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.
| public OpenApiCustomizer sortSchemasAlphabetically() { | |
| return openApi -> { | |
| Map<String, Schema> schemas = openApi.getComponents().getSchemas(); | |
| openApi.getComponents().setSchemas(new TreeMap<>(schemas)); | |
| }; | |
| } | |
| public OpenApiCustomizer sortSchemasAlphabetically() { | |
| return openApi -> { | |
| if (openApi.getComponents() != null && openApi.getComponents().getSchemas() != null) { | |
| Map<String, Schema> schemas = openApi.getComponents().getSchemas(); | |
| openApi.getComponents().setSchemas(new TreeMap<>(schemas)); | |
| } | |
| }; | |
| } |
π€ Prompt for AI Agents
In
`@src/main/java/com/pinHouse/server/core/config/swaagger/ProdSwaggerConfig.java`
around lines 43 - 48, The sortSchemasAlphabetically() OpenApiCustomizer can NPE
if openApi.getComponents() or openApi.getComponents().getSchemas() is null;
update the method to null-check components and schemas (in
sortSchemasAlphabetically) before creating a TreeMap and only replace schemas
when non-null, or set an empty map when schemas are null, using the existing
openApi.getComponents() and getSchemas() accessors to locate and guard the
calls.
π μμ ν λ΄μ©
π μ°Έκ³ μ¬ν
πΌοΈ μ€ν¬λ¦°μ·
π κ΄λ ¨ μ΄μ
β 체ν¬λ¦¬μ€νΈ
Summary by CodeRabbit
λ¦΄λ¦¬μ€ λ ΈνΈ
μλ‘μ΄ κΈ°λ₯
μμ
βοΈ Tip: You can customize this high-level summary in your review settings.