Skip to content

feat: Implement pipeline executor with logging and error handling#65

Merged
jisung-02 merged 1 commit into
mainfrom
9-pipeline-engine
Dec 7, 2025
Merged

feat: Implement pipeline executor with logging and error handling#65
jisung-02 merged 1 commit into
mainfrom
9-pipeline-engine

Conversation

@jisung-02
Copy link
Copy Markdown
Owner

@jisung-02 jisung-02 commented Dec 7, 2025

.github/pull_request_template.md

🎯 변경 사항

📋 체크리스트

  • gleam format 실행 완료
  • gleam check 통과
  • 테스트 추가/수정 완료
  • 문서 업데이트 완료
  • CHANGELOG.md 업데이트 (필요시)

🧪 테스트 방법

🤖 CodeRabbit 리뷰 요청사항

  • 성능 최적화 검토
  • 에러 처리 검증
  • 타입 안전성 확인
  • API 설계 리뷰

📸 스크린샷/데모


참고: 댓글에 @coderabbitai 다시 리뷰해줘라고 작성하면 전체 재리뷰를 요청할 수 있습니다.

Summary by CodeRabbit

릴리스 노트

New Features

  • 파이프라인 실행 중 상세한 로깅 및 타이밍 추적 기능 추가
  • 실행 컨텍스트를 통한 개선된 에러 정보로 디버깅 및 모니터링 향상
  • 다단계 파이프라인 성능 메트릭 조회 기능 추가 (총 소요 시간, 완료된 단계 수, 가장 느린 단계 등)
  • 유연한 로깅 레벨 설정으로 실행 상세도 제어 가능

Tests

  • 파이프라인 실행, 타이밍, 에러 처리 및 로깅 시나리오에 대한 포괄적인 테스트 추가

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Dec 7, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

새로운 파이프라인 실행자 모듈을 추가하여 컨텍스트 인식 실행, 단계별 타이밍 추적, 동적 중간 결과 수집, 그리고 포괄적인 로깅을 지원합니다. 보조 타임 유틸리티 모듈, FFI 헬퍼, 그리고 광범위한 테스트 스위트를 함께 추가합니다.

Changes

Cohort / File(s) Summary
Core Executor Implementation
src/aether/pipeline/executor.gleam
컨텍스트 기반 파이프라인 실행, 단계별 타이밍 기록, 중간 결과 추적을 구현합니다. ExecutionContext, StageTiming, ExecutionResult, ExecutionError 타입과 execute_with_context, execute_with_logging, run 함수를 제공합니다.
Pipeline Infrastructure Updates
src/aether/pipeline/pipeline.gleam
Pipeline을 공개 불투명 타입으로 확장하며 실행자 메타데이터를 추가합니다. StageExecutor 타입, get_stage_executors 함수, 그리고 FFI 헬퍼(unsafe_coerce, to_dynamic)를 추가합니다.
Time Utilities
src/aether/util/time.gleam
고해상도 시간 추적 함수 제공: now_microseconds, now_milliseconds, 단위 변환 유틸리티, Erlang FFI를 통한 시스템 시간 접근.
Comprehensive Test Suite
test/aether/pipeline/executor_test.gleam
실행자 실행, 타이밍, 에러 처리, 컨텍스트 보존, 로깅 동작, 타입 변환을 다루는 22개의 테스트 함수를 추가합니다.

Sequence Diagram

sequenceDiagram
    participant User
    participant Executor as Pipeline Executor
    participant Stage as Stage Executor
    participant Context as ExecutionContext
    participant Time as Time Utilities

    User->>Executor: execute_with_context(pipeline, input)
    activate Executor
    Executor->>Context: empty_context()
    activate Context
    Context-->>Executor: ExecutionContext
    deactivate Context
    
    Executor->>Time: now_microseconds()
    activate Time
    Time-->>Executor: start_time
    deactivate Time
    
    loop for each stage
        Executor->>Time: now_microseconds()
        activate Time
        Time-->>Executor: stage_start_time
        deactivate Time
        
        Executor->>Stage: execute(stage_fn, input)
        activate Stage
        Stage-->>Executor: Result(output, StageError)
        deactivate Stage
        
        Executor->>Time: now_microseconds()
        activate Time
        Time-->>Executor: stage_end_time
        deactivate Time
        
        Executor->>Context: record StageTiming
        activate Context
        Context-->>Executor: updated ExecutionContext
        deactivate Context
    end
    
    Executor-->>User: Result(ExecutionResult(output, context), ExecutionError)
    deactivate Executor
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

검토 시 주의가 필요한 영역:

  • 타입 안전성: unsafe_coerceto_dynamic을 통한 동적 타입 처리 - 타입 안전성이 우회되는 지점이므로 신중한 검토 필요
  • 에러 컨텍스트 보존: StageExecutionError 구성 시 컨텍스트가 올바르게 전파되는지 확인
  • FFI 통합: Erlang 시스템 시간 함수의 정확한 호출 및 단위(마이크로초 vs 나노초) 검증
  • 패턴 매칭: do_execute_stages의 재귀적 단계 처리 로직이 모든 엣지 케이스(빈 파이프라인, 에러 발생 시점)를 올바르게 처리하는지 확인
  • Result/Option 처리: get_stage_timing, slowest_stage에서 Result 타입 일관성 확인
  • 로깅 부작용: 각 로깅 함수의 Nil 반환과 입출력 부작용 검증
  • 파이프라인 상태 전파: append 함수에서 단계 재인덱싱 시 executor 필드가 올바르게 유지되는지 확인

Poem

📊 타이밍과 에러의 우아한 춤,
컨텍스트 속에 담긴 각 단계의 숨결,
Gleam의 타입으로 지켜낸 진실,
함수형의 길에서 빛나는 실행 흐름 ✨


📜 Recent review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Free

📥 Commits

Reviewing files that changed from the base of the PR and between acf5603 and b0dc525.

📒 Files selected for processing (4)
  • src/aether/pipeline/executor.gleam (1 hunks)
  • src/aether/pipeline/pipeline.gleam (6 hunks)
  • src/aether/util/time.gleam (1 hunks)
  • test/aether/pipeline/executor_test.gleam (1 hunks)

Note

🎁 Summarized by CodeRabbit Free

Your organization is on the Free plan. CodeRabbit will generate a high-level summary and a walkthrough for each pull request. For a comprehensive line-by-line review, please upgrade your subscription to CodeRabbit Pro by visiting https://app.coderabbit.ai/login.

Comment @coderabbitai help to get the list of available commands and usage tips.

@jisung-02 jisung-02 merged commit 3dd1c9c into main Dec 7, 2025
0 of 2 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