Conversation
Documented the behavior of WithReadiness regarding stage assignment in FuncActor. Added tests to verify default stage, readiness probe stage, and explicit stage overrides. Introduced a lifecycle test to ensure actors are started in the correct stage order.
There was a problem hiding this comment.
Pull request overview
This PR adds actor staging support to the lifecycle package, enabling controlled execution order of actors during startup. It also enhances readiness probe logging by adding name support.
- Introduces a
Stagedinterface that actors can implement to specify their execution stage, with lower stages starting first - Adds name fields and methods to
ReadinessProbeandFuncActorto improve logging and debugging capabilities - Updates actor tracking mechanism from index-based to pointer-based to correctly handle sorted actors
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| lifecycle/readiness.go | Adds name field with WithName() and GetName() methods for improved probe identification in logs |
| lifecycle/func.go | Implements stage support via WithStage() and GetStage() methods, with math.MaxInt default for actors with readiness probes |
| lifecycle/lifecycle.go | Defines Staged interface, implements sortActorsByStage() sorting function, updates actor tracking to use pointer addresses, and adds enhanced logging with probe names |
| lifecycle/lifecycle_test.go | Adds TestStageOrdering to verify actors start in correct stage order (ascending) |
| lifecycle/func_test.go | Adds TestFuncActor_Stage to verify stage behavior including defaults and overrides |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 5 out of 5 changed files in this pull request and generated 5 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 5 out of 5 changed files in this pull request and generated 6 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Provide context or links (Jira ticket, Slack thread) for both the reviewer and your future self: