-
Notifications
You must be signed in to change notification settings - Fork 4
Backfill now replays first approvals for GitHub PR triggers #862
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -77,7 +77,7 @@ Backfill suggestions lets you run Promptless on pull requests that already exist | |
|
|
||
| Open the **Backfill suggestions** panel on a trigger row, choose a window of the **last 14 days**, **last 30 days**, or **last 90 days**, and select **Preview**. The preview lists the pull requests opened or merged in that window that the trigger matches, applying the same repository, topic, directory, and branch filters it uses for live events. When a trigger scopes repositories by GitHub topic (the **Trigger on repos with certain topics** option, covered in [Repository topics](/docs/connect/triggers/github-prs#repository-topics)), the preview lists pull requests only from repositories that carry a matching topic. Backfill covers up to 1,000 pull requests per repository in the window. | ||
|
|
||
| Backfill matches pull requests that were opened or merged but it doesn't replay historical approvals. A trigger that activates only on first approval returns no backfill results because approval matching applies only to live events going forward. | ||
| Backfill also replays first approvals for GitHub PR triggers that activate only on first approval: the preview includes open pull requests whose first approval landed within the selected window, even if they were opened before the window. GitLab merge request and Bitbucket PR triggers don't offer a first-approval option, so this backfill behavior applies only to GitHub. | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. _recent_pull_request_search_queries: approval-mode search stays is:open but widens the date filter from created:>= to updated:>=, so PRs opened before the backfill window are included when their approval landed inside it.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. MergeRequestLifecycleEvent (GitLab MR / Bitbucket PR triggers) is Literal["opened", "merge"] and explicitly excludes first_approval, because the webhook lifecycle mapper never emits it for those providers -- confirms GitLab/Bitbucket first-approval triggers have no backfill analogue. |
||
|
|
||
| When the preview looks right, select **Launch backfill** to run it. Promptless processes each pull request live, exactly as it does for a new event: your publishing policy applies, so backfilled pull requests can create documentation PRs and send notifications. The panel updates with progress as the run works through the list. | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
list_matching_pull_requests docstring: backfill now replays approval-shaped events for GitHub PR triggers with a first_approval-only clause, matching PRs whose first active approval landed in the window even if opened long before it.
Source: https://github.com/Promptless/promptless/blob/922f2a1fe0bfd05d7dbfa6a676e1d35d7212f7e4/runtime/replays/service.py#L993-L1002