bug(merge): all merge paths ignore the repo's default_merge_style — hardcoded "merge" fallback creates forge merge commits despite fast-forward-only setting #73
Labels
No labels
breaking
bug
documentation
enhancement
epic
good first issue
help wanted
refactoring
resolution/duplicate
resolution/invalid
resolution/wontfix
security
severity/critical
severity/high
severity/low
severity/medium
status/abandoned
status/blocked
status/needs-decision
status/needs-info
status/needs-verification
testing
upstream
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
sixfold-space/madtea#73
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
Symptom
Main history on a repo whose
default_merge_styleisfast-forward-only(set deliberately, several times) still accumulates one forge-authored merge commit per PR (Merge pull request …by<user>@noreply.codeberg.org). Those commits are unsigned, so a repo withcommit.gpgsigndiscipline shows a permanent mix of signed work commits and unsigned merge commits — this repo's own main is the live evidence (e.g.3b6bd54c,2c623deevs the signedGcommits between them).Root cause
No merge path ever consults the repo's
default_merge_style:internal/gitea/client_pr.goMergePR: emptyStrategyfalls back to a hardcodedstrategy = "merge"— the API call always carries an explicitdo, so the forge-side default is never in play.internal/service/workflow/finish.go:1089mergeStep: passesgitea.MergePROptions{}→ hits that fallback. Everymadt_finishtherefore requests a merge commit, unconditionally.internal/cmd/pr/merge.go: no strategy flag → hardcodedstrategy := "merge"default.internal/mcp/tools_prs_crud.goprsMerge: emptystrategyparam → same client fallback.Setting
default_merge_styleon the repo (the documented forge-side lever) is silently overridden by every madtea surface.Fix
When the caller does not choose a strategy explicitly, resolve the target repo's
default_merge_styleand send that asdo. Explicit flags/params keep overriding. Behavior on repos whose default ismergeis unchanged.Points to cover:
finishmergeStep uses the resolved repo default; the behind-base retry path (MergeWithRetryrebase handling) must still work underfast-forward-only, where a behind-base branch cannot ff — needs a test.pr mergewith no strategy flag: repo default instead of hardcodedmerge(flags unchanged).madt_prs action=mergewith nostrategy: same.Acceptance
default_merge_style: fast-forward-only,madt_finish/pr merge/madt_prs mergewith no explicit strategy performs a fast-forward merge (no forge merge commit).