fix: use Application::addCommand() for Symfony Console 8 - #192
Merged
Conversation
Symfony Console 8 removed the deprecated Application::add() method in favor of addCommand(). This caused a PHP fatal error when generating the release changelog: Call to undefined method Symfony\Component\Console\Application::add() Signed-off-by: John Molakvoæ <skjnldsv@protonmail.com> Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
skjnldsv
force-pushed
the
fix/symfony-console-8-addcommand
branch
2 times, most recently
from
July 23, 2026 17:22
819ddcb to
766fd29
Compare
The Symfony Console 8 breakages (this fix and #191) reached a release run because nothing ever executed changelog/index.php in CI. Dependabot bumps composer deps weekly, so an API-breaking upgrade was invisible until the release workflow ran the tool. Add a PHPUnit suite for the changelog generator plus a GitHub Actions workflow that discovers every composer project in the repo and, on any PR touching PHP or composer files (including dependabot's), installs deps and lints them. It runs 'composer test' only for tools that define a test script, so a future Symfony tool added alongside the changelog generator is covered automatically just by shipping its own tests. changelog tests: - testEntrypointBootstrapsWithoutFatalError runs the real 'php index.php generate:changelog --help', catching removed/renamed Console APIs used in index.php's own bootstrap (e.g. Application::add()). - The remaining tests assert the command class declares cleanly (catching configure()/execute() signature breaks) and that its definition matches configure(). index.php's bootstrap is guarded so requiring the file only declares the command class instead of running the app. Signed-off-by: John Molakvoæ <skjnldsv@protonmail.com> Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
The tool's dependencies were pinned to knplabs/github-api ^2.1 and
cache/redis-adapter ^0.5, both requiring PHP ^5.6 || ^7.0, so composer
install failed on PHP 8.4. The new php-test workflow surfaced this.
- Bump to knplabs/github-api ^3.16 with guzzlehttp/guzzle ^7.13 and
http-interop/http-factory-guzzle, matching the other tools.
- Drop cache/redis-adapter: it was declared but never used by search.php.
- Adapt search.php to the github-api v3 API:
- authenticate() no longer takes Client::AUTH_HTTP_TOKEN; use
AuthMethod::ACCESS_TOKEN.
- Issue::setPerPage() was removed; pass the page size to ResultPager
instead.
- Stop tracking vendor/ (it was committed here unlike every other tool;
.gitignore already ignores it).
Signed-off-by: John Molakvoæ <skjnldsv@protonmail.com>
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
skjnldsv
force-pushed
the
fix/symfony-console-8-addcommand
branch
from
July 23, 2026 17:28
766fd29 to
07481eb
Compare
skjnldsv
enabled auto-merge
July 23, 2026 17:33
skjnldsv
disabled auto-merge
July 23, 2026 17:33
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
changelog/index.phpcalledApplication::add(), removed in Symfony Console 8 in favor ofaddCommand(). Sincecomposer.jsonrequiressymfony/console: ^8.1, release changelog generation crashed:Failing release run: https://github.com/nextcloud-releases/server/actions/runs/30026045919
Why
Second Symfony Console 8 breakage after the dependabot bump (#189); #191 already fixed the
configure()/execute()return types. Both reached a release run because nothing executed the tools in CI, while dependabot bumps composer deps weekly.Commits
Application::addCommand()for Symfony Console 8.php index.php generate:changelog --helpand fails on non-zero exit, catching removed/renamed Console APIs in the bootstrap; others guard theconfigure()/execute()signatures). New.github/workflows/php-test.ymldiscovers every composer project, installs + lints each on any PR touching PHP/composer files (dependabot included), runscomposer testonly where atestscript exists, and ends in a fixed-namephp-test-summarycheck for branch protection. Drop a future Symfony tool in alongside and it's covered automatically.search.phpto the v3 API (AuthMethod::ACCESS_TOKEN,ResultPagerpage size), and stopped tracking its committedvendor/.Testing
CI is green across all tools.