fix: remote-backend scale-up relies on workflow_job webhooks, which Forgejo never sends #56

Open
opened 2026-09-27 20:10:10 +00:00 by rcsheets · 0 comments
Owner

The webhook receiver's scale-up path (internal/webhook/receiver.go) waits for workflow_job events with action queued, then annotates matching pools with requested-replicas, which the remote backend reads to scale up from minReplicas.

Forgejo never sends workflow_job events. Checked against Forgejo 16 source: the only Actions webhook events are action_run_success, action_run_failure and action_run_recover (modules/webhook/type.go), all fired when a run finishes. The receiver was modeled on GitHub/Gitea. So remote-backend pools never scale above minReplicas, and the completed path never fires either.

Proposal: move the remote backend onto the same mechanism Kubernetes ephemeral pools use (#30): poll GET …/actions/runners/jobs?labels=… in the pool's scope for waiting jobs, and scale on those. Then retire the workflow_job receiver, or repurpose it to trigger an immediate reconcile on action_run_* events if that turns out to be useful.

Found while designing ephemeral mode for #30.

🤖 Generated with Claude Code

The webhook receiver's scale-up path (`internal/webhook/receiver.go`) waits for `workflow_job` events with action `queued`, then annotates matching pools with `requested-replicas`, which the remote backend reads to scale up from `minReplicas`. **Forgejo never sends `workflow_job` events.** Checked against Forgejo 16 source: the only Actions webhook events are `action_run_success`, `action_run_failure` and `action_run_recover` (`modules/webhook/type.go`), all fired when a run *finishes*. The receiver was modeled on GitHub/Gitea. So remote-backend pools never scale above `minReplicas`, and the `completed` path never fires either. **Proposal:** move the remote backend onto the same mechanism Kubernetes ephemeral pools use (#30): poll `GET …/actions/runners/jobs?labels=…` in the pool's scope for waiting jobs, and scale on those. Then retire the `workflow_job` receiver, or repurpose it to trigger an immediate reconcile on `action_run_*` events if that turns out to be useful. Found while designing ephemeral mode for #30. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
brooktrails/forgejo-runner-operator#56
No description provided.