Skip to content

Auto-triage: flag area:UI PRs missing screenshots/demo from new contributors#64516

Merged
potiuk merged 6 commits intoapache:mainfrom
shivaam:claude/ui-demo-check
Apr 6, 2026
Merged

Auto-triage: flag area:UI PRs missing screenshots/demo from new contributors#64516
potiuk merged 6 commits intoapache:mainfrom
shivaam:claude/ui-demo-check

Conversation

@shivaam
Copy link
Copy Markdown
Contributor

@shivaam shivaam commented Mar 31, 2026

Add a deterministic check to breeze pr auto-triage that flags area:UI PRs from non-collaborator contributors when their PR description lacks screenshots or demo videos. So owners, members, and committers / collaborators are excluded from this check. The rationale: having one PR merged doesn't mean they know the project's conventions around UI demos.

There are some PR - #62885 that do not need a UI mock but it is not simple to exclude them.

Comment posted on the PR:

[WARNING] Missing UI demo: This PR changes UI code but the description does not include screenshots or a demo video.
For UI changes, please add screenshots or a short screen recording to the PR description so reviewers can verify the visual changes. You can paste images directly into the GitHub PR description or drag-and-drop a screen recording. See pull request guidelines.

What this does

When triaging PRs, the tool now checks if a PR:

  1. Has the area:UI label
  2. Is authored by a non-collaborator (not COLLABORATOR/MEMBER/OWNER)
  3. Lacks demo evidence in the PR body (screenshots, videos, or image links)

If all three conditions are met, the PR is flagged with a [WARNING] Missing UI demo violation. The suggested action is comment (not draft conversion) — this is a soft violation handled by a new branch in _compute_default_action.

How it works

  • assess_pr_ui_demo() in utils/github.py — new deterministic check function following the same pattern as assess_pr_checks, assess_pr_conflicts, and assess_pr_unresolved_comments
  • Detection patterns cover: GitHub drag-and-drop <img> tags, user-attachments/assets/ URLs (images & videos), markdown ![alt](url) syntax, and direct media file URLs (.png, .jpg, .gif, .mp4, .mov, .webm, etc.)
  • Integrated into _assess_pr_deterministic() so the check runs everywhere: main triage flow, TUI, pagination batches, and single-PR mode
  • _compute_default_action soft-violation branch ensures UI-demo-only flags get COMMENT instead of falling through to DRAFT

Dry-run validation against all open area:UI PRs

Ran breeze pr auto-triage --label "area:UI" --llm-use api --dry-run --answer-triage s --authors all:

Metric Count
Total area:UI PRs assessed 35
Flagged for Missing UI demo 32
Flagged for other issues only (CI, conflicts, comments) 3
Passed all checks (had video demo) 1
False positives 0
False negatives 0

False negative (marked as Area:UI, but dont need a UI mock)

True negatives (correctly NOT flagged)

True positives (correctly flagged)

Known limitations

  • Grace period interaction: When CI failures are within the grace window and are the only hard issue, the grace-period skip logic does not check for UI demo violations. A PR with grace-period CI + missing UI demo could be silently skipped. This is a pre-existing structural pattern in the grace period logic, not introduced by this change.

Tests

Tests covering:

  • _has_demo_evidence helper (empty/None body, text-only, all media patterns, false positive resistance)
  • assess_pr_ui_demo (every exit path: no label, collaborator associations, demo present/absent)
  • _compute_default_action soft-violation branch (comment for soft-only, draft when combined with hard issues)

Was generative AI tooling used to co-author this PR?
  • Yes — Claude Opus 4.6

Generated-by: Claude Opus 4.6 following the guidelines

@boring-cyborg boring-cyborg bot added area:dev-tools backport-to-v3-2-test Mark PR with this label to backport to v3-2-test branch labels Mar 31, 2026
@shivaam shivaam changed the title Add missing UI demo/screenshot check to auto-triage Auto-triage: flag area:UI PRs missing screenshots/demo from new contributors Mar 31, 2026
@shivaam shivaam marked this pull request as ready for review March 31, 2026 01:59
Copy link
Copy Markdown
Member

@pierrejeambrun pierrejeambrun left a comment

Choose a reason for hiding this comment

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

That's interesting. Code looks good beside one comment.

Would love to hear what @potiuk thinks about this one. (personally I think it's a good idea)

@pierrejeambrun
Copy link
Copy Markdown
Member

I just rebased the branch to rerun the CI

@bbovenzi
Copy link
Copy Markdown
Contributor

Very interesting. Yes sometimes its not needed but I have found myself commenting a bunch to ask for a screenshot.

Copy link
Copy Markdown
Member

@potiuk potiuk left a comment

Choose a reason for hiding this comment

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

Looks good besides the one comment.

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 a deterministic breeze pr auto-triage rule to warn on area:UI PRs from non-collaborators when the PR body lacks screenshots or demo evidence.

Changes:

  • Add _has_demo_evidence() + assess_pr_ui_demo() deterministic assessment in utils/github.py
  • Integrate the new assessment into deterministic triage and review-mode aggregation in pr_commands.py
  • Add focused pytest coverage for demo detection, assessment behavior, and default-action handling

Reviewed changes

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

File Description
dev/breeze/tests/test_github_ui_demo.py Adds tests for demo-evidence detection, UI demo assessment, and expected triage actions
dev/breeze/src/airflow_breeze/utils/github.py Implements demo-evidence detection and a new deterministic UI-demo assessment producing a warning violation
dev/breeze/src/airflow_breeze/commands/pr_commands.py Wires the new deterministic assessment into triage flows and merges violations/summaries

Copy link
Copy Markdown
Member

@pierrejeambrun pierrejeambrun left a comment

Choose a reason for hiding this comment

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

LGTM

shivaam added 3 commits April 3, 2026 14:45
Add a deterministic check to `breeze pr auto-triage` that flags
`area:UI` PRs from non-collaborator contributors when their PR
description lacks screenshots or demo videos.

The check runs as part of the existing deterministic checks in
`_assess_pr_deterministic()` alongside CI failure, merge conflict,
and unresolved comment checks. PRs flagged only for missing UI demo
receive a comment (not draft conversion), using a new soft-violation
branch in `_compute_default_action`.

Detection patterns cover GitHub drag-and-drop uploads (`<img>` tags,
`user-attachments/assets/` URLs), markdown image syntax, and direct
media file URLs (png, jpg, gif, mp4, etc).
Per reviewer feedback from @pierrejeambrun and @potiuk: the
separate elif branch for soft-only violations (e.g. missing UI
demo) defaulting to COMMENT is unnecessary — maintainers can
override DRAFT to COMMENT interactively. A future enhancement
will let each check define its own suggested action severity.
@pierrejeambrun
Copy link
Copy Markdown
Member

I just rebased the branch to see if it helps with the CI failures.

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.

It looks cool 👍

@shivaam
Copy link
Copy Markdown
Contributor Author

shivaam commented Apr 3, 2026

CI failures are not related to this PR. Other PRs are also failing the same CI tests - #64669

@potiuk potiuk merged commit ab918c9 into apache:main Apr 6, 2026
147 checks passed
@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 6, 2026

Backport failed to create: v3-2-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-2-test Commit Link

You can attempt to backport this manually by running:

cherry_picker ab918c9 v3-2-test

This should apply the commit to the v3-2-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

Labels

area:dev-tools backport-to-v3-2-test Mark PR with this label to backport to v3-2-test branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants