Skip to content

Conversation

@TooAngel
Copy link
Owner

Summary

  • Fixed bug where merging one PR would reset the merge timer for all other open PRs
  • The issue was in getDates() which fetched all repository events and used the most recent PushEvent regardless of branch
  • Now filters push events by payload.ref to only include pushes to the PR's specific head branch

Root Cause

When processing push events in pullRequest.js, the code was:

  1. Fetching pull.head.repo.events_url (all repository events)
  2. Finding the most recent PushEvent without filtering by branch
  3. Using this as dates.max for timer calculation

This meant when PR #748 was merged (pushing to master), that PushEvent became the most recent for ALL open PRs, resetting their timers.

Fix

Added a filter to only consider push events where current.payload.ref === refs/heads/${pull.head.ref}

Test plan

  • Existing unit tests pass
  • Manual verification with multiple open PRs

When a PR was merged to master, the push event affected the merge timer
calculation for all other open PRs. This happened because getDates()
was fetching all repository events and using the most recent PushEvent
regardless of which branch it targeted.

Now the code filters push events to only include those where payload.ref
matches the PR's head branch (refs/heads/<branch-name>), preventing
merges to master or other branches from resetting unrelated PR timers.

Closes #752
@worlddriven
Copy link
Contributor

worlddriven bot commented Nov 30, 2025

🤖 Worlddriven Status

📊 Live Status Dashboard

🗓️ Merge Date: 2025-12-05 at 19:12:26 UTC (today)
📅 Started: 2025-12-03 at 23:51:54 UTC
Speed Factor: 0.18 (82% faster due to reviews)
Positive votes: 304/371 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-30, 11:35:47 - Pull request opened
2025-11-30, 11:35:49 - Pull request opened
2025-12-05, 19:52:08 - Pull request merged by worlddriven ✅


This comment is automatically updated by worlddriven

@worlddriven worlddriven bot merged commit 4374707 into master Dec 5, 2025
2 checks passed
@worlddriven worlddriven bot deleted the fix/push-event-branch-filter branch December 5, 2025 19:52
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.

2 participants