Skip to content

Commit 368c54b

Browse files
[docs] Add Claude Code command for automated hotfix releases (#4369)
1 parent f1575a6 commit 368c54b

File tree

1 file changed

+222
-0
lines changed

1 file changed

+222
-0
lines changed
Lines changed: 222 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,222 @@
1+
# Create Hotfix Release
2+
3+
This command guides you through creating a patch/hotfix release for ComfyUI Frontend with comprehensive safety checks and human confirmations at each step.
4+
5+
<task>
6+
Create a hotfix release by cherry-picking commits or PR commits from main to a core branch: $ARGUMENTS
7+
8+
Expected format: Comma-separated list of commits or PR numbers
9+
Examples:
10+
- `abc123,def456,ghi789` (commits)
11+
- `#1234,#5678` (PRs)
12+
- `abc123,#1234,def456` (mixed)
13+
14+
If no arguments provided, the command will help identify the correct core branch and guide you through selecting commits/PRs.
15+
</task>
16+
17+
## Prerequisites
18+
19+
Before starting, ensure:
20+
- You have push access to the repository
21+
- GitHub CLI (`gh`) is authenticated
22+
- You're on a clean working tree
23+
- You understand the commits/PRs you're cherry-picking
24+
25+
## Hotfix Release Process
26+
27+
### Step 1: Identify Target Core Branch
28+
29+
1. Fetch the current ComfyUI requirements.txt from master branch:
30+
```bash
31+
curl -s https://raw.githubusercontent.com/comfyanonymous/ComfyUI/master/requirements.txt | grep "comfyui-frontend-package"
32+
```
33+
2. Extract the `comfyui-frontend-package` version (e.g., `comfyui-frontend-package==1.23.4`)
34+
3. Parse version to get major.minor (e.g., `1.23.4``1.23`)
35+
4. Determine core branch: `core/<major>.<minor>` (e.g., `core/1.23`)
36+
5. Verify the core branch exists: `git ls-remote origin refs/heads/core/*`
37+
6. **CONFIRMATION REQUIRED**: Is `core/X.Y` the correct target branch?
38+
39+
### Step 2: Parse and Validate Arguments
40+
41+
1. Parse the comma-separated list of commits/PRs
42+
2. For each item:
43+
- If starts with `#`: Treat as PR number
44+
- Otherwise: Treat as commit hash
45+
3. For PR numbers:
46+
- Fetch PR details using `gh pr view <number>`
47+
- Extract the merge commit if PR is merged
48+
- If PR has multiple commits, list them all
49+
- **CONFIRMATION REQUIRED**: Use merge commit or cherry-pick individual commits?
50+
4. Validate all commit hashes exist in the repository
51+
52+
### Step 3: Analyze Target Changes
53+
54+
1. For each commit/PR to cherry-pick:
55+
- Display commit hash, author, date
56+
- Show PR title and number (if applicable)
57+
- Display commit message
58+
- Show files changed and diff statistics
59+
- Check if already in core branch: `git branch --contains <commit>`
60+
2. Identify potential conflicts by checking changed files
61+
3. **CONFIRMATION REQUIRED**: Proceed with these commits?
62+
63+
### Step 4: Create Hotfix Branch
64+
65+
1. Checkout the core branch (e.g., `core/1.23`)
66+
2. Pull latest changes: `git pull origin core/X.Y`
67+
3. Display current version from package.json
68+
4. Create hotfix branch: `hotfix/<version>-<timestamp>`
69+
- Example: `hotfix/1.23.4-20241120`
70+
5. **CONFIRMATION REQUIRED**: Created branch correctly?
71+
72+
### Step 5: Cherry-pick Changes
73+
74+
For each commit:
75+
1. Attempt cherry-pick: `git cherry-pick <commit>`
76+
2. If conflicts occur:
77+
- Display conflict details
78+
- Show conflicting sections
79+
- Provide resolution guidance
80+
- **CONFIRMATION REQUIRED**: Conflicts resolved correctly?
81+
3. After successful cherry-pick:
82+
- Show the changes: `git show HEAD`
83+
- Run validation: `npm run typecheck && npm run lint`
84+
4. **CONFIRMATION REQUIRED**: Cherry-pick successful and valid?
85+
86+
### Step 6: Create PR to Core Branch
87+
88+
1. Push the hotfix branch: `git push origin hotfix/<version>-<timestamp>`
89+
2. Create PR using gh CLI:
90+
```bash
91+
gh pr create --base core/X.Y --head hotfix/<version>-<timestamp> \
92+
--title "[Hotfix] Cherry-pick fixes to core/X.Y" \
93+
--body "Cherry-picked commits: ..."
94+
```
95+
3. Add appropriate labels (but NOT "Release" yet)
96+
4. PR body should include:
97+
- List of cherry-picked commits/PRs
98+
- Original issue references
99+
- Testing instructions
100+
- Impact assessment
101+
5. **CONFIRMATION REQUIRED**: PR created correctly?
102+
103+
### Step 7: Wait for Tests
104+
105+
1. Monitor PR checks: `gh pr checks`
106+
2. Display test results as they complete
107+
3. If any tests fail:
108+
- Show failure details
109+
- Analyze if related to cherry-picks
110+
- **DECISION REQUIRED**: Fix and continue, or abort?
111+
4. Wait for all required checks to pass
112+
5. **CONFIRMATION REQUIRED**: All tests passing?
113+
114+
### Step 8: Merge Hotfix PR
115+
116+
1. Verify all checks have passed
117+
2. Check for required approvals
118+
3. Merge the PR: `gh pr merge --merge`
119+
4. Delete the hotfix branch
120+
5. **CONFIRMATION REQUIRED**: PR merged successfully?
121+
122+
### Step 9: Create Version Bump
123+
124+
1. Checkout the core branch: `git checkout core/X.Y`
125+
2. Pull latest changes: `git pull origin core/X.Y`
126+
3. Read current version from package.json
127+
4. Determine patch version increment:
128+
- Current: `1.23.4` → New: `1.23.5`
129+
5. Create release branch named with new version: `release/1.23.5`
130+
6. Update version in package.json to `1.23.5`
131+
7. Commit: `git commit -m "[release] Bump version to 1.23.5"`
132+
8. **CONFIRMATION REQUIRED**: Version bump correct?
133+
134+
### Step 10: Create Release PR
135+
136+
1. Push release branch: `git push origin release/1.23.5`
137+
2. Create PR with Release label:
138+
```bash
139+
gh pr create --base core/X.Y --head release/1.23.5 \
140+
--title "[Release] v1.23.5" \
141+
--body "..." \
142+
--label "Release"
143+
```
144+
3. **CRITICAL**: Verify "Release" label is added
145+
4. PR description should include:
146+
- Version: `1.23.4``1.23.5`
147+
- Included fixes (link to previous PR)
148+
- Release notes for users
149+
5. **CONFIRMATION REQUIRED**: Release PR has "Release" label?
150+
151+
### Step 11: Monitor Release Process
152+
153+
1. Wait for PR checks to pass
154+
2. **FINAL CONFIRMATION**: Ready to trigger release by merging?
155+
3. Merge the PR: `gh pr merge --merge`
156+
4. Monitor release workflow:
157+
```bash
158+
gh run list --workflow=release.yaml --limit=1
159+
gh run watch
160+
```
161+
5. Track progress:
162+
- GitHub release draft/publication
163+
- PyPI upload
164+
- npm types publication
165+
166+
### Step 12: Post-Release Verification
167+
168+
1. Verify GitHub release:
169+
```bash
170+
gh release view v1.23.5
171+
```
172+
2. Check PyPI package:
173+
```bash
174+
pip index versions comfyui-frontend-package | grep 1.23.5
175+
```
176+
3. Verify npm package:
177+
```bash
178+
npm view @comfyorg/[email protected]
179+
```
180+
4. Generate release summary with:
181+
- Version released
182+
- Commits included
183+
- Issues fixed
184+
- Distribution status
185+
5. **CONFIRMATION REQUIRED**: Release completed successfully?
186+
187+
## Safety Checks
188+
189+
Throughout the process:
190+
- Always verify core branch matches ComfyUI's requirements.txt
191+
- For PRs: Ensure using correct commits (merge vs individual)
192+
- Check version numbers follow semantic versioning
193+
- **Critical**: "Release" label must be on version bump PR
194+
- Validate cherry-picks don't break core branch stability
195+
- Keep audit trail of all operations
196+
197+
## Rollback Procedures
198+
199+
If something goes wrong:
200+
- Before push: `git reset --hard origin/core/X.Y`
201+
- After PR creation: Close PR and start over
202+
- After failed release: Create new patch version with fixes
203+
- Document any issues for future reference
204+
205+
## Important Notes
206+
207+
- Core branch version will be behind main - this is expected
208+
- The "Release" label triggers the PyPI/npm publication
209+
- PR numbers must include the `#` prefix
210+
- Mixed commits/PRs are supported but review carefully
211+
- Always wait for full test suite before proceeding
212+
213+
## Expected Timeline
214+
215+
- Step 1-3: ~10 minutes (analysis)
216+
- Steps 4-6: ~15-30 minutes (cherry-picking)
217+
- Step 7: ~10-20 minutes (tests)
218+
- Steps 8-10: ~10 minutes (version bump)
219+
- Step 11-12: ~15-20 minutes (release)
220+
- Total: ~60-90 minutes
221+
222+
This process ensures a safe, verified hotfix release with multiple confirmation points and clear tracking of what changes are being released.

0 commit comments

Comments
 (0)