background-agents icon indicating copy to clipboard operation
background-agents copied to clipboard

Feature request: resolve webhook automation repo from payload

Open rubenlangeweg opened this issue 5 months ago • 1 comments

Description

Webhook automations have a fixed repo and branch, set at creation. That breaks down for events that already carry a repo: CI failures, deploy events, monitoring alerts, internal platform events. You end up needing one automation per repo. We want webhook automations to resolve the target repo, and optionally the branch, from the payload. Pull the values from configured JSON paths, validate them against an allowed repo set, then start the session against the resolved repo.

Out of scope

  • Multi-repo fan-out from a single webhook event.
  • Provider-specific parsers for every external system. Generic JSON payload paths first.

Acceptance criteria

  • Users can configure a webhook automation to resolve repoOwner, repoName, and optionally branch from JSON payload paths.
  • Resolved repos are validated against an explicit allowlist or the GitHub App's installed repos before any session is created.
  • If repo resolution fails, the webhook returns a clear error and creates no session.
  • If branch is missing, fall back to the resolved repo's default branch or a configured fallback branch.
  • The resolved repo and branch are recorded on the automation run and the created session.
  • Existing automations with fixed repo and branch keep working unchanged.
  • The agent's webhook context includes the resolved repo and branch plus the original payload.
  • Tests cover fixed repo behaviour, successful payload-based resolution, missing repo fields, unauthorized repo, invalid branch, fallback branch, and duplicate/idempotent delivery.

Related

  • Existing webhook automation support: https://github.com/ColeMurray/background-agents/issues/339
  • Generic webhook receiver: https://github.com/ColeMurray/background-agents/issues/494
  • Automations docs: https://github.com/ColeMurray/background-agents/blob/main/docs/AUTOMATIONS.md
  • Repo-set automation ticket: https://github.com/ColeMurray/background-agents/issues/831

rubenlangeweg avatar Jun 26 '26 07:06 rubenlangeweg

Before working on this one, lets land the following PRs

  • https://github.com/ColeMurray/background-agents/pull/836
  • https://github.com/ColeMurray/background-agents/pull/850

rubenlangeweg avatar Jun 29 '26 12:06 rubenlangeweg