Commit 3f04851
fix(ji-do): fix Effect composition bug in ensureSingleCommitForGerrit
Critical bug fix: The squashing logic was not executing due to incorrect
Effect composition.
The Problem:
- ensureSingleCommitForGerrit was using Effect.sync() that returned
Effect.runSync() for the squashing case
- This caused the inner Effect to never execute
- Result: Multiple commits were pushed to Gerrit without being squashed
The Fix:
- Restructured to use proper Effect.flatMap composition
- First Effect.sync() counts commits and returns the count
- Then Effect.flatMap() conditionally calls squashCommitsForGerrit
- Now the squashing Effect actually executes when needed
Flow:
1. Check if remote is Gerrit (early return if not)
2. Count commits via Effect.sync()
3. Use Effect.flatMap() to conditionally squash if count > 1
4. squashCommitsForGerrit Effect executes properly
This ensures that when ji do creates multiple commits during iterations,
they will be automatically squashed into one before pushing to Gerrit.
Testing:
- All 502 tests pass
- TypeScript compilation succeeds
- Effect composition is now correct
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>1 parent 3e91613 commit 3f04851
1 file changed
Lines changed: 17 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
108 | 108 | | |
109 | 109 | | |
110 | 110 | | |
111 | | - | |
112 | | - | |
113 | | - | |
114 | | - | |
115 | | - | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
116 | 115 | | |
| 116 | + | |
117 | 117 | | |
118 | 118 | | |
119 | 119 | | |
120 | 120 | | |
121 | | - | |
| 121 | + | |
122 | 122 | | |
123 | 123 | | |
124 | 124 | | |
125 | 125 | | |
126 | | - | |
| 126 | + | |
127 | 127 | | |
128 | 128 | | |
129 | 129 | | |
130 | | - | |
131 | | - | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
132 | 140 | | |
133 | 141 | | |
134 | 142 | | |
| |||
0 commit comments