Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/fixed-5716-golicenses-install-retry.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Retry the pinned go-licenses install in `src/scripts/generate-notice.sh` (3 bounded attempts with backoff) so transient sum.golang.org stream errors no longer fail the NOTICE gate on unrelated pushes ([#5716](https://github.com/kubestellar/hive/issues/5716)).
17 changes: 16 additions & 1 deletion src/scripts/generate-notice.sh
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,22 @@ if ! command -v go >/dev/null 2>&1; then
fi

echo "Installing go-licenses@${GO_LICENSES_VERSION} (pinned)..." >&2
go install "github.com/google/go-licenses@${GO_LICENSES_VERSION}"
# Bounded retry: sum.golang.org intermittently returns HTTP/2 stream errors
# (INTERNAL_ERROR) that fail an otherwise-deterministic pinned install and
# turn the NOTICE gate red on unrelated pushes (see issue #5716). The pin is
# untouched — only the network fetch gets resilience.
install_attempts=3
for attempt in $(seq 1 "${install_attempts}"); do
if go install "github.com/google/go-licenses@${GO_LICENSES_VERSION}"; then
break
fi
if [[ "${attempt}" -eq "${install_attempts}" ]]; then
echo "generate-notice.sh: go install go-licenses@${GO_LICENSES_VERSION} failed after ${install_attempts} attempts" >&2
exit 1
fi
echo "generate-notice.sh: go install attempt ${attempt}/${install_attempts} failed (likely transient module-proxy/sumdb error); retrying in $((attempt * 5))s..." >&2
sleep $((attempt * 5))
done

GOBIN="$(go env GOPATH)/bin"
GO_LICENSES_BIN="${GOBIN}/go-licenses"
Expand Down
Loading