Use gh api for workflow watch - #5719
Merged
Merged
Conversation
clockwork-labs-bot
requested review from
bfops,
cloutiertyler and
jdetter
as code owners
August 11, 2026 21:13
bfops
force-pushed
the
bot/use-gh-api-workflow-watch
branch
2 times, most recently
from
August 11, 2026 21:21
af4a8e5 to
91f5e74
Compare
jdetter
approved these changes
Aug 11, 2026
jdetter
left a comment
Contributor
There was a problem hiding this comment.
Seems fine, not manually tested by me
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description of Changes
Updates
cargo ci other-workflows watchto poll workflow runs with:gh api --include "repos/$OWNER/$REPO/actions/runs/$id"instead of
gh run view.This should reduce API calls by 3x, since apparently
gh run viewcurrently does 3 API calls per call.This also adds some diagnostic info in case we hit rate limits again. If
gh apifails, the watcher now prints the complete captured stdout and stderr before returning an error. Because the call uses--include, stdout includes the HTTP status line and response headers, including GitHub rate-limit headers, plus the JSON error body.API and ABI breaking changes
None.
Expected complexity level and risk
Testing
cargo fmt --manifest-path tools/ci/Cargo.toml --all -- --checkcargo check -p cicargo clippy -p ci -- -D warningscargo run -p ci -- other-workflows watch --repo clockworklabs/SpacetimeDB --run-id 31536451346 --interval-seconds 1 --max-attempts 1cargo run -p ci -- other-workflows watch --repo clockworklabs/SpacetimeDB --run-id 0 --interval-seconds 1 --max-attempts 1prints HTTP headers, rate-limit headers, JSON error body, andghstderr for the expected 404git diff --check