Task #462 still shows "In review" and a Merge button, but its PR (#1846) was merged on Gitea on 2026-11-10 06:54 UTC, two days before this was seen. Clicking Merge fails with:
task action conflict: merge pull request #1846: forge merge pull request: merge pull request sam/archie#1846: Gitea did not merge it
Why
The pr-reconcile job (reconcilePRs in internal/daemon/daemon.go, every minute) is what moves a task to merged when its PR is merged outside Archie. It lists tasks with status = 'pr_open' (ListOpenPRs in internal/infrastructure/postgres/queries/tasks.sql), calls fg.PRState, and on "merged" transitions pr_open to merged. #462 was not moved, so one of these holds:
PRState for Gitea does not return "merged" for this PR. It goes through forgeext.PRState to the Gitea forge extension in archipelago, which I could not read. A closed, merged Gitea PR may come back as "closed" or "open".
The task is not in pr_open, so the job never sees it. The "In review" label may come from another status.
forgeFor returns a NoopForge for the task, so the job skips it silently (continue with no log).
PRState or Transition fails every pass. Both log a warning or error, so check the daemon logs for PR state check failed or PR merged but task transition failed on #1846.
Also
applyMerge in internal/domain/taskactions/service.go calls the forge merge, and on refusal returns ErrConflict and leaves the task unchanged. If the PR is already merged, the action should check PRState, record the task merged, and return success instead of a conflict. Even if the reconciler is fixed, the Merge button can race it.
Done when
A task whose PR is merged on Gitea reaches merged within one reconcile pass, and the Merge button disappears.
Clicking Merge on a PR already merged on the forge moves the task to merged rather than returning a conflict.
Task #462 still shows "In review" and a Merge button, but its PR (#1846) was merged on Gitea on 2026-11-10 06:54 UTC, two days before this was seen. Clicking Merge fails with:
`task action conflict: merge pull request #1846: forge merge pull request: merge pull request sam/archie#1846: Gitea did not merge it`
## Why
The `pr-reconcile` job (`reconcilePRs` in `internal/daemon/daemon.go`, every minute) is what moves a task to `merged` when its PR is merged outside Archie. It lists tasks with `status = 'pr_open'` (`ListOpenPRs` in `internal/infrastructure/postgres/queries/tasks.sql`), calls `fg.PRState`, and on `"merged"` transitions `pr_open` to `merged`. #462 was not moved, so one of these holds:
1. `PRState` for Gitea does not return `"merged"` for this PR. It goes through `forgeext.PRState` to the Gitea forge extension in archipelago, which I could not read. A closed, merged Gitea PR may come back as `"closed"` or `"open"`.
2. The task is not in `pr_open`, so the job never sees it. The "In review" label may come from another status.
3. `forgeFor` returns a `NoopForge` for the task, so the job skips it silently (`continue` with no log).
4. `PRState` or `Transition` fails every pass. Both log a warning or error, so check the daemon logs for `PR state check failed` or `PR merged but task transition failed` on #1846.
## Also
`applyMerge` in `internal/domain/taskactions/service.go` calls the forge merge, and on refusal returns `ErrConflict` and leaves the task unchanged. If the PR is already merged, the action should check `PRState`, record the task merged, and return success instead of a conflict. Even if the reconciler is fixed, the Merge button can race it.
## Done when
- A task whose PR is merged on Gitea reaches `merged` within one reconcile pass, and the Merge button disappears.
- Clicking Merge on a PR already merged on the forge moves the task to `merged` rather than returning a conflict.
- #462 shows Merged.
sam
added the mediumbug labels 2026-11-12 15:51:30 +00:00
Live cause: the reconciler resolved each task's forge through the execution-identity gate, which refuses tasks run as an operator's user account, so they were skipped every minute. It now resolves the forge through the repository's bound connection in the task's org, as the Merge action does. Verified on the live host after deploy: a closed PR moved its task to rejected and a merged PR moved its task to merged within a minute. A refused merge now tells the operator why (closed without merging) instead of the forge error chain.
Live cause: the reconciler resolved each task's forge through the execution-identity gate, which refuses tasks run as an operator's user account, so they were skipped every minute. It now resolves the forge through the repository's bound connection in the task's org, as the Merge action does. Verified on the live host after deploy: a closed PR moved its task to rejected and a merged PR moved its task to merged within a minute. A refused merge now tells the operator why (closed without merging) instead of the forge error chain.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Task #462 still shows "In review" and a Merge button, but its PR (#1846) was merged on Gitea on 2026-11-10 06:54 UTC, two days before this was seen. Clicking Merge fails with:
task action conflict: merge pull request #1846: forge merge pull request: merge pull request sam/archie#1846: Gitea did not merge itWhy
The
pr-reconcilejob (reconcilePRsininternal/daemon/daemon.go, every minute) is what moves a task tomergedwhen its PR is merged outside Archie. It lists tasks withstatus = 'pr_open'(ListOpenPRsininternal/infrastructure/postgres/queries/tasks.sql), callsfg.PRState, and on"merged"transitionspr_opentomerged. #462 was not moved, so one of these holds:PRStatefor Gitea does not return"merged"for this PR. It goes throughforgeext.PRStateto the Gitea forge extension in archipelago, which I could not read. A closed, merged Gitea PR may come back as"closed"or"open".pr_open, so the job never sees it. The "In review" label may come from another status.forgeForreturns aNoopForgefor the task, so the job skips it silently (continuewith no log).PRStateorTransitionfails every pass. Both log a warning or error, so check the daemon logs forPR state check failedorPR merged but task transition failedon #1846.Also
applyMergeininternal/domain/taskactions/service.gocalls the forge merge, and on refusal returnsErrConflictand leaves the task unchanged. If the PR is already merged, the action should checkPRState, record the task merged, and return success instead of a conflict. Even if the reconciler is fixed, the Merge button can race it.Done when
mergedwithin one reconcile pass, and the Merge button disappears.mergedrather than returning a conflict.Landed on main; task check passed on the merged tree. Not yet proven live.
Live cause: the reconciler resolved each task's forge through the execution-identity gate, which refuses tasks run as an operator's user account, so they were skipped every minute. It now resolves the forge through the repository's bound connection in the task's org, as the Merge action does. Verified on the live host after deploy: a closed PR moved its task to rejected and a merged PR moved its task to merged within a minute. A refused merge now tells the operator why (closed without merging) instead of the forge error chain.