Repository navigation
Conversation
|
Important Review skippedToo many files! This PR contains 123 files, which is 23 over the limit of 100. To get a review, reduce the PR to 100 files or fewer by splitting it into smaller PRs or changing its base branch. Upgrade to a paid plan to raise the limit. This review couldn't start because sufficient usage credits or metered capacity aren't available. Add credits or update usage-based reviews in the billing tab, then retry. ⚙️ Run configuration
📒 Files selected for processing (123)
You can disable this status message by setting the
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. Comment |
241d99f to
07e35af
Compare
|
@coderabbitai review |
|
|
Blocked by php-internal/dload#143: the |
`get-binary` and `download-protoc-binary` keep their options and output, but release lookup, asset selection, download and extraction are done by DLoad (`internal/dload` ^1.19.0); the overwrite prompt and `.rr.yaml` generation stay in the CLI. `--filter` and `--stability` become a DLoad constraint, and `--refresh` is always on so the version cache never hides a fresh release. An empty bundled `resources/dload.xml`, shipped in the dist archive, is passed as `--config`, so a project's `./dload.xml` can not override the requested version. `RR_GITHUB_API_URL` keeps its meaning: a GitHub Enterprise Server API URL `scheme://host[:port]/api/v3` becomes a temporary config that points the `rr` and `protoc-gen-php-grpc` entries at `scheme://host[:port]/roadrunner-server/roadrunner`. `GITHUB_TOKEN` goes only to the public GitHub, as DLoad does. A kept binary now exits with 1, and an unknown `--os` or `--arch` fails before any request. The acceptance tests run `rr get` against a fake GitHub Enterprise Server. BREAKING CHANGE: for `get-binary` and `download-protoc-binary`, `RR_GITHUB_API_URL` must be `https://api.github.com` or end with `/api/v3`, and the token for a GitHub Enterprise Server is read from `DLOAD_TOKEN_<HOST>` (e.g. `DLOAD_TOKEN_GHE_EXAMPLE_COM`) instead of `GITHUB_TOKEN`. `symfony/console` and `symfony/http-client` 6.4 or newer are required. Assisted-By: Claude Opus 5.5 <noreply@anthropic.com>
RoadRunner went from calendar releases back to 3.x and DLoad orders versions numerically, so `-f '*'` installed 2025.1.x for both `get-binary` and `download-protoc-binary`, which share the release stream. `*` and an empty filter now mean `^3.0` with the requested stability; `2025.*` still selects the calendar releases. Assisted-By: Claude Opus 5.5 <noreply@anthropic.com>
The tests pin the output of `rr versions` before its GitHub client is replaced. Assisted-By: Claude Opus 5.5 <noreply@anthropic.com>
DLoad downloads and unpacks the binaries, so only `rr versions` still reads the GitHub releases. It now uses a small internal client that lists release names and asset file names, and passes `--filter` to composer/semver as a whole, so `||` alternatives work. A release whose tag and name are not versions is named `dev-<tag>` instead of `d-<tag>`. BREAKING CHANGE: the `Spiral\RoadRunner\Console\Archive` and `Spiral\RoadRunner\Console\Repository` namespaces are removed, `Version1\StaticRepository` included. `Command::getRepository()` and `Command::confirm()` are removed, and `VersionFilterOption::find()` and `VersionFilterOption::choices()` with them. `VersionsCommand` is final. Assisted-By: Claude Opus 5.5 <noreply@anthropic.com>
Only the console commands and the platform constants are meant for other code: the Temporal SDK reads `Environment\OperatingSystem` and `Environment\Architecture`. Everything else is marked `@internal` and lives under `Spiral\RoadRunner\Console\Internal`, so it can change in a minor release. BREAKING CHANGE: the `Command`, `Configuration` and `Downloader` namespaces move to `Spiral\RoadRunner\Console\Internal\Option`, `Internal\Configuration` and `Internal\Downloader`, and `Environment\Stability`, `Environment\RoadRunnerVersion` and `Environment\Environment` to `Internal\Environment`; all of them are internal now. The abstract `Spiral\RoadRunner\Console\Command`, `Command\OptionInterface`, `Environment\Enum` and both `Environment\*\Factory` classes are removed: the commands extend the Symfony command directly. The commands and `Configuration\Generator` are final. `Environment\Environment::get()` takes only the variable name, `OperatingSystem::createFromGlobals()` takes no arguments, `Stability::all()` returns a list, and `RoadRunnerVersion::PACKAGE_NAME` and `DEFAULT_CONSTRAINT` are private. Assisted-By: Claude Opus 5.5 <noreply@anthropic.com>
build: drop the spiral/tokenizer and ext-json requirements Scanning the `Section` directory with spiral/tokenizer on every `make-config` run found the same fixed set of classes; `PluginsTest` still checks that every section is listed. JSON is always enabled since PHP 8.0. Assisted-By: Claude Opus 5.5 <noreply@anthropic.com>
`get-binary` printed the error and then wrote the undefined result to `.rr.yaml`; `make-config` already stopped there. Assisted-By: Claude Opus 5.5 <noreply@anthropic.com>
`versions` sent `GITHUB_TOKEN` to whatever `RR_GITHUB_API_URL` named, while `get-binary` keeps it on the public GitHub. Now both follow DLoad's rules: the public GitHub gets `DLOAD_TOKEN_GITHUB_COM` or `GITHUB_TOKEN`, another server only its own `DLOAD_TOKEN_<HOST>`, and plain HTTP carries a token only to a loopback host. DLoad keeps these rules in internal classes, so they are repeated in `Internal\GitHub\Token`. Symfony HttpClient already drops the `Authorization` header on a redirect to another scheme, host or port; an acceptance test pins that. Assisted-By: Claude Opus 5.5 <noreply@anthropic.com>
The commands are used only by `bin/rr`, which psalm does not analyse, so they are marked `@psalm-api`. Assisted-By: Claude Opus 5.5 <noreply@anthropic.com>
DLoad orders versions numerically, so the calendar releases (2025.x) rank above 3.x, and a filter without an upper bound, like `>=3.0` or `!=3.1.0`, installed 2025.1.x while `rr versions` lists 3.x first. Each `||` alternative without an upper bound now gets `<2000`, unless its lower bound is a calendar version, and `*` means `>=3.0 <2000`, so a future 4.x is included. The calendar releases are installed only when named, like `2025.*` or `>=2025`. Assisted-By: Claude Opus 5.5 <noreply@anthropic.com>
DLoad picks the libc itself, so an explicit `--os=linux` on Alpine now installs the musl build, and `--os=unknown-musl` still forces it from any host. The registry location and `vendor/bin/dload` are new to users of the CLI. Assisted-By: Claude Opus 5.5 <noreply@anthropic.com>
Assisted-By: Claude Opus 5.5 <noreply@anthropic.com>
What was changed
rr get-binaryandrr download-protoc-binarykeep their options and their meaning, but the download itself (release lookup, asset selection, download, extraction) is done by DLoad (internal/dload), so the download progress and download errors are printed in DLoad's format. The environment summary, the overwrite prompt and.rr.yamlgeneration stay in the CLI.rr versionskeeps its output and uses a small internal GitHub client that lists release names and asset file names.symfony/console^6.4 || ^7.0 || ^8.0,symfony/http-client^6.4.17 || ^7.2 || ^8.0; PHP stays>=8.2.spiral/tokenizerandext-jsonare no longer required.--filter+--stability→rr:<filter>@<stability>, where every||alternative without an upper bound gets<2000unless its lower bound is a calendar version (>=3.0→>=3.0 <2000);--filter='*'(or empty) →rr:>=3.0 <2000@<stability>;--os,--arch,--location→--os,--arch,--path;--forceis always passed, since the CLI asks about an existing binary itself.--refreshis always on, so DLoad's version registry (kept in the user cache, see README) 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).resources/dload.xmlis passed as--config; otherwise a project's./dload.xmlwith anrraction would silently override--filter. The file is now part of the dist archive.RR_GITHUB_API_URLkeeps its meaning from feat: read the GitHub API URL from RR_GITHUB_API_URL #65 (the full API URL).https://api.github.comchanges nothing; a GitHub Enterprise URLscheme://host[:port]/api/v3becomes a temporary config that re-declares therrandprotoc-gen-php-grpcentries with<repository uri="scheme://host[:port]/roadrunner-server/roadrunner">. Any other path is rejected: DLoad always serves a self-hosted API atscheme://host[:port]/api/v3.versionsrepeats them inInternal\GitHub\Token): the public GitHub getsDLOAD_TOKEN_GITHUB_COM, elseGITHUB_TOKEN; any other server only its ownDLOAD_TOKEN_<HOST>(e.g.DLOAD_TOKEN_GHE_EXAMPLE_COM;-is encoded as__, a port follows___), soGITHUB_TOKENnever leaves the public GitHub. Plainhttpcarries a token only to a loopback host, and a redirect to another host drops it.versionspasses--filterto composer/semver as a whole, so||alternatives work; a release whose tag is not a version is nameddev-<tag>.get-binaryno longer writes an empty.rr.yamlwhen the configuration cannot be generated.get-binaryanddownload-protoc-binarynow install the musl build by default and with an explicit--os=linux(see Review notes).vendor/bin/dload, and the version registry is written to~/.cache/dload($XDG_CACHE_HOME/dload,%LOCALAPPDATA%\dload\cacheon Windows;DLOAD_CACHE_DIRmoves it,DLOAD_CACHE_TTL=0turns it off).Breaking changes (PHP API only, the console commands are unchanged)
ArchiveandRepositorynamespaces (Version1\StaticRepositoryincluded), the abstractSpiral\RoadRunner\Console\CommandwithgetRepository(),Command\OptionInterface,Environment\Enum, bothEnvironment\*\Factoryclasses.Spiral\RoadRunner\Console\Internal\…and marked@internal: the options (Command\*→Internal\Option),Configuration\*,Downloader\DLoadDownloader,Environment\Stability,Environment\RoadRunnerVersion,Environment\Environment.final) andEnvironment\OperatingSystem/Environment\Architecture(used by the Temporal SDK).OperatingSystem::createFromGlobals()takes no arguments.Why?
One downloader for the RoadRunner ecosystem instead of a second copy of release lookup and archive handling in the CLI, and a minimal public surface for 3.0.0.
Review notes
^1.19.0. Self-hosted servers come from feat(repository): support self-hosted servers via repository URLs php-internal/dload#148. 1.19.0 is not on Packagist yet (release PR chore(1.x): release 1.19.0 php-internal/dload#144), so withminimum-stability: devComposer resolves1.x-devuntil the release.php -S, API under/api/v3, one server per scenario since a server in a DLoad repository URL has no path). DLoad matches an exact pre-release (-f 3.5.0-beta.1), skips.debpackages and falls back to an older release with an archive, and sorts-rcabove-beta.--stability=rcstill prints the CLI's "Possibly invalid stability" warning, but DLoad reads it as RC (--stability=rc is treated as dev #67). DLoad requests the first release page twice when a server ignoresper_page(GitHub and GHE honour it), sofollowsPaginationcompares unique pages.<2000. DLoad orders versions numerically, so calendar releases rank above 3.x and any filter without an upper bound (*,>=3.0,!=3.1.0) would install2025.1.x(rrandprotoc-gen-php-grpcshare the release stream), whilerr versionslists 3.x first.get-binaryanddownload-protoc-binarycap such filters below 2000 per||alternative, since DLoad has no parentheses; calendar releases are installed only when named (2025.*,>=2025). A filter that names both lines, like3.* || 2025.*, still installs the numerically highest, 2025.x.Internal\DLoad\Command\Get, is@internal. The integration runs thegetcommand in-process (suppressedInternalClass).Libc::create()):--os=unknown-musl(oralpine) forces the musl build from any host — checked on the fake from Windows, it downloads…-unknown-musl-amd64.tar.gz; for--os=linuxDLoad detects the host libc by/lib/ld-musl-*.so.1. Behaviour change: on Alpine--os=linux, explicit or the default (PHP_OSisLinuxthere, socreateFromGlobals()returnslinux), now installs the musl build, where the old-linux-asset filter gave the glibc one. A glibc build can no longer be forced on a musl host.Checklist
get-binarydefault,-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.0versions -s beta,get-binary,download-protoc-binary,make-config -p http,getwith a kept binary → exit 1rr versionsincluded