Skip to content

Conversation

@AndreuCodina
Copy link
Owner

No description provided.

Copilot AI review requested due to automatic review settings February 6, 2026 21:28
@coveralls
Copy link
Collaborator

coveralls commented Feb 6, 2026

Coverage Status

coverage: 98.378% (+0.1%) from 98.25%
when pulling 6c168b4 on feature/add-incremental-service-container
into af81bb4 on main.

@AndreuCodina
Copy link
Owner Author

@copilot Try adding tests

Copy link

Copilot AI commented Feb 6, 2026

@AndreuCodina I've opened a new pull request, #46, to work on those changes. Once the pull request is ready, I'll request review from you.

Copy link

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 introduces a new ServiceContainer abstraction to make service registration + resolution more ergonomic (auto-building/auto-initializing a ServiceProvider) and enables incremental descriptor updates after initialization, with corresponding updates across engine internals, tests, docs, and CI.

Changes:

  • Add ServiceContainer with async resolve helpers, scope creation, and override helpers.
  • Make ServiceProvider/CallSiteFactory support incremental descriptor additions via pending descriptors + incremental population.
  • Update docs/quickstart + API reference, and switch GitHub Actions installs to uv sync.

Reviewed changes

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

Show a summary per file
File Description
tests/test_service_provider.py Removes the “must be fully initialized before create_scope” expectation.
tests/test_service_container.py Adds comprehensive tests for ServiceContainer auto-init, incremental adds, overrides.
src/wirio/service_provider_engine_scope.py Ensures root provider initialization when entering a scope.
src/wirio/service_provider.py Adds pending descriptor pipeline + incremental initialization hooks.
src/wirio/service_container.py Introduces ServiceContainer wrapper over ServiceCollection.
src/wirio/service_collection.py Stops caching a built ServiceProvider on the collection itself.
src/wirio/integrations/_fastapi_dependency_injection.py Minor comment update around provider building in lifespan.
src/wirio/exceptions.py Adds ServiceContainerNotBuiltError.
src/wirio/_service_lookup/_call_site_factory.py Supports incremental descriptor population via add_descriptor().
docs/pages/getting-started/quickstart.md Updates quickstart to use ServiceContainer + new usage patterns.
docs/pages/core-concepts/*.md Minor formatting edits; one section now potentially inconsistent with new container approach.
docs/pages/api-reference/service-container.md Adds API reference page for ServiceContainer.
docs/mkdocs.yml Adds ServiceContainer to MkDocs nav.
docs/code/getting_started/quickstart/fastapi_full_code.py Updates example to use ServiceContainer.
.github/workflows/pull_request.yaml Switches dependency install to uv sync --locked --all-extras.
.github/workflows/_test.yaml Switches dependency install steps to uv sync.
Comments suppressed due to low confidence (1)

docs/pages/core-concepts/pluggable-architecture.md:99

  • This section states that Wirio intentionally avoids a “container-class API” and that the provider is sealed/immutable after build_service_provider(). With the introduction of ServiceContainer and incremental descriptor support, this rationale appears outdated and potentially misleading for readers. Consider updating this section to clarify the new ServiceContainer API (and whether late registration is now supported/encouraged) or adjust the claims about immutability/sealing accordingly.
Other libraries embrace a container-class API: we extend a `Container`, override methods, or mutate attributes to register services. That style works, but it comes with trade-offs that Wirio intentionally avoids:

- **Interoperability:** Both approaches technically work across frameworks, but the collection style keeps things primitive (just create an instance and start registering). Container subclasses introduce class-level state, overridden hooks, and metaclass magic that become friction points when we try to share the same container between, say, a CLI bootstrapper and an async worker, or application code and test cases.
- **Composability:** Collection-first helpers (`add_logging`, `add_sqlmodel`, etc.) compose like ordinary functions. Container subclasses tend to accumulate registration logic across inheritance hierarchies, making it harder to cherry-pick modules or share them between apps.
- **Predictability:** Once `build_service_provider()` runs, the provider is sealed. Container-class APIs often allow late mutation or rely on attribute access magic, which can hide ordering bugs.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copilot AI review requested due to automatic review settings February 9, 2026 17:46
Copy link

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


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link

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


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copilot AI review requested due to automatic review settings February 10, 2026 07:03
@AndreuCodina AndreuCodina merged commit 05bfa18 into main Feb 10, 2026
11 checks passed
Copy link

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


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@AndreuCodina AndreuCodina deleted the feature/add-incremental-service-container branch February 10, 2026 07:12
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.

3 participants