PROP-88 - Use Semantic Definition Format (SDF) for Data and Interactions of Things#182
Open
JeffMboya wants to merge 2 commits intoabsmach:mainfrom
Open
PROP-88 - Use Semantic Definition Format (SDF) for Data and Interactions of Things#182JeffMboya wants to merge 2 commits intoabsmach:mainfrom
JeffMboya wants to merge 2 commits intoabsmach:mainfrom
Conversation
Adds pkg/sdf with Document types and PropletDocument builder, wires
GET /proplets/{id}/sdf through the full manager stack (endpoint,
response, transport, service, middleware, mock), and exposes
GetPropletSDF on the SDK interface.
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 type of PR is this?
This is a feature because it adds SDF (Semantic Definition Format) support for describing proplet data and interactions.
What does this do?
Introduces a new
pkg/sdfpackage that implements the Semantic Definition Format (SDF) for describing proplet data and interactions as standardized Thing descriptions.pkg/sdfwithDocumentand affordance types (PropertyAfford,ActionAfford,EventAfford,ObjectAfford,ThingAfford,DataAfford) following the SDF specPropletDocument(p proplet.Proplet) sdf.Documentwhich builds a full SDF Thing description for a proplet, including properties (id,name,alive,task_count,metadata), actions (start_task,stop_task), events (heartbeat,task_result), and data schemas (PropletMetadata,TaskDispatch,HeartbeatPayload,TaskResult)GetPropletSDFthrough the full manager stack: service interface, implementation, endpoint, HTTP transport (GET /proplets/{id}/sdf), logging/metrics/tracing middleware, and mockGetPropletSDF(id string) (sdf.Document, error)on the SDK interfaceWhich issue(s) does this PR fix/relate to?
Have you included tests for your changes?
Yes.
pkg/sdf/proplet_test.gocontains table-driven tests covering:Infofields (title contains proplet ID, non-empty version)sdfProperty,sdfAction,sdfEvent, andsdfDatakeys on thePropletthingTaskResult.stateenum completeness (Completed,Failed,Skipped,Interrupted)Minimumpointer aliasing safety acrossDataAffordfieldsDid you document any new/modified features?
The new
GET /proplets/{id}/sdfendpoint andGetPropletSDFSDK method follow the existing patterns in the codebase. The SDK interface entry includes an inline usage example consistent with all other SDK methods.Notes
The SDF document is returned as a flat JSON object (fields of
sdf.Documentdirectly at the top level), consistent with how other response types embed their domain structs. The shape matches what the SDKGetPropletSDFunmarshals.