-
Notifications
You must be signed in to change notification settings - Fork 5
feat: new kolide api #448
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: new kolide api #448
Conversation
📝 Changelog previewBelow is a preview of the Changelog that will be added to the next release. Only commit messages that follow the Conventional Commits specification will be included in the Changelog. v1.11.0 - 2025-12-29Full Changelog: v1.10.4...v1.11.0 🚀 Features
🐛 Bug Fixes⚙️ Miscellaneous Changes
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR migrates to the new Kolide API version (2023-05-26), updating data structures and removing "last seen" tracking functionality in favor of Kolide's native issue tracking system.
- Updated Kolide API client to use new API version with string-based IDs instead of int64
- Removed client-side "last seen" issue generation logic, relying on Kolide's native issue tracking
- Changed database linking method from
SetDeviceSeenByKolidetoLinkKolideDevicewithout timestamp tracking
Reviewed changes
Copilot reviewed 23 out of 23 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| pkg/pb/devices.go | Removed UpdateLastSeenIssues method and related constants for client-side last-seen tracking |
| internal/apiserver/kolide/types.go | Renamed types (DeviceFailure→Issue, DeviceOwner→Person) and changed ID fields from int64 to string |
| internal/apiserver/kolide/types_test.go | Updated tests to match new API response format with string IDs and new field names |
| internal/apiserver/kolide/transport.go | Added API version header and renamed MaxHttpRetries to MaxHTTPRetries |
| internal/apiserver/kolide/client.go | Updated API endpoints and renamed functions/variables (baseUrl→baseURL, WithBaseUrl→WithBaseURL) |
| internal/apiserver/kolide/client_test.go | Updated tests to use test data files instead of inline JSON |
| internal/apiserver/kolide/cache.go | Removed entire generic Cache implementation (no longer needed) |
| internal/apiserver/kolide/cache_test.go | Removed tests for deleted Cache |
| internal/apiserver/kolide/fakeclient.go | Updated method signatures to use Issue instead of DeviceFailure |
| internal/apiserver/kolide/testdata/*.json | Added test data files for new API response format |
| internal/apiserver/database/kolide_issues.go | Updated to handle string IDs and new field names, removed last-seen issue generation |
| internal/apiserver/database/device_issues.go | Removed last-seen issue generation logic |
| internal/apiserver/database/database.go | Renamed SetDeviceSeenByKolide to LinkKolideDevice, removed timestamp parameter |
| internal/apiserver/database/interface.go | Updated interface method signatures |
| internal/apiserver/database/mock_database.go | Regenerated mock with updated method signatures |
| internal/apiserver/database/database_test.go | Updated tests to remove LastSeen field and use new method names |
| internal/apiserver/api/device.go | Removed LastSeen field assignment from UpdateAllDevices |
| internal/apiserver/auth/sessionstore_test.go | Removed LastSeen field from test device creation |
| internal/integration_test/integration_test.go | Updated to use new Kolide types and removed LastSeen assignments |
| cmd/apiserver/main.go | Changed from SetDeviceSeenByKolide to LinkKolideDevice |
Comments suppressed due to low confidence (1)
internal/apiserver/database/database.go:122
- Missing required field: the Healthy field is required by the UpdateDevice SQL query but is not set here. This will cause the Healthy field to be set to its zero value (false), potentially marking devices as unhealthy when they shouldn't be. Consider setting Healthy based on whether Kolide is enabled or other relevant criteria.
return db.queries.UpdateDevice(ctx, sqlc.UpdateDeviceParams{
Serial: serial,
Platform: platform,
LastUpdated: sql.NullString{
String: timeToString(time.Now().UTC()),
Valid: true,
},
ExternalID: sql.NullString{
String: externalID,
Valid: externalID != "",
},
})
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
No description provided.