You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(foreach): run against previously failed or successful repos (#147)
* implement symlinks and tests
* use a single symlink
* update error handling
* readme update
* minor changes
---------
Co-authored-by: Danny Ranson <[email protected]>
Copy file name to clipboardexpand all lines: README.md
+26
Original file line number
Diff line number
Diff line change
@@ -158,6 +158,32 @@ At any time, if you need to update your working copy branches from the upstream,
158
158
159
159
It is highly recommended that you run tests against affected repos, if it will help validate the changes you have made.
160
160
161
+
#### Logging and re-running with foreach
162
+
163
+
Every time a command is run with `turbolift foreach`, logging output for each repository is collected in a temporary directory
164
+
with the following structure:
165
+
166
+
```
167
+
temp-dir
168
+
\ successful
169
+
\ repos.txt # a list of repos where the command succeeded
170
+
\ org
171
+
\ repo
172
+
\ logs.txt # logs from the specific foreach execution on this repo
173
+
....
174
+
\ failed
175
+
\ repos.txt # a list of repos where the command succeeded
176
+
\ org
177
+
\ repo
178
+
\ logs.txt # logs from the specific foreach execution on this repo
179
+
```
180
+
181
+
You can use `--successful` or `--failed` to run a foreach command only against the repositories that succeeded or failed in the preceding foreach execution.
182
+
183
+
```
184
+
turbolift foreach --failed -- make test
185
+
```
186
+
161
187
### Committing changes
162
188
163
189
When ready to commit changes across all repos, run:
logger.Printf("Logs for all executions have been stored under %s", overallResultsDirectory)
131
-
logger.Printf("Names of successful repos have been written to %s", successfulReposFileName)
132
-
logger.Printf("Names of failed repos have been written to %s", failedReposFileName)
168
+
logger.Printf("Names of successful repos have been written to %s. Use --successful to run the next foreach command against these repos", successfulReposFileName)
169
+
logger.Printf("Names of failed repos have been written to %s. Use --failed to run the next foreach command against these repos", failedReposFileName)
133
170
134
171
returnnil
135
172
}
136
173
137
174
// sets up a temporary directory to store success/failure logs etc
logger.Warnf("Failed to create symlink to foreach results: %v", err)
201
+
}
202
+
154
203
_, _=successfulReposFile.WriteString(fmt.Sprintf("# This file contains the list of repositories that were successfully processed by turbolift foreach\n# for the command: %s\n", command))
155
204
_, _=failedReposFile.WriteString(fmt.Sprintf("# This file contains the list of repositories that failed to be processed by turbolift foreach\n# for the command: %s\n", command))
0 commit comments