Skip to content

feat: use DLoad to download binaries - #49

Draft
roxblnfk wants to merge 15 commits into
3.xfrom
dload
Draft

roxblnfk wants to merge 15 commits into
3.xfrom
dload

Conversation

@roxblnfk

@roxblnfk roxblnfk commented Oct 9, 2026 •

Copy link
Copy Markdown
Member

What was changed

  • rr get-binary and rr download-protoc-binary keep their options and output, but the download itself (release lookup, asset selection, download, extraction) is done by DLoad (internal/dload). The overwrite prompt and .rr.yaml generation stay in the CLI. rr versions still uses the built-in GitHub client.
  • Requirements: PHP >=8.2, symfony/console / symfony/http-client ^6.4 || ^7 || ^8 (DLoad's minimums).
  • Option mapping: --filter + --stability → rr:<filter>@<stability>; --filter='*' → no constraint + --stability; --os, --arch, --location → --os, --arch, --path; a confirmed overwrite → --force. --refresh is always on, so DLoad's version-registry cache never hides a fresh release. The default filter is the RoadRunner v3 one from feat: support RoadRunner v3 #48 (3.* or the installed metapackage major).
  • A bundled empty resources/dload.xml is passed as --config; otherwise a project's ./dload.xml with an rr action would silently override --filter.
  • RR_GITHUB_API_URL keeps its meaning from feat: read the GitHub API URL from RR_GITHUB_API_URL #65 (the full API URL). https://api.github.com changes nothing; a GitHub Enterprise URL scheme://host[:port]/api/v3 becomes a temporary config that re-declares the rr and protoc-gen-php-grpc entries with <repository server="scheme://host[:port]"> (feat(repository): support self-hosted servers via the server attribute php-internal/dload#148). Any other path is rejected: DLoad always serves a server's API at {server}/api/v3.
  • Tokens: GITHUB_TOKEN is honoured for the public GitHub only; DLoad never sends it to another host. A GitHub Enterprise token goes into DLOAD_TOKEN_<HOST> (e.g. DLOAD_TOKEN_GHE_EXAMPLE_COM).

Why?

One downloader for the RoadRunner ecosystem instead of a second copy of release lookup and archive handling in the CLI.

Review notes

Checklist

  • Tested
    • Tested manually on Windows: get-binary default, -f '3.*' -s beta → 3.0.0, -f '9.*' → fails with exit 1, existing binary → prompt/skip; download-protoc-binary -f 2025.1 → 2025.1.0
    • Unit tests added
    • Acceptance tests pass locally on Windows with outbound HTTPS blocked, so none reaches api.github.com
  • Documentation

@coderabbitai

coderabbitai Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

- Require spiral/roadrunner-worker ^3.7 (RoadRunner v3).
- Sort releases so that 3.x is newer than the calendar 2023.x-2025.x
  releases (they sort between 2.x and 3.x). Pre-releases now sort below
  their stable release.
- Take the default --filter constraint from the installed
  spiral/roadrunner metapackage ("3.*", "2025.*", ...) and fall back to
  "3.*" instead of the spiral/roadrunner-worker major.
- Generate the AMQP section in the v3 named-connection format.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
github-actions and others added 2 commits October 9, 2026 18:16
get-binary and download-protoc-binary keep their options but delegate the
download to DLoad (internal/dload): release lookup, asset selection
(including libc detection), download and extraction. The overwrite prompt
and .rr.yaml generation stay in the CLI. The versions command still uses
the built-in GitHub client.

- Require internal/dload ^1.18, PHP >=8.2, symfony/console and
  symfony/http-client ^6.4.
- --filter and --stability are passed as a DLoad constraint
  ("3.*@beta"); "*" means no constraint.
- An empty bundled dload.xml keeps a project's ./dload.xml from
  overriding the requested version.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The commands now download through DLoad, so the tests replace DLoad's `get` command with a spy that accepts its input definition instead of serving releases from an in-memory repository. The commands take the downloader as an optional constructor argument for that. The pre-release ordering test is no longer skipped: the RoadRunner v3 release ordering fixed it.

Assisted-By: Claude Opus 5.5 <noreply@anthropic.com>
Assisted-By: Claude Opus 5.5 <noreply@anthropic.com>
@roxblnfk

roxblnfk commented Oct 9, 2026

Copy link
Copy Markdown
Member Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Oct 9, 2026 •

Copy link
Copy Markdown
⚠️ Action not completed

Review rate limited.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

# Conflicts:
#	psalm-baseline.xml
#	src/DownloadProtocBinaryCommand.php
#	src/GetBinaryCommand.php
@roxblnfk

roxblnfk commented Oct 9, 2026

Copy link
Copy Markdown
Member Author

Blocked by php-internal/dload#143: the rr get acceptance tests (#66) point rr at a local fake GitHub through RR_GITHUB_API_URL, and on this branch that address reaches DLoad as <repository host="…">, which DLoad does not support yet. Until it does, the acceptance tests here are expected to fail.

With the variable set, DLoad gets a temporary config that redefines the rr and protoc-gen-php-grpc entries of its registry with the `host` of that URL, port included. DLoad takes a bare host name there, so the scheme and the path are dropped. DLoad does not support the attribute yet (php-internal/dload#143), so until it does the variable has no effect on downloads.

Assisted-By: Claude Opus 5.5
Takes the roadrunner/cli name, metadata and dependencies from 2.x and drops spiral/roadrunner-worker, which 2.x replaced with roadrunner/worker.

Assisted-By: Claude Opus 5.5 <noreply@anthropic.com>
Assisted-By: Claude Opus 5.5 <noreply@anthropic.com>
Assisted-By: Claude Opus 5.5 <noreply@anthropic.com>
feat: map RR_GITHUB_API_URL to a GitHub Enterprise Server for DLoad

DLoad takes a bare `scheme://host[:port]` server and serves its API at `{server}/api/v3`, so RR_GITHUB_API_URL keeps its meaning of a full API URL and must be either https://api.github.com or end with /api/v3; any other path is rejected instead of silently going elsewhere. GITHUB_TOKEN no longer reaches such a server: DLoad reads its token from DLOAD_TOKEN_<HOST>.

The DLoad branch is required until DLoad 1.19.0 is released.

Assisted-By: Claude Opus 5.5 <noreply@anthropic.com>
The fake serves the API under /api/v3 and plays one scenario per server, since DLoad's server can not carry a path. Two DLoad bugs are skipped: an exact pre-release filter matches nothing, and a .deb asset is picked instead of falling back to an older release.

Assisted-By: Claude Opus 5.5 <noreply@anthropic.com>
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