fix: feat: vault PRs should auto-merge after approval (#170) #173

Merged
dev-qwen merged 2 commits from fix/issue-170 into main 2026-04-03 06:42:54 +00:00
Collaborator

Fixes #170

Changes

Fixes #170 ## Changes
dev-qwen added 1 commit 2026-04-03 06:29:51 +00:00
fix: feat: vault PRs should auto-merge after approval (#170)
All checks were successful
ci/woodpecker/push/ci Pipeline was successful
ci/woodpecker/pr/ci Pipeline was successful
ci/woodpecker/pr/smoke-init Pipeline was successful
7b9c483477
Collaborator

AI Review

Summary

This PR adds auto-merge to vault PRs so that human approval triggers automatic merge without a separate merge click. The intent is correct and the approach (calling the Forgejo merge API right after PR creation) is the right pattern.

However, there is a critical bug in the API payload that renders the feature entirely non-functional.

Findings

  • bug lib/vault.sh:196 / bin/disinto:2983: "merge_when_checks_succeed":false is the wrong flag value. With false, the API call attempts an immediate merge (not a scheduled/auto-merge). The PR was just created with no approval, so Forgejo rejects the request (HTTP 405 or similar) and the error is silently swallowed by the || { _vault_log ... } handler. Auto-merge is never actually scheduled. The correct value is true — that is the Forgejo signal to schedule the merge once the required approval conditions are satisfied. Docs in VAULT.md describe the auto-merge behaviour as if it works, but it will never trigger.

Required Fix

Change both occurrences of the payload from:

{"Do":"merge","merge_when_checks_succeed":false}

to:

{"Do":"merge","merge_when_checks_succeed":true}

One occurrence is in lib/vault.sh (the main vault_request helper) and one is in bin/disinto (the release vault path). Both must be fixed.

Verdict

REQUEST_CHANGES — merge_when_checks_succeed is false — this attempts an immediate merge (which fails and is swallowed), not auto-merge after approval; the feature is broken as shipped


Reviewed at 7b9c483 | AGENTS.md

## AI Review <!-- reviewed: 7b9c483477d08128c58f7ba273a3a0b83a290a40 --> ### Summary This PR adds auto-merge to vault PRs so that human approval triggers automatic merge without a separate merge click. The intent is correct and the approach (calling the Forgejo merge API right after PR creation) is the right pattern. However, there is a critical bug in the API payload that renders the feature entirely non-functional. ### Findings - **bug** `lib/vault.sh:196` / `bin/disinto:2983`: `"merge_when_checks_succeed":false` is the wrong flag value. With `false`, the API call attempts an **immediate merge** (not a scheduled/auto-merge). The PR was just created with no approval, so Forgejo rejects the request (HTTP 405 or similar) and the error is silently swallowed by the `|| { _vault_log ... }` handler. Auto-merge is **never actually scheduled**. The correct value is `true` — that is the Forgejo signal to schedule the merge once the required approval conditions are satisfied. Docs in `VAULT.md` describe the auto-merge behaviour as if it works, but it will never trigger. ### Required Fix Change both occurrences of the payload from: ```json {"Do":"merge","merge_when_checks_succeed":false} ``` to: ```json {"Do":"merge","merge_when_checks_succeed":true} ``` One occurrence is in `lib/vault.sh` (the main vault_request helper) and one is in `bin/disinto` (the release vault path). Both must be fixed. ### Verdict **REQUEST_CHANGES** — merge_when_checks_succeed is false — this attempts an immediate merge (which fails and is swallowed), not auto-merge after approval; the feature is broken as shipped --- *Reviewed at `7b9c483` | [AGENTS.md](AGENTS.md)*
review-bot requested changes 2026-04-03 06:33:40 +00:00
Dismissed
review-bot left a comment
Collaborator

AI Review: REQUEST_CHANGES — merge_when_checks_succeed is false — this attempts an immediate merge (which fails and is swallowed), not auto-merge after approval; the feature is broken as shipped

AI Review: **REQUEST_CHANGES** — merge_when_checks_succeed is false — this attempts an immediate merge (which fails and is swallowed), not auto-merge after approval; the feature is broken as shipped
dev-bot added 1 commit 2026-04-03 06:37:20 +00:00
fix: correct merge_when_checks_succeed to true for auto-merge (#170)
All checks were successful
ci/woodpecker/push/ci Pipeline was successful
ci/woodpecker/pr/ci Pipeline was successful
ci/woodpecker/pr/smoke-init Pipeline was successful
a916904e76
Collaborator

AI Re-review (round 2)

Previous Findings

  • bug lib/vault.sh:196 / bin/disinto:2983: merge_when_checks_succeed:false attempted immediate merge instead of scheduling auto-merge → FIXED: both occurrences updated to merge_when_checks_succeed:true

New Issues

None.

Verdict

APPROVE — previous finding fixed: merge_when_checks_succeed is now true in both lib/vault.sh and bin/disinto


Reviewed at a916904 | Previous: 7b9c483 | AGENTS.md

## AI Re-review (round 2) <!-- reviewed: a916904e7624275bac5af9eeaa291c38706debdf --> ### Previous Findings - **bug** `lib/vault.sh:196` / `bin/disinto:2983`: `merge_when_checks_succeed:false` attempted immediate merge instead of scheduling auto-merge → **FIXED**: both occurrences updated to `merge_when_checks_succeed:true` ### New Issues None. ### Verdict **APPROVE** — previous finding fixed: merge_when_checks_succeed is now true in both lib/vault.sh and bin/disinto --- *Reviewed at `a916904` | Previous: `7b9c483` | [AGENTS.md](AGENTS.md)*
review-bot approved these changes 2026-04-03 06:42:26 +00:00
review-bot left a comment
Collaborator

AI Re-review (round 2): APPROVE — previous finding fixed: merge_when_checks_succeed is now true in both lib/vault.sh and bin/disinto

AI Re-review (round 2): **APPROVE** — previous finding fixed: merge_when_checks_succeed is now true in both lib/vault.sh and bin/disinto
dev-qwen merged commit 2dbe6a85f4 into main 2026-04-03 06:42:54 +00:00
dev-qwen deleted branch fix/issue-170 2026-04-03 06:42:55 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
3 participants
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: disinto-admin/disinto#173
No description provided.