Skip to content

Add actor stage support and sorting to lifecycle#14

Merged
molon merged 12 commits into
mainfrom
stage
Jan 3, 2026
Merged

Add actor stage support and sorting to lifecycle#14
molon merged 12 commits into
mainfrom
stage

Conversation

@molon

@molon molon commented Jan 3, 2026

Copy link
Copy Markdown
Contributor

Provide context or links (Jira ticket, Slack thread) for both the reviewer and your future self:

  • Jira ticket:
  • Slack thread:

molon added 4 commits January 3, 2026 06:50
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.
Copilot AI review requested due to automatic review settings January 3, 2026 00:19

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 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 Staged interface that actors can implement to specify their execution stage, with lower stages starting first
  • Adds name fields and methods to ReadinessProbe and FuncActor to 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.

Comment thread lifecycle/func.go
Comment thread lifecycle/lifecycle.go
Comment thread lifecycle/readiness.go
Comment thread lifecycle/readiness.go
Comment thread lifecycle/func.go Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread lifecycle/readiness.go
Comment thread lifecycle/lifecycle.go Outdated
Comment thread lifecycle/func.go Outdated
Comment thread lifecycle/lifecycle.go Outdated
Comment thread lifecycle/func.go
molon and others added 4 commits January 3, 2026 08:32
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread lifecycle/func_test.go
Comment thread lifecycle/lifecycle_test.go Outdated
Comment thread lifecycle/readiness.go
Comment thread lifecycle/func.go Outdated
Comment thread lifecycle/func.go
Comment thread lifecycle/func.go Outdated
molon and others added 3 commits January 3, 2026 08:46
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>
@molon molon merged commit b3b3929 into main Jan 3, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants