Disable AGit review refs at git-gate #506

Closed
opened 2026-07-26 13:52:47 -04:00 by didericis-codex · 0 comments
Collaborator

Problem

Gitea AGit accepts pushes to refs/for/*, refs/draft/*, and refs/for-review/* and creates pull requests backed by server-managed review refs rather than normal refs/heads/* branches.

That conflicts with bot-bottle’s git-gate workflow:

  • follow-up commits cannot be pushed to the PR through the normal branch workflow;
  • git-gate can forward creation of the AGit review ref, but Gitea rejects later direct updates to the generated refs/pull/<n>/head;
  • agents and operators cannot reliably fetch, amend, and push the source branch because no ordinary source branch exists;
  • recovery requires creating a replacement branch-backed PR, losing continuity and creating avoidable review churn.

Desired behavior

Git-gate should reject creation or updates of AGit review refs and instruct callers to push to refs/heads/<branch> before opening a pull request. Normal branches and tags must remain unaffected. Deletion of old AGit refs should remain allowed for cleanup.

Acceptance criteria

  • pushes creating or updating refs/for/*, refs/draft/*, or refs/for-review/* fail before scanning or upstream forwarding;
  • the rejection message explains the branch-backed PR workflow;
  • deletion of legacy AGit refs remains possible;
  • focused unit coverage verifies the guard.
## Problem Gitea AGit accepts pushes to `refs/for/*`, `refs/draft/*`, and `refs/for-review/*` and creates pull requests backed by server-managed review refs rather than normal `refs/heads/*` branches. That conflicts with bot-bottle’s git-gate workflow: - follow-up commits cannot be pushed to the PR through the normal branch workflow; - git-gate can forward creation of the AGit review ref, but Gitea rejects later direct updates to the generated `refs/pull/<n>/head`; - agents and operators cannot reliably fetch, amend, and push the source branch because no ordinary source branch exists; - recovery requires creating a replacement branch-backed PR, losing continuity and creating avoidable review churn. ## Desired behavior Git-gate should reject creation or updates of AGit review refs and instruct callers to push to `refs/heads/<branch>` before opening a pull request. Normal branches and tags must remain unaffected. Deletion of old AGit refs should remain allowed for cleanup. ## Acceptance criteria - pushes creating or updating `refs/for/*`, `refs/draft/*`, or `refs/for-review/*` fail before scanning or upstream forwarding; - the rejection message explains the branch-backed PR workflow; - deletion of legacy AGit refs remains possible; - focused unit coverage verifies the guard.
gitea-actions bot added the Status/Needs Triage label 2026-07-26 13:52:55 -04:00
didericis added
Priority
Critical
1
Kind/Security
and removed Status/Needs Triage labels 2026-07-26 13:56:05 -04:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: didericis/bot-bottle#506