Skip to content

Commit 4eb6b0a

Browse files
committed
fix: restore proper rebase matching logic and cleanup empty files
- Remove dangerous fallback to first group that was causing PR overwrites - Add bidirectional package matching for exact group identification - Add detailed logging when no matching group found - Remove accidentally committed empty files This ensures PR #20 type incidents won't happen again by making rebase operations fail safely instead of overwriting wrong PRs.
1 parent aafc18c commit 4eb6b0a

File tree

4 files changed

+8
-4
lines changed

4 files changed

+8
-4
lines changed

bin/cli.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -765,14 +765,18 @@ cli
765765
return
766766
}
767767

768-
// Find the matching update group
768+
// Find the matching update group - must match exactly
769769
const group = scanResult.groups.find(g =>
770770
g.updates.length === packageUpdates.length
771-
&& g.updates.every(u => packageUpdates.some(pu => pu.name === u.name)),
772-
) || scanResult.groups[0] // Fallback to first group
771+
&& g.updates.every(u => packageUpdates.some(pu => pu.name === u.name))
772+
&& packageUpdates.every(pu => g.updates.some(u => u.name === pu.name))
773+
)
773774

774775
if (!group) {
775-
logger.error('❌ Could not find matching update group')
776+
logger.error('❌ Could not find matching update group. This likely means the package grouping has changed.')
777+
logger.info(`📋 PR packages: ${packageUpdates.map(p => p.name).join(', ')}`)
778+
logger.info(`📋 Available groups: ${scanResult.groups.map(g => `${g.name} (${g.updates.length} packages)`).join(', ')}`)
779+
logger.info(`💡 Close this PR manually and let buddy-bot create new ones with correct grouping`)
776780
return
777781
}
778782

close-and-recreate.js

Whitespace-only changes.

test-regex.js

Whitespace-only changes.

trigger-update.js

Whitespace-only changes.

0 commit comments

Comments
 (0)