-
Notifications
You must be signed in to change notification settings - Fork 104
Remove legacy namespace #822
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Warning Rate limit exceeded@norkunas has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 20 minutes and 12 seconds before requesting another review. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. 📒 Files selected for processing (1)
WalkthroughThe pull request removes the deprecated Changes
Sequence DiagramsequenceDiagram
autonumber
participant Client
participant HandlesSystem
participant HttpClient
participant VersionFactory
Client->>HandlesSystem: version()
HandlesSystem->>HttpClient: $this->version->show()
HttpClient-->>HandlesSystem: array {commitSha, commitDate, pkgVersion}
HandlesSystem->>VersionFactory: Version::fromArray(array)
VersionFactory-->>HandlesSystem: Version (immutable object)
HandlesSystem-->>Client: Version object
Note over Client: Now uses Version methods:<br/>getCommitSha(), getCommitDate(),<br/>getPkgVersion()
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes
Poem
Pre-merge checks and finishing touches❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
tests/Endpoints/ClientTest.php (1)
202-208: Update namespace fromMeiliSearchtoMeilisearchin three locations to match autoloader configurationThe test expectations are correct, but the code will fail at runtime due to a namespace mismatch. The
src/Contracts/Version.phpfile and its references use the legacyMeiliSearch\Contractsnamespace, which is not exposed by the PSR-4 autoloader (which only definesMeilisearch\\). Update these locations:
src/Contracts/Version.phpline 5: Changenamespace MeiliSearch\Contracts;tonamespace Meilisearch\Contracts;src/Endpoints/Delegates/HandlesSystem.phpline 36: Change return type from\MeiliSearch\Contracts\Versionto\Meilisearch\Contracts\Versionsrc/Endpoints/Delegates/HandlesSystem.phpline 38: Change\MeiliSearch\Contracts\Version::fromArray()to\Meilisearch\Contracts\Version::fromArray()
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (6)
composer.json(0 hunks)src/Contracts/Http.php(1 hunks)src/Contracts/Version.php(1 hunks)src/Endpoints/Delegates/HandlesSystem.php(1 hunks)src/Http/Client.php(5 hunks)tests/Endpoints/ClientTest.php(1 hunks)
💤 Files with no reviewable changes (1)
- composer.json
🧰 Additional context used
🧬 Code graph analysis (4)
src/Http/Client.php (4)
src/Contracts/Http.php (5)
get(16-16)post(24-24)put(32-32)patch(38-38)delete(44-44)src/Endpoints/Tasks.php (1)
get(20-23)src/Endpoints/Keys.php (2)
get(156-161)delete(208-211)src/Endpoints/Indexes.php (1)
delete(147-153)
src/Contracts/Http.php (5)
src/Http/Client.php (5)
get(69-77)post(87-98)put(108-119)patch(121-129)delete(131-139)src/Endpoints/Tasks.php (1)
get(20-23)src/Endpoints/Batches.php (1)
get(13-16)src/Endpoints/Keys.php (2)
get(156-161)delete(208-211)src/Endpoints/Indexes.php (1)
delete(147-153)
src/Endpoints/Delegates/HandlesSystem.php (2)
src/Contracts/Version.php (2)
Version(7-53)fromArray(45-52)src/Contracts/Endpoint.php (1)
show(19-22)
tests/Endpoints/ClientTest.php (1)
src/Contracts/Version.php (2)
getCommitSha(23-26)getPkgVersion(33-36)
🪛 GitHub Actions: Tests
src/Endpoints/Delegates/HandlesSystem.php
[error] 38-38: PHPUnit-related failure: Class 'MeiliSearch\Contracts\Version' not found. (Call stack reference from HandlesSystem.php)
tests/Endpoints/ClientTest.php
[error] 204-204: PHPUnit error: Class 'MeiliSearch\Contracts\Version' not found. (Triggered during test Versions in ClientTest)
🔇 Additional comments (2)
src/Http/Client.php (1)
69-139: Addingmixedreturn types to HTTP methods matches actual behaviour and the Http contractThe explicit
mixedreturn types onget,post,put,patch, anddeletecorrectly document whatexecute()/parseResponse()already return (decoded JSON ornull), and they stay in sync with the updatedMeilisearch\Contracts\Httpinterface. No functional issues stand out here.Given this is a public class and interface, it’s worth confirming that any custom Http implementations (or subclasses) in your ecosystem are updated to match the new signatures.
src/Contracts/Http.php (1)
16-50: Http contract now exposes flexiblemixedresponses; ensure all implementations are updatedChanging
get,post,put,patch, anddeleteto returnmixed(and updatingpost/putparameters) brings the interface in line with the actualClientbehaviour and the variety of response payloads.This is a breaking change for any userland classes implementing
Meilisearch\Contracts\Http, so it would be good to confirm:
- All internal implementations have been updated, and
- The changelog/release notes clearly call out the new method signatures for v2.
092ef2b to
62e3a3a
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #822 +/- ##
==========================================
- Coverage 89.78% 88.32% -1.46%
==========================================
Files 59 78 +19
Lines 1449 1679 +230
==========================================
+ Hits 1301 1483 +182
- Misses 148 196 +48 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
62e3a3a to
eb28e5a
Compare
eb28e5a to
4224268
Compare
Pull Request
Related issue
Fixes #767
What does this PR do?
PR checklist
Please check if your PR fulfills the following requirements:
Summary by CodeRabbit
getCommitSha(),getCommitDate(),getPkgVersion()) instead of an associative array. Update code accessing version endpoint data accordingly.