René's URL Explorer Experiment


Title: history_export: resolve activity dependencies per invocation (retire process-global bind_context) by andystaples · Pull Request #210 · microsoft/durabletask-python · GitHub

Open Graph Title: history_export: resolve activity dependencies per invocation (retire process-global bind_context) by andystaples · Pull Request #210 · microsoft/durabletask-python

X Title: history_export: resolve activity dependencies per invocation (retire process-global bind_context) by andystaples · Pull Request #210 · microsoft/durabletask-python

Description: Summary Fixes #182. The history-export activities previously resolved their runtime dependencies (a durabletask client and a HistoryWriter) from a module-global _context installed once via bind_context(HistoryExportContext(...)). That "activities run in-process within the worker that registered them" assumption holds for a standalone worker but breaks in host-driven, multi-process models such as Azure Functions, where the process that starts an export job is often not the worker process that runs an export activity — so _require_context() raised. This PR retires the process-global and moves the core extension to a per-invocation resolver / factory pattern, so any hosting model can supply the dependencies lazily at execution time. Core changes (durabletask.extensions.history_export) Added HistoryExportContextResolver (a Callable[[], HistoryExportContext]) plus the pure activity bodies run_list_terminal_instances(context, input) and run_export_instance_history(context, input) that take the resolved context explicitly. Added build_activities(resolver) — a factory returning the two worker-registrable activity callables (with the canonical activity names) that invoke resolver() once per activity execution. Changed register(worker, resolver) to register resolver-bound activities. Removed bind_context(), clear_context(), _require_context(), and the module-global context. ExportHistoryClient.register_worker() now captures a HistoryExportContext in the activity closures — no process-global is installed. Azure Functions adapter Dropped the bind_context shim (_ensure_context_bound). The client-bound wrappers now build a HistoryExportContext from the per-invocation injected durable client (cached once per process) and call the core run_* bodies explicitly — fitting the single core pattern instead of layering Functions-specific plumbing on top of bind_context. Breaking change bind_context() / clear_context() (exported in v1.8.0) are removed. Most callers use ExportHistoryClient.register_worker() and are unaffected. Code that called bind_context(HistoryExportContext(client, writer)) directly should register with durabletask.extensions.history_export.activities.register(worker, lambda: HistoryExportContext(client, writer)) (or a lazier resolver). Documented in CHANGELOG.md. Validation flake8: clean on all changed files. pyright (strict, repo config): 0 errors on the changed source, the full history_export package, and the example. Core history_export tests: 76 passed. azure-functions-durable unit suite: 203 passed (incl. the history-export compat tests). Smoke-tested DFApp.configure_history_export(...) wiring end to end.

Open Graph Description: Summary Fixes #182. The history-export activities previously resolved their runtime dependencies (a durabletask client and a HistoryWriter) from a module-global _context installed once via bind_con...

X Description: Summary Fixes #182. The history-export activities previously resolved their runtime dependencies (a durabletask client and a HistoryWriter) from a module-global _context installed once via bind_con...

Opengraph URL: https://github.com/microsoft/durabletask-python/pull/210

X: @github

direct link

Domain: github.com

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:9746d96c-535b-cc71-6ca5-8afa01a6b553
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-id9FAE:36C697:172126:1DD8C5:6AFE44BB
html-safe-nonce597ccfd01e673f6db41d3e582870d5929e63fe422cf76db7ba89caeab9d36bcc
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5RkFFOjM2QzY5NzoxNzIxMjY6MUREOEM1OjZBRkU0NEJCIiwidmlzaXRvcl9pZCI6Ijg5NzE2MjU2NTczMzA5NzU5MzEiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmacae23487fee25e2b8cdb9372abdd0ccb8c2cecf29890227e1cd093a2037c8563d
hovercard-subject-tagpull_request:4144523892
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/microsoft/durabletask-python/pull/210/files
twitter:imagehttps://avatars.githubusercontent.com/u/77818326?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/77818326?s=400&v=4
og:image:altSummary Fixes #182. The history-export activities previously resolved their runtime dependencies (a durabletask client and a HistoryWriter) from a module-global _context installed once via bind_con...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
Nonef1a5901e2377b0af2a0b303f9528678f1475d04b9219dca1e993344196eaa07c
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/microsoft/durabletask-python git https://github.com/microsoft/durabletask-python.git
octolytics-dimension-user_id6154722
octolytics-dimension-user_loginmicrosoft
octolytics-dimension-repository_id627664515
octolytics-dimension-repository_nwomicrosoft/durabletask-python
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id627664515
octolytics-dimension-repository_network_root_nwomicrosoft/durabletask-python
turbo-body-classeslogged-out env-production page-responsive full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
releasece393ea11ad276623b946bc9663d3e7d6f564275
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/microsoft/durabletask-python/pull/210/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmicrosoft%2Fdurabletask-python%2Fpull%2F210%2Ffiles
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmicrosoft%2Fdurabletask-python%2Fpull%2F210%2Ffiles
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=microsoft%2Fdurabletask-python
Reloadhttps://github.com/microsoft/durabletask-python/pull/210/files
Reloadhttps://github.com/microsoft/durabletask-python/pull/210/files
Reloadhttps://github.com/microsoft/durabletask-python/pull/210/files
microsofthttps://github.com/microsoft
durabletask-pythonhttps://github.com/microsoft/durabletask-python
Codehttps://github.com/microsoft/durabletask-python
Issues15 (15)https://github.com/microsoft/durabletask-python/issues
Pull requests12 (12)https://github.com/microsoft/durabletask-python/pulls
Actionshttps://github.com/microsoft/durabletask-python/actions
Projectshttps://github.com/microsoft/durabletask-python/projects
Security and qualityhttps://github.com/microsoft/durabletask-python/security
Insightshttps://github.com/microsoft/durabletask-python/insights
Sign up for GitHub https://github.com/signup?return_to=%2Fmicrosoft%2Fdurabletask-python%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2Fmicrosoft%2Fdurabletask-python%2Fissues%2Fnew%2Fchoose
Bernd Verst (berndverst)https://github.com/berndverst
mainhttps://github.com/microsoft/durabletask-python/tree/main
andystaples-history-export-per-invocation-depshttps://github.com/microsoft/durabletask-python/tree/andystaples-history-export-per-invocation-deps
Conversation 2 https://github.com/microsoft/durabletask-python/pull/210
Commits 1 https://github.com/microsoft/durabletask-python/pull/210/commits
Checks 24 https://github.com/microsoft/durabletask-python/pull/210/checks
Files changed https://github.com/microsoft/durabletask-python/pull/210/files
Please reload this pagehttps://github.com/microsoft/durabletask-python/pull/210/files
history_export: resolve activity dependencies per invocation (retire process-global bind_context) https://github.com/microsoft/durabletask-python/pull/210/files#top
Show all changes 1 commit https://github.com/microsoft/durabletask-python/pull/210/files
2bd9af5 history_export: resolve activity dependencies per invocation andystaples Jul 27, 2026 https://github.com/microsoft/durabletask-python/pull/210/commits/2bd9af57c4df0eaf144406ce95964d3079c1a227
Clear filters https://github.com/microsoft/durabletask-python/pull/210/files
Please reload this pagehttps://github.com/microsoft/durabletask-python/pull/210/files
Please reload this pagehttps://github.com/microsoft/durabletask-python/pull/210/files
CHANGELOG.md https://github.com/microsoft/durabletask-python/pull/210/files#diff-06572a96a58dc510037d5efa622f9bec8519bc1beab13c9f251e97e657a9d4ed
history_export_compat.py https://github.com/microsoft/durabletask-python/pull/210/files#diff-9f60c8b9b2d230340b3c34d48444ff8a6cd4e3900125fdc33af6957fbf6513ad
__init__.py https://github.com/microsoft/durabletask-python/pull/210/files#diff-051600ba2467389dd1aa686c093fc551a36dcba46277a47e4f1299d1bd772e56
activities.py https://github.com/microsoft/durabletask-python/pull/210/files#diff-1d1f2807047150ca1b99919150dfc5e8ceaf05cc805e6f8d7d4ac74a0147886d
client.py https://github.com/microsoft/durabletask-python/pull/210/files#diff-c7cf351d1ab973671599aab1ec8593c7c638013dcae3df242ba36fb1d5202407
history_export_routes.py https://github.com/microsoft/durabletask-python/pull/210/files#diff-61a01edba32277cbeb8fcf8beb14826de10e27f993872ed15f6aa67f4e77e87a
test_history_export_compat.py https://github.com/microsoft/durabletask-python/pull/210/files#diff-233401409e9ef9f918ca8606dee981f056bb36682ef48ef7bffd630c8876cd12
_test_helpers.py https://github.com/microsoft/durabletask-python/pull/210/files#diff-1ba2b1a452482a1579447f6eae0b13c49c03e9b777ba9b7db93e80dc78963db5
test_activities.py https://github.com/microsoft/durabletask-python/pull/210/files#diff-4105561a5f60c416a9992cb3eeab6ed114523a259cc77dd5a20b3a41432f3628
test_client.py https://github.com/microsoft/durabletask-python/pull/210/files#diff-cd446e1caf263e79a82027c02bf0fb539d960d1c9c9076f386594a0129bf663b
test_orchestrator.py https://github.com/microsoft/durabletask-python/pull/210/files#diff-33172e16bd6e0b28485e5e2c8f4c234c5ba0cdcacd396f423ca5949a642636bd
CHANGELOG.mdhttps://github.com/microsoft/durabletask-python/pull/210/files#diff-06572a96a58dc510037d5efa622f9bec8519bc1beab13c9f251e97e657a9d4ed
View file https://github.com/microsoft/durabletask-python/blob/2bd9af57c4df0eaf144406ce95964d3079c1a227/CHANGELOG.md
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/microsoft/durabletask-python/pull/210/{{ revealButtonHref }}
https://github.com/microsoft/durabletask-python/pull/210/files#diff-06572a96a58dc510037d5efa622f9bec8519bc1beab13c9f251e97e657a9d4ed
https://github.com/microsoft/durabletask-python/pull/210/files#diff-06572a96a58dc510037d5efa622f9bec8519bc1beab13c9f251e97e657a9d4ed
azure-functions-durable/azure/durable_functions/internal/history_export_compat.pyhttps://github.com/microsoft/durabletask-python/pull/210/files#diff-9f60c8b9b2d230340b3c34d48444ff8a6cd4e3900125fdc33af6957fbf6513ad
View file https://github.com/microsoft/durabletask-python/blob/2bd9af57c4df0eaf144406ce95964d3079c1a227/azure-functions-durable/azure/durable_functions/internal/history_export_compat.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/microsoft/durabletask-python/pull/210/{{ revealButtonHref }}
https://github.com/microsoft/durabletask-python/pull/210/files#diff-9f60c8b9b2d230340b3c34d48444ff8a6cd4e3900125fdc33af6957fbf6513ad
https://github.com/microsoft/durabletask-python/pull/210/files#diff-9f60c8b9b2d230340b3c34d48444ff8a6cd4e3900125fdc33af6957fbf6513ad
https://github.com/microsoft/durabletask-python/pull/210/files#diff-9f60c8b9b2d230340b3c34d48444ff8a6cd4e3900125fdc33af6957fbf6513ad
https://github.com/microsoft/durabletask-python/pull/210/files#diff-9f60c8b9b2d230340b3c34d48444ff8a6cd4e3900125fdc33af6957fbf6513ad
https://github.com/microsoft/durabletask-python/pull/210/files#diff-9f60c8b9b2d230340b3c34d48444ff8a6cd4e3900125fdc33af6957fbf6513ad
https://github.com/microsoft/durabletask-python/pull/210/files#diff-9f60c8b9b2d230340b3c34d48444ff8a6cd4e3900125fdc33af6957fbf6513ad
https://github.com/microsoft/durabletask-python/pull/210/files#diff-9f60c8b9b2d230340b3c34d48444ff8a6cd4e3900125fdc33af6957fbf6513ad
https://github.com/microsoft/durabletask-python/pull/210/files#diff-9f60c8b9b2d230340b3c34d48444ff8a6cd4e3900125fdc33af6957fbf6513ad
https://github.com/microsoft/durabletask-python/pull/210/files#diff-9f60c8b9b2d230340b3c34d48444ff8a6cd4e3900125fdc33af6957fbf6513ad
https://github.com/microsoft/durabletask-python/pull/210/files#diff-9f60c8b9b2d230340b3c34d48444ff8a6cd4e3900125fdc33af6957fbf6513ad
https://github.com/microsoft/durabletask-python/pull/210/files#diff-9f60c8b9b2d230340b3c34d48444ff8a6cd4e3900125fdc33af6957fbf6513ad
https://github.com/microsoft/durabletask-python/pull/210/files#diff-9f60c8b9b2d230340b3c34d48444ff8a6cd4e3900125fdc33af6957fbf6513ad
durabletask/extensions/history_export/__init__.pyhttps://github.com/microsoft/durabletask-python/pull/210/files#diff-051600ba2467389dd1aa686c093fc551a36dcba46277a47e4f1299d1bd772e56
View file https://github.com/microsoft/durabletask-python/blob/2bd9af57c4df0eaf144406ce95964d3079c1a227/durabletask/extensions/history_export/__init__.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/microsoft/durabletask-python/pull/210/{{ revealButtonHref }}
https://github.com/microsoft/durabletask-python/pull/210/files#diff-051600ba2467389dd1aa686c093fc551a36dcba46277a47e4f1299d1bd772e56
https://github.com/microsoft/durabletask-python/pull/210/files#diff-051600ba2467389dd1aa686c093fc551a36dcba46277a47e4f1299d1bd772e56
https://github.com/microsoft/durabletask-python/pull/210/files#diff-051600ba2467389dd1aa686c093fc551a36dcba46277a47e4f1299d1bd772e56
Please reload this pagehttps://github.com/microsoft/durabletask-python/pull/210/files
Please reload this pagehttps://github.com/microsoft/durabletask-python/pull/210/files
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.