Skip to content

feat(visual_review): post pr comment with run review link#52653

Draft
webjunkie wants to merge 1 commit intomasterfrom
codex/add-commenting-flow-for-visual-review
Draft

feat(visual_review): post pr comment with run review link#52653
webjunkie wants to merge 1 commit intomasterfrom
codex/add-commenting-flow-for-visual-review

Conversation

@webjunkie
Copy link
Copy Markdown
Contributor

Motivation

  • Visual Review posts commit statuses but does not proactively surface runs that need human approval in the PR thread, making them easy to miss.
  • Improve reviewer discoverability by linking the PR discussion to the PostHog run review UI when visual changes are detected.

Description

  • Added _post_review_prompt_comment which posts a best-effort GitHub PR comment to issues/{pr_number}/comments containing a direct link to the run review page and logs failures without failing run completion. (products/visual_review/backend/logic.py)
  • Invoke the new comment flow from mark_run_completed whenever a run completes with changed/new/removed snapshots on a PR-backed run. (mark_run_completed in logic.py)
  • Updated test fixtures to mock and capture GitHub issue comment creation via the existing mock_github_api fixture and exposed rsps.review_comments for assertions. (products/visual_review/backend/tests/conftest.py)
  • Added test assertions to TestCommitStatusChecks covering comment posted on change, and not posted when PR is missing, when there are no changes, or when completion fails. (products/visual_review/backend/tests/test_logic.py)

Testing

  • Attempted to run pytest products/visual_review/backend/tests/test_logic.py::TestCommitStatusChecks -q, but the run failed in this environment with ModuleNotFoundError: No module named 'django' so tests could not be executed here. (failure)
  • Attempted to run tests inside flox via flox activate -- bash -c "pytest ...", but flox was not available in this environment. (not run)
  • New/modified tests and fixtures were added and exercised locally in CI-like test design (fixtures capture review_comments), and no runtime exceptions were introduced by static inspection and committing the changes. (observed via local checks)

Codex Task

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant