Skip to content

Parse pr:modified draft→ready flips as synthetic pr:ready_for_review#59

Merged
trick77 merged 2 commits into
masterfrom
t3code/61f93775
May 18, 2026
Merged

Parse pr:modified draft→ready flips as synthetic pr:ready_for_review#59
trick77 merged 2 commits into
masterfrom
t3code/61f93775

Conversation

@trick77
Copy link
Copy Markdown
Owner

@trick77 trick77 commented May 18, 2026

Summary

  • Adds a synthetic pr:ready_for_review event type emitted by the parser when a pr:modified payload carries previousDraft=true, draft=false.
  • Other pr:modified variants (title/description/target changes) are skipped at parse time.
  • Actor attribution for the synthetic event follows the same rule as reviewer-activity events (actor not PR author).
  • Updates onboarding scripts and webhook setup docs to include the pr:modified trigger.
  • Documents the new pickup-time CTE (clock-start = COALESCE(pr:ready_for_review, pr:opened) with occurred_at >= clock_start guard) in README.

Testing

  • test_draft_to_ready_flip_emits_synthetic_ready_for_review — verifies pr:ready_for_review event_type, raw eventKey preserved on payload
  • test_draft_to_ready_uses_actor_as_author — maintainer flip attributes to flipper not PR author
  • test_title_only_modify_returns_skip — title/description changes return BitbucketSkip
  • test_ready_to_draft_returns_skip — reverse flip (ready→draft) skipped
  • test_pr_opened_as_draft_passes_through_unchanged — regression guard: opened-as-draft rows still emitted with raw draft field
  • test_modified_without_draft_fields_returns_skip — no draft fields → skip (not a synthetic ready)
  • Lint/type-check: ruff check . && ruff format --check . && pyright — clean

trick77 added 2 commits May 18, 2026 21:18
- Emit pr:ready_for_review when previousDraft=true & draft=false
- Skip title/description/target-only pr:modified variants
- Attribute actor as author for the synthetic event
- Add test fixtures and comprehensive parser tests
- Update docs (README, setup guide, onboarding script)
Resolve conflict in tests/test_parsers_bitbucket.py by keeping both new
test classes — TestExtractPrDeclined from #58 (master) and
TestExtractPrModified from this branch. The pr:declined and
pr:modified work is orthogonal; both belong in the parser tests.

The script's REQUIRED_WEBHOOK_EVENTS tuple auto-merged with pr:declined
inserted next to pr:modified — no manual fix-up needed there.
@trick77 trick77 merged commit 5bcc758 into master May 18, 2026
2 checks passed
@trick77 trick77 deleted the t3code/61f93775 branch May 18, 2026 19:24
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.

1 participant