Skip to content

feat: display CI check status in PR overview#2

Merged
flexphere merged 3 commits into
mainfrom
feat/overview-ci-status
Mar 2, 2026
Merged

feat: display CI check status in PR overview#2
flexphere merged 3 commits into
mainfrom
feat/overview-ci-status

Conversation

@flexphere
Copy link
Copy Markdown
Owner

Summary

  • PR Overview (ReviewOverview) の DESCRIPTION セクション後に CI STATUS セクションを追加
  • 各チェックのステータスを記号(✓/✗/●/-/!)とハイライトで表示
  • 再実行されたチェックは最新のみ表示(重複排除)
  • CI チェック行で gx を押すとワークフロー URL をブラウザで開ける
  • セクションマーク('d/'s/'c)で DESCRIPTION / CI STATUS / COMMENTS にジャンプ可能
  • マーク文字は overview.marks オプションでカスタマイズ可能

Changes

lua/reviewit/gh.lua

  • get_pr_overview()statusCheckRollup フィールドを追加

lua/reviewit/ui.lua

  • format_check_status() — チェック結果を記号・ハイライトにマッピング
  • deduplicate_checks() — 同名チェックの重複排除(最新のみ保持)
  • build_checks_summary() — "N/M passed" サマリー文字列の生成
  • build_overview_lines() に CI STATUS セクション・セクション追跡・check_urls を追加
  • setup_github_refs()line_urls パラメータを追加(行レベル URL マッピング)
  • show_overview_float() にセクションマーク設定を追加

tests/reviewit/ui_spec.lua

  • 23 テスト追加(format_check_status: 12, deduplicate_checks: 5, build_checks_summary: 6, build_overview_lines: 拡張)

doc/reviewit.txt

  • ReviewOverview の CI STATUS 説明を追記
  • セクションマーク・overview.marks オプションのドキュメント追加

Test plan

  • make all passes (luacheck + stylua + 133 tests)
  • 実際の PR で :ReviewStart:ReviewOverview で CI STATUS セクション表示確認
  • CI チェック行で gx でワークフロー URL が開くこと
  • 'd / 's / 'c でセクションジャンプできること

🤖 Generated with Claude Code

flexphere and others added 3 commits March 1, 2026 22:50
Show CI check runs with pass/fail indicators and summary count
between DESCRIPTION and COMMENTS sections. Duplicate checks from
re-runs are deduplicated, keeping only the latest result per name.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Enable gx keymap on CI status lines to open the check's detailsUrl
in the browser. The line-to-URL mapping is passed through
setup_github_refs via a new line_urls parameter.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Set Vim marks ('d, 's, 'c) on DESCRIPTION, CI STATUS, and COMMENTS
sections when opening the PR overview, allowing quick navigation.
Mark characters are configurable via overview.marks option.
Change new comment keymap from c to C to avoid mark conflict.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@flexphere flexphere marked this pull request as ready for review March 1, 2026 14:22
Copilot AI review requested due to automatic review settings March 1, 2026 14:22
@flexphere flexphere self-assigned this Mar 1, 2026
@flexphere
Copy link
Copy Markdown
Owner Author

gxが使用可能であることがパッと見わかりにくいけど全部にunderline引くのもなぁ・・
と思いつつ一旦PRにしました!

@flexphere flexphere requested a review from kyu08 March 1, 2026 14:24
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds CI check status visibility and navigation improvements to the PR overview float, integrating GitHub statusCheckRollup data into the existing ReviewOverview UI.

Changes:

  • Fetches statusCheckRollup via gh pr view and renders a new CI STATUS section with per-check symbols/highlights plus a pass-count summary.
  • Adds overview section marks ('d/'s/'c) and line-level gx support to open CI check URLs.
  • Expands unit tests and updates documentation for the new CI STATUS section and mark customization.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
lua/reviewit/gh.lua Requests statusCheckRollup in PR overview JSON payload.
lua/reviewit/ui.lua Renders CI STATUS section, deduplicates checks, adds section marks, and enables gx opening check URLs.
tests/reviewit/ui_spec.lua Adds coverage for check formatting/dedup/summary and overview rendering outputs.
doc/reviewit.txt Documents CI STATUS section, section marks, and overview.marks option.
Comments suppressed due to low confidence (3)

lua/reviewit/ui.lua:156

  • deduplicate_checks() uses key = check.name or check.context or "unknown". If multiple check entries lack both name and context, they will all collapse into a single "unknown" entry, dropping data incorrectly. Use a unique fallback key (e.g., the check index, check.id, or tostring(check)), or skip deduplication when the identifier is missing.
	for _, check in ipairs(checks) do
		local key = check.name or check.context or "unknown"
		if not seen[key] then
			table.insert(order, key)
		end
		seen[key] = check
	end

lua/reviewit/ui.lua:570

  • Section marks are user-configurable (overview.marks), but vim.api.nvim_buf_set_mark is called without validation or pcall. If a user sets an invalid mark (e.g., multi-character string or unsupported char), this will error and prevent the overview from rendering. Consider validating mark is a 1-character string and wrapping the call in pcall (or ignoring invalid entries with a warning).
	-- Set section marks
	local marks = config.opts.overview and config.opts.overview.marks
		or { description = "d", ci_status = "s", comments = "c" }
	for section, mark in pairs(marks) do
		local line = result.sections[section]
		if line and mark then
			vim.api.nvim_buf_set_mark(buf, mark, line, 0, {})
		end

doc/reviewit.txt:190

  • The docs show overview.marks as part of the default configuration snippet, but lua/reviewit/config.lua defaults currently do not include overview.marks (the code only provides a fallback at runtime). Either add marks = { description = "d", ci_status = "s", comments = "c" } to the actual defaults, or adjust the documentation snippet to reflect the real defaults.
      -- Width/height as percentage of screen (1-100)
      width = 80,
      height = 80,
      -- Section marks (jump with 'd, 's, 'c)
      marks = { description = "d", ci_status = "s", comments = "c" },

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Copy Markdown
Collaborator

@kyu08 kyu08 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • PR Overview (ReviewOverview) の DESCRIPTION セクション後に CI STATUS セクションを追加

実際このPRのレビューにこのPRの機能使ってみてますがCheck Status出るのめっちゃいいですねww

  • CI チェック行で gx を押すとワークフロー URL をブラウザで開ける
  • セクションマーク('d/'s/'c)で DESCRIPTION / CI STATUS / COMMENTS にジャンプ可能

これにキーマップ貼られてるのも使いやすくていいですね!!!
[s, ]sでnext section/previous sectionに飛べてもいいかもですね(とはいえ今のままでも全然便利そうです)

@flexphere
Copy link
Copy Markdown
Owner Author

[s, ]sでnext section/previous sectionに飛べてもいいかもですね
タシカニー!そっちの方が今後セクション増えたりした時に対応不要で良さそう!
別PRで追加します!

@flexphere flexphere merged commit 2281217 into main Mar 2, 2026
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.

3 participants