Release v1.6.62 - #255
Merged
Merged
Release v1.6.62#255
Conversation
Every other resource in the platform is addressed by a prefixed public id; a custom field was addressed by its uuid, so any API handing one out exposed an internal identifier. FleetOps' inspection API is the case in point — a submission names the field each answer belongs to, and had nothing but a uuid to name it with. Existing rows are backfilled, and the column is nullable and indexed rather than unique-and-required so the migration is safe on a table that is already populated. A field created on the fly through setCustomField() is saved quietly, which skips the hook that mints the id, so that path mints its own.
The release branch carried the feature and nothing else: composer.json still read 1.6.61 and RELEASE.md still described v1.6.61's IAM authorization work. release.yml refuses the tag unless both agree with the branch name, and its RELEASE.md check exists precisely to catch the previous release's notes left in place — which is what these were. composer.json is this repository's single source of the version, and RELEASE.md now opens with the version it describes.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #255 +/- ##
===========================================
Coverage 100.00% 100.00%
- Complexity 6750 6765 +15
===========================================
Files 398 398
Lines 22502 22554 +52
===========================================
+ Hits 22502 22554 +52
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:
|
A triage queue needs to exclude snoozed alerts in the query and to say who owns one. `snooze()` kept its wake time inside the `meta` JSON, so a list of open-but-not-snoozed alerts had to load every row and ask each one. Move it to an indexed `snoozed_until` column (reading the old meta value for rows written before it existed), record who snoozed it, add `assigned_to_uuid` for an owner distinct from the acknowledger, and `planned_at` for a time the owner chose to handle it. `acknowledge()` now also moves an open alert to `acknowledged`, which the status column always documented but nothing wrote. New `snoozed()` and `active()` scopes, plus `unsnooze()` and `assignTo()`.
The coverage gate wanted the three one-line members the alert tests never reached: the snoozedBy and assignedTo relations and the assigned_to_name accessor. Assert their foreign keys and the null fallback alongside the existing relationship contracts.
An observer that refuses a write by throwing FleetbaseRequestValidationException had its explanation discarded on two paths. The write was still refused, but the caller saw "Invalid request" or "Error occurred while trying to update a X" instead of the message the observer wrote. Both sites already had a handler for the exception; each was made unreachable by a catch block one frame deeper. updateRecordFromRequest() wrapped every exception from $record->update() in a plain \Exception, so the controller's dedicated catch and the global handler's getErrors() rendering never saw the original. It now rethrows FleetbaseRequestValidationException untouched and keeps wrapping everything else, so database and internal errors still do not leak. bulkDelete() listed catch (\Exception) before its QueryException and FleetbaseRequestValidationException catches, leaving both dead behind a @codeCoverageIgnore block that acknowledged as much. The catches are now ordered most specific first and the ignore block is gone because the branches are reachable and covered. Create and single delete were already correct and are unchanged. Fixes #256
…w-3717b2 Let observer refusals reach the caller on update and bulk delete
Give alerts a real snooze, an owner and a planned time
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.
Release branch for v1.6.62, cut from
mainfor the custom-field public id.What it carries
Give custom fields a public id (#254) — every other resource in the platform is addressed by a prefixed public id; a custom field was addressed by its uuid, so any API handing one out exposed an internal identifier. FleetOps' inspection API was the case in point: a submission names the field each answer belongs to, and had nothing but a uuid to name it with.
CustomFieldtakesHasPublicIdwith$publicIdType = 'custom_field', andpublic_idjoins$fillable.nullable()->index()rather than unique-and-required, following thegroupsprecedent, so it is safe on an already-populated table.HasCustomFields::setCustomField()creates a field withsaveQuietly(), which skips thecreatinghook that mints the id, so that path mints its own — otherwise a field created on the fly would be the only one without one.Scope
CustomFieldis platform-wide, so this gives every custom field a public id — orders, vendors, drivers, not only inspections.withCustomFields()'s public projection emits field names and is unchanged.Downstream
FleetOps #319 emits the public id on a form's fields and on a submission's answers, falling back to the uuid until this lands — so nothing breaks in the interim, and the ids simply start appearing once it does. The collection (fleetbase/postman#62, #63) and the PHP SDK (fleetbase/fleetbase-php#17) already document the public-id form.
Checks
#254 was green before merge: build, Postman contract, and both codecov gates.
vendor/bin/pestran 1434 tests with 0 failures, php-cs-fixer clean, and a newgenerates custom field public idstest covers the minting.