Repository navigation
Description
Before submitting
- I searched existing issues and did not find a duplicate.
- I included enough detail to reproduce or investigate the problem.
Area
apps/desktop
Steps to reproduce
- On a self-hosted Forgejo instance, create a repository and disable Merge commit, Squash, Rebase, and Rebase with merge commit, leaving only Fast-forward only enabled. The API then reports
allow_fast_forward_only_merge: true, every otherallow_*merge flag false, anddefault_merge_style: "fast-forward-only". - Add the repository to a T3 Code project and open a pull request from a branch in T3 Code.
- Open the pull request's merge controls.
Expected behavior
T3 Code offers a merge action that performs a Forgejo fast-forward-only merge (Do: "fast-forward-only"). At minimum, the action should be shown disabled with an explanation.
Actual behavior
No merge button appears at all. The available merge-method list is empty because T3 Code only maps Forgejo's allow_merge_commits, allow_squash_merge, and allow_rebase flags. A repository whose only enabled style is fast-forward-only therefore reports no merge capabilities, and the UI gates the merge control on that list. If the action is forced from the client, it throws No merge method is available for this repository.
Impact
Major degradation or frequent failure: fast-forward-only is the only merge style allowed on these repositories, so T3 Code cannot merge any of their pull requests.
Version or commit
0.1.7 (latest release at the time of the report)
Environment
macOS desktop app; self-hosted Forgejo 17.0.1+gitea-1.22.0
Logs or stack traces
None available, because the button is hidden before any API call. The client-side guard is visible in the bundled app:
throw Error("No merge method is available for this repository.")
Workaround
Enable the repository's Rebase style (allow_rebase: true) in addition to fast-forward-only. T3 Code then offers "Rebase and merge", which still creates no merge commit, though it rewrites branch commits when the base has moved.
Root cause and suggested fix
In packages/source-control-forgejo:
forgejoPullRequestJson.tsparsesallow_merge_commits,allow_squash_merge,allow_rebase, andallow_rebase_update, but notallow_fast_forward_only_merge.ForgejoPullRequestProvider.tssetsmergeCapabilitiesfrom those three flags and advertisesmergeMethods: ["merge", "squash", "rebase"].runActionsendsDo: input.mergeMethod ?? "merge".
The UI filters the advertised methods by mergeCapabilities, so a fast-forward-only repository yields zero methods and hides the control.
Forgejo accepts Do: "fast-forward-only" and exposes the flag as allow_fast_forward_only_merge. A fix needs a distinct merge method on the shared PullRequestMergeMethod union, because fast-forward is not Rebase (it refuses when the branch has moved instead of rewriting it). It also needs a UI label, the Forgejo capability mapping, and the action-to-Do mapping. Other providers' advertised methods would stay unchanged.
Activity