vouchington-tooling 0.1.6 → 0.1.7

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.
package/README.md CHANGED
@@ -50,7 +50,8 @@ vouchington stage-review-payload optional|required <source> <destination>
50
50
  `download-optional-run-artifacts` uses the current Actions run and host. Pattern mode discovers
51
51
  non-expired artifacts across the run, keeps the first result for each name (matching `gh run
52
52
  download`), and extracts each selected name into its own directory. Ordinary absence is reported as
53
- `availability=unavailable`; invalid names and cancellation remain hard failures.
53
+ `availability=unavailable`. Artifact listing retries up to three times with bounded backoff;
54
+ exhausted transport errors, invalid names, and cancellation remain hard failures.
54
55
 
55
56
  `retrospective-transcript` discovers Codex and Claude transcripts by default. It also reads a
56
57
  Claude-compatible transcript when `CURSOR_SESSION_ID` is set, and Grok's `updates.jsonl` session
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vouchington-tooling",
3
- "version": "0.1.6",
3
+ "version": "0.1.7",
4
4
  "description": "Vouchington CLI and extractable tooling libraries.",
5
5
  "homepage": "https://github.com/vouchington/vouchington-tooling/tree/main/packages/vouchington-tooling#readme",
6
6
  "bugs": {
@@ -71,15 +71,39 @@ download_exact() {
71
71
  GH_HOST="$github_host" gh run download "$GITHUB_RUN_ID" --repo "$repository" --name "$artifact" --dir "$directory"
72
72
  }
73
73
 
74
- list_artifact_names() {
74
+ list_artifact_names_once() {
75
75
  GH_HOST="$github_host" gh api \
76
76
  --paginate \
77
77
  "repos/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID/artifacts?per_page=100" \
78
78
  --jq '.artifacts[] | select(.expired | not) | .name'
79
79
  }
80
80
 
81
+ list_artifact_names() {
82
+ local attempt status=0 delay artifact_names
83
+ for attempt in 1 2 3; do
84
+ if artifact_names=$(list_artifact_names_once); then
85
+ [ -z "$artifact_names" ] || printf '%s\n' "$artifact_names"
86
+ return 0
87
+ else
88
+ status=$?
89
+ fi
90
+ case "$status" in 130|143) return "$status" ;; esac
91
+ if [ "$attempt" -lt 3 ]; then
92
+ delay=2
93
+ [ "$attempt" -eq 2 ] && delay=5
94
+ echo "::warning::Optional same-run artifact listing failed (attempt $attempt/3 exit=$status); retrying in ${delay}s" >&2
95
+ if sleep "$delay"; then :; else return $?; fi
96
+ fi
97
+ done
98
+ echo "[optional-run-artifacts] listing exhausted attempts=3 exit=$status" >&2
99
+ return "$status"
100
+ }
101
+
81
102
  download_pattern() {
82
- artifacts=$(list_artifact_names | awk '!seen[$0]++') || return $?
103
+ artifacts=$(list_artifact_names) || return $?
104
+ if [ -n "$artifacts" ]; then
105
+ artifacts=$(printf '%s\n' "$artifacts" | awk '!seen[$0]++')
106
+ fi
83
107
  selected_artifacts=()
84
108
  while IFS= read -r artifact; do
85
109
  [ -n "$artifact" ] || continue