Repository navigation
fix(maintenance)!: move warranties off the removed /preview paths and sync spec 2445b573294b - #17
Open
eastagiletracker wants to merge 1 commit into
Conversation
…nc spec 2445b573294b Samsara removed the nine /preview/maintenance/warranties* and /preview/maintenance/warranty-claims operations and republished them, schema-identical, under /maintenance/* (tag Maintenance). The IPreviewApisClient members kept calling the old paths, which now return 404 from the live API. - IMaintenanceClient gains the ten graduated warranty/claim operations, including the new GET /maintenance/warranties/assets. The preview members become [Obsolete] forwarders, so existing callers keep compiling and start working again. - Implement the rest of the drift: vendor writes and list filters, vendor groups, technician shifts, maintenance sites, work-order attachments and shared-asset batch cancellation. - Add the new members on Part, PartInventoryLocation, PurchaseOrder, WorkOrder, ServiceTaskInstance, the work-order requests and Trip; relax UpdateDriverVehicleAssignmentRequest's composite key, which the spec no longer requires. - Refresh the baseline with check-api-sync --update-baseline, the client-tag map with --update-tags, the status block and the docs. All four checkers pass against the refreshed baseline (396/396 ops, 0 mismatched, 0 tag drift, 0 MEDIUM+), and against the live spec. BREAKING CHANGE: ListVendorsAsync inserts two optional filters before cancellationToken, so positional token callers must pass it by name.
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.
This PR proposes moving the warranty methods off the
/preview/maintenance/*paths Samsara removed, and syncing the SDK to spec content2445b573294b(Closes #16). We include this PR work along with a full history of your repo at https://eastagiletracker.com/projects/970. You can sign in with your GitHub ID to claim ownership of the project.What was broken
Samsara deleted the nine warranty operations under
/preview/maintenance/and republished them, schema-identical, under/maintenance/*(tagMaintenance). EveryIPreviewApisClientwarranty method still calls the old paths, so they fail against the live API today. Reproduced onmainat2a3dbe7:(The unauthenticated probe is enough to tell the two apart: the removed route 404s before auth, the live one asks for a token.)
What changed
Following the steps in the issue:
check-api-sync.py --update-baseline(the baseline diff is the reviewable spec change), then everything in its section 2, thencheck-sdk-fabrication.py --update-tags, the status block, the checklist docs and aCHANGELOG.mdentry.IMaintenanceClient, same signatures as before, plus the newListWarrantyAssetAssignmentsAsync. The nineIPreviewApisClientmembers become[Obsolete]forwarders, the same pattern you used forCreateTachographFileUploadAsync. One difference: they delegate toMaintenanceClientinstead of repeating the path, so there is a single implementation and noALLOW_DUPLICATE/ALLOW_TAG_DRIFTentries are needed. The warranty records stay inSamsara.Sdk.Models.Previewso nobody'susingbreaks.explode=true, so they go out as repeated keys), maintenance sites,POST /maintenance/work-orders/attachments, andPOST /fleet/asset-sharing/agreements/assets/cancel/batch(a bare{ requestId, responses }body with per-asset status, read withPostAsync<T>rather than thedataunwrap).Trip.finalDistanceMeters/tripPurpose, the newMaintenanceVendormembers), plusListVendorsAsync's newexternalIds/includeResolvedSettingsfilters soresolvedSettingscan actually be requested.UpdateDriverVehicleAssignmentRequestno longer requiresdriverId/vehicleId/startTime, since the spec now acceptsmetadata.sourceNameinstead. That brings the LOW count back from 7 to 4.Compatibility: existing warranty callers keep compiling and start working again. They see CS0618 instead of the SAMSARA001 opt-in. The one source break is
ListVendorsAsync: the two new filters sit beforecancellationToken, so a caller passing the token positionally has to name it. That is why the commit is marked!.Verification
Before and after, on this tree:
dotnet build -c Releasehas 0 warnings.dotnet test tests/Samsara.Sdk.Tests -c Releasewent from 1341 passed to 1403 passed, with 0 failing before or after. The four checkers from the issue are green against the refreshed baseline: 396/396 ops, 0 mismatched, 0 tag drift, 0 CRITICAL/HIGH/MEDIUM.check-sdk-syncalso passes against the live spec.render-sync-status.py --checkpasses. It was already stale onmain, still showing hashddbd93d89c05.The new contract tests are
WarrantyGraduationContractTests,MaintenanceSpecDriftContractTestsandSpecDriftModelContractTests. They pin the verb, path and query placement of every new call, the request body names, and response binding. The shim test drives all nineIPreviewApisClientmembers and asserts that none of them touch/preview/. To confirm the tests catch the regression, I pointedMaintenanceClient's two warranty path constants back atpreview/...: 9 of the 10 warranty tests went red. The tenth checks the[Obsolete]attributes.Left alone on purpose:
DELETE /placesexternalId,GET /placeshubIds,GET /assets/depreciationqueryByTimeField, andGET /functions-storage/lsprefix/groupByFolder. None of the checkers report them, and surfacingfoldersfromfunctions-storage/lswould changeListStorageFilesAsync's return type, which is your call.[Experimental]on parts, preventive maintenance and preferred stations. Samsara moved those out ofBeta APIs, and the--update-tagsdiff shows that, but whether to drop the opt-in is a policy decision for you.How this was managed
We imported your issues and pull requests into a board and used it to manage this work. This change is tracked as https://eastagiletracker.com/projects/970/stories/1122535 on https://eastagiletracker.com/projects/970.
If you'd rather not receive contributions like this, reply
no-more-prson this pull request and we won't open any further ones on your repositories.Lawrence W. Sinclair
CEO / East Agile
linkedin.com/in/lwsinclair/
eastagile.com