fix(github): resolve latest release via REST API to avoid flaky GraphQL 401#1156
Open
malept wants to merge 1 commit into
Open
fix(github): resolve latest release via REST API to avoid flaky GraphQL 401#1156malept wants to merge 1 commit into
malept wants to merge 1 commit into
Conversation
…QL 401 `gh release list` uses GitHub's GraphQL API, which intermittently returns 401 Unauthorized for some organization repositories (~45% failure rate observed for getoutreach/stencil). This caused `github_test.bats` to fail flakily in CI when resolving the latest release tag. Switch `latest_github_release_version` to the equivalent REST endpoint (`gh api repos/<slug>/releases`), which is unaffected, filtering drafts and pre-releases with the same semantics as before. Assisted-By: claude-opus-4.8 4.8 via opencode
Contributor
|
Link to code coverage report (posted by coverbot 🤖) |
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.
What this PR does / why we need it
latest_github_release_versionusedgh release list, which calls GitHub'sGraphQL API. That endpoint intermittently returns
401 Unauthorizedfor someorganization repositories (~45% failure rate observed locally for
getoutreach/stencilover 20 runs), causinggithub_test.batsto fail flakilyin CI when resolving the latest release tag.
This switches the function to the equivalent REST endpoint, which passed all of
the same runs. Draft and pre-release filtering keep the same semantics as
before.
Unblocks #1155 (blocked on a green CI run).
Jira ID
N/A
Notes for your reviewers
github_test.batsintegration tests, whichexercise
latest_github_release_versionend-to-end viainstall_latest_github_releaseagainst the real GitHub API. They went fromflaky (401) to consistently passing with this change.
gh release list/gh release create|deleteusages (e.g.shell/protoc.sh,shell/ci/release/pre-release.sh) are intentionally out ofscope for this CI fix.## What this PR does / why we need it
latest_github_release_versionusedgh release list, which calls GitHub'sGraphQL API. That endpoint intermittently returns
401 Unauthorizedfor someorganization repositories (~45% failure rate observed locally for
getoutreach/stencilover 20 runs), causinggithub_test.batsto fail flakilyin CI when resolving the latest release tag.
This switches the function to the equivalent REST endpoint, which passed all of
the same runs. Draft and pre-release filtering keep the same semantics as
before.
Unblocks #1155 (blocked on a green CI run).
Notes for your reviewers
github_test.batsintegration tests, whichexercise
latest_github_release_versionend-to-end viainstall_latest_github_releaseagainst the real GitHub API. They went fromflaky (401) to consistently passing with this change.
gh release list/gh release create|deleteusages (e.g.shell/protoc.sh,shell/ci/release/pre-release.sh) are intentionally out ofscope for this CI fix.
🤖 PR generated by AI