Actions: merge, approve, close, comment, open, refresh, bulk merge #9

Closed
opened 2026-10-01 21:55:16 -05:00 by deadstyle · 3 comments
Owner

Problem

Browsing without acting isn't the product. v1 needs the action keys: m merge, a approve, x close, c comment (in $EDITOR), o open in browser, r refresh, with confirm dialogs for merge and close, and space to mark PRs for bulk merge.

Plan

  1. A confirm dialog component: lists the targets, the merge strategy, and a warning for failing or pending CI.
  2. m, x, a through core → forge, with the result (or error) shown in the status bar and the cache updated so the list reflects the change at once.
  3. c: open $EDITOR on a temp file via tea.ExecProcess; empty content cancels.
  4. o: open the item's web URL with the platform opener (xdg-open/open).
  5. space marks and esc clears marks; m with marks bulk-merges. Bulk results are reported per PR, because partial failure is expected.
  6. Keys are hidden when the adapter lacks the capability (e.g. no forge.Approver).

Plan-review additions (#17): the merge contract

  • Freshness: the confirm dialog records each target's head SHA. Merge sends it (head_commit_id), so a PR that gained commits after confirmation is refused, not merged.
  • Per-target results: every merge, single or bulk, produces a result per PR: merged, refused (changed, conflicts, CI rule), failed (network, server error), or unknown (timed out; the server may have merged it).
  • Reconcile before retry: before any retry, re-fetch each failed or unknown target. Ones that turn out merged are reported as merged and never retried.
  • Cancellation: esc during a bulk merge stops starting new merges; in-flight ones finish and report.
  • The dialog shows exactly what will run: each target PR (deduplicated), with its full contents for Renovate PRs, not just the selected row.
  • What the user sees after a partial failure is a product question on #13. Build to the recommendation there unless the PM says otherwise.

Context

  • docs/design.md → Keymap (the confirm-dialog rule).
  • Merge strategy default (repo default vs config override) is a pending product decision. Use the repo's default until the PM decides.
  • Depends on the gitea adapter and UI shell tickets.

PM decisions (2026-10-02, #13)

  • Bulk merge carries on past a failure and shows a result per PR. PRs that didn't merge stay marked, so m retries just those after a re-check. Replaces the open question in the plan-review section.
  • CI: the confirm dialog warns about failing or running CI and allows the merge, unless the "only merge when CI is green" setting is on for the host (or the repo's override). Then it refuses. Branch protection stays the forge's job; show its reason when it refuses.
  • Merge strategy: always the repo's default.
  • R opens the run's page in the browser (Forgejo has no re-run API, #1). Add it to the keys in this ticket.
## Problem Browsing without acting isn't the product. v1 needs the action keys: `m` merge, `a` approve, `x` close, `c` comment (in `$EDITOR`), `o` open in browser, `r` refresh, with confirm dialogs for merge and close, and `space` to mark PRs for bulk merge. ## Plan 1. A confirm dialog component: lists the targets, the merge strategy, and a warning for failing or pending CI. 2. `m`, `x`, `a` through core → forge, with the result (or error) shown in the status bar and the cache updated so the list reflects the change at once. 3. `c`: open `$EDITOR` on a temp file via `tea.ExecProcess`; empty content cancels. 4. `o`: open the item's web URL with the platform opener (`xdg-open`/`open`). 5. `space` marks and `esc` clears marks; `m` with marks bulk-merges. Bulk results are reported per PR, because partial failure is expected. 6. Keys are hidden when the adapter lacks the capability (e.g. no `forge.Approver`). ### Plan-review additions (#17): the merge contract - **Freshness:** the confirm dialog records each target's head SHA. Merge sends it (`head_commit_id`), so a PR that gained commits after confirmation is refused, not merged. - **Per-target results:** every merge, single or bulk, produces a result per PR: merged, refused (changed, conflicts, CI rule), failed (network, server error), or unknown (timed out; the server may have merged it). - **Reconcile before retry:** before any retry, re-fetch each failed or unknown target. Ones that turn out merged are reported as merged and never retried. - **Cancellation:** `esc` during a bulk merge stops starting new merges; in-flight ones finish and report. - **The dialog shows exactly what will run:** each target PR (deduplicated), with its full contents for Renovate PRs, not just the selected row. - What the user sees after a partial failure is a product question on #13. Build to the recommendation there unless the PM says otherwise. ## Context - `docs/design.md` → Keymap (the confirm-dialog rule). - Merge strategy default (repo default vs config override) is a pending product decision. Use the repo's default until the PM decides. - Depends on the gitea adapter and UI shell tickets. ## PM decisions (2026-10-02, #13) - **Bulk merge carries on past a failure** and shows a result per PR. PRs that didn't merge stay marked, so `m` retries just those after a re-check. Replaces the open question in the plan-review section. - **CI:** the confirm dialog warns about failing or running CI and allows the merge, unless the "only merge when CI is green" setting is on for the host (or the repo's override). Then it refuses. Branch protection stays the forge's job; show its reason when it refuses. - **Merge strategy:** always the repo's default. - **`R`** opens the run's page in the browser (Forgejo has no re-run API, #1). Add it to the keys in this ticket.
Author
Owner

🤖 Plan approved (engineering lead). Two parts in order: (1) the merge, approve, close and comment plumbing, with the safety rules (each target is re-checked before merging, a PR that changed since you confirmed is refused rather than merged, and every PR gets its own result: merged, refused with the forge's reason, failed, unknown, or not started); (2) the keys and dialogs (m, a, x, c, o, R, r, space, esc), with the confirm dialog naming the repo's merge style and warning on red or running CI (or refusing when 'only merge when green' is on). PRs that didn't merge stay marked, so m retries just those. Branch: feature/9-actions.

🤖 Plan approved (engineering lead). Two parts in order: (1) the merge, approve, close and comment plumbing, with the safety rules (each target is re-checked before merging, a PR that changed since you confirmed is refused rather than merged, and every PR gets its own result: merged, refused with the forge's reason, failed, unknown, or not started); (2) the keys and dialogs (m, a, x, c, o, R, r, space, esc), with the confirm dialog naming the repo's merge style and warning on red or running CI (or refusing when 'only merge when green' is on). PRs that didn't merge stay marked, so m retries just those. Branch: feature/9-actions.
Author
Owner

🤖 Scope correction: the plan said c (comment) is hidden when you can only read a repo. Forgejo lets readers comment, so c follows what the forge allows. If the forge refuses, its reason shows in the status bar.

🤖 Scope correction: the plan said `c` (comment) is hidden when you can only read a repo. Forgejo lets readers comment, so `c` follows what the forge allows. If the forge refuses, its reason shows in the status bar.
Author
Owner

🤖 Merged in #31. The action keys are in: m, a, x, c (in $EDITOR), o, R, r, plus space/esc marks and bulk merge. Every merge re-checks first and refuses a PR that changed after you confirmed. Each PR gets its own result, and PRs that didn't merge stay marked so m retries just those. The dialog warns on red or running CI, or refuses when 'only merge when green' is on.

🤖 Merged in #31. The action keys are in: m, a, x, c (in $EDITOR), o, R, r, plus space/esc marks and bulk merge. Every merge re-checks first and refuses a PR that changed after you confirmed. Each PR gets its own result, and PRs that didn't merge stay marked so m retries just those. The dialog warns on red or running CI, or refuses when 'only merge when green' is on.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
deadstyle/lazyforge#9
No description provided.