Skip to content

Release v2.0.5: App Review types that share a model - #345

Merged
roncodes merged 2 commits into
mainfrom
release/v2.0.5
Nov 24, 2026
Merged

roncodes merged 2 commits into
mainfrom
release/v2.0.5

Conversation

@roncodes

@roncodes roncodes commented Nov 24, 2026 •

Copy link
Copy Markdown
Member

What changed

AppReview::typeOf() returns the first registered type whose model matches. Fleet-Ops registers Navigator on Company, so a second Company type (Fleet-Ops' new customer-app type, fleetops-customer) was always read, changed and checked as Navigator's.

  • accessFor, isEnabledFor, acceptsCode, update and status take an optional ?string $type as their last argument. Left out, it is typeOf($subject), so current callers behave as before.
  • New AppReview::resolveType($subject, $type). A type registered for another model never applies: acceptsCode/isEnabledFor answer false, status reports no type, update throws.
  • Internal/v1/ReviewAccessController (/int/v1/review-access/{type}/{id}) and OAuthServer/ResourceController::reviewAccess (/oauth/v1/review-access/{type}/{id}) pass the route's {type} through.
  • Tests: two types on Company, each with its own phone, code and access row, through AppReview, the Console endpoint and the OAuth endpoint.
  • RELEASE.md and composer.json bumped to 2.0.5. No migration.

Review numbers in use on Company

  • Navigator (navigator): +1 202 555 0144, Console: Fleet-Ops → Settings → Navigator App
  • Customer apps (fleetops-customer, in the Fleet-Ops PR): +1 202 555 0145, Console: Fleet-Ops → Settings → Customer Apps

Merge order

  1. This PR (core-api v2.0.5) first, then tag 2.0.5.
  2. Fleet-Ops v0.7.3 (Release v0.7.3: App Review sign-in for customer apps fleetops#437), which requires fleetbase/core-api ^2.0.5.
  3. A fleetbase monorepo release that bumps both.

Tests

AppReviewTest and OAuthServerEndpointsTest pass (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; one ForeignKeyTargetsUniqueMigrationTest assertion), 2382 passed. PHPStan over all of src timed 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.

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

codecov Bot commented Nov 24, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (970b2f1) to head (c58e500).

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     
Flag Coverage Δ
backend 100.00% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@roncodes
roncodes merged commit 211454d into main Nov 24, 2026
7 checks passed
@roncodes
roncodes deleted the release/v2.0.5 branch November 24, 2026 08:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant