Skip to content

Feat/67/press-defect-data-simulator-service#71

Merged
haeyekim merged 10 commits intomainfrom
feat/67/update-press-defect-simulator
Aug 28, 2025
Merged

Feat/67/press-defect-data-simulator-service#71
haeyekim merged 10 commits intomainfrom
feat/67/update-press-defect-simulator

Conversation

@haeyekim
Copy link
Member

@haeyekim haeyekim commented Aug 28, 2025

✨ Description

  • 어떤 작업을 완료했는지 간략히 설명해 주세요.

✅ Task

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

✅ Test Result

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

📸 Screenshot (선택)

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

📌 Etc

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

Summary by CodeRabbit

  • New Features
    • Added an event-driven mode with Spring Boot integration alongside the existing direct-call mode.
    • Mode-aware health checks, status, and summaries now indicate which architecture is active.
    • Configurable endpoints and timeouts for the Spring Boot path; automatic enable/disable based on mode.
    • Unknown environment variables are ignored to ease configuration.
  • Refactor
    • Standardized imports to a unified app package structure.
    • Improved startup by initializing storage before connectivity tests.
  • Style
    • Minor formatting cleanups with no functional impact.

이벤트 기반 아키텍처 지원을 위해 Spring Boot 서비스 관련 설정을 추가했습니다. 또한, 'direct'와 'event_driven' 모드를 선택할 수 있는 'architecture_mode' 설정을 도입하여 유연성을 확보했습니다. 관련 설정 검증 및 상태 조회 로직도 함께 업데이트했습니다.
- Spring Boot 서비스와 통신하기 위한 비동기 클라이언트 클래스를 추가했습니다.
- 이 클라이언트는 이벤트 기반 아키텍처를 지원하며, 원시 데이터를 Spring Boot 엔드포인트로 전송하는 기능을 구현합니다.
- 또한, 연결 테스트, 헬스체크, 재시도 로직 등을 포함하여 안정적인 통신을 보장합니다.
- 이벤트 기반 아키텍처를 지원하기 위해 스케줄러 서비스에 모드별 분기 로직을 추가했습니다.
- 'event_driven' 모드에서는 Spring Boot 클라이언트를 통해 데이터를 전송하도록 변경하고, 'direct' 모드에서는 기존의 FastAPI 모델 서비스로 직접 호출하도록 유지했습니다.
- 또한, 새로운 모드에 맞춰 서비스 초기화 및 헬스체크 로직을 업데이트하여 유연성을 확보했습니다.
Add azure_storage_service.initialize() call before test_connection() in main.py to prevent false connection failures during app startup
API 및 모델 서비스에 대한 대기 시간을 300초(5분)로 통일하여 일관성을 확보.
…client

Spring Boot 서비스 클라이언트에 디버깅용 로그, 오류 처리 및 재시도 로직을 추가. 연결 상태 확인, 전송 실패 원인 파악이 용이하도록 개선.
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Aug 28, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

Adds an event-driven architecture mode alongside direct calls in the simulator. Extends settings with Spring Boot configuration, integrates a new SpringBoot client, and updates the scheduler to branch execution and health checks by mode. Adjusts imports to app.* namespace, tweaks startup initialization, and surfaces mode/status in summaries and stats.

Changes

Cohort / File(s) Summary
Architecture & Settings
services/press-defect-data-simulator-service/app/config/settings.py
Introduces architecture_mode ("direct" or "event_driven"); adds Spring Boot config fields; ignores extra env vars; updates summaries, validation, and stats to include architecture and enable flags.
Scheduler: Dual-path Execution
services/press-defect-data-simulator-service/app/services/scheduler_service.py
Adds event-driven path with Spring Boot readiness flag; branches initialization and execution; implements _execute_event_driven_simulation and _execute_direct_call_simulation; updates health/status outputs and logging.
New Spring Boot Client
services/press-defect-data-simulator-service/app/services/spring_boot_client.py
Adds async client using aiohttp: connection test, health check, send_raw_data with retries/timeouts, service status, and client status; provides singleton spring_boot_client.
App startup flow
services/press-defect-data-simulator-service/app/main.py
Migrates imports to app.*; during lifespan, awaits azure_storage_service.initialize() before test_connection(), preserving subsequent logic.
Routers import migration
services/press-defect-data-simulator-service/app/routers/connection_test_router.py, services/press-defect-data-simulator-service/app/routers/simulator_router.py
Updates imports to app.* namespaces; no logic changes.
Service imports migration
services/press-defect-data-simulator-service/app/services/azure_storage.py, services/press-defect-data-simulator-service/app/services/model_client.py, services/press-defect-data-simulator-service/app/utils/logger.py
Points imports to app.config/app.utils; behavior unchanged.
Model service formatting
services/press-defect-detection-model-service/app/main.py
Removes a blank line; no functional impact.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant U as User/Trigger
  participant F as FastAPI App
  participant AZ as AzureStorageService
  participant SCH as SchedulerService
  participant SB as SpringBootClient
  participant MS as ModelServiceClient

  rect rgba(200,220,255,0.2)
    note right of F: Startup
    U->>F: Start app
    F->>AZ: initialize()
    AZ-->>F: ready/False
    F->>AZ: test_connection()
    AZ-->>F: available/False
    F->>SCH: initialize_services()
    alt architecture_mode == "event_driven"
      SCH->>SB: test_connection() / check_service_health()
      SB-->>SCH: availability/health
      SCH-->>F: spring_boot_ready
    else architecture_mode == "direct"
      SCH->>MS: test_connection() / model readiness
      MS-->>SCH: availability/ready
      SCH-->>F: model_ready
    end
  end

  rect rgba(200,255,200,0.2)
    note right of SCH: Execution
    U->>SCH: execute_single_simulation(inspectionId, images)
    alt Event-driven
      SCH->>SB: send_raw_data(inspectionId, images)
      SB-->>SCH: (success,data) or (failure,error)
      SCH-->>U: result (mode=event_driven)
    else Direct
      SCH->>MS: predict_inspection(images)
      MS-->>SCH: prediction/result
      SCH-->>U: result (mode=direct)
    end
  end
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

Poem

A rabbit taps the scheduler’s drum,
Two paths now hum—events or direct they come.
Spring breezes carry data to Boot,
Or models reply with predictions astute.
Settings bloom, logs gleam bright,
Hoppity flows choose left or right.
Ship it—carrots served tonight! 🥕

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.


📜 Recent 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 26d5c17 and 7ca8cab.

📒 Files selected for processing (10)
  • services/press-defect-data-simulator-service/app/config/settings.py (5 hunks)
  • services/press-defect-data-simulator-service/app/main.py (2 hunks)
  • services/press-defect-data-simulator-service/app/routers/connection_test_router.py (1 hunks)
  • services/press-defect-data-simulator-service/app/routers/simulator_router.py (1 hunks)
  • services/press-defect-data-simulator-service/app/services/azure_storage.py (1 hunks)
  • services/press-defect-data-simulator-service/app/services/model_client.py (1 hunks)
  • services/press-defect-data-simulator-service/app/services/scheduler_service.py (11 hunks)
  • services/press-defect-data-simulator-service/app/services/spring_boot_client.py (1 hunks)
  • services/press-defect-data-simulator-service/app/utils/logger.py (1 hunks)
  • services/press-defect-detection-model-service/app/main.py (0 hunks)
✨ 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/67/update-press-defect-simulator

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

github-actions bot commented Aug 28, 2025

🤖 Smart FAST 자동 코드 리뷰

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

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

🔍 Git diff를 통해 서비스 감지됨

📊 전체 검사 결과:

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

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

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

🔒 보안 스캔 결과:

⚠️ 보안 스캔 상태 불명

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

✅ 검사 체크리스트:

  • ❌ 테스트 실패
  • ✅ 코드 품질 검사 통과
  • ❌ 보안 이슈 발견

🚀 배포 정보:

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

@haeyekim haeyekim merged commit b777257 into main Aug 28, 2025
7 of 8 checks passed
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