feat(smartlog): Phase 3 #310 — branch-tip CI overlay for PR-less nodes - #420
Merged
Merged
Conversation
Previously attach_ci_overlay skipped any SmartlogNode that had no PR overlay, leaving worktrees without an open PR with no CI information. This phase completes the original #310 acceptance criterion: > 각 worktree branch tip 에 대해 GitHub check runs aggregate Changes - src/github/mod.rs: add GitHubClient::get_check_runs_by_sha(sha) Fetches /commits/{sha}/check-runs directly, without a PR round-trip. Returns CiStatus with pr_number=0 as sentinel (callers use aggregate fields, not pr_number). Identical aggregation logic to get_check_runs. - src/cli/commands/smartlog.rs: - attach_ci_overlay: remove early-exit when all nodes lack a PR; instead branch per node — PR nodes use get_check_runs (existing), PR-less nodes resolve their branch-tip SHA via git rev-parse and call get_check_runs_by_sha (new). Skip gracefully on git failure. - resolve_branch_tip_sha(repo, branch) -> Option<String>: thin helper calling git rev-parse, returns None for orphan/unresolvable branches. - Phase 3 doc comment at module top. - 3 new unit tests: ci badge renders for PR-less node, none badge for PR-less node, resolve_branch_tip_sha returns None for invalid path. Backward-compat: behaviour for PR-linked nodes is unchanged; nodes that fail the git rev-parse (orphan/unborn) degrade to no CI badge, same as before. Refs #310 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This was referenced Sep 4, 2026
Merged
Merged
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.
무엇
attach_ci_overlay가 PR이 없는 SmartlogNode를 조용히 건너뛰던 문제를 수정합니다. 이 Phase는 issue #310 의 원래 요구사항을 완성합니다:왜 (Epic: Refs #310, Milestone: v1.0)
SmartlogCiOverlaystruct +attach_ci_overlayskeleton (PR feat(smartlog): Phase 1 CI overlay — SmartlogCiOverlay + attach_ci_overlay · Refs #310 #418)running필드 + badge fix (PR feat(smartlog): Phase 2 #310 — SmartlogCiOverlay.running count + badge fix #419)PR 없이 작업 중인 worktree(초기 branch, 실험적 spike 등)도 CI 상태를 한눈에 볼 수 있어야 합니다.
변경
src/github/mod.rsGitHubClient::get_check_runs_by_sha(sha: &str) -> Result<CiStatus>추가/commits/{sha}/check-runs직접 호출pr_number: 0sentinel (호출자는 집계 필드만 사용)get_check_runs와 동일한 집계 로직 공유src/cli/commands/smartlog.rsattach_ci_overlay: 노드별 분기get_check_runs(pr.number)경로git rev-parse <branch>로 SHA 해결 후get_check_runs_by_sha호출resolve_branch_tip_sha(repo, branch) -> Option<String>추가다음 Phase 힌트
Phase 4 후보:
parsec smartlog --no-overlay시 CI도 완전히 skip되는지 통합 테스트리스크
get_check_runs와 같은 엔드포인트.롤백
git revert e0033c3— 두 파일만 변경, 메인 로직 불변.Test plan
cargo build --quiet✅cargo fmt --check✅cargo clippy --all-targets -- -D warnings✅cargo test --quiet: 325 tests pass ✅ci_badge_renders_same_for_pr_less_node,ci_badge_none_renders_for_pr_less_node,resolve_branch_tip_sha_rejects_empty@erishforG