Skip to content

TUI: add full-screen interactive TUI for PR triage and review#63773

Merged
potiuk merged 1 commit intoapache:mainfrom
potiuk:worktree-modular-stargazing-lampson
Mar 30, 2026
Merged

TUI: add full-screen interactive TUI for PR triage and review#63773
potiuk merged 1 commit intoapache:mainfrom
potiuk:worktree-modular-stargazing-lampson

Conversation

@potiuk
Copy link
Copy Markdown
Member

@potiuk potiuk commented Mar 17, 2026

Add a rich full-screen terminal UI for the breeze pr auto-triage command
that replaces the sequential review flow when a TTY is available.

TUI Features

  • Full-screen PR list with columns: PR#, Classification, CI Checks,
    Behind, Title (with labels), Author, LLM status, Suggested action,
    Performed action
  • Detail panel showing PR info, classification, LLM review status
    with timing, labels, assessment summary, violations, unresolved threads
  • Inline diff viewer with syntax highlighting and scroll support
  • Tab-based focus cycling between PR list, detail, and diff panels
  • Mouse support for clicking rows and scrolling panels

PR Classifications

PRs are automatically categorized: WF Approval, CI Issues, LLM Warnings,
LLM Errors, All passed, Wait for LLM, Stale Review, Recently Triaged.
Each has context-sensitive suggested actions derived from the PR state
(e.g. merge conflicts → draft, 1-2 CI failures → rerun, only unresolved
comments → comment).

Keyboard Shortcuts

  • Enter: Sequential assessment (triage) / Detailed review (review mode)
  • Space: Toggle select | b: Batch action
  • Quick actions: o Open, s Skip, a Approve, d Draft, c Comment, z Close,
    f Rerun failed, r Rebase, m Mark ready, x Flag suspicious, l LLM review
  • Navigation: j/k Up/Down, n/p Pages, Tab focus, e Diff, Esc/q Quit

Background Operations

  • LLM reviews run in background threads with running/queued distinction,
    per-PR timing (took/queued/attempts), retry (3 attempts, 3min timeout),
    on-demand trigger via l key, and auto-submission for passing PRs
  • PR status refresh after actions (5s delay then 60s polling for pending CI)
  • Diff prefetching for current and nearby PRs
  • Lazy pagination loading more PRs when scrolling near end of list
  • Cache validation at startup — batch-checks head_sha via GraphQL,
    removes stale entries

Review Mode

Review mode (--mode review) uses the TUI with green color scheme and
adapted UI for code review workflow:

  • PR filtering: Only shows PRs with 'ready for maintainer review' label
    and PRs where the reviewer has previously accepted or requested changes
  • LLM action: Uses review_pr (detailed code review with line-level
    comments) instead of assess_pr (triage quality check)
  • Review-oriented actions: LLM review and Comment are primary quick
    actions; suggested actions show "ready to review", "review findings",
    "needs rebase" etc. instead of triage-oriented "draft", "close"
  • Footer labels: "Detailed review" instead of "Sequential assessment",
    "Review action:" instead of "Quick action:"
  • Sequential review mode preserved for non-TTY/CI environments

CLI Changes

  • --authors replaces --include-collaborators (choice: contributors/collaborators/all)
  • --llm-use replaces --check-mode (choice: both/api/llm)
  • --llm-concurrency defaults to CPU count (capped at 8), hardcoded 4 for screenshots
  • Reorganized help groups: Mode, Select people, Target selection, Filter options,
    Pagination and sorting, Assessment options, Other

Session Summary

On exit, prints a table of acted PRs with links, suggested/performed actions,
per-PR timing, startup/interactive/LLM time, velocity (PRs/hr), and
LLM avg/median duration.

Code Changes

  • Refactored pr_commands.py into extracted modules: pr_cache.py, pr_models.py,
    pr_display.py, pr_comments.py, tui_display.py
  • AuthorFilter enum for author selection logic
  • _PRRefreshManager for background PR status refresh
  • _RefreshResult dataclass for refresh results
  • _review_pr_as_assessment() wrapper to use review_pr results in the
    existing LLM pipeline (wraps dict result as PRAssessment)
  • Mode-aware get_suggested_action() and get_available_actions() with
    separate triage/review implementations
  • Reduced GitHub API timeouts (10s connect, 20-30s read) with error handling
  • Skip LLM for bot PRs (dependabot, renovate, github-actions)
  • Model discovery via Claude CLI config when API key not set
  • Graceful shutdown: cancel futures, 10s countdown, force exit
  • Comprehensive documentation update in 13_pr_tasks.rst

Was generative AI tooling used to co-author this PR?
  • Yes — Claude Code (claude-opus-4-6)

Generated-by: Claude Code (claude-opus-4-6) following the guidelines

Copy link
Copy Markdown
Member

@choo121600 choo121600 left a comment

Choose a reason for hiding this comment

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

Wow😮
Cool!

@potiuk potiuk force-pushed the worktree-modular-stargazing-lampson branch from 3f08b33 to bcee932 Compare March 17, 2026 07:16
@potiuk potiuk requested review from XD-DENG and kaxil as code owners March 17, 2026 07:16
Comment thread airflow-core/src/airflow/jobs/scheduler_job_runner.py Outdated
@potiuk
Copy link
Copy Markdown
Member Author

potiuk commented Mar 17, 2026

@choo121600 -> it's based on #63770 - I should merge it first :)

@potiuk potiuk force-pushed the worktree-modular-stargazing-lampson branch from bcee932 to b92bd88 Compare March 17, 2026 08:00
@potiuk potiuk changed the title Add full-screen TUI for PR triage workflow TUI: add full-screen TUI for PR triage with inline diff panel Mar 17, 2026
@potiuk potiuk force-pushed the worktree-modular-stargazing-lampson branch 9 times, most recently from 923b0b2 to b38dd2f Compare March 17, 2026 16:27
@potiuk potiuk force-pushed the worktree-modular-stargazing-lampson branch 9 times, most recently from 5e85d56 to 014e4d8 Compare March 22, 2026 19:40
@potiuk potiuk changed the title TUI: add full-screen TUI for PR triage with inline diff panel TUI: add full-screen interactive TUI for PR triage and review Mar 22, 2026
@potiuk potiuk force-pushed the worktree-modular-stargazing-lampson branch 13 times, most recently from 82c8ae8 to 2b18a82 Compare March 24, 2026 10:54
Comment thread dev/breeze/src/airflow_breeze/utils/pr_models.py Outdated
Comment thread dev/breeze/src/airflow_breeze/utils/pr_models.py Outdated
Copy link
Copy Markdown
Contributor

@andreahlert andreahlert left a comment

Choose a reason for hiding this comment

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

Security concern with credential handling in _get_claude_cli_api_key.

Comment thread dev/breeze/src/airflow_breeze/utils/llm_utils.py Outdated
Comment thread dev/breeze/src/airflow_breeze/utils/pr_cache.py
Adds a full-screen terminal UI (TUI) for the `breeze pr auto-triage` command
with interactive PR navigation, real-time LLM review tracking, and direct
quick actions.

Key features:
- Full-screen Rich-based TUI with PR list, detail panel, and diff viewer
- Mouse support (click to select, scroll panels) and vim-style keybindings
- Background LLM assessment with live status updates per PR
- Background diff pre-fetching for instant diff display
- Direct quick actions (draft, comment, close, rerun, rebase, flag, LLM)
- Batch operations on multi-selected PRs
- Category-based PR organization (CI Issues, LLM Errors, Passing, etc.)
- Pagination with background page loading
- Review mode with green color scheme, review-oriented actions/labels,
  and detailed code review via review_pr instead of triage assess_pr
- Review mode filters to only show PRs with 'ready for maintainer review'
  label or PRs where the reviewer has previously reviewed

Also includes: PR data models, display utilities, caching layer,
comment deduplication, and comprehensive test coverage.
@github-actions
Copy link
Copy Markdown
Contributor

Backport failed to create: v3-1-test. View the failure log Run details

Note: As of Merging PRs targeted for Airflow 3.X
the committer who merges the PR is responsible for backporting the PRs that are bug fixes (generally speaking) to the maintenance branches.

In matter of doubt please ask in #release-management Slack channel.

Status Branch Result
v3-1-test Commit Link

You can attempt to backport this manually by running:

cherry_picker 48f0a72 v3-1-test

This should apply the commit to the v3-1-test branch and leave the commit in conflict state marking
the files that need manual conflict resolution.

After you have resolved the conflicts, you can continue the backport process by running:

cherry_picker --continue

If you don't have cherry-picker installed, see the installation guide.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants