fix(prs): gitea_pr_conflict_resolve says "Conflict Resolution Applied" without confirm when there are no conflicts #24
Labels
No labels
area/dsh
area/forgejo
experiment
priority/later
priority/next
priority/now
type/bug
type/task
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
dsh-plugins/dsh-gitea#24
Loading…
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
gitea_pr_conflict_resolvewith noconfirmreportsConflict Resolution Applied: No conflicts to resolve.Nothing was applied and no confirmation was given, yet the output claims success. That is misleading for an operator and obscures the dry-run gate.Repro
No
confirm: truewas passed; the tool definition says it is dry-run by default and applies only withconfirm: true.Observed vs expected
Conflict Resolution (dry-run): no conflicts to resolve; nothing to apply."Applied" only afterconfirm: trueand a real commit.Root cause
lib/conflict-assistant.jsearly-returns before the confirmation branch:lib/handlers/formatters.jsonly distinguishesdata.dryRun; without it, the non-dry-run branch printsConflict Resolution Applied: ....Proposed fix
Return
dryRun: args.confirm !== true/applied: falsein the clean early return, and make the formatter use explicitdata.applied(or acleanbranch) rather than assuming applied. Tests: no-confirm + clean → dry-run wording; confirm + clean → no-op wording without claiming a commit.Acceptance: "Applied" never appears unless
confirm: trueand a resolution commit was created.Duplicate check
Searched issues for
conflict(state all) — only #11/#8 matched the word incidentally; none covers this gate.Layer
dsh-gitea plugin/tool.
Fixed in
234cbd4(PR #39).The clean early-return in
resolveMergeConflictsnow carries{clean:true, applied:false, dryRun: !confirm}, and the formatter handles that shape before the applied branch. Live,gitea_pr_conflict_resolvewithmaster/masterand noconfirm→Conflict Resolution (dry-run): no conflicts to resolve; nothing to apply.“Applied” is reachable only afterconfirm: trueand a real resolution commit.Tests:
test/pr-semantics.test.mjs.