Skip to content

feat: implement backend configuration and lifecycle management#488

Merged
niteshpurohit merged 19 commits intomainfrom
feat/backend-configuration-wiring-and-runtime-backend-bootstrapping
May 5, 2026
Merged

feat: implement backend configuration and lifecycle management#488
niteshpurohit merged 19 commits intomainfrom
feat/backend-configuration-wiring-and-runtime-backend-bootstrapping

Conversation

@niteshpurohit
Copy link
Copy Markdown
Member

  • Added configure_backend method to set backend class and options.
  • Introduced BackendBoot class to manage backend lifecycle hooks.
  • Updated CLI to utilize the configured backend during worker execution.
  • Enhanced tests to validate backend configuration and lifecycle behavior.
  • Updated documentation to reflect changes in backend configuration usage.

closes: #110

- Added `configure_backend` method to set backend class and options.
- Introduced `BackendBoot` class to manage backend lifecycle hooks.
- Updated CLI to utilize the configured backend during worker execution.
- Enhanced tests to validate backend configuration and lifecycle behavior.
- Updated documentation to reflect changes in backend configuration usage.

closes: #110
@niteshpurohit niteshpurohit self-assigned this May 3, 2026
Copilot AI review requested due to automatic review settings May 3, 2026 13:51
Copy link
Copy Markdown

Copilot AI left a 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 wires a new backend-configuration path into Karya’s runtime, adding backend boot/lifecycle handling so the CLI can resolve a configured backend into a queue store and wrap worker execution with backend hooks.

Changes:

  • Add Karya.configure_backend + accessors for backend class/options.
  • Introduce Karya::CLI::BackendBoot to resolve/instantiate backends, build queue stores, and run lifecycle hooks.
  • Update CLI worker boot + specs + docs to use backend configuration.

Reviewed changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
docs/pages/runtime/workers.md Updates worker example to configure a backend instead of a queue store.
docs/pages/getting-started.md Tweaks guidance to mention configuring a backend class at boot.
docs/pages/backends.md Updates “scenario” snippets to show backend selection values.
core/karya/spec/karya/karya_base_spec.rb Adds unit specs for Karya.configure_backend storage/defensive copying.
core/karya/spec/karya/cli_start_spec.rb Extends CLI worker boot specs to validate backend resolution and failure modes.
core/karya/spec/karya/cli_backend_boot_spec.rb Adds lifecycle-hook behavior specs for BackendBoot.run_with_lifecycle.
core/karya/sig/karya/base.rbs Adds signatures for backend configuration methods and state.
core/karya/sig/karya/backend.rbs Introduces _BackendClass interface for backend class typing.
core/karya/sig/karya.rbs Adds backend_option_value alias and extends option typing.
core/karya/lib/karya/cli/backend_boot.rb Implements backend resolution/instantiation and lifecycle wrapping.
core/karya/lib/karya/cli.rb Wires BackendBoot into karya worker execution path.
core/karya/lib/karya/base.rb Implements configure_backend, backend_class, and backend_options.

Comment thread core/karya/sig/karya.rbs Outdated
Comment thread core/karya/lib/karya/cli/backend_boot.rb
Comment thread docs/pages/backends.md
Comment thread docs/pages/backends.md Outdated
Comment thread docs/pages/backends.md
Copy link
Copy Markdown

Copilot AI left a comment

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 12 out of 12 changed files in this pull request and generated 7 comments.

Comment thread core/karya/sig/karya/cli/backend_boot.rbs Outdated
Comment thread core/karya/sig/karya.rbs Outdated
Comment thread core/karya/lib/karya/base.rb
Comment thread core/karya/sig/karya/base.rbs
Comment thread core/karya/lib/karya/cli.rb Outdated
Comment thread core/karya/lib/karya/cli.rb
Comment thread core/karya/lib/karya/cli/backend_boot.rb Outdated
Copy link
Copy Markdown

Copilot AI left a comment

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 12 out of 12 changed files in this pull request and generated 4 comments.

Comment thread core/karya/lib/karya/cli/backend_boot.rb
Comment thread core/karya/lib/karya/cli.rb Outdated
Comment thread core/karya/sig/karya/base.rbs Outdated
Comment thread core/karya/lib/karya/base.rb Outdated
Copy link
Copy Markdown

Copilot AI left a comment

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 15 out of 15 changed files in this pull request and generated 4 comments.

Comment thread core/karya/sig/karya.rbs Outdated
Comment thread core/karya/sig/karya/base.rbs Outdated
Comment thread core/karya/sig/karya/base.rbs
Comment thread core/karya/sig/karya/backend.rbs Outdated
Copy link
Copy Markdown

Copilot AI left a comment

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 15 out of 15 changed files in this pull request and generated 6 comments.

Comment thread core/karya/lib/karya/base.rb
Comment thread core/karya/lib/karya/base.rb
Comment thread core/karya/lib/karya/base.rb Outdated
Comment thread core/karya/lib/karya/base.rb Outdated
Comment thread core/karya/sig/karya/backend.rbs Outdated
Comment thread core/karya/sig/karya.rbs
Copy link
Copy Markdown

Copilot AI left a comment

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 15 out of 15 changed files in this pull request and generated 4 comments.

Comment thread core/karya/lib/karya/base.rb
Comment thread core/karya/lib/karya/base.rb
Comment thread core/karya/sig/karya/cli/backend_boot.rbs Outdated
Comment thread core/karya/sig/karya/backend.rbs Outdated
Copy link
Copy Markdown

Copilot AI left a comment

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 15 out of 15 changed files in this pull request and generated 1 comment.

Comment thread core/karya/lib/karya/base.rb Outdated
Copy link
Copy Markdown

Copilot AI left a comment

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 15 out of 15 changed files in this pull request and generated 2 comments.

Comment thread core/karya/lib/karya/cli.rb Outdated
Comment thread core/karya/sig/karya.rbs
Copy link
Copy Markdown

Copilot AI left a comment

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 16 out of 16 changed files in this pull request and generated 2 comments.

Comment thread core/karya/lib/karya/base.rb Outdated
Comment thread core/karya/sig/karya/backend.rbs Outdated
Copy link
Copy Markdown

Copilot AI left a comment

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 16 out of 16 changed files in this pull request and generated 4 comments.

Comment thread core/karya/sig/karya/backend.rbs Outdated
Comment thread core/karya/sig/karya/backend.rbs Outdated
Comment thread core/karya/sig/karya/base.rbs
Comment thread core/karya/sig/karya.rbs
Copy link
Copy Markdown

Copilot AI left a comment

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 16 out of 16 changed files in this pull request and generated 3 comments.

Comment thread core/karya/lib/karya/base.rb Outdated
Comment thread core/karya/lib/karya/base.rb Outdated
Comment thread core/karya/sig/karya/backend.rbs Outdated
- Added validation to reject queue_store_class when it is an instance of a queue store.
- Updated the error handling to raise InvalidBackendConfigurationError for unsupported values.
- Improved the generic_backend_option? method to ensure queue_store_class is not treated as a callable option.
Copy link
Copy Markdown

Copilot AI left a comment

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 16 out of 16 changed files in this pull request and generated 2 comments.

Comment thread core/karya/sig/karya/backend.rbs Outdated
Comment thread core/karya/sig/karya/base.rbs Outdated
Copy link
Copy Markdown

Copilot AI left a comment

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 16 out of 16 changed files in this pull request and generated 2 comments.

Comment thread core/karya/sig/karya/backend.rbs
Comment thread core/karya/sig/karya/base.rbs
@niteshpurohit niteshpurohit merged commit 40f1331 into main May 5, 2026
26 checks passed
@niteshpurohit niteshpurohit deleted the feat/backend-configuration-wiring-and-runtime-backend-bootstrapping branch May 5, 2026 03:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement backend configuration wiring and runtime backend bootstrapping

2 participants