Skip to content

fix: resolve GitHub release asset API URL for private repo bundle downloads#3136

Open
lselvar wants to merge 1 commit into
github:mainfrom
lselvar:fix/private-github-release-bundle-downloads
Open

fix: resolve GitHub release asset API URL for private repo bundle downloads#3136
lselvar wants to merge 1 commit into
github:mainfrom
lselvar:fix/private-github-release-bundle-downloads

Conversation

@lselvar

@lselvar lselvar commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

Summary

Fix — one download path is now covered

_download_remote_manifest (catalog-based bundle manifest download):

  • Resolves browser release URLs to REST API asset URLs before downloading the bundle manifest (YAML or ZIP)
  • Direct REST API asset URLs (api.github.com/repos/.../releases/assets/<id>) are passed through directly with Accept: application/octet-stream
  • The original catalog URL is still used to determine artifact format (.zip vs YAML) since the resolved API URL does not carry the file extension
  • Other URLs: existing behavior unchanged

Implementation

Uses the existing shared resolve_github_release_asset_api_url(download_url, open_url_fn, timeout) function from _github_http.py — the same utility used by the extension, preset, and workflow fixes. No new helpers needed.

Test plan

  • Run the bundler contract test suite:
    UV_NATIVE_TLS=true SSL_CERT_FILE=/opt/homebrew/etc/openssl@3/cert.pem UV_DEFAULT_INDEX=https://pypi.org/simple PYTHONPATH=src uv run --extra test pytest tests/contract/test_bundle_cli.py -v
    Expected: 25 passed (includes 2 new tests)
  • Run full bundler test suite:
    UV_NATIVE_TLS=true SSL_CERT_FILE=/opt/homebrew/etc/openssl@3/cert.pem UV_DEFAULT_INDEX=https://pypi.org/simple PYTHONPATH=src uv run --extra test pytest tests/contract/ tests/unit/ tests/integration/ tests/test_github_http.py
    Expected: all passing
  • Verify specify bundle install <id> works when the catalog's download_url points at a GitHub release asset on a private repo
  • Verify specify bundle info <id> works for the same case

AI disclosure: This PR was developed with Claude Code assistance.

🤖 Generated with Claude Code

…nloads

For private/SSO-protected GitHub repos, browser release download URLs
(https://github.com/<owner>/<repo>/releases/download/<tag>/<asset>)
redirect to an HTML/SSO page instead of delivering the asset, causing
bundle manifest downloads to fail.

Extends the pattern from github#2855 (presets/workflows) to cover the bundle
manifest download path in _download_remote_manifest:

- Resolves browser release URLs to GitHub REST API asset URLs via
  resolve_github_release_asset_api_url before downloading
- Direct REST API asset URLs (api.github.com/repos/.../releases/assets/<id>)
  are passed through directly
- Both cases use Accept: application/octet-stream so the API returns the
  binary payload rather than JSON metadata
- The original catalog URL is used to determine artifact format (.zip vs
  YAML) since the resolved API URL does not carry the file extension

Adds two CLI-level contract tests:
- bundle info resolves browser release URL via GitHub tags API
- bundle info passes direct API asset URL through with octet-stream

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@lselvar lselvar requested a review from mnriem as a code owner June 23, 2026 21:36
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