mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-01-26 19:09:52 +00:00
[fix] Fall back to current minor when next minor branch doesn't exist (#7286)
## Summary - When the next minor branch (e.g., `core/1.35`) doesn't exist yet, fall back to current minor (`core/1.34`) for patch releases instead of failing - Fixes the weekly release workflow failure when ComfyUI is on version 1.33.x and `core/1.34` doesn't exist yet ## Test plan - [x] Tested locally with version where next minor exists (1.33.5 → finds core/1.34) - [x] Tested fallback when next minor doesn't exist (1.34.7 → falls back to core/1.34) - [x] Tested error case when neither branch exists ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-7286-fix-Fall-back-to-current-minor-when-next-minor-branch-doesn-t-exist-2c46d73d365081009762c732954e148d) by [Unito](https://www.unito.io)
This commit is contained in:
@@ -134,22 +134,38 @@ function resolveRelease(
|
|||||||
|
|
||||||
const [major, currentMinor, patch] = currentVersion.split('.').map(Number)
|
const [major, currentMinor, patch] = currentVersion.split('.').map(Number)
|
||||||
|
|
||||||
// Calculate target minor version (next minor)
|
// Fetch all branches
|
||||||
const targetMinor = currentMinor + 1
|
|
||||||
const targetBranch = `core/1.${targetMinor}`
|
|
||||||
|
|
||||||
// Check if target branch exists in frontend repo
|
|
||||||
exec('git fetch origin', frontendRepoPath)
|
exec('git fetch origin', frontendRepoPath)
|
||||||
const branchExists = exec(
|
|
||||||
|
// Try next minor first, fall back to current minor if not available
|
||||||
|
let targetMinor = currentMinor + 1
|
||||||
|
let targetBranch = `core/1.${targetMinor}`
|
||||||
|
|
||||||
|
const nextMinorExists = exec(
|
||||||
`git rev-parse --verify origin/${targetBranch}`,
|
`git rev-parse --verify origin/${targetBranch}`,
|
||||||
frontendRepoPath
|
frontendRepoPath
|
||||||
)
|
)
|
||||||
|
|
||||||
if (!branchExists) {
|
if (!nextMinorExists) {
|
||||||
console.error(
|
// Fall back to current minor for patch releases
|
||||||
`Target branch ${targetBranch} does not exist in frontend repo`
|
targetMinor = currentMinor
|
||||||
|
targetBranch = `core/1.${targetMinor}`
|
||||||
|
|
||||||
|
const currentMinorExists = exec(
|
||||||
|
`git rev-parse --verify origin/${targetBranch}`,
|
||||||
|
frontendRepoPath
|
||||||
|
)
|
||||||
|
|
||||||
|
if (!currentMinorExists) {
|
||||||
|
console.error(
|
||||||
|
`Neither core/1.${currentMinor + 1} nor core/1.${currentMinor} branches exist in frontend repo`
|
||||||
|
)
|
||||||
|
return null
|
||||||
|
}
|
||||||
|
|
||||||
|
console.error(
|
||||||
|
`Next minor branch core/1.${currentMinor + 1} not found, falling back to core/1.${currentMinor} for patch release`
|
||||||
)
|
)
|
||||||
return null
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get latest patch tag for target minor
|
// Get latest patch tag for target minor
|
||||||
|
|||||||
Reference in New Issue
Block a user