Skip to content

[WIP] poc implementation of extendable services#1

Open
felipemontoya wants to merge 6 commits into
masterfrom
fmo/extensible-services
Open

[WIP] poc implementation of extendable services#1
felipemontoya wants to merge 6 commits into
masterfrom
fmo/extensible-services

Conversation

@felipemontoya

Copy link
Copy Markdown
Member

This is test PR to see the implementation in action internally. It will be closed in favor of a public PR to the upstream repo

Kelketek and others added 3 commits June 10, 2026 10:34
This commit contains no changes, but satisfies the requirements
of the configured GitHub actions to publish a release to PyPi.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Adds a proof-of-concept mechanism for loading XBlock runtime services from installed-package entry points (xblock.service.v1), so runtimes can pick up optional capabilities without hardcoding them in the host application.

Changes:

  • Introduces a ServiceProvider plugin loader (entry-point based) and a Runtime.service() fallback to instantiate provider classes when a runtime service isn’t present.
  • Adds pytest coverage for plugin-provided services, runtime shadowing, and needs/wants behavior.
  • Adds an ADR documenting the motivation and intended resolution order for service discovery.

Reviewed changes

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

File Description
xblock/runtime.py Adds ServiceProvider and runtime fallback that loads service providers from xblock.service.v1.
xblock/test/test_plugin_services.py New tests validating entry-point service loading and interaction with runtime-provided services.
docs/decisions/0001-service-entry-points.rst ADR describing the design rationale and expected behavior of entry-point-provided services.

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

Comment thread xblock/runtime.py Outdated
Comment on lines +56 to +63
@ServiceProvider.register_temp_plugin(
DummyAIService, identifier='ai_extensions', group='xblock.service.v1',
)
def test_runtime_service_shadows_plugin_service():
sentinel = object()
runtime = TestRuntime(services={'ai_extensions': sentinel})
block = make_block(WantsAIBlock, runtime=runtime)
assert block.runtime.service(block, 'ai_extensions') is sentinel
Comment on lines +1 to +3
0001 Plugin-provided runtime services via entry points
######################################################

felipemontoya and others added 2 commits June 10, 2026 17:37
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@felipemontoya felipemontoya force-pushed the fmo/extensible-services branch from 35dbbd5 to ea3e7b0 Compare June 10, 2026 22:38
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.

4 participants