Add merge-style support to ward agent pr merge #1215

Merged
coilyco-ops merged 2 commits from issue-1202 into main 2026-07-13 23:56:01 +00:00
Member

This adds merge-style selection to ward agent pr merge and teaches the Forgejo merge helper to honor explicit styles or a usable repo default.

  • Adds --style and forwards it through the read-only broker path.
  • Resolves repository merge settings before merging and fails clearly when no usable default exists.
  • Covers explicit squash, repo-default squash, unsupported styles, and broker round-trip behavior.

Tests: ward exec test, ward exec build, pre-commit run --all-files.

closes #1202
ward.workflow: pull-request-and-merge

This adds merge-style selection to `ward agent pr merge` and teaches the Forgejo merge helper to honor explicit styles or a usable repo default. - Adds `--style` and forwards it through the read-only broker path. - Resolves repository merge settings before merging and fails clearly when no usable default exists. - Covers explicit squash, repo-default squash, unsupported styles, and broker round-trip behavior. Tests: `ward exec test`, `ward exec build`, `pre-commit run --all-files`. closes #1202 ward.workflow: pull-request-and-merge
feat: add merge-style support to pr merge
All checks were successful
test / test (pull_request) Successful in 36s
76dca28f7e
Author
Member

WARDED_WORKFLOW review-note

verdict: block
confidence: high
summary: PR 1215 adds the merge-style flag, repo default-style resolution, broker forwarding, and the expected status/head gates. It does not satisfy the branch-deletion part of ward#1202 because the merge payload ignores the repository default_delete_branch_after_merge setting.
findings:

  • severity: medium
    file: cmd/ward/forgejo_ops.go
    line: 574
    problem: mergePullRequestWithHeadAndStyle reads DefaultDeleteBranchAfterMerge into forgejoRepositoryMergeSettings, but builds the merge request as only {"do": style} plus head_commit_id. It never sends Forgejos delete_branch_after_mergefield. impact: Repos whose setting says to delete PR branches after merge will not get that behavior throughward agent pr merge, violating the issue requirement to keep branch deletion aligned with the repository default unless ward has a more specific policy. conclusion: Review blocks PR 1215 until the merge request carries delete_branch_after_merge` from the repo setting, with test coverage proving both true and false defaults. The merge-style selection itself is close, but this PR should not land while it drops a stated repository merge policy.
WARDED_WORKFLOW review-note verdict: block confidence: high summary: PR 1215 adds the merge-style flag, repo default-style resolution, broker forwarding, and the expected status/head gates. It does not satisfy the branch-deletion part of ward#1202 because the merge payload ignores the repository default_delete_branch_after_merge setting. findings: - severity: medium file: cmd/ward/forgejo_ops.go line: 574 problem: `mergePullRequestWithHeadAndStyle` reads `DefaultDeleteBranchAfterMerge` into `forgejoRepositoryMergeSettings`, but builds the merge request as only `{"do": style}` plus `head_commit_id`. It never sends Forgejo`s `delete_branch_after_merge` field. impact: Repos whose setting says to delete PR branches after merge will not get that behavior through `ward agent pr merge`, violating the issue requirement to keep branch deletion aligned with the repository default unless ward has a more specific policy. conclusion: Review blocks PR 1215 until the merge request carries `delete_branch_after_merge` from the repo setting, with test coverage proving both true and false defaults. The merge-style selection itself is close, but this PR should not land while it drops a stated repository merge policy.
feat: carry repo merge defaults into pr merge
All checks were successful
test / test (pull_request) Successful in 1m27s
7c274c2833
Sign in to join this conversation.
No description provided.