Repository navigation
Conversation
INTER-2457 option C. Event stays a single model; EventEdge is additive for POST /edge.
There was a problem hiding this comment.
Pull request overview
This spike updates the OpenAPI inputs and generated Go SDK surface to support the new Automation Intelligence /edge endpoint while keeping Event as a single flattened struct that can represent both device and edge events (distinguished via source).
Changes:
- Added
/edgePOST endpoint (analyzeRequestForAutomationIntelligence) withEdgeRequestpayload andEventEdgeresponse. - Introduced new generated models (
EdgeRequest,EdgeRequestHeadersInner,EventEdge) and re-exported them from the public package. - Updated
Eventschema/model to include edge-related fields in the flattenedEventstruct (field reordering; JSON tags unchanged), plus doc/link updates.
Reviewed changes
Copilot reviewed 11 out of 18 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| res/fingerprint-server-api-v4.yaml | Adds /edge path + new schemas; updates Event schema/docs and link text |
| internal/openapi/api/openapi.yaml | Generated OpenAPI used for SDK generation; includes /edge + new schemas/docs |
| internal/openapi/api_fingerprint.go | Generated API client adds AnalyzeRequestForAutomationIntelligence request/execute methods |
| internal/openapi/model_event.go | Updates flattened Event struct ordering/fields and serialization mapping |
| internal/openapi/model_event_edge.go | Adds EventEdge model with required fields + (unconstrained) source |
| internal/openapi/model_edge_request*.go | Adds EdgeRequest + header-entry model |
| models.go | Re-exports EdgeRequest, EdgeRequestHeadersInner, EventEdge |
| fingerprint.go | Re-exports APIAnalyzeRequestForAutomationIntelligenceRequest alias |
| README.md / docs/*.md | Adds model docs/links for the new types |
| functional_test/functional_test.go | Extends mock interface for the new API method |
| options_test.go | Extends test stub implementation to satisfy updated FingerprintAPI interface |
| internal/openapi/.openapi-generator/FILES | Registers newly generated files |
| bin/sync.sh | Updates schema sync comment for flattened Event context |
Files not reviewed (6)
- internal/openapi/api_fingerprint.go: Generated file
- internal/openapi/model_edge_request.go: Generated file
- internal/openapi/model_edge_request_headers_inner.go: Generated file
- internal/openapi/model_event.go: Generated file
- internal/openapi/model_event_edge.go: Generated file
- models.go: Generated file
Suppressed comments (3)
internal/openapi/api/openapi.yaml:1533
- In the
EventEdgeexample,event_idandtimestampare shown as empty strings.event_idshould be a non-empty string andtimestampshould be an integer (Unix ms), otherwise the example is invalid and can mislead users.
event_id: ""
timestamp: ""
internal/openapi/api/openapi.yaml:1608
EventEdgerepresents an Automation Intelligence (/edge) event, so the examplesourcevalue should beedge(notdevice).
source: device
res/fingerprint-server-api-v4.yaml:1303
- Typo in the header-forwarding guidance: "with with" is duplicated, which reads incorrectly in generated docs and code comments.
included, but with with their value set to an empty string. This
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
@copilot review |
Reviewed the current state of the branch: |
pnpm exec changesetto create a changeset. |
|
This was a prototype done as part of a spike. Closing now, still usable as a reference during the production implementation. |
SPIKE. Do not merge. Option C: Event stays a struct. Generated from openapi#465. Not the earlier all-SDK union spike (#101), which turned Event into a pointer-pair sum type.
Eventstill hasIdentificationandSource *EventSource.AnalyzeRequestForAutomationIntelligence→*EventEdge. Re-exportsEventEdge,EdgeRequest.bin/sync.shalready usedfingerprint-server-api-v4-normalized.yaml.Known: Event field order
Struct field order follows flattened
EventDevice(Sourcemoved below the VPN block). JSON tags are unchanged. Named composite literals are fine. UnnamedEvent{"id", 123, ...}would fail to compile.