Commit Graph

10 Commits

Author SHA1 Message Date
Johnpaul Chiwetelu
3372f455ca CI: Use custom container for E2E tests (#7625)
## Summary
Use a pre-built container image with all dependencies for Playwright E2E
tests, eliminating ~130s setup time per shard.

## Changes
- Use `ghcr.io/comfy-org/comfyui-ci-container:0.0.8` container for test
jobs
- Container includes: Playwright browsers, Node.js, pnpm, Python,
ComfyUI backend (v0.5.1), all Python deps
- Simplified setup: just copy devtools and start server (no cloning, no
pip install, no browser setup)
- Add `version-bump*` to `branches-ignore` to skip E2E tests for version
bump PRs
- Replace cache with artifacts (cache doesn't work inside containers)

## Benefits
- ~130s faster per shard (no ComfyUI clone, no pip install, no browser
download)
- Consistent environment across all test jobs
- Simpler workflow configuration

## Container Image
Repository: https://github.com/comfy-org/comfyui-ci-container
Image: `ghcr.io/comfy-org/comfyui-ci-container:0.0.8`

## Test plan
- [x] Verify CI workflow runs with container
- [x] Verify Playwright tests pass
- [x] Verify snapshot updates work correctly

---------

Co-authored-by: github-actions <github-actions@github.com>
2025-12-30 04:58:25 +01:00
Christian Byrne
596add9f63 fix: npm link in release notification comment (#6683)
Changes to correct URL syntax for npm package link (types package).

┆Issue is synchronized with this [Notion
page](https://www.notion.so/PR-6683-fix-npm-link-in-release-notification-comment-2aa6d73d365081729c54efabc76a833a)
by [Unito](https://www.unito.io)
2025-11-13 11:25:23 -07:00
Christian Byrne
ef46f0cbf4 ci: fix action that comments on Release PRs (#6663)
Fixes issues with the action that comments updates on merged release
PRs:

1. Multi-line LINKS_VALUE: Use '%s\n%s' command substitution instead of
literal newline
2. Heredoc delimiter: Changed to COMMENT_BODY_END_MARKER without quotes
3. Variable bug: Fixed incorrect variable (`$URL` not `$URL_TEMPLATE`)
4. Change from `printf` to `echo` (avoid weird printf gymnastics)

┆Issue is synchronized with this [Notion
page](https://www.notion.so/PR-6663-ci-fix-action-that-comments-on-Release-PRs-2a96d73d365081b1b0c5c8e66f0e317f)
by [Unito](https://www.unito.io)
2025-11-12 14:58:02 -07:00
Christian Byrne
56153596d9 fix: release summary comment action (#6640)
Fixes
https://github.com/Comfy-Org/ComfyUI_frontend/actions/runs/19188216288/job/54858802407

┆Issue is synchronized with this [Notion
page](https://www.notion.so/PR-6640-fix-release-summary-comment-action-2a56d73d365081f89bf1ec7c4e4818a4)
by [Unito](https://www.unito.io)
2025-11-08 10:39:46 -07:00
Christian Byrne
cafd2de961 ci: comment when publish to npm/pypi finishes successfully (#6628)
This change adds a reusable `post-release-summary` composite action that
automatically figures out the current/previous version, generates diff +
PyPI/npm links, and posts (or updates) the release summary comment
whenever the publish jobs succeed.

┆Issue is synchronized with this [Notion
page](https://www.notion.so/PR-6628-ci-comment-when-publish-to-npm-pypi-finishes-successfully-2a46d73d36508181a8d0eb050efe7762)
by [Unito](https://www.unito.io)
2025-11-07 20:55:51 -07:00
snomiao
fd474fe2aa refactor: Reorganize GitHub Actions for better reusability (#5949)
## Summary

This PR refactors the GitHub Actions workflow structure to improve
reusability, maintainability, and CI performance.

## Changes

### New Actions
- **setup-comfyui-server**: New composite action that handles ComfyUI
server setup and launch
  - Checks out ComfyUI repository
  - Installs ComfyUI_devtools custom node
  - Sets up Python environment and dependencies
  - Optionally launches the server with configurable parameters

### Refactored Actions
- **setup-frontend**: Simplified to focus only on frontend-specific
tasks
  - Installs pnpm and Node.js
  - Installs dependencies
- Optionally builds the frontend (can be skipped when using cached
builds)
  - No longer handles server setup or checkout

### Workflow Improvements

#### tests-ci.yaml
- Introduced a setup job that builds once and caches the entire
workspace
- Test jobs now restore the cached workspace instead of rebuilding
- Eliminated redundant setup steps in each test shard
- Better separation between setup and test execution phases
- Significant performance improvement through workspace caching

#### Locale Update Workflows
- Updated `update-locales.yaml` to use the new action structure
- Updated `update-locales-for-given-custom-node-repository.yaml` with
proper custom node installation
- Updated `update-node-definitions-locales.yaml` to use new actions
- Removed `working-directory` references where appropriate

#### Other Workflows
- Updated `update-playwright-expectations.yaml` to use new action
structure
- Consistent action usage across all workflows

## Benefits

1. **Better Performance**: Workspace caching eliminates redundant builds
in CI, significantly reducing test execution time
2. **Improved Maintainability**: Clear separation of concerns makes
actions easier to understand and modify
3. **Enhanced Reusability**: Actions can be composed in different ways
for different workflows
4. **DRY Principle**: Eliminated code duplication across workflows
5. **Easier Debugging**: Smaller, focused actions make it easier to
identify and fix issues

## Testing

- [ ] Verify tests-ci workflow runs successfully
- [ ] Verify locale update workflows function correctly
- [ ] Verify playwright expectations update workflow works
- [ ] Confirm cache/restore mechanism works as expected

## Related Issues

This refactoring addresses workflow complexity and reduces CI runtime by
leveraging GitHub Actions caching more effectively.

┆Issue is synchronized with this [Notion
page](https://www.notion.so/PR-5949-refactor-Reorganize-GitHub-Actions-for-better-reusability-2846d73d365081ae8e16f151423b5a88)
by [Unito](https://www.unito.io)

---------

Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Alexander Brown <drjkl@comfy.org>
Co-authored-by: DrJKL <DrJKL0424@gmail.com>
2025-10-09 19:21:10 +00:00
snomiao
87f5480462 Fix CI: Remove explicit repository parameter causing non-reproducible test results (#5950)
## Problem

Our CI tests were experiencing non-reproducible results where:
- Tests would pass on a PR initially  
- The same PR would fail later when main HEAD changed
- Screenshot comparisons showed excessive differences between expected
vs actual
- Blake identified: *"tests are not reproducible inside a branch - they
change every time main HEAD changes"*

## Root Cause

The issue was caused by **explicit `repository` parameters** in our
`actions/checkout` steps:

```yaml
- name: Checkout ComfyUI_frontend
  uses: actions/checkout@v5
  with:
    repository: 'Comfy-Org/ComfyUI_frontend'  # ← This was the problem!
    path: 'ComfyUI_frontend'
```

According to GitHub Actions documentation:

> **When checking out the repository that triggered a workflow, `ref`
defaults to the reference or SHA for that event. Otherwise, uses the
default branch.**

When you specify an explicit `repository` parameter (even if it's the
same repo), GitHub Actions treats it as "otherwise" and defaults to the
**main branch** instead of using the **PR context**.

## The Fix

Remove the explicit `repository` parameter when checking out the same
repository:

```yaml
- name: Checkout ComfyUI_frontend
  uses: actions/checkout@v5
  with:
    path: 'ComfyUI_frontend'  # No repository parameter = uses PR context
```

## Changes Made

-  Removed `repository: 'Comfy-Org/ComfyUI_frontend'` from setup job
checkout
-  Removed `repository: 'Comfy-Org/ComfyUI_frontend'` from
merge-reports job checkout
-  Updated setup-frontend action to use `actions/checkout@v5` for
consistency
-  Simplified workflow by removing unnecessary `ref` and `fetch-depth`
parameters

## How This Fixes the Problem

**Before:** 
- Setup job checked out main branch (due to explicit repository)
- Tests ran PR code against main branch snapshots
- Results varied based on what was in main at the time

**After:**
- Setup job checks out PR merge commit (natural PR context)
- Tests run PR code against PR snapshots  
- Results are consistent and reproducible

## Why It Worked Before (Sometimes)

The explicit `repository` parameter has been there for a long time, but
the issue became more apparent recently due to:
1. GitHub Actions behavior changes over time
2. Increased frequency of main branch updates
3. More sensitive screenshot comparison tests
4. Complex cache/restore workflow where timing mattered

The fix ensures deterministic behavior regardless of GitHub's internal
changes.

## Testing

This change makes the CI behavior explicit and predictable:
-  PR tests will always use PR context
-  Push tests will always use pushed commit  
-  No dependency on GitHub's default behavior interpretation
-  Simplified workflow with fewer moving parts

Resolves the issues described in `.github/workflows/problem.log`.

┆Issue is synchronized with this [Notion
page](https://www.notion.so/PR-5950-Fix-CI-Remove-explicit-repository-parameter-causing-non-reproducible-test-results-2846d73d36508159a848c4a2e14a0fb1)
by [Unito](https://www.unito.io)

Co-authored-by: Alexander Brown <drjkl@comfy.org>
2025-10-08 13:11:53 -07:00
snomiao
c662c77305 Add Playwright composite action to reduce workflow duplication (#5754)
This PR introduces a reusable composite action for Playwright setup to
reduce duplication across workflows.

## Changes
- Created `.github/actions/setup-playwright/action.yml` composite action
that:
  - Detects or uses provided Playwright version
  - Caches Playwright browsers with intelligent cache keys
  - Installs browsers only when cache miss occurs
  - Installs OS dependencies when cache hit occurs
  
## Technical Details
- **Important:** The composite action requires `shell: bash` for all
`run` steps as per [GitHub Actions requirements for composite
actions](https://docs.github.com/en/actions/creating-actions/creating-a-composite-action#creating-an-action-metadata-file).
This is a mandatory field for composite actions, unlike regular workflow
steps.
- Updated workflow paths to account for repository checkout locations
(some workflows checkout to subdirectories like `ComfyUI_frontend/`)
- Uses conditional caching to avoid redundant browser installations

## Benefits
- Reduces code duplication across 6 workflow files
- Centralizes Playwright caching logic  
- Consistent browser setup across all workflows
- Easier maintenance and updates
- Faster CI runs through intelligent caching

## Affected Workflows
- `.github/workflows/test-ui.yaml` (2 uses)
- `.github/workflows/i18n-custom-nodes.yaml`
- `.github/workflows/i18n-node-defs.yaml`
- `.github/workflows/i18n.yaml`
- `.github/workflows/test-browser-exp.yaml`

---------

Co-authored-by: GitHub Action <action@github.com>
2025-10-02 14:20:48 +09:00
snomiao
aed342572c Remove optional ref: master from setup-frontend action (#5858)
## Summary
- Removed the optional `ref: master` parameter from the ComfyUI checkout
step in the setup-frontend action
- The ref parameter defaults to the repository's default branch when
omitted

## Details
The `ref: master` specification in
`.github/actions/setup-frontend/action.yml` is unnecessary since GitHub
Actions will automatically use the repository's default branch when the
ref parameter is not provided.

This simplifies the configuration and makes it more maintainable, as the
action will automatically follow any future changes to the default
branch name.

## Test plan
- [ ] Verify that GitHub Actions workflows using this composite action
still work correctly
- [ ] Confirm ComfyUI is checked out properly in CI/CD pipelines

Generated with [Claude Code](https://claude.ai/code)

┆Issue is synchronized with this [Notion
page](https://www.notion.so/PR-5858-Remove-optional-ref-master-from-setup-frontend-action-27e6d73d365081aeb632f2d0e76f267d)
by [Unito](https://www.unito.io)

Co-authored-by: Claude <noreply@anthropic.com>
2025-09-30 15:08:48 +09:00
snomiao
789617415d Add frontend setup composite action to reduce workflow duplication (#5805)
## Summary
- Adds a local composite action at `.github/actions/setup-frontend` to
replace the external `Comfy-Org/ComfyUI_frontend_setup_action`
- Follows the same pattern as PR #5754 (sno-playwright-composite-action)
for consistency
- Updates workflows to use the new local composite action

## Motivation
Similar to the Playwright composite action, this change:
- Reduces external dependencies on separate action repositories
- Provides better control over versioning and updates
- Maintains consistency with other composite actions in the repository
- Simplifies maintenance by keeping all CI/CD logic in one place

## Changes
### New composite action: `.github/actions/setup-frontend/action.yml`
Direct mirror of the external action with the same 2 inputs:
- `extra_server_params`: Additional parameters to pass to ComfyUI server
- `devtools_ref`: Reference to use for ComfyUI_devtools

The action:
1. Checks out ComfyUI, ComfyUI_frontend, and ComfyUI_devtools
2. Sets up pnpm, Node.js (LTS), and Python (3.10)
3. Installs all dependencies (Python packages, npm packages)
4. Builds the frontend
5. Starts the ComfyUI server with the built frontend

### Updated workflows:
- `.github/workflows/i18n.yaml`
- `.github/workflows/i18n-node-defs.yaml`
- `.github/workflows/test-browser-exp.yaml`

All workflows now use the local composite action instead of
`Comfy-Org/ComfyUI_frontend_setup_action@v3`

## Test plan
- [ ] Verify all updated workflows pass CI tests
- [ ] Confirm the composite action works in all scenarios
- [ ] Check that build and server startup work as expected

## Related PRs
- #5754 - Similar approach for Playwright composite action

🤖 Generated with [Claude Code](https://claude.ai/code)
2025-09-29 22:11:37 -07:00