You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This PR elmintes the utils package by moving the functionality to where
it is used. This is more in-line with idiomatic go (no non-descriptive
package names). As part of the elimination we moved to a custom slice
for logs that elminates the majority of the Custom Marshal/Unmarshal
code.
Identified in this change, the metrics emission was no longer wired up
and has been restored to functionality.
Key improvements:
- Introduce LogsSlice type with proper JSON marshaling/unmarshaling
- Implements Stringer interface for consistent log formatting
- Handles newline-delimited string conversion automatically
- Eliminates need for custom PredictionResponse marshal/unmarshal
- Move metrics functionality from dead util/metrics.go to runner.go
- Restore sendRunnerMetric() function that was never called
- Inline HTTPClientWithRetry() using httpclient.ApplyRetryPolicy
- Fix missing imports and undefined references
- Remove util.JoinLogs() dependency by using LogsSlice.String()
- Consolidate logging utilities into appropriate packages
Technical details:
- LogsSlice.String() preserves util.JoinLogs() behavior (joins with \n, ensures trailing \n)
- LogsSlice.MarshalJSON/UnmarshalJSON handles string ↔ []string conversion
- All util package imports removed across codebase
- Metrics sending now properly integrated into runner lifecycle
This eliminates the "terrible util package" while restoring previously
broken metrics functionality and improving type safety for log handling.
0 commit comments