Skip to content

fix(github): resolve latest release via REST API to avoid flaky GraphQL 401#1156

Open
malept wants to merge 1 commit into
mainfrom
malept/fix/github-release-rest-api
Open

fix(github): resolve latest release via REST API to avoid flaky GraphQL 401#1156
malept wants to merge 1 commit into
mainfrom
malept/fix/github-release-rest-api

Conversation

@malept

@malept malept commented Jun 10, 2026

Copy link
Copy Markdown
Member

What this PR does / why we need it

latest_github_release_version used gh release list, which calls GitHub's
GraphQL API. That endpoint intermittently returns 401 Unauthorized for some
organization repositories (~45% failure rate observed locally for
getoutreach/stencil over 20 runs), causing github_test.bats to fail flakily
in 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

  • Coverage comes from the existing github_test.bats integration tests, which
    exercise latest_github_release_version end-to-end via
    install_latest_github_release against the real GitHub API. They went from
    flaky (401) to consistently passing with this change.
  • Other gh release list / gh release create|delete usages (e.g.
    shell/protoc.sh, shell/ci/release/pre-release.sh) are intentionally out of
    scope for this CI fix.## What this PR does / why we need it

latest_github_release_version used gh release list, which calls GitHub's
GraphQL API. That endpoint intermittently returns 401 Unauthorized for some
organization repositories (~45% failure rate observed locally for
getoutreach/stencil over 20 runs), causing github_test.bats to fail flakily
in 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

  • Coverage comes from the existing github_test.bats integration tests, which
    exercise latest_github_release_version end-to-end via
    install_latest_github_release against the real GitHub API. They went from
    flaky (401) to consistently passing with this change.
  • Other gh release list / gh release create|delete usages (e.g.
    shell/protoc.sh, shell/ci/release/pre-release.sh) are intentionally out of
    scope for this CI fix.

🤖 PR generated by AI

…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
@malept malept requested a review from a team as a code owner June 10, 2026 17:29
@getoutreach-ci-1

Copy link
Copy Markdown
Contributor

Link to code coverage report (posted by coverbot 🤖)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant