feat: orderPriority on infra and dcc-bus services - #58
Conversation
Align redis/microdns/alloy (100/110/130) and dcc-bus (350) with hub OS bands; bump microinit/go for OrderPriority on ServiceDef. Co-authored-by: Cursor <cursoragent@cursor.com>
There was a problem hiding this comment.
This Pull Request effectively introduces OrderPriority to several key infrastructure and dcc-bus services, which is a significant improvement for managing service startup order and dependencies. The dependency update to microinit is appropriate, and the new unit tests for Redis and MicroDNS services correctly validate the OrderPriority settings. This change enhances the robustness and predictability of service initialization.
| github.com/alicebob/miniredis/v2 v2.38.0 | ||
| github.com/coder/websocket v1.8.13 | ||
| github.com/dcc-bigfred/microinit/go v0.5.1-0.20260808173513-340a48672843 | ||
| github.com/dcc-bigfred/microinit/go v0.5.1-0.20260808181038-38c3ddf12a28 |
There was a problem hiding this comment.
✨ [POSITIVE] POSITIVE: The dependency update to github.com/dcc-bigfred/microinit/go is necessary to support the new OrderPriority field in ServiceDef, aligning with the PR's goal.
| RestartPolicy: RestartAlways, | ||
| StartWaitSecs: IntPtr(2), | ||
| ShutdownWaitSecs: IntPtr(10), | ||
| OrderPriority: IntPtr(100), |
There was a problem hiding this comment.
✨ [POSITIVE] POSITIVE: Explicitly setting OrderPriority for the Redis service improves control over service startup order, which is crucial for dependent services.
| RestartBackoff: IntPtr(60), | ||
| StartWaitSecs: IntPtr(1), | ||
| ShutdownWaitSecs: IntPtr(5), | ||
| OrderPriority: IntPtr(110), |
There was a problem hiding this comment.
✨ [POSITIVE] POSITIVE: Assigning an OrderPriority to the MicroDNS service ensures it starts in a predictable sequence, especially if it relies on other foundational services.
| RestartPolicy: RestartOnError, | ||
| StartWaitSecs: IntPtr(2), | ||
| ShutdownWaitSecs: IntPtr(10), | ||
| OrderPriority: IntPtr(130), |
There was a problem hiding this comment.
✨ [POSITIVE] POSITIVE: Setting OrderPriority for the Alloy service is a good practice for managing complex service dependencies and ensuring correct initialization flow.
| if svc.RestartPolicy != RestartAlways { | ||
| t.Fatalf("RestartPolicy = %q, want %q", svc.RestartPolicy, RestartAlways) | ||
| } | ||
| if svc.OrderPriority == nil || *svc.OrderPriority != 100 { |
There was a problem hiding this comment.
✨ [POSITIVE] POSITIVE: Adding an assertion for OrderPriority in the Redis service test ensures that the priority is correctly applied and maintained, improving test coverage and reliability.
| if svc.Labels[LabelCreatedBy] != CreatedByBigfred { | ||
| t.Fatalf("labels: %+v", svc.Labels) | ||
| } | ||
| if svc.OrderPriority == nil || *svc.OrderPriority != 110 { |
There was a problem hiding this comment.
✨ [POSITIVE] POSITIVE: The new assertion for OrderPriority in the MicroDNS service test is valuable for verifying the correct configuration of service startup order.
| RestartPolicy: microinit.RestartOnError, | ||
| StartWaitSecs: microinit.IntPtr(1), | ||
| ShutdownWaitSecs: microinit.IntPtr(35), | ||
| OrderPriority: microinit.IntPtr(350), |
There was a problem hiding this comment.
✨ [POSITIVE] POSITIVE: Setting OrderPriority for the dcc-bus service is a critical improvement, as this service likely has dependencies and its startup order is important for system stability.
Pin github.com/dcc-bigfred/microinit/go to 3d44aec on main. Co-authored-by: Cursor <cursoragent@cursor.com>
There was a problem hiding this comment.
This Pull Request successfully introduces explicit OrderPriority for Redis, microdns, alloy, and dcc-bus services, aligning them with the hub OS services' priority scale. The dependency update to github.com/dcc-bigfred/microinit/go correctly incorporates the OrderPriority field into ServiceDef. The addition of unit tests to assert these priorities is a good practice, ensuring the new configuration is correctly applied and maintained.
| if svc.RestartPolicy != RestartAlways { | ||
| t.Fatalf("RestartPolicy = %q, want %q", svc.RestartPolicy, RestartAlways) | ||
| } | ||
| if svc.OrderPriority == nil || *svc.OrderPriority != 100 { |
There was a problem hiding this comment.
✨ [POSITIVE] POSITIVE: Adding assertions for OrderPriority in the unit tests is a great improvement. It ensures that the newly introduced priority settings are correctly configured and provides confidence in the service definitions.
| if svc.Labels[LabelCreatedBy] != CreatedByBigfred { | ||
| t.Fatalf("labels: %+v", svc.Labels) | ||
| } | ||
| if svc.OrderPriority == nil || *svc.OrderPriority != 110 { |
There was a problem hiding this comment.
✨ [POSITIVE] POSITIVE: This test addition for OrderPriority is valuable, ensuring the microdns service correctly sets its startup priority.
Summary
OrderPriorityon Redis (100), microdns (110), alloy (130), and dcc-bus (350) drop-ins — same scale as hub OS servicesgithub.com/dcc-bigfred/microinit/goto includeOrderPriorityonServiceDefDepends on dcc-bigfred/microinit#11. Related: dcc-bigfred/bigfred-os#24.
Test plan
go test ./pkgs/bigfred/server/microinit/... ./pkgs/bigfred/server/service/infra/*.json/dcc-bus/*.jsonfororderPriorityMade with Cursor