-
Notifications
You must be signed in to change notification settings - Fork 419
[feat] Add weekly ComfyUI release automation #6877
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Adds scheduled workflow to bump ComfyUI frontend RC releases every Monday at noon PST. - Resolver script checks ComfyUI requirements.txt and determines next minor version - Triggers release workflow if commits exist since last patch tag - Creates draft PR to comfyanonymous/ComfyUI with updated requirements.txt - Reuses existing release-version-bump workflow and comment actions - Includes error handling and validation for all steps
📝 WalkthroughWalkthroughIntroduces a scheduled/manual GitHub Actions workflow and a TypeScript resolver that compute ComfyUI frontend release metadata, optionally dispatch the frontend release workflow, and create/update a draft PR on a configurable fork to bump the comfyui-frontend package version. Changes
Sequence DiagramsequenceDiagram
autonumber
participant Scheduler as Scheduler / Manual
participant Workflow as weekly-comfyui-release
participant Resolver as resolve-comfyui-release.ts
participant Frontend as comfyui-frontend repo
participant ReleaseWf as release-version-bump workflow
participant Fork as comfyui fork repo
participant Upstream as comfyui upstream
Scheduler->>Workflow: trigger (schedule / manual)
Workflow->>Resolver: run resolver (comfyui path, frontend path)
Resolver->>Frontend: query tags, branches, commits
Frontend-->>Resolver: tags/branch heads/SHAs
Resolver-->>Workflow: emit ReleaseInfo JSON
alt ReleaseInfo.needs_release == true
Workflow->>ReleaseWf: dispatch release workflow (branch, version)
ReleaseWf-->>Workflow: release run metadata / URL
end
Workflow->>Fork: checkout fork, update `requirements.txt` bump
Workflow->>Fork: push branch `automation/comfyui-frontend-bump`
Workflow->>Upstream: create/update draft PR (fork -> upstream)
Upstream-->>Workflow: PR URL / status
✨ Finishing touches🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
Comment |
🎨 Storybook Build Status✅ Build completed successfully! ⏰ Completed at: 11/26/2025, 01:08:00 AM UTC 🔗 Links🎉 Your Storybook is ready for review! |
🎭 Playwright Test Results⏰ Completed at: 11/26/2025, 01:17:11 AM UTC 📈 Summary
📊 Test Reports by Browser
🎉 Click on the links above to view detailed test results for each browser configuration. |
Bundle Size ReportSummary
Category Glance Per-category breakdownApp Entry Points — 3.18 MB (baseline 3.18 MB) • ⚪ 0 BMain entry bundles and manifests
Graph Workspace — 944 kB (baseline 944 kB) • ⚪ 0 BGraph editor runtime, canvas, workflow orchestration
Views & Navigation — 6.54 kB (baseline 6.54 kB) • ⚪ 0 BTop-level views, pages, and routed surfaces
Panels & Settings — 298 kB (baseline 298 kB) • ⚪ 0 BConfiguration panels, inspectors, and settings screens
UI Components — 139 kB (baseline 139 kB) • ⚪ 0 BReusable component library chunks
Data & Services — 12.5 kB (baseline 12.5 kB) • ⚪ 0 BStores, services, APIs, and repositories
Utilities & Hooks — 2.94 kB (baseline 2.94 kB) • ⚪ 0 BHelpers, composables, and utility bundles
Vendor & Third-Party — 8.56 MB (baseline 8.56 MB) • ⚪ 0 BExternal libraries and shared vendor chunks
Other — 3.84 MB (baseline 3.84 MB) • ⚪ 0 BBundles that do not match a named category
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 5
🧹 Nitpick comments (4)
.github/workflows/weekly-comfyui-release.yaml (2)
224-240: Force-push strategy overwrites branch history weekly.The workflow uses
git push -fto overwrite the branch each week. This is intentional per the PR description ("force-pushes the same branch weekly to maintain a single open PR"), but be aware this destroys the branch history.If the PR has review comments or commits from maintainers, they will be lost. Consider documenting this behavior in a comment.
Add a comment to clarify the intent:
# Force push to fork (overwrites previous week's branch) + # Note: This intentionally destroys branch history to maintain a single PR + # Any review comments or changes will need to be re-applied if ! git push -f origin "$BRANCH"; then
245-261: PR existence check has a logic issue.The PR creation logic attempts to create a PR, and if it fails, checks if a PR already exists. However, line 255 checks for PR existence but doesn't capture the output, then the condition always evaluates to true based on the command's exit code.
The logic works but could be clearer. Consider simplifying:
# Try to create PR, ignore error if it already exists if ! gh pr create \ --repo comfyanonymous/ComfyUI \ --head "${FORK_OWNER}:${BRANCH}" \ --base master \ --title "Bump comfyui-frontend-package to ${{ needs.resolve-version.outputs.target_version }}" \ --body "$PR_BODY" \ --draft 2>&1; then # Check if PR already exists - if gh pr list --repo comfyanonymous/ComfyUI --head "${FORK_OWNER}:${BRANCH}" --json number --jq '.[0].number' > /dev/null 2>&1; then + EXISTING_PR=$(gh pr list --repo comfyanonymous/ComfyUI --head "${FORK_OWNER}:${BRANCH}" --json number --jq '.[0].number' 2>/dev/null || echo "") + if [ -n "$EXISTING_PR" ]; then echo "PR already exists, updating branch will update the PR" else echo "Failed to create PR and no existing PR found" exit 1 fi fiscripts/cicd/resolve-comfyui-release.ts (2)
19-32: Silent error handling may mask critical failures.The
execfunction catches all errors and returns an empty string, which silently suppresses failures. While this works for optional operations (like checking if a tag exists), it could hide critical errors for required operations (like fetching from git repos).Consider logging errors to stderr before returning empty string, or accepting a parameter to control error behavior:
function exec(command: string, cwd?: string): string { try { return execSync(command, { cwd, encoding: 'utf-8', stdio: ['pipe', 'pipe', 'pipe'] }).trim() } catch (error) { + console.error(`Command failed: ${command}`) + if (error instanceof Error) { + console.error(error.message) + } return '' } }
59-89: Consider using git's native version sorting.The manual semantic sort implementation is correct, but git has built-in version sorting that's more robust and handles edge cases like pre-release versions.
function getLatestPatchTag(repoPath: string, minor: number): string | null { // Fetch all tags exec('git fetch --tags', repoPath) - // List all tags matching v1.{minor}.* - const tags = exec(`git tag -l 'v1.${minor}.*'`, repoPath) - .split('\n') - .filter((tag) => tag.trim() !== '') - - if (tags.length === 0) { + // Get the latest tag matching v1.{minor}.* using git's version sort + const latestTag = exec( + `git tag -l 'v1.${minor}.*' --sort=-version:refname | head -n 1`, + repoPath + ) + + if (!latestTag) { return null } - // Sort tags by version (semantic sort) - const sortedTags = tags.sort((a, b) => { - const aParts = a.replace('v', '').split('.').map(Number) - const bParts = b.replace('v', '').split('.').map(Number) - - for (let i = 0; i < 3; i++) { - if (aParts[i] !== bParts[i]) { - return aParts[i] - bParts[i] - } - } - return 0 - }) - - return sortedTags[sortedTags.length - 1] + return latestTag }
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
.github/workflows/weekly-comfyui-release.yaml(1 hunks)knip.config.ts(1 hunks)scripts/cicd/resolve-comfyui-release.ts(1 hunks)
🧰 Additional context used
🪛 actionlint (1.7.8)
.github/workflows/weekly-comfyui-release.yaml
2-2: unexpected key "description" for "workflow" section. expected one of "concurrency", "defaults", "env", "jobs", "name", "on", "permissions", "run-name"
(syntax-check)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
- GitHub Check: setup
- GitHub Check: test
- GitHub Check: collect
- GitHub Check: lint-and-format
🔇 Additional comments (4)
knip.config.ts (1)
30-30: LGTM! Necessary addition for the new workflow.The 'gh' binary is used extensively in the new weekly-comfyui-release.yaml workflow, so adding it to ignoreBinaries prevents false positives from Knip.
scripts/cicd/resolve-comfyui-release.ts (3)
1-17: LGTM! Clean interface definition.The ReleaseInfo interface is well-structured with clear field names and appropriate types for all release metadata.
34-57: LGTM! Robust version parsing.The function correctly handles multiple version operators and provides clear error messages. The regex pattern appropriately captures semantic versions.
187-209: LGTM! Clean main execution flow.The argument parsing, error handling, and JSON output are well-implemented. The export at the end allows the function to be used programmatically.
- Validate currentVersion and tagVersion format before destructuring - Check for 3-part versions with numeric parts - Guard parseInt with radix and NaN check - Validate existingPatch is finite number before increment - Return null early on invalid formats with descriptive errors
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
🧹 Nitpick comments (1)
scripts/cicd/resolve-comfyui-release.ts (1)
230-251: LGTM!The main execution block appropriately validates required arguments and exits with proper error codes. JSON output format is well-suited for GitHub Actions consumption.
Optionally, you could add upfront validation that the paths exist and are git repositories before calling
resolveRelease:if (!fs.existsSync(comfyuiRepoPath) || !fs.existsSync(path.join(comfyuiRepoPath, '.git'))) { console.error(`Invalid ComfyUI repository path: ${comfyuiRepoPath}`) process.exit(1) } if (!fs.existsSync(frontendRepoPath) || !fs.existsSync(path.join(frontendRepoPath, '.git'))) { console.error(`Invalid frontend repository path: ${frontendRepoPath}`) process.exit(1) }This would provide clearer error messages, but it's not essential since the git commands will fail anyway with descriptive errors.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
scripts/cicd/resolve-comfyui-release.ts(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
- GitHub Check: lint-and-format
- GitHub Check: test
- GitHub Check: collect
- GitHub Check: setup
🔇 Additional comments (4)
scripts/cicd/resolve-comfyui-release.ts (4)
6-17: LGTM!The
ReleaseInfointerface is well-structured and includes all necessary metadata for tracking release state, version progression, and PR references.
38-57: LGTM!The regex comprehensively handles Python requirements operators, and the error handling with null returns is appropriate for the calling context.
62-76: LGTM!The validation is thorough, and the
String(num) === partcheck at line 74 cleverly prevents edge cases like leading zeros ("01") or trailing characters ("3extra").
125-197: LGTM! Version validation concerns from prior reviews have been addressed.The function now validates:
currentVersionformat before destructuring (lines 125-131)tagVersionformat before destructuring (lines 183-189)existingPatchis a valid non-negative number (lines 193-197)commitCountNaN case is handled (line 178)All destructuring operations are now protected by validation checks, preventing the runtime issues flagged in previous reviews.
- Replace -i with -i.bak for BSD/macOS compatibility - Use [0-9.][0-9.]* instead of GNU-specific [0-9.]\+ - Store version in variable for cleaner shell expansion - Remove .bak file after successful replace
- Add regex filter for valid semver tags (vX.Y.Z format) - Prevent NaN from malformed tags like v1.28.x or v1.28 - Return null if no valid tags found after filtering - Log descriptive error showing malformed tags
- Log command, cwd, and error message when exec fails - Preserve existing empty-string fallback behavior - Improve debugging for command execution failures
- Remove sleep + polling for workflow run ID - Use generic links to workflow runs page instead of specific run - Eliminates race condition and timeout complexity - Cleaner job summary with branch and version info
- Install dependencies in frontend directory - Ensures tsx devDependency is available for resolver script - Use --frozen-lockfile for reproducible builds
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
♻️ Duplicate comments (1)
.github/workflows/weekly-comfyui-release.yaml (1)
1-2: Remove invalid "description" field (duplicate issue).Line 2 contains a "description" field that is not valid at the workflow root level in GitHub Actions. This was flagged in a previous review and is still present.
Apply this diff to remove it:
name: "Weekly ComfyUI Release" -description: "Automated weekly workflow to bump ComfyUI frontend RC releases" on:Alternatively, convert it to a YAML comment to preserve the documentation:
name: "Weekly ComfyUI Release" +# Automated weekly workflow to bump ComfyUI frontend RC releases on:
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
.github/workflows/weekly-comfyui-release.yaml(1 hunks)scripts/cicd/resolve-comfyui-release.ts(1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
- scripts/cicd/resolve-comfyui-release.ts
🧰 Additional context used
🪛 actionlint (1.7.8)
.github/workflows/weekly-comfyui-release.yaml
2-2: unexpected key "description" for "workflow" section. expected one of "concurrency", "defaults", "env", "jobs", "name", "on", "permissions", "run-name"
(syntax-check)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
- GitHub Check: setup
- GitHub Check: lint-and-format
- GitHub Check: test
- GitHub Check: collect
🔇 Additional comments (5)
.github/workflows/weekly-comfyui-release.yaml (5)
45-57: ✓ Dependency installation properly configured (past issue resolved).The pnpm and Node.js setup, followed by
pnpm install --frozen-lockfile, correctly addresses the previous concern thattsxdevDependency would be unavailable. The correct order and working-directory specification ensure dependencies are installed before the resolver script executes.
154-156: ✓ sed command is POSIX-compatible (past issue resolved).The sed invocation correctly uses
-i.bak(portable across BSD and GNU sed) and the POSIX-compatible regex[0-9.][0-9.]*instead of the GNU-specific\+metacharacter. The backup is properly cleaned up afterward. This resolves the previous cross-platform portability concern.
99-132: ✓ Simplified trigger logic avoids race condition (past concern resolved).The trigger-release-if-needed job uses a straightforward
gh workflow runinvocation without attempting to fetch or track the resulting workflow run ID. This avoids the race condition and misleading output name flagged in the previous review. The summary provides a direct link to workflow runs for visibility.
59-97: ✓ Robust error handling and JSON validation in resolver step.The resolver step includes proper defensive coding:
set -euo pipefailfor fail-fast behavior, JSON validation withjq empty, and explicit error messages. All required outputs are correctly parsed and populated. The step summary provides helpful debugging information with the diff URL and version details.
208-231: ✓ Git operations properly configured for weekly branch reuse.The git configuration, branch creation with reuse (
git checkout -B), and conditional commit logic are appropriate. The force push correctly maintains a single updated branch weekly, and the commit guard prevents empty commits on subsequent runs with no changes.
| # Try to create PR, ignore error if it already exists | ||
| if ! gh pr create \ | ||
| --repo comfyanonymous/ComfyUI \ | ||
| --head "${FORK_OWNER}:${BRANCH}" \ | ||
| --base master \ | ||
| --title "Bump comfyui-frontend-package to ${{ needs.resolve-version.outputs.target_version }}" \ | ||
| --body "$PR_BODY" \ | ||
| --draft 2>&1; then | ||
|
|
||
| # Check if PR already exists | ||
| if gh pr list --repo comfyanonymous/ComfyUI --head "${FORK_OWNER}:${BRANCH}" --json number --jq '.[0].number' > /dev/null 2>&1; then | ||
| echo "PR already exists, updating branch will update the PR" | ||
| else | ||
| echo "Failed to create PR and no existing PR found" | ||
| exit 1 | ||
| fi | ||
| fi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix empty PR list check to avoid masking real errors.
Line 243 attempts to detect existing PRs by checking if gh pr list succeeds, but this logic is flawed:
- When
gh pr listreturns no results, the exit code is still 0 (success) - The condition
if gh pr list ... > /dev/null 2>&1;is true even when no PR exists - This causes the script to incorrectly report "PR already exists" when PR creation actually failed due to auth errors, API issues, or other transient problems
- Real failures are silently masked, degrading observability and reliability
Check whether the jq output is non-empty instead of just checking the command exit code:
- # Check if PR already exists
- if gh pr list --repo comfyanonymous/ComfyUI --head "${FORK_OWNER}:${BRANCH}" --json number --jq '.[0].number' > /dev/null 2>&1; then
+ # Check if PR already exists (verify jq output is non-empty)
+ if [ -n "$(gh pr list --repo comfyanonymous/ComfyUI --head "${FORK_OWNER}:${BRANCH}" --json number --jq '.[0].number' 2>/dev/null)" ]; then
echo "PR already exists, updating branch will update the PR"
else
echo "Failed to create PR and no existing PR found"This ensures the branch-exists check only succeeds if a PR number is actually returned.
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| # Try to create PR, ignore error if it already exists | |
| if ! gh pr create \ | |
| --repo comfyanonymous/ComfyUI \ | |
| --head "${FORK_OWNER}:${BRANCH}" \ | |
| --base master \ | |
| --title "Bump comfyui-frontend-package to ${{ needs.resolve-version.outputs.target_version }}" \ | |
| --body "$PR_BODY" \ | |
| --draft 2>&1; then | |
| # Check if PR already exists | |
| if gh pr list --repo comfyanonymous/ComfyUI --head "${FORK_OWNER}:${BRANCH}" --json number --jq '.[0].number' > /dev/null 2>&1; then | |
| echo "PR already exists, updating branch will update the PR" | |
| else | |
| echo "Failed to create PR and no existing PR found" | |
| exit 1 | |
| fi | |
| fi | |
| # Try to create PR, ignore error if it already exists | |
| if ! gh pr create \ | |
| --repo comfyanonymous/ComfyUI \ | |
| --head "${FORK_OWNER}:${BRANCH}" \ | |
| --base master \ | |
| --title "Bump comfyui-frontend-package to ${{ needs.resolve-version.outputs.target_version }}" \ | |
| --body "$PR_BODY" \ | |
| --draft 2>&1; then | |
| # Check if PR already exists (verify jq output is non-empty) | |
| if [ -n "$(gh pr list --repo comfyanonymous/ComfyUI --head "${FORK_OWNER}:${BRANCH}" --json number --jq '.[0].number' 2>/dev/null)" ]; then | |
| echo "PR already exists, updating branch will update the PR" | |
| else | |
| echo "Failed to create PR and no existing PR found" | |
| exit 1 | |
| fi | |
| fi |
🤖 Prompt for AI Agents
In .github/workflows/weekly-comfyui-release.yaml around lines 233 to 249, the
current check treats a successful gh pr list with no results as an existing PR
and masks real failures; change the logic to capture both the command exit
status and its jq output: run gh pr list --jq '.[0].number' into a variable,
check the gh command exit code first and if non-zero fail the workflow with an
error, otherwise check whether the captured output is non-empty to decide "PR
already exists" vs "no existing PR" and only then take the appropriate action.
- Move description to YAML comment - GitHub Actions does not support top-level description field
Adds scheduled workflow to bump ComfyUI frontend RC releases every Monday at noon PST.
Implementation
scripts/cicd/resolve-comfyui-release.ts): Checks ComfyUIrequirements.txtand determines next minor version, compares branch commits to latest patch tag.github/workflows/weekly-comfyui-release.yaml):release-version-bump.yamlworkflowcomfyanonymous/ComfyUIwith updatedrequirements.txtTesting
ghbinary added to ignore listFollow-up
Can test via workflow_dispatch once merged, or in this PR if we enable Actions on branch.
┆Issue is synchronized with this Notion page by Unito