fix(mkreleaselog): continue even if we fail to fetch a dep
We might as well generate as much of the changelog as we can.
Steven Allen committed
Jan 16, 2020 at 15:42 UTC
399546a32005a3d4d6b6c0e306579522caa59f3e
1 file changed
+9
-3
bin/mkreleaselog
+9
-3
@@ -126,6 +126,7 @@ recursive_release_log() {
126
local repo_root="$(git rev-parse --show-toplevel)"
127
local package="$(go list)"
128
(
129
+ local result=0
130
local workspace="$(mktemp -d)"
131
trap "$(printf 'rm -rf "%q"' "$workspace")" INT TERM EXIT
132
cd "$workspace"
@@ -153,9 +154,13 @@ recursive_release_log() {
154
# Compute changelogs
155
jq -r '"\(.Path) \(.New.Version) \(.New.Ref) \(.Old.Version) \(.Old.Ref // "")"' |
156
while read repo new new_ref old old_ref; do
156
- ensure "$repo" "$new_ref"
157
- statlog "$repo" "$old_ref" "$new_ref" >> statlog.json
158
- local changelog="$(release_log "$repo" "$old_ref" "$new_ref")"
157
+ if ! ensure "$repo" "$new_ref"; then
158
+ result=1
159
+ local changelog="failed to fetch repo"
160
+ else
161
+ statlog "$repo" "$old_ref" "$new_ref" >> statlog.json
162
+ local changelog="$(release_log "$repo" "$old_ref" "$new_ref")"
163
+ fi
164
if [[ -n "$changelog" ]]; then
165
printf -- "- %s (%s -> %s):\n" "$repo" "$old" "$new"
166
echo "$changelog" | indent
@@ -171,6 +176,7 @@ recursive_release_log() {
176
statsummary <statlog.json |
177
jq -s 'sort_by(.Lines) | reverse | .[]' |
178
jq -r '"| \(.Author) | \(.Commits) | +\(.Insertions)/-\(.Deletions) | \(.Files) |"'
179
+ return "$status"
180
)
181
}
182