Repository navigation
Commit 26465d7
fix(promotion): commit the files of transitions that applied when a later one fails
When a promotion failed partway, the workflow's commit step staged only
the UUID state, but the failing transition had already rewritten tracked
files in its target org, so `git pull --rebase` refused and nothing was
pushed — not the state, and not the files of transitions that had
already reached the platform.
- promote-cmd truncates tmp/promotion-applied.txt at the start of each
--apply run and, after each successful apply.ts, records every path git
reports changed under resources/<target>/ (from git, not the plan:
apply's own pull and push can rewrite other files) with its content at
that moment, written to git's object store (`-` for a deletion).
- On a non-success outcome, the commit step stages the state files plus
exactly those recorded blobs, commits, then resets and cleans
resources/ so the failed transition's rewrites can't block the rebase.
Staging the recorded content rather than the working tree means a later
failed transition that rewrote the same file (two pipelines promoting
into one org in one --all run) can't replace what was applied.
- promotionCommandRun(args, deps) takes an injectable child runner.
- tests/promotion-workflow-commit.test.ts runs the workflow's real commit
step (read from promotion.yml, run with bash -e) against a bare origin:
partial failure, the same-org case, success, and no changes.
Refs TEST-141
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>1 parent 2bd9f32 commit 26465d7
5 files changed
Lines changed: 676 additions & 9 deletions
File tree
- .github/workflows
- src
- tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
96 | 96 | | |
97 | 97 | | |
98 | 98 | | |
99 | | - | |
| 99 | + | |
100 | 100 | | |
101 | | - | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
102 | 115 | | |
103 | 116 | | |
104 | | - | |
| 117 | + | |
105 | 118 | | |
106 | 119 | | |
107 | 120 | | |
108 | 121 | | |
109 | 122 | | |
110 | 123 | | |
111 | | - | |
112 | 124 | | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
113 | 129 | | |
114 | 130 | | |
115 | 131 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
86 | 86 | | |
87 | 87 | | |
88 | 88 | | |
| 89 | + | |
89 | 90 | | |
90 | 91 | | |
91 | 92 | | |
| |||
1822 | 1823 | | |
1823 | 1824 | | |
1824 | 1825 | | |
| 1826 | + | |
| 1827 | + | |
| 1828 | + | |
| 1829 | + | |
| 1830 | + | |
| 1831 | + | |
| 1832 | + | |
| 1833 | + | |
| 1834 | + | |
| 1835 | + | |
| 1836 | + | |
| 1837 | + | |
| 1838 | + | |
| 1839 | + | |
| 1840 | + | |
| 1841 | + | |
| 1842 | + | |
| 1843 | + | |
| 1844 | + | |
| 1845 | + | |
| 1846 | + | |
| 1847 | + | |
| 1848 | + | |
| 1849 | + | |
| 1850 | + | |
| 1851 | + | |
| 1852 | + | |
| 1853 | + | |
| 1854 | + | |
| 1855 | + | |
| 1856 | + | |
| 1857 | + | |
| 1858 | + | |
| 1859 | + | |
| 1860 | + | |
| 1861 | + | |
| 1862 | + | |
| 1863 | + | |
| 1864 | + | |
| 1865 | + | |
| 1866 | + | |
| 1867 | + | |
| 1868 | + | |
| 1869 | + | |
| 1870 | + | |
| 1871 | + | |
| 1872 | + | |
| 1873 | + | |
| 1874 | + | |
| 1875 | + | |
| 1876 | + | |
| 1877 | + | |
| 1878 | + | |
| 1879 | + | |
| 1880 | + | |
| 1881 | + | |
| 1882 | + | |
| 1883 | + | |
| 1884 | + | |
| 1885 | + | |
| 1886 | + | |
| 1887 | + | |
1825 | 1888 | | |
1826 | 1889 | | |
1827 | 1890 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
2 | | - | |
| 1 | + | |
| 2 | + | |
| 3 | + | |
3 | 4 | | |
4 | 5 | | |
5 | 6 | | |
| |||
31 | 32 | | |
32 | 33 | | |
33 | 34 | | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
34 | 47 | | |
35 | 48 | | |
36 | 49 | | |
| |||
126 | 139 | | |
127 | 140 | | |
128 | 141 | | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
129 | 203 | | |
130 | 204 | | |
131 | 205 | | |
| |||
141 | 215 | | |
142 | 216 | | |
143 | 217 | | |
| 218 | + | |
144 | 219 | | |
| 220 | + | |
145 | 221 | | |
146 | | - | |
| 222 | + | |
147 | 223 | | |
148 | 224 | | |
149 | 225 | | |
150 | 226 | | |
151 | 227 | | |
152 | | - | |
| 228 | + | |
153 | 229 | | |
154 | 230 | | |
155 | 231 | | |
| |||
177 | 253 | | |
178 | 254 | | |
179 | 255 | | |
180 | | - | |
| 256 | + | |
181 | 257 | | |
182 | 258 | | |
183 | 259 | | |
184 | 260 | | |
185 | 261 | | |
| 262 | + | |
186 | 263 | | |
187 | 264 | | |
188 | 265 | | |
189 | 266 | | |
190 | 267 | | |
| 268 | + | |
191 | 269 | | |
192 | 270 | | |
193 | 271 | | |
| |||
198 | 276 | | |
199 | 277 | | |
200 | 278 | | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
201 | 284 | | |
202 | 285 | | |
203 | 286 | | |
| |||
209 | 292 | | |
210 | 293 | | |
211 | 294 | | |
| 295 | + | |
212 | 296 | | |
213 | 297 | | |
214 | 298 | | |
| |||
0 commit comments