fix(review-host): follow GitHub API redirects in release and token checks

Merged
KI
1mo ago
+3-3

What

apps/review-host/check.sh and apps/review-host/self-update.sh call api.github.com/repos/superset-sh/... with curl and no -L. If a repository's owner or name ever changes, GitHub answers those URLs with a 301 to /repositories/<id>/.... Without -L:

  • self-update.sh: the latest-release lookup gets an empty body, so the box logs "could not read the latest release" and silently stops updating.
  • check.sh: the release probe fails closed ("version not verified"), and the token probe sees 301 instead of 200 and reports the GitHub token as broken.

This adds -L to those three calls (curl -sf โ†’ curl -sfL, curl -s โ†’ curl -sL). The redirect stays on api.github.com, so curl keeps the Authorization header. No behaviour change today: the current URLs return 200 directly.

The other curl calls in apps/review-host already use -L (release tarballs) or hit localhost.

Verification

  • bash -n on both scripts: OK.
  • Against a real renamed repo (zeit/hyper, now vercel/hyper), the exact pipeline from the scripts:
    • without -L: tag_name = '' (empty, the failure above)
    • with -L: tag_name = v3.4.1
    • token-style probe: 301 without -L; with -L it reaches /repositories/62367558/pulls/1 (that repo has no PR #1, so 404, same as calling the new name directly)
  • Against today's repo with -L: desktop-v1.39.0, unchanged.

๐Ÿค– Generated with Claude Code


Summary by cubic

Fixes review-host release and token checks to follow GitHub API redirects so the host keeps updating and validating correctly after a repository rename.

  • Adds -L to the three api.github.com curl calls in check.sh and self-update.sh.
  • Without it, GitHub's 301 to /repositories/<id>/... returns an empty body: self-update.sh silently stops updating, and check.sh reports the release as unverified and the token as broken.
  • Redirects stay on the same host, so the Authorization header is preserved.

Summary by CodeRabbit

  • Bug Fixes
    • Updated release and pull-request checks to handle redirected GitHub requests, improving reliability when retrieving their responses.