Repository navigation
Register discovered package providers again - #255
Conversation
The package manifest's providers were spliced into the provider list as separate strings instead of as one group, so collapse() skipped them and no discovered provider was registered when app.loadDiscoveredPackages is enabled. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configuration
You can disable this status message by setting the Use the checkbox below for a quick retry:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
Walkthrough
Priority: ⬇️ Low Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk: ⚪ Minimal · up to
|
| Check name | Status | Explanation | Resolution |
|---|---|---|---|
| Docstring Coverage | Docstring coverage is 16.67% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 6 functions across 2 files. | Write docstrings for the functions missing them to satisfy the coverage threshold. |
✅ Passed checks (4 passed)
-
Check name Status Explanation Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled. Title check ✅ Passed The title clearly and concisely describes the main change: restoring registration of discovered package providers. Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request. Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
-
🧪 Generate unit tests (beta)
-
- Create a new PR
-
- Autopilot · 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.
Comment @coderabbitai help to get the list of available commands.
|
@coderabbitai review |
✅ Action performedReview finished.
|
The test pointed the facade application at the throwaway app it builds and never put the previous one back, so everything running after it inherited a dead facade root. Restore it in the `finally`, and drop the temp directory with `deleteDirectory()` rather than hand-rolled glob/unlink/rmdir. Restoring it surfaced that this class never boots an app through Testbench, so Testbench's teardown cannot run at all: it resolves `ParallelTesting` and the database config off `$this->app` and threw "A facade root has not been set" on every test in the file when the file was run on its own. An empty `tearDown()` skips it, mirroring what `setUp()` already does.
clearPackageCache() reset PackageManifest::$manifest to [], but Laravel's getManifest() short-circuits on ! is_null(), so the retry in registerConfiguredProviders() never rebuilt the manifest. With app.loadDiscoveredPackages enabled it boots with no discovered providers and swallows the original exception instead of reporting it. Resetting to null, the unbuilt state, fixes both. phpstan flags the assignment because Laravel annotates the untyped $manifest as @var array; corrected in tests/stubs/PackageManifest.stub rather than suppressed. Tests: tests/Foundation/PackageCacheTest.php, three tests, all failing without the fix. Two of them need #255 to run on wip/1.3. Broken since 6eef811 (octobercms/library#492). app.loadDiscoveredPackages defaults to false, so only opt-in installs are affected.
With
app.loadDiscoveredPackagesenabled, no discovered package provider gets registered onwip/1.3.0a6b24e("Laravel 10 changes") dropped the brackets around the manifest's providers inApplication::registerConfiguredProviders():That splices each provider class in as a separate string, between the
Illuminate\group and the other providers.collapse()only flattens arrays and skips anything else, so those strings never reachProviderRepository::load(). Laravel 12 still passes them as one group ([…->providers()]), which is what this restores. The default (loadDiscoveredPackages => false) is unaffected.Applicationwith a discovered provider and checks that it gets registered. It fails without the change.🤖 Generated with Claude Code
Summary by CodeRabbit