@redpanda-data/docs-extensions-and-macros 5.1.2 → 5.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -104,7 +104,11 @@ install_buf() {
104
104
  # Download and install buf for Linux
105
105
  BIN="/usr/local/bin/buf"
106
106
  VERSION="1.28.1"
107
- curl -sSL "https://github.com/bufbuild/buf/releases/download/v${VERSION}/buf-$(uname -s)-$(uname -m)" -o "${BIN}" || { log_error "Failed to download buf"; exit 1; }
107
+ # Same download hardening as install_rpk: fail on HTTP errors and
108
+ # retry transient GitHub/CDN failures with exponential backoff.
109
+ curl -fsSL --retry 5 --retry-all-errors \
110
+ --connect-timeout 30 --max-time 300 --retry-max-time 600 \
111
+ "https://github.com/bufbuild/buf/releases/download/v${VERSION}/buf-$(uname -s)-$(uname -m)" -o "${BIN}" || { log_error "Failed to download buf"; rm -f "${BIN}" 2>/dev/null; exit 1; }
108
112
  chmod +x "${BIN}" || { log_error "Failed to make buf executable"; exit 1; }
109
113
  ;;
110
114
  Darwin)
@@ -464,8 +468,15 @@ install_rpk() {
464
468
 
465
469
  log_info "Detected ${os_name} ${arch_name}, downloading ${rpk_filename}..."
466
470
 
467
- # Try to download and install rpk
468
- if curl -LO "$rpk_url"; then
471
+ # Try to download and install rpk.
472
+ # Use -f so HTTP errors (e.g. 403/404/429/503) fail instead of writing an
473
+ # error page into the zip, and retry with curl's default exponential
474
+ # backoff (1s, 2s, 4s, ...) to ride out transient GitHub/CDN and network
475
+ # errors, including rate limits that need time to clear. --retry-max-time
476
+ # caps the whole retry window so CI fails fast on persistent errors.
477
+ if curl -fL --retry 5 --retry-all-errors \
478
+ --connect-timeout 30 --max-time 300 --retry-max-time 600 \
479
+ -o "$rpk_filename" "$rpk_url"; then
469
480
  if unzip "$rpk_filename" 2>/dev/null; then
470
481
  mkdir -p ~/.local/bin
471
482
  if mv rpk ~/.local/bin/ 2>/dev/null; then
@@ -505,6 +516,8 @@ install_rpk() {
505
516
  fi
506
517
  else
507
518
  log_warn "Failed to download $rpk_url"
519
+ # A mid-transfer failure can leave a partial file behind even with -f.
520
+ rm -f "$rpk_filename" 2>/dev/null
508
521
  log_warn "Please install rpk manually:"
509
522
  log_warn "https://docs.redpanda.com/current/get-started/rpk-install/"
510
523
  return 1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@redpanda-data/docs-extensions-and-macros",
3
- "version": "5.1.2",
3
+ "version": "5.1.3",
4
4
  "description": "Antora extensions and macros developed for Redpanda documentation.",
5
5
  "keywords": [
6
6
  "antora",