Repository navigation
Release v2.0.5: App Review types that share a model - #345
Merged
Merged
Conversation
typeOf() returns the first type registered for a model, so a second type on
Company (Fleet-Ops' customer apps, next to Navigator) was always read, changed
and checked as Navigator's.
- accessFor, isEnabledFor, acceptsCode, update and status take an optional
type; left out it is typeOf($subject), so current callers are unchanged
- a type registered for another model never applies (resolveType)
- the Console and OAuth review-access endpoints pass the route's {type}
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #345 +/- ##
===========================================
Coverage 100.00% 100.00%
- Complexity 9964 9971 +7
===========================================
Files 532 532
Lines 30374 30382 +8
===========================================
+ Hits 30374 30382 +8
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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 changed
AppReview::typeOf()returns the first registered type whose model matches. Fleet-Ops registers Navigator onCompany, so a secondCompanytype (Fleet-Ops' new customer-app type,fleetops-customer) was always read, changed and checked as Navigator's.accessFor,isEnabledFor,acceptsCode,updateandstatustake an optional?string $typeas their last argument. Left out, it istypeOf($subject), so current callers behave as before.AppReview::resolveType($subject, $type). A type registered for another model never applies:acceptsCode/isEnabledForanswer false,statusreports no type,updatethrows.Internal/v1/ReviewAccessController(/int/v1/review-access/{type}/{id}) andOAuthServer/ResourceController::reviewAccess(/oauth/v1/review-access/{type}/{id}) pass the route's{type}through.Company, each with its own phone, code and access row, throughAppReview, the Console endpoint and the OAuth endpoint.composer.jsonbumped to 2.0.5. No migration.Review numbers in use on Company
navigator): +1 202 555 0144, Console: Fleet-Ops → Settings → Navigator Appfleetops-customer, in the Fleet-Ops PR): +1 202 555 0145, Console: Fleet-Ops → Settings → Customer AppsMerge order
fleetbase/core-api^2.0.5.Tests
AppReviewTestandOAuthServerEndpointsTestpass (16 tests), and the full Pest suite passes except 3 tests that fail the same way on main (NotificationsAndMailTest×2: Mockery isn't installed locally; oneForeignKeyTargetsUniqueMigrationTestassertion), 2382 passed. PHPStan over all ofsrctimed out locally (600s worker limit); on the three changed files it reports the same 50 findings as main, none new. php-cs-fixer is clean on the changed files.