Skip to content

Conversation

@TooAngel
Copy link
Owner

Summary

Fixes webhook processing failure caused by incorrect parameter passing to getPullRequestData().

Problem

The webhook handler was passing installationId directly to getPullRequestData() instead of creating a GitHubClient instance, causing webhooks to fail with:

TypeError: githubClient.getPullRequest is not a function

Solution

Updated processPullRequest() in src/helpers/webhookHandler.js to:

  1. Create Auth instance with owner/repo
  2. Create GitHubClient instance with Auth
  3. Pass GitHubClient to getPullRequestData()

This matches the working pattern already used in pullRequestProcessor.js.

Impact

  • Webhook-triggered PR processing now works correctly
  • Real-time PR updates via webhooks are restored
  • Scheduled cron processing continues to work as before

Testing

  • All existing tests pass
  • Fix follows established pattern from pullRequestProcessor.js

Closes #312

The webhook handler was passing installationId directly to getPullRequestData()
instead of creating a GitHubClient instance. This caused webhooks to fail with
"githubClient.getPullRequest is not a function" error.

Updated processPullRequest() to:
- Import Auth and GitHubClient classes
- Create Auth instance with owner/repo
- Create GitHubClient instance with Auth
- Pass GitHubClient to getPullRequestData()

This matches the working pattern in pullRequestProcessor.js.

Closes #312
@worlddriven
Copy link
Contributor

worlddriven bot commented Nov 15, 2025

🤖 Worlddriven Status

📊 Live Status Dashboard

🗓️ Merge Date: 2025-11-17 at 08:28:49 UTC (today)
📅 Started: 2025-11-15 at 12:32:46 UTC
Speed Factor: 0.18 (82% faster due to reviews)
Positive votes: 299/366 contribution weight (coefficient: 0.82)
📈 Base Merge Time: 10 days → Current: 2 days

🎯 Want to influence when this merges?

Your review matters! As a contributor to this project, your voice helps determine the merge timeline.

How to review:

  1. Check the changes
    Files changed

  2. Leave your review
    Review changes

Your options:

  • ✅ Agree & Speed Up: Approve Approving makes this merge faster
  • ❌ Disagree & Slow Down: Request changes Requesting changes delays the merge

💡 Pro tip: The more contributors who agree, the faster this gets merged!

📊 View detailed stats on the dashboard

📋 Recent Activity

2025-11-17, 08:51:45 - Pull request merged by worlddriven ✅


This comment is automatically updated by worlddriven

@worlddriven worlddriven bot merged commit 8d5c5ca into master Nov 17, 2025
2 of 3 checks passed
@worlddriven worlddriven bot deleted the fix/webhook-github-client branch November 17, 2025 08:51
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.

fix: webhook handler fails with 'githubClient.getPullRequest is not a function'

2 participants