Skip to content

Fix webhook handler processing any label from any sender#2307

Merged
hiroshinishio merged 1 commit intomainfrom
wes
Feb 22, 2026
Merged

Fix webhook handler processing any label from any sender#2307
hiroshinishio merged 1 commit intomainfrom
wes

Conversation

@hiroshinishio
Copy link
Collaborator

Summary

  • The pull_request.labeled webhook handler was triggered by ANY label on ANY PR, not just the gitauto label. This caused Dependabot PRs with labels like dependencies to trigger 4 simultaneous agent runs, waste credits, post duplicate comments, and cause git lock contention on EFS.
  • Added three guard checks: (1) verify label name matches gitauto, (2) reject bot senders except GitAuto's own app, (3) return early for non-gitauto branch prefixes instead of silently defaulting to dashboard trigger.

Social Media Post (GitAuto)

Dependabot bumped a dependency on a customer repo. Four Lambda functions spun up, each trying to write unit tests for a lockfile change. Root cause: our webhook handler triggered on any label, not just "gitauto". Three lines of guard checks fixed it.

Social Media Post (Wes)

Debugging why a customer got 4 duplicate bot comments on a Dependabot PR. Our pull_request.labeled handler had no filter - it ran on every label, not just ours. Dependabot adds labels like "dependencies" and "npm_and_yarn" when creating PRs, each firing a separate webhook. Four concurrent Lambdas fought over the same git repo on shared storage. Added label name check, bot sender check, and branch prefix check.

- Check label name matches PRODUCT_ID before processing (root cause: dependabot labels like "dependencies" triggered full agent pipeline)
- Reject bot senders except GitAuto's own app (allow schedule triggers)
- Return early for non-gitauto branch prefixes instead of defaulting to "dashboard"
- Add tests for all three guard checks
@hiroshinishio hiroshinishio self-assigned this Feb 22, 2026
@hiroshinishio hiroshinishio merged commit 13e21d6 into main Feb 22, 2026
1 check passed
@hiroshinishio hiroshinishio deleted the wes branch February 22, 2026 02:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant