Skip to content

Feat/29/press-defect-detection-model-service: 프레스 공정 - 임포트문 수정 및 __init__.py 추가#70

Merged
haeyekim merged 4 commits intomainfrom
feat/29/press-defect-model-api
Aug 28, 2025
Merged

Feat/29/press-defect-detection-model-service: 프레스 공정 - 임포트문 수정 및 __init__.py 추가#70
haeyekim merged 4 commits intomainfrom
feat/29/press-defect-model-api

Conversation

@haeyekim
Copy link
Member

@haeyekim haeyekim commented Aug 28, 2025

✨ Description

  • 모듈화하기 위한 init.py 추가
  • app 폴더 외부에서 가상환경 실행하기 위해 import문 앞에 app. 첨가

✅ Task

  • 작업한 내용 1
  • 작업한 내용 2

✅ Test Result

  • 테스트 진행 여부 및 결과를 간략히 작성해 주세요.
    예: 모든 테스트 통과 / 새로운 테스트 케이스 추가 등

📸 Screenshot (선택)

  • 결과 이미지, 시각화 그래프 등 필요한 경우 첨부해 주세요.

📌 Etc

  • 코드 리뷰 시 확인이 필요한 부분이나 기타 참고 사항을 적어 주세요.

Summary by CodeRabbit

  • New Features
    • No user-facing feature changes in this release.
  • Refactor
    • Aligned internal module import paths to a consistent application package structure, with no impact on behavior or APIs.
  • Chores
    • Updated external model source reference to the correct repository.
    • Standardized configuration formatting for consistency.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Aug 28, 2025

Walkthrough

Updated YOLOv7 submodule URL in .gitmodules. Adjusted Python import paths in the model service to use app.* package namespaces. No functional or API changes; logic and endpoints remain the same.

Changes

Cohort / File(s) Summary
Submodule config
.gitmodules
Updated YOLOv7 submodule URL to https://github.com/WongKinYiu/yolov7.git; switched indentation to a tab; ensured EOF formatting.
App import path normalization
services/press-defect-detection-model-service/app/main.py, services/press-defect-detection-model-service/app/routers/predict.py
Changed imports to use app.* package paths: press_models.yolo_modelapp.press_models.yolo_model, services.inferenceapp.services.inference, and router imports updated accordingly. No behavioral changes.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

A rabbit taps the repo’s gate, hop-hop, tidy and bright,
Points YOLO to the proper burrow, URL set right.
Imports line up, paths in a row—no logic to rewrite.
With whiskers twitching, CI smiles: “Green lights tonight!”
Carrot commits made small and light.

Tip

🔌 Remote MCP (Model Context Protocol) integration is now available!

Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats.

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/29/press-defect-model-api

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.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbit in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbit in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbit gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbit read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbit help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbit ignore or @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbit summary or @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbit or @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@github-actions
Copy link

🤖 Smart FAST 자동 코드 리뷰

📦 변경된 서비스 (1개):

  • press-defect-detection-model-service 서비스

🎯 PR 제목에서 서비스 자동 감지됨

  • 제목: Feat/29/press-defect-detection-model-service: 프레스 공정 - 임포트문 수정 및 __init__.py 추가

📊 전체 검사 결과:

⚠️ 일부 검사에서 문제 발견 - 확인 필요

🧪 테스트 & 코드 품질 결과:

⚠️ 테스트 & 린트 상태 불명

  • 총 테스트: 3개
  • 성공: 0개 ✅
  • 실패: 3개 ❌
  • 커버리지: 0%
  • 린트 오류: 4개
  • 린트 경고: 0개

🔍 실패한 테스트:

  • press-defect-detection-model-service

🔒 보안 스캔 결과:

⚠️ 보안 스캔 상태 불명

  • 보안 이슈가 발견되지 않았습니다 ✅

✅ 검사 체크리스트:

  • ❌ 테스트 실패
  • ❌ 린트 오류 발견
  • ❌ 보안 이슈 발견

🚀 배포 정보:

  • ⚠️ 검사 실패 - 문제 해결 후 배포 가능
    • 🧪 테스트 문제 해결 필요
    • 🔒 보안 이슈 해결 필요
  • 📋 상세 로그는 Actions 탭에서 확인 가능

@haeyekim haeyekim merged commit 26d5c17 into main Aug 28, 2025
8 of 9 checks passed
Copy link
Contributor

@coderabbitai coderabbitai bot left a 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 (3)
.gitmodules (1)

2-3: Add submodule initialization to CI pipelines

The .gitmodules file correctly pins the yolov7 submodule at commit a207844b1ce82d204ab36d87d496728d3d2348e7, but a plain git submodule status shows it’s uninitialized (leading - prefix). Ensure your CI config runs, for example:

git submodule update --init --recursive services/press-defect-detection-model-service/app/yolov7

This guarantees the submodule is fetched at the pinned SHA before any build steps.

services/press-defect-detection-model-service/app/routers/predict.py (1)

1-13: Gate runtime import in predict_router_module.py
The scan uncovered a remaining runtime import in app/predict_router_module.py (line 10). Apply the same pattern there: add

+ from __future__ import annotations
  from typing import TYPE_CHECKING
  if TYPE_CHECKING:
-     from services.inference import InferenceService  # type: ignore
+     from app.services.inference import InferenceService

This avoids latent import cycles and speeds up startup.

services/press-defect-detection-model-service/app/main.py (1)

181-188: Match uvicorn app target to the new absolute package path.

If you intend to run from outside the app folder, target the fully qualified module.

Apply:

 if __name__ == "__main__":
-    uvicorn.run(
-        "main:app",
+    uvicorn.run(
+        "app.main:app",
         host="0.0.0.0",
         port=8000,
         reload=True,
         log_level="info"
     )

Ensure README/run scripts use:

  • uvicorn app.main:app --host 0.0.0.0 --port 8000
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between dbfad2e and cbe859d.

📒 Files selected for processing (3)
  • .gitmodules (1 hunks)
  • services/press-defect-detection-model-service/app/main.py (1 hunks)
  • services/press-defect-detection-model-service/app/routers/predict.py (1 hunks)
🧰 Additional context used
🧬 Code graph analysis (2)
services/press-defect-detection-model-service/app/routers/predict.py (1)
services/press-defect-detection-model-service/app/services/inference.py (1)
  • InferenceService (14-234)
services/press-defect-detection-model-service/app/main.py (3)
services/press-defect-detection-model-service/app/press_models/yolo_model.py (1)
  • YOLOv7Model (15-339)
services/press-defect-detection-model-service/app/services/inference.py (1)
  • InferenceService (14-234)
services/press-defect-detection-model-service/app/routers/predict.py (1)
  • set_inference_service (21-24)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: aggregate-results
🔇 Additional comments (3)
.gitmodules (1)

2-3: LGTM: Submodule now points to official YOLOv7 repo.

Good switch to the canonical upstream; aligns with the model wrapper’s expectations.

services/press-defect-detection-model-service/app/routers/predict.py (1)

11-11: Absolute import to app.services.inference is correct and consistent with PR goals.

services/press-defect-detection-model-service/app/main.py (1)

11-13: Imports migrated to app. namespace—alignment looks good.*

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant