feat(smartlog): Phase 5 — PR merge readiness overlay · Refs #309 - #417
Merged
Conversation
Add `SmartlogPrOverlay::merge_ready: Option<bool>` that surfaces GitHub's merge-ability verdict in the smartlog one-line badge. Changes: - `SmartlogPrOverlay`: new `merge_ready: Option<bool>` field (skip_serializing_if=None for backward-compat) - `fetch_overlay()`: populate from `PrStatus::mergeable` (open PRs only) - `format_pr_badge()`: append '⬆ ready' (green) / '⚡ conflicts' (red) for open PRs when readiness is known; no segment when None or non-open - 7 Phase 5 unit tests: ready/conflict badge, None omit, merged/draft skip, serde round-trip (absent + present) - `mk_overlay_with_readiness()` test helper for targeted badge tests Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
무엇
SmartlogPrOverlay에merge_ready: Option<bool>필드를 추가해 GitHub의 병합 가능 여부를 smartlog 한 줄 뱃지에 표시한다.merge_ready필드 추가SmartlogPrOverlay에Option<bool>;skip_serializing_if=None으로 기존 JSON 호환 유지fetch_overlay()수정PrStatus::mergeable(이미 API에서 가져오던 값)을 open PR에만 채워 전달format_pr_badge()수정⬆ ready(green) /⚡ conflicts(red) 세그먼트 추가mk_overlay_with_readiness()헬퍼mk_overlay()확장 (merge_ready=None 기본값 유지)뱃지 출력 예시:
왜 (이슈 참조)
Refs #309 — smartlog PR overlay merge readiness Phase 5.
PrStatus.mergeable은 이미get_pr_status()가 GitHub API에서 가져오고 있었지만SmartlogPrOverlay에 전달되지 않았음. worktree별 한 줄 뱃지를 보면서 충돌 여부를 즉시 파악하는 것이 #309의 핵심 value.변경
src/cli/commands/smartlog.rs1파일, +154줄SmartlogPrOverlay::merge_ready필드fetch_overlay(): open PR일 때만status.mergeable복사format_pr_badge(): Phase 5 세그먼트 추가 (open 상태일 때만)mk_overlay_with_readiness()헬퍼다음 Phase 힌트
review_decision(REVIEW_REQUIRED vs APPROVED) 세분화 가능get_check_runs()를SmartlogNode.ci에 채우는 Phase 1리스크
low — 순수 additive 변경.
merge_ready=None이 기본값이라 기존 동작 영향 0. GitHub API 호출 추가 없음 (이미 가져오는 값 활용). 뱃지 포맷 변경은 open PR에만, 뒤에 세그먼트 추가 방식.롤백
git revert 4db2d93— 즉시 이전 상태 복원.Test plan
cargo test -- smartlog: 36 tests pass (기존 29 + Phase 5 신규 7)cargo build --quiet+cargo clippy -D warnings+cargo fmt --check: all clean@erishforG