Skip to content

feat(smartlog): Phase 1 CI overlay — SmartlogCiOverlay + attach_ci_overlay · Refs #310 - #418

Merged
erishforG merged 1 commit into
release/1.0from
feat/auto-ci-overlay-phase1
Sep 2, 2026
Merged

feat(smartlog): Phase 1 CI overlay — SmartlogCiOverlay + attach_ci_overlay · Refs #310#418
erishforG merged 1 commit into
release/1.0from
feat/auto-ci-overlay-phase1

Conversation

@erishforG

Copy link
Copy Markdown
Owner

무엇

SmartlogNode.ciOption<serde_json::Value> placeholder를 타입 안전한 SmartlogCiOverlay 구조체로 교체하고, GitHub Checks API 결과를 smartlog 출력에 반영한다.

변경 설명
SmartlogCiOverlay 신규 struct overall (passed/running/failed/none) + total + failed 카운트
SmartlogNode.ci 타입 변경 Option<serde_json::Value>Option<SmartlogCiOverlay> (backward-compat: None은 skip-serialize)
attach_ci_overlay() 함수 PR-linked 노드에 대해 get_check_runs() 호출 → soft-fail pattern (PR overlay와 동일)
map_ci_overall() 헬퍼 passing/failing/pending/no checks → 4 canonical states
format_ci_badge() 렌더러 [CI: ✓ passed (7/7)] / [CI: ✗ failed (2/7)] / [CI: ● running (0/5)] / [CI: none]
render_text 업데이트 ci overlay 있을 때 PR badge 뒤에 ├─ [CI: ...] 줄 추가
9개 Phase 1 테스트 badge 4가지 variant, serde roundtrip, JSON omit/present, render_text 통합, map_ci_overall 매핑

출력 예시:

├─ [PR #42 ● open ✓ CI ✓ approved ⬆ ready]
├─ [CI: ✓ passed (7/7)]
└─ abc1234 feat: some change

왜 (이슈 참조)

Refs #310 — smartlog CI overlay check runs Phase 1.

GitHubClient::get_check_runs() 는 이미 구현되어 있었지만 smartlog layer까지 데이터가 전달되지 않았음. Phase 1은 typed struct 정의 + async overlay 함수 + 텍스트 렌더링의 skeleton. JSON output에서도 ci 필드로 per-check detail이 소비 가능해짐.

변경

  • src/cli/commands/smartlog.rs 1파일, +217/-5줄

다음 Phase 힌트

리스크

low — 순수 additive. ci=None 이 기본값이라 기존 JSON consumers 영향 0. attach_ci_overlay soft-fail이라 네트워크 에러도 안전.

롤백

git revert b6f222e — 즉시 이전 상태 복원.

Test plan

  • cargo test -- smartlog: 45 tests pass (기존 36 + Phase 1 신규 9)
  • cargo build --quiet + cargo clippy -D warnings + cargo fmt --check: all clean
  • 기존 모든 test suite: 226 + 81 + 5 + 10 = 322 tests 전부 통과

@erishforG

…erlay · Refs #310

- Add `SmartlogCiOverlay` struct (overall/total/failed) replacing the
  `serde_json::Value` placeholder in `SmartlogNode.ci`
- `attach_ci_overlay()` soft-fail async fn: calls `get_check_runs()` for
  each PR-linked node; maps passing/failing/pending/no-checks to the four
  canonical states (passed/failed/running/none)
- `map_ci_overall()` helper for the state mapping
- `format_ci_badge()` text renderer: [CI: ✓ passed (7/7)] / [CI: ✗ failed (2/7)]
  / [CI: ● running (0/5)] / [CI: none]
- `render_text` emits ├─ CI badge line for nodes with ci overlay set
- 9 new Phase 1 tests (badge variants, serde roundtrip, JSON omit/present,
  render_text integration, map_ci_overall mapping)
- `SmartlogNode.ci` change is backward-compatible: None is skip-serialized,
  existing JSON consumers see no change

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

auto-improvement Daily auto-generated improvement PR/issue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant