@buddysh/buddy 0.11.8 → 0.11.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # Changelog
2
2
 
3
+ [Compare changes](https://github.com/stacksjs/buddy/compare/v0.11.8...v0.11.9)
4
+
5
+ ## 🐛 Bug Fixes
6
+
7
+ - **rebase**: rebase a ticked PR, and one whose branch is behind its base ([343032f](https://github.com/stacksjs/buddy/commit/343032f)) _(by Chris <chrisbreuer93@gmail.com>)_
8
+
9
+ ## 🔧 Chores
10
+
11
+ - release v0.11.9 ([4f1a20a](https://github.com/stacksjs/buddy/commit/4f1a20a)) _(by Chris <chrisbreuer93@gmail.com>)_
12
+
13
+ ## Contributors
14
+
15
+ - _Chris <chrisbreuer93@gmail.com>_
16
+
3
17
  [Compare changes](https://github.com/stacksjs/buddy/compare/v0.11.7...v0.11.8)
4
18
 
5
19
  ## 🐛 Bug Fixes
package/bin/cli.ts CHANGED
@@ -1012,7 +1012,16 @@ cli
1012
1012
  ),
1013
1013
  )
1014
1014
 
1015
- if (upToDate) {
1015
+ // Matching versions say nothing about the branch itself: one cut from
1016
+ // an older base can fail CI for reasons long since fixed there.
1017
+ const baseBranch = config.repository.baseBranch || 'main'
1018
+ const behind = upToDate && gitProvider.isBranchBehind
1019
+ ? await gitProvider.isBranchBehind(pr.head, baseBranch).catch(() => false)
1020
+ : false
1021
+ if (behind)
1022
+ logger.info(`🔄 ${pr.head} is behind ${baseBranch}; rebasing`)
1023
+
1024
+ if (upToDate && !behind) {
1016
1025
  logger.success('✅ PR is already up to date, no rebase needed')
1017
1026
  logger.info('💡 Use --force to rebase anyway')
1018
1027
  return
@@ -1203,9 +1212,12 @@ cli
1203
1212
  logger.info(`🔄 Rebasing PR #${pr.number} via rebase command...`)
1204
1213
 
1205
1214
  try {
1206
- // Use the existing rebase command logic
1215
+ // Use the existing rebase command logic. --force because a
1216
+ // person ticked "rebase/retry": the command's own up-to-date
1217
+ // check would otherwise decline a branch whose updates still
1218
+ // match, however far behind its base it is.
1207
1219
  const { spawn } = await import('node:child_process')
1208
- const rebaseProcess = spawn('bunx', ['@buddysh/buddy', 'rebase', pr.number.toString()], {
1220
+ const rebaseProcess = spawn('bunx', ['@buddysh/buddy', 'rebase', pr.number.toString(), '--force'], {
1209
1221
  stdio: 'inherit',
1210
1222
  cwd: process.cwd(),
1211
1223
  })