feat: re-run a failed run from its detail page #9
No reviewers
Labels
No labels
ai::retry
ai::retry_once
ai::retry_until_green
ai::validate_plan
status::blocked
status::done
status::functional_analysis
status::in_ci
status::in_development
status::in_review
status::technical_analysis
status::waiting_info
status::waiting_validation
type::analysis
type::bug
type::question
type::task
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
Alchemic.Studio/Alfred!9
Loading…
Reference in a new issue
No description provided.
Delete branch "agent/issue-8-permit-to-re-run-the-failed-runs"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Adds a Re-run button in the top-right corner of the run detail page (
/runs/{id}).failedand is the latest run of its mailbox, no run of the mailbox ispending/running, the mailbox is neitherrunningnorcancelling, the target is open, and the issue isblockedwith a failed phase or infunctional_analysis,technical_analysis,in_development,in_ciorin_review.RunPolicy::rerun→ProjectPolicy::update). Members see the page without the button, and their POST gets 403.<x-confirm>, which gets a new non-destructivevariantprop (it defaults todanger).internal.rerun_requestedevent is buffered.RetryCommand: exactly what theretrylabel does.RerunRequestedtrigger keeps the status, resets the counter of the failed phase and runs that phase again with the failed run's trigger events (attempt + 1). The "Retryingphase." comment is posted and the status label restored. This is howlease_expiredandstale_runruns get restarted.MailboxWakernow dispatchesProcessMailboxafter commit.Tests
TriggerResolverTestandIssueLifecycleTestcover the new trigger, its precedence and its invalid states.tests/Feature/Lifecycle/RerunTest.phpcovers a lease-expired re-run, the counter reset, equivalence with theretrylabel, an MR review, and a comment for each re-run.tests/Feature/Admin/Runs/RunRerunTest.phpcovers visibility for each state and eligibility case, 403/404/login, success, stale requests and the double click.tests/Browser/Runs/RunRerunTest.phpcovers cancel, then confirm, then landing on the new run.RunDispatcherTestthat failed in long full runs.php artisan testwith Playwright chromium, so they pick up the new tests unchanged.The full suite passes (2,139 tests), and pint and phpstan pass.
Closes #8
Add a "Re-run" button in the top-right corner of /runs/{id}. It appears for the latest run of a mailbox when that run failed and nothing else is pending or running there. Only those who manage the project see it, and the click must be confirmed. The button buffers a new internal.rerun_requested event through the MailboxWaker. On a blocked issue, the dispatcher resolves it to the existing RetryCommand, so the re-run does exactly what the `retry` label does. On functional_analysis, technical_analysis, in_development, in_ci or in_review, a new RerunRequested trigger keeps the status, resets the counter of the failed phase and runs that phase again with the failed run's trigger events. RetryCommandHandler then posts "Retrying `phase`." and restores the status label. This covers runs that failed as lease_expired or stale_run, which nothing restarted until now. On an MR mailbox the review runs again. RerunFailedRun is the single source of eligibility. The controller checks it again under the mailbox lock. A stale request changes nothing and flashes the reason. On success the user lands on the newly planned run. MailboxWaker now queues ProcessMailbox after commit, so that a worker never reads the mailbox before its new version is saved. Also make the "window still open" dataset of RunDispatcherTest lazy: it evaluated now() when the file loaded and failed in long runs of the suite. Refs: #8WIP: feat: re-run a failed run from its detail pageto feat: re-run a failed run from its detail page