Skip to content

feat: add register_converter API - #354

Merged
hallvictoria merged 4 commits into
devfrom
hallvictoria/register-converter-api
Jul 24, 2026
Merged

feat: add register_converter API#354
hallvictoria merged 4 commits into
devfrom
hallvictoria/register-converter-api

Conversation

@hallvictoria

@hallvictoria hallvictoria commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

The azure-functions-durable v2.x SDK uses the durabletask gRPC programming model, which requires orchestration and entity trigger outputs to be encoded as string datums rather than json. Previously there was no public way to override a registered converter.

This change introduces a minimal, stable public API that allows azure-functions-durable (and only that package) to replace durable-related converters without touching any private internals of azure-functions.

Only 4 binding names are permitted to be overridden: orchestrationTrigger, entityTrigger, activityTrigger, durableClient.

This does not change:

  1. No changes to the cold-start path for non-durable function apps
  2. No changes to existing converter registration behavior
  3. Converter overrides are the responsibility of azure-functions-durable itself

@andystaples

Copy link
Copy Markdown
Contributor

FWIW, this works really well for the Durable scenario and removes the ask for PRs like
#353
#309

@hallvictoria
hallvictoria marked this pull request as ready for review July 24, 2026 17:11

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

Introduces a new public azure.functions.register_converter() API to let integration packages (notably azure-functions-durable) replace converters for a small allow-list of durable-related bindings, without reaching into private internals.

Changes:

  • Add _OVERRIDABLE_BINDINGS allow-list and register_converter() implementation in azure/functions/meta.py.
  • Export register_converter from the azure.functions package surface (__init__.py / __all__).
  • Add unit tests covering allow-list enforcement and overwrite behavior.

Reviewed changes

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

File Description
tests/test_meta.py Adds tests for the new register_converter API (allow-list + overwrite semantics + export surface).
azure/functions/meta.py Implements allow-listed converter registration/override API on top of the binding registry.
azure/functions/init.py Exposes register_converter as part of the public azure.functions API.

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

Comment thread azure/functions/meta.py
Comment thread azure/functions/meta.py Outdated
Comment thread tests/test_meta.py
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@hallvictoria
hallvictoria merged commit 33b1a31 into dev Jul 24, 2026
16 checks passed
@hallvictoria
hallvictoria deleted the hallvictoria/register-converter-api branch July 24, 2026 20:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants