@futurelastic/colab-handbook 1.13.0-rc.59 → 1.13.0-rc.60

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/package.json CHANGED
@@ -33,5 +33,5 @@
33
33
  "engines": {
34
34
  "node": ">=18"
35
35
  },
36
- "version": "1.13.0-rc.59"
36
+ "version": "1.13.0-rc.60"
37
37
  }
@@ -209,16 +209,40 @@ jobs:
209
209
  return 1
210
210
  fi
211
211
  }
212
- # The cited run, as "<id> <head sha> <url> <branch>": a green push run of this workflow on
213
- # another ref of this repo. #552: one at THIS sha first (a `ship-batch/*` run trunk
214
- # fast-forwarded to), an exact query; else one whose commit has THIS tree (#493).
212
+ # The candidate runs, one per line as "<id> <head sha> <url> <branch>", newest first: green
213
+ # push runs of this workflow on another ref of this repo. #552: those at THIS sha first (a
214
+ # `ship-batch/*` run trunk fast-forwarded to), an exact query; then those whose commit has
215
+ # THIS tree (#493). The query's own per_page bounds the walk (#592).
215
216
  same_sha() {
216
217
  gh api "repos/$REPO/actions/workflows/$WFID/runs?head_sha=$SHA&event=push&status=success&per_page=20" \
217
- --jq "first(.workflow_runs[] | select(.id != $RUN_ID and .head_branch != \"$REF_NAME\" and .head_repository.full_name == \"$REPO\") | \"\\(.id) \\(.head_sha) \\(.html_url) \\(.head_branch)\") // empty" 2>/dev/null | grep .
218
+ --jq ".workflow_runs[] | select(.id != $RUN_ID and .head_branch != \"$REF_NAME\" and .head_repository.full_name == \"$REPO\") | \"\\(.id) \\(.head_sha) \\(.html_url) \\(.head_branch)\"" 2>/dev/null
218
219
  }
219
220
  same_tree() {
220
221
  gh api "repos/$REPO/actions/workflows/$WFID/runs?event=push&status=success&per_page=50" \
221
- --jq "first(.workflow_runs[] | select(.id != $RUN_ID and .head_branch != \"$REF_NAME\" and .head_repository.full_name == \"$REPO\" and .head_commit.tree_id == \"$OURS\") | \"\\(.id) \\(.head_sha) \\(.html_url) \\(.head_branch)\") // empty" 2>/dev/null
222
+ --jq ".workflow_runs[] | select(.id != $RUN_ID and .head_branch != \"$REF_NAME\" and .head_repository.full_name == \"$REPO\" and .head_commit.tree_id == \"$OURS\") | \"\\(.id) \\(.head_sha) \\(.html_url) \\(.head_branch)\"" 2>/dev/null
223
+ }
224
+ # #592: cite the newest candidate on stdin that passes every check. One that fails a check
225
+ # is passed over, not the end of the search: the newest green run can be a skip-chained one
226
+ # (#511) while an older run at the same sha or tree ran every job. A run already tried (the
227
+ # sha query's runs reappear in the tree listing) is not tried twice.
228
+ cite() {
229
+ local CID CSHA URL BR CTREE
230
+ while read -r CID CSHA URL BR; do
231
+ [ -n "$CID" ] || continue
232
+ case " $TRIED " in *" $CID "*) continue ;; esac
233
+ TRIED="$TRIED $CID"
234
+ if ! CTREE="$(gh api "repos/$REPO/git/commits/$CSHA" --jq .tree.sha 2>/dev/null)" || [ "$CTREE" != "$OURS" ]; then
235
+ echo "::notice::Could not confirm the tree of $CSHA — passing over run $CID (#493)."
236
+ elif reusable "$CID"; then
237
+ tested=true
238
+ cited="$URL"
239
+ echo "::notice title=tree-already-green::$URL tree=$OURS head=$CSHA branch=$BR"
240
+ echo "Tree $OURS already passed this workflow at $CSHA on $BR ($URL) — skipping the suite (#493)."
241
+ echo "Already tested: tree \`$OURS\` passed this workflow on \`$BR\` — [the run relied on]($URL); suite skipped (#493)." >> "$GITHUB_STEP_SUMMARY"
242
+ return 0
243
+ fi
244
+ done
245
+ return 1
222
246
  }
223
247
  if ! command -v gh >/dev/null 2>&1; then
224
248
  echo "::notice::gh is not installed on this runner — running the full suite (#418)."
@@ -234,20 +258,17 @@ jobs:
234
258
  echo "::notice::$REF_NAME is not this repo's trunk — running the full suite (#493)."
235
259
  elif ! OURS="$(gh api "repos/$REPO/git/commits/$SHA" --jq .tree.sha 2>/dev/null)" || [ -z "$OURS" ]; then
236
260
  echo "::notice::Could not read the tree of $SHA — running the full suite (#493)."
237
- elif ! CAND="$(same_sha || same_tree)"; then
238
- echo "::notice::Could not list this workflow's green runs — running the full suite (#493)."
239
- elif [ -z "$CAND" ]; then
240
- echo "No green run of this workflow on another ref has sha $SHA or tree $OURS — running the full suite."
241
261
  else
242
- read -r CID CSHA URL BR <<< "$CAND"
243
- if ! CTREE="$(gh api "repos/$REPO/git/commits/$CSHA" --jq .tree.sha 2>/dev/null)" || [ "$CTREE" != "$OURS" ]; then
244
- echo "::notice::Could not confirm the tree of $CSHA — running the full suite (#493)."
245
- elif reusable "$CID"; then
246
- tested=true
247
- cited="$URL"
248
- echo "::notice title=tree-already-green::$URL tree=$OURS head=$CSHA branch=$BR"
249
- echo "Tree $OURS already passed this workflow at $CSHA on $BR ($URL) — skipping the suite (#493)."
250
- echo "Already tested: tree \`$OURS\` passed this workflow on \`$BR\` — [the run relied on]($URL); suite skipped (#493)." >> "$GITHUB_STEP_SUMMARY"
262
+ TRIED=
263
+ SC="$(same_sha)" || SC= # the sha query failing falls through to the tree listing (#552)
264
+ if [ -n "$SC" ] && cite <<< "$SC"; then
265
+ :
266
+ elif ! TC="$(same_tree)"; then
267
+ echo "::notice::Could not list this workflow's green runs — running the full suite (#493)."
268
+ elif [ -z "$SC$TC" ]; then
269
+ echo "No green run of this workflow on another ref has sha $SHA or tree $OURS — running the full suite."
270
+ elif ! cite <<< "$TC"; then
271
+ echo "No green run of this workflow at sha $SHA or tree $OURS can be cited — running the full suite (#592)."
251
272
  fi
252
273
  fi
253
274
  elif ! N="$(gh api "repos/$REPO/actions/workflows/$WFID/runs?head_sha=$SHA&status=success&per_page=20" \
@@ -174,16 +174,40 @@ jobs:
174
174
  return 1
175
175
  fi
176
176
  }
177
- # The cited run, as "<id> <head sha> <url> <branch>": a green push run of this workflow on
178
- # another ref of this repo. #552: one at THIS sha first (a `ship-batch/*` run trunk
179
- # fast-forwarded to), an exact query; else one whose commit has THIS tree (#493).
177
+ # The candidate runs, one per line as "<id> <head sha> <url> <branch>", newest first: green
178
+ # push runs of this workflow on another ref of this repo. #552: those at THIS sha first (a
179
+ # `ship-batch/*` run trunk fast-forwarded to), an exact query; then those whose commit has
180
+ # THIS tree (#493). The query's own per_page bounds the walk (#592).
180
181
  same_sha() {
181
182
  gh api "repos/$REPO/actions/workflows/$WFID/runs?head_sha=$SHA&event=push&status=success&per_page=20" \
182
- --jq "first(.workflow_runs[] | select(.id != $RUN_ID and .head_branch != \"$REF_NAME\" and .head_repository.full_name == \"$REPO\") | \"\\(.id) \\(.head_sha) \\(.html_url) \\(.head_branch)\") // empty" 2>/dev/null | grep .
183
+ --jq ".workflow_runs[] | select(.id != $RUN_ID and .head_branch != \"$REF_NAME\" and .head_repository.full_name == \"$REPO\") | \"\\(.id) \\(.head_sha) \\(.html_url) \\(.head_branch)\"" 2>/dev/null
183
184
  }
184
185
  same_tree() {
185
186
  gh api "repos/$REPO/actions/workflows/$WFID/runs?event=push&status=success&per_page=50" \
186
- --jq "first(.workflow_runs[] | select(.id != $RUN_ID and .head_branch != \"$REF_NAME\" and .head_repository.full_name == \"$REPO\" and .head_commit.tree_id == \"$OURS\") | \"\\(.id) \\(.head_sha) \\(.html_url) \\(.head_branch)\") // empty" 2>/dev/null
187
+ --jq ".workflow_runs[] | select(.id != $RUN_ID and .head_branch != \"$REF_NAME\" and .head_repository.full_name == \"$REPO\" and .head_commit.tree_id == \"$OURS\") | \"\\(.id) \\(.head_sha) \\(.html_url) \\(.head_branch)\"" 2>/dev/null
188
+ }
189
+ # #592: cite the newest candidate on stdin that passes every check. One that fails a check
190
+ # is passed over, not the end of the search: the newest green run can be a skip-chained one
191
+ # (#511) while an older run at the same sha or tree ran every job. A run already tried (the
192
+ # sha query's runs reappear in the tree listing) is not tried twice.
193
+ cite() {
194
+ local CID CSHA URL BR CTREE
195
+ while read -r CID CSHA URL BR; do
196
+ [ -n "$CID" ] || continue
197
+ case " $TRIED " in *" $CID "*) continue ;; esac
198
+ TRIED="$TRIED $CID"
199
+ if ! CTREE="$(gh api "repos/$REPO/git/commits/$CSHA" --jq .tree.sha 2>/dev/null)" || [ "$CTREE" != "$OURS" ]; then
200
+ echo "::notice::Could not confirm the tree of $CSHA — passing over run $CID (#493)."
201
+ elif reusable "$CID"; then
202
+ tested=true
203
+ cited="$URL"
204
+ echo "::notice title=tree-already-green::$URL tree=$OURS head=$CSHA branch=$BR"
205
+ echo "Tree $OURS already passed this workflow at $CSHA on $BR ($URL) — skipping the suite (#493)."
206
+ echo "Already tested: tree \`$OURS\` passed this workflow on \`$BR\` — [the run relied on]($URL); suite skipped (#493)." >> "$GITHUB_STEP_SUMMARY"
207
+ return 0
208
+ fi
209
+ done
210
+ return 1
187
211
  }
188
212
  if ! command -v gh >/dev/null 2>&1; then
189
213
  echo "::notice::gh is not installed on this runner — running the full suite (#418)."
@@ -199,20 +223,17 @@ jobs:
199
223
  echo "::notice::$REF_NAME is not this repo's trunk — running the full suite (#493)."
200
224
  elif ! OURS="$(gh api "repos/$REPO/git/commits/$SHA" --jq .tree.sha 2>/dev/null)" || [ -z "$OURS" ]; then
201
225
  echo "::notice::Could not read the tree of $SHA — running the full suite (#493)."
202
- elif ! CAND="$(same_sha || same_tree)"; then
203
- echo "::notice::Could not list this workflow's green runs — running the full suite (#493)."
204
- elif [ -z "$CAND" ]; then
205
- echo "No green run of this workflow on another ref has sha $SHA or tree $OURS — running the full suite."
206
226
  else
207
- read -r CID CSHA URL BR <<< "$CAND"
208
- if ! CTREE="$(gh api "repos/$REPO/git/commits/$CSHA" --jq .tree.sha 2>/dev/null)" || [ "$CTREE" != "$OURS" ]; then
209
- echo "::notice::Could not confirm the tree of $CSHA — running the full suite (#493)."
210
- elif reusable "$CID"; then
211
- tested=true
212
- cited="$URL"
213
- echo "::notice title=tree-already-green::$URL tree=$OURS head=$CSHA branch=$BR"
214
- echo "Tree $OURS already passed this workflow at $CSHA on $BR ($URL) — skipping the suite (#493)."
215
- echo "Already tested: tree \`$OURS\` passed this workflow on \`$BR\` — [the run relied on]($URL); suite skipped (#493)." >> "$GITHUB_STEP_SUMMARY"
227
+ TRIED=
228
+ SC="$(same_sha)" || SC= # the sha query failing falls through to the tree listing (#552)
229
+ if [ -n "$SC" ] && cite <<< "$SC"; then
230
+ :
231
+ elif ! TC="$(same_tree)"; then
232
+ echo "::notice::Could not list this workflow's green runs — running the full suite (#493)."
233
+ elif [ -z "$SC$TC" ]; then
234
+ echo "No green run of this workflow on another ref has sha $SHA or tree $OURS — running the full suite."
235
+ elif ! cite <<< "$TC"; then
236
+ echo "No green run of this workflow at sha $SHA or tree $OURS can be cited — running the full suite (#592)."
216
237
  fi
217
238
  fi
218
239
  elif ! N="$(gh api "repos/$REPO/actions/workflows/$WFID/runs?head_sha=$SHA&status=success&per_page=20" \
@@ -186,16 +186,40 @@ jobs:
186
186
  return 1
187
187
  fi
188
188
  }
189
- # The cited run, as "<id> <head sha> <url> <branch>": a green push run of this workflow on
190
- # another ref of this repo. #552: one at THIS sha first (a `ship-batch/*` run trunk
191
- # fast-forwarded to), an exact query; else one whose commit has THIS tree (#493).
189
+ # The candidate runs, one per line as "<id> <head sha> <url> <branch>", newest first: green
190
+ # push runs of this workflow on another ref of this repo. #552: those at THIS sha first (a
191
+ # `ship-batch/*` run trunk fast-forwarded to), an exact query; then those whose commit has
192
+ # THIS tree (#493). The query's own per_page bounds the walk (#592).
192
193
  same_sha() {
193
194
  gh api "repos/$REPO/actions/workflows/$WFID/runs?head_sha=$SHA&event=push&status=success&per_page=20" \
194
- --jq "first(.workflow_runs[] | select(.id != $RUN_ID and .head_branch != \"$REF_NAME\" and .head_repository.full_name == \"$REPO\") | \"\\(.id) \\(.head_sha) \\(.html_url) \\(.head_branch)\") // empty" 2>/dev/null | grep .
195
+ --jq ".workflow_runs[] | select(.id != $RUN_ID and .head_branch != \"$REF_NAME\" and .head_repository.full_name == \"$REPO\") | \"\\(.id) \\(.head_sha) \\(.html_url) \\(.head_branch)\"" 2>/dev/null
195
196
  }
196
197
  same_tree() {
197
198
  gh api "repos/$REPO/actions/workflows/$WFID/runs?event=push&status=success&per_page=50" \
198
- --jq "first(.workflow_runs[] | select(.id != $RUN_ID and .head_branch != \"$REF_NAME\" and .head_repository.full_name == \"$REPO\" and .head_commit.tree_id == \"$OURS\") | \"\\(.id) \\(.head_sha) \\(.html_url) \\(.head_branch)\") // empty" 2>/dev/null
199
+ --jq ".workflow_runs[] | select(.id != $RUN_ID and .head_branch != \"$REF_NAME\" and .head_repository.full_name == \"$REPO\" and .head_commit.tree_id == \"$OURS\") | \"\\(.id) \\(.head_sha) \\(.html_url) \\(.head_branch)\"" 2>/dev/null
200
+ }
201
+ # #592: cite the newest candidate on stdin that passes every check. One that fails a check
202
+ # is passed over, not the end of the search: the newest green run can be a skip-chained one
203
+ # (#511) while an older run at the same sha or tree ran every job. A run already tried (the
204
+ # sha query's runs reappear in the tree listing) is not tried twice.
205
+ cite() {
206
+ local CID CSHA URL BR CTREE
207
+ while read -r CID CSHA URL BR; do
208
+ [ -n "$CID" ] || continue
209
+ case " $TRIED " in *" $CID "*) continue ;; esac
210
+ TRIED="$TRIED $CID"
211
+ if ! CTREE="$(gh api "repos/$REPO/git/commits/$CSHA" --jq .tree.sha 2>/dev/null)" || [ "$CTREE" != "$OURS" ]; then
212
+ echo "::notice::Could not confirm the tree of $CSHA — passing over run $CID (#493)."
213
+ elif reusable "$CID"; then
214
+ tested=true
215
+ cited="$URL"
216
+ echo "::notice title=tree-already-green::$URL tree=$OURS head=$CSHA branch=$BR"
217
+ echo "Tree $OURS already passed this workflow at $CSHA on $BR ($URL) — skipping the suite (#493)."
218
+ echo "Already tested: tree \`$OURS\` passed this workflow on \`$BR\` — [the run relied on]($URL); suite skipped (#493)." >> "$GITHUB_STEP_SUMMARY"
219
+ return 0
220
+ fi
221
+ done
222
+ return 1
199
223
  }
200
224
  if ! command -v gh >/dev/null 2>&1; then
201
225
  echo "::notice::gh is not installed on this runner — running the full suite (#418)."
@@ -211,20 +235,17 @@ jobs:
211
235
  echo "::notice::$REF_NAME is not this repo's trunk — running the full suite (#493)."
212
236
  elif ! OURS="$(gh api "repos/$REPO/git/commits/$SHA" --jq .tree.sha 2>/dev/null)" || [ -z "$OURS" ]; then
213
237
  echo "::notice::Could not read the tree of $SHA — running the full suite (#493)."
214
- elif ! CAND="$(same_sha || same_tree)"; then
215
- echo "::notice::Could not list this workflow's green runs — running the full suite (#493)."
216
- elif [ -z "$CAND" ]; then
217
- echo "No green run of this workflow on another ref has sha $SHA or tree $OURS — running the full suite."
218
238
  else
219
- read -r CID CSHA URL BR <<< "$CAND"
220
- if ! CTREE="$(gh api "repos/$REPO/git/commits/$CSHA" --jq .tree.sha 2>/dev/null)" || [ "$CTREE" != "$OURS" ]; then
221
- echo "::notice::Could not confirm the tree of $CSHA — running the full suite (#493)."
222
- elif reusable "$CID"; then
223
- tested=true
224
- cited="$URL"
225
- echo "::notice title=tree-already-green::$URL tree=$OURS head=$CSHA branch=$BR"
226
- echo "Tree $OURS already passed this workflow at $CSHA on $BR ($URL) — skipping the suite (#493)."
227
- echo "Already tested: tree \`$OURS\` passed this workflow on \`$BR\` — [the run relied on]($URL); suite skipped (#493)." >> "$GITHUB_STEP_SUMMARY"
239
+ TRIED=
240
+ SC="$(same_sha)" || SC= # the sha query failing falls through to the tree listing (#552)
241
+ if [ -n "$SC" ] && cite <<< "$SC"; then
242
+ :
243
+ elif ! TC="$(same_tree)"; then
244
+ echo "::notice::Could not list this workflow's green runs — running the full suite (#493)."
245
+ elif [ -z "$SC$TC" ]; then
246
+ echo "No green run of this workflow on another ref has sha $SHA or tree $OURS — running the full suite."
247
+ elif ! cite <<< "$TC"; then
248
+ echo "No green run of this workflow at sha $SHA or tree $OURS can be cited — running the full suite (#592)."
228
249
  fi
229
250
  fi
230
251
  elif ! N="$(gh api "repos/$REPO/actions/workflows/$WFID/runs?head_sha=$SHA&status=success&per_page=20" \