Skip to content

Update upstream #12

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 20 commits into
base: main
Choose a base branch
from
Open

Update upstream #12

wants to merge 20 commits into from

Conversation

acroca
Copy link

@acroca acroca commented Jun 16, 2025

This PR brings upstream changes into the dapr fork.

  • Merged microsoft@a49f1e0
  • Removed azuremanaged files
  • Relocated
    @pytest.mark.parametrize("timeout", [None, 0, 5])
    def test_wait_for_orchestration_start_timeout(timeout):
    instance_id = "test-instance"
    from durabletask.internal.orchestrator_service_pb2 import GetInstanceResponse, \
    OrchestrationState, ORCHESTRATION_STATUS_RUNNING
    response = GetInstanceResponse()
    state = OrchestrationState()
    state.instanceId = instance_id
    state.orchestrationStatus = ORCHESTRATION_STATUS_RUNNING
    response.orchestrationState.CopyFrom(state)
    c = TaskHubGrpcClient()
    c._stub = Mock()
    c._stub.WaitForInstanceStart.return_value = response
    grpc_timeout = None if timeout is None else timeout
    c.wait_for_orchestration_start(instance_id, timeout=grpc_timeout)
    # Verify WaitForInstanceStart was called with timeout=None
    c._stub.WaitForInstanceStart.assert_called_once()
    _, kwargs = c._stub.WaitForInstanceStart.call_args
    if timeout is None or timeout == 0:
    assert kwargs.get('timeout') is None
    else:
    assert kwargs.get('timeout') == timeout
    @pytest.mark.parametrize("timeout", [None, 0, 5])
    def test_wait_for_orchestration_completion_timeout(timeout):
    instance_id = "test-instance"
    from durabletask.internal.orchestrator_service_pb2 import GetInstanceResponse, \
    OrchestrationState, ORCHESTRATION_STATUS_COMPLETED
    response = GetInstanceResponse()
    state = OrchestrationState()
    state.instanceId = instance_id
    state.orchestrationStatus = ORCHESTRATION_STATUS_COMPLETED
    response.orchestrationState.CopyFrom(state)
    c = TaskHubGrpcClient()
    c._stub = Mock()
    c._stub.WaitForInstanceCompletion.return_value = response
    grpc_timeout = None if timeout is None else timeout
    c.wait_for_orchestration_completion(instance_id, timeout=grpc_timeout)
    # Verify WaitForInstanceStart was called with timeout=None
    c._stub.WaitForInstanceCompletion.assert_called_once()
    _, kwargs = c._stub.WaitForInstanceCompletion.call_args
    if timeout is None or timeout == 0:
    assert kwargs.get('timeout') is None
    else:
    assert kwargs.get('timeout') == timeout
    to a separate test file
  • Kept protobuf files from the dapr fork. Updates on protobuf will come in a separate PR.
  • Kept github workflows unchanged.

@acroca acroca force-pushed the update-upstream branch from d70c829 to e309580 Compare June 17, 2025 07:48
cgillum and others added 16 commits June 17, 2025 16:25
…ons workflow (dapr#1) (microsoft#35)

- Bump version in `pyproject.toml` to 0.2b1 and update Python requirement to >=3.9.
- Add `protobuf` dependency in `requirements.txt`.
- Update GitHub Actions workflow to support Python versions 3.9 to 3.13 and upgrade action versions.
- Refactor type hints in various files to use `Optional` and `list` instead of `Union` and `List`.
- Improve handling of custom status in orchestration context and related functions.
- Fix purge implementation to pass required parameters.

Signed-off-by: Albert Callarisa <[email protected]>
* Creation of DTS example and passing of completionToken

Signed-off-by: Ryan Lettieri <[email protected]>

* Adressing review feedback

Signed-off-by: Ryan Lettieri <[email protected]>

* Reverting dapr readme

Signed-off-by: Ryan Lettieri <[email protected]>

* Adding accessTokenManager class for refreshing credential token

Signed-off-by: Ryan Lettieri <[email protected]>

* Adding comments to the example

Signed-off-by: Ryan Lettieri <[email protected]>

* Adding in requirement for azure-identity

Signed-off-by: Ryan Lettieri <[email protected]>

* Moving dts logic into its own module

Signed-off-by: Ryan Lettieri <[email protected]>

* Fixing whitesapce

Signed-off-by: Ryan Lettieri <[email protected]>

* Updating dts client to refresh token

Signed-off-by: Ryan Lettieri <[email protected]>

* Cleaning up construction of dts objects and improving examples

Signed-off-by: Ryan Lettieri <[email protected]>

* Migrating shared access token logic to new grpc class

Signed-off-by: Ryan Lettieri <[email protected]>

* Adding log statements to access_token_manager

Signed-off-by: Ryan Lettieri <[email protected]>

* breaking for loop when setting interceptors

Signed-off-by: Ryan Lettieri <[email protected]>

* Removing changes to client.py and adding additional steps to readme.md

Signed-off-by: Ryan Lettieri <[email protected]>

* Refactoring client and worker to pass around interceptors

Signed-off-by: Ryan Lettieri <[email protected]>

* Fixing import for DefaultClientInterceptorImpl

Signed-off-by: Ryan Lettieri <[email protected]>

* Adressing round 1 of feedback

Signed-off-by: Ryan Lettieri <[email protected]>

* Fixing interceptor issue

Signed-off-by: Ryan Lettieri <[email protected]>

* Moving some files around to remove dependencies

Signed-off-by: Ryan Lettieri <[email protected]>

* Adressing more feedback

Signed-off-by: Ryan Lettieri <[email protected]>

* More review feedback

Signed-off-by: Ryan Lettieri <[email protected]>

* Passing token credential as an argument rather than 2 strings

Signed-off-by: Ryan Lettieri <[email protected]>

* More review feedback for token passing

Signed-off-by: Ryan Lettieri <[email protected]>

* Addressing None comment and using correct metadata

Signed-off-by: Ryan Lettieri <[email protected]>

* Updating unit tests

Signed-off-by: Ryan Lettieri <[email protected]>

* Fixing the type for the unit test

Signed-off-by: Ryan Lettieri <[email protected]>

* Fixing grpc calls

Signed-off-by: Ryan Lettieri <[email protected]>

* Fix linter errors and update documentation

* Specifying version reqiuirement for pyproject.toml

Signed-off-by: Ryan Lettieri <[email protected]>

* Updating README

Signed-off-by: Ryan Lettieri <[email protected]>

* Adding comment for credential type

Signed-off-by: Ryan Lettieri <[email protected]>

---------

Signed-off-by: Ryan Lettieri <[email protected]>
Signed-off-by: Ryan Lettieri <[email protected]>
Co-authored-by: Chris Gillum <[email protected]>
Signed-off-by: Albert Callarisa <[email protected]>
Signed-off-by: Albert Callarisa <[email protected]>
Signed-off-by: Ryan Lettieri <[email protected]>
Signed-off-by: Albert Callarisa <[email protected]>
)

* Creating of pipeline to publish dts python package to pypi

Signed-off-by: Ryan Lettieri <[email protected]>

* Upgrading version of durabletask-azuremanaged from 0.1b1 to 0.1

Signed-off-by: Ryan Lettieri <[email protected]>

* Updating versioning on packages

Signed-off-by: Ryan Lettieri <[email protected]>

* Incrementing version to allign with pypi

Signed-off-by: Ryan Lettieri <[email protected]>

* Adressing majority of first round of feedback

Signed-off-by: Ryan Lettieri <[email protected]>

* Updating pipeline to have linting

Signed-off-by: Ryan Lettieri <[email protected]>

* Updating versions in pyproject.toml

Signed-off-by: Ryan Lettieri <[email protected]>

* Updating working dirs in yml

Signed-off-by: Ryan Lettieri <[email protected]>

* Adding requirements.txt

Signed-off-by: Ryan Lettieri <[email protected]>

* Moving durabletask tests into specific dir and more

Signed-off-by: Ryan Lettieri <[email protected]>

* Fixing more paths

Signed-off-by: Ryan Lettieri <[email protected]>

* ATtemptign to ignore durabletask-azuremanaged folder

Signed-off-by: Ryan Lettieri <[email protected]>

* installing dts dependencies

Signed-off-by: Ryan Lettieri <[email protected]>

* Changing path for requirements.txt

Signed-off-by: Ryan Lettieri <[email protected]>

* Moving init.py

Signed-off-by: Ryan Lettieri <[email protected]>

* Updating readme and some tests

Signed-off-by: Ryan Lettieri <[email protected]>

* Running all dts tests in publish pipeline

Signed-off-by: Ryan Lettieri <[email protected]>

* Removing PYTHONPATH and installing regular deps

Signed-off-by: Ryan Lettieri <[email protected]>

* Adding timeout to dts orchestration e2e test

Signed-off-by: Ryan Lettieri <[email protected]>

* Removing suspend and continue as new tests from dts

Signed-off-by: Ryan Lettieri <[email protected]>

* Removing raise event timeout tests

Signed-off-by: Ryan Lettieri <[email protected]>

* Only runnign publish on tag push

Signed-off-by: Ryan Lettieri <[email protected]>

* Changing dts action to run on tag creation

Signed-off-by: Ryan Lettieri <[email protected]>

* Updating tag name

Signed-off-by: Ryan Lettieri <[email protected]>

* Adressing review feedback

Signed-off-by: Ryan Lettieri <[email protected]>

* Fixing run requirements in actions and adding exit-zero

Signed-off-by: Ryan Lettieri <[email protected]>

* Update .github/workflows/publish-dts-sdk.yml

---------

Signed-off-by: Ryan Lettieri <[email protected]>
Co-authored-by: Bernd Verst <[email protected]>
Signed-off-by: Albert Callarisa <[email protected]>
Signed-off-by: Albert Callarisa <[email protected]>
Signed-off-by: Albert Callarisa <[email protected]>
…r release (microsoft#50)

* Reconnect upon connection error

* concurrency

* Test updates

* More updates

* more concurrency stuff

* final touches

* fix import

* update log level

* fix exports

* more fixup

* test updateS

* more test imports

* fix github workflow pytest

* cleanup tests

* Python 3.9 specific test fix

* fixup reconnection for new concurrency model

* autopep8

* Remove existing duplicate import

Signed-off-by: Albert Callarisa <[email protected]>
* Update GitHub workflows and automate release

* Update linter config

* more workflow changes

* linter fixes

* ignore new linter warning

* even more workflow cleanup and improvement

* declare asyncio as package dependency

* Update requirements.txt

Signed-off-by: Albert Callarisa <[email protected]>
Signed-off-by: Elena Kolevska <[email protected]>
Co-authored-by: Bernd Verst <[email protected]>
Signed-off-by: Albert Callarisa <[email protected]>
@acroca acroca force-pushed the update-upstream branch from e309580 to 25aae7d Compare June 17, 2025 14:29
@acroca acroca requested a review from cicoyle June 17, 2025 14:41
Copy link
Member

@mikeee mikeee left a comment

Choose a reason for hiding this comment

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

Just some initial obs

CHANGELOG.md Outdated

### New

- Added `set_custom_status` orchestrator API ([#31](https://github.com/microsoft/durabletask-python/pull/31)) - contributed by [@famarting](https://github.com/famarting)
- Added `purge_orchestration` client API ([#34](https://github.com/microsoft/durabletask-python/pull/34)) - contributed by [@famarting](https://github.com/famarting)
- Added new `durabletask-azuremanaged` package for use with the [Durable Task Scheduler](https://learn.microsoft.com/azure/azure-functions/durable/durable-task-scheduler/durable-task-scheduler) - by [@RyanLettieri](https://github.com/RyanLettieri)
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
- Added new `durabletask-azuremanaged` package for use with the [Durable Task Scheduler](https://learn.microsoft.com/azure/azure-functions/durable/durable-task-scheduler/durable-task-scheduler) - by [@RyanLettieri](https://github.com/RyanLettieri)

I think the Changelog needs to be clarified for this fork

acroca added 2 commits June 18, 2025 12:13
Signed-off-by: Albert Callarisa <[email protected]>
The changelog entry removed mentions
`azuremanaged`, and that's something
we are not bringing from upstream.

Signed-off-by: Albert Callarisa <[email protected]>
@@ -8,7 +8,7 @@ All the examples assume that you have a Durable Task-compatible sidecar running

1. Install the latest version of the [Dapr CLI](https://docs.dapr.io/getting-started/install-dapr-cli/), which contains and exposes an embedded version of the Durable Task engine. The setup process (which requires Docker) will configure the workflow engine to store state in a local Redis container.

1. Clone and run the [Durable Task Sidecar](https://github.com/microsoft/durabletask-go) project locally (requires Go 1.18 or higher). Orchestration state will be stored in a local sqlite database.
2. Clone and run the [Durable Task Sidecar](https://github.com/microsoft/durabletask-go) project locally (requires Go 1.18 or higher). Orchestration state will be stored in a local sqlite database.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
2. Clone and run the [Durable Task Sidecar](https://github.com/microsoft/durabletask-go) project locally (requires Go 1.18 or higher). Orchestration state will be stored in a local sqlite database.
2. Clone and run the [Durable Task Sidecar](https://github.com/dapr/durabletask-go) project locally (requires Go 1.18 or higher). Orchestration state will be stored in a local sqlite database.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Or to make it easier, we could give the exact commands:

go install github.com/dapr/durabletask-go@main
durabletask-go --port 4001

@@ -1 +1 @@
grpcio-tools==1.62.3 # 1.62.X is the latest version before protobuf 1.26.X is used which has breaking changes for Python
grpcio-tools
Copy link
Collaborator

Choose a reason for hiding this comment

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

We already tried updating this dependency and there was a long discussion about it:
dapr/python-sdk#757 (comment)

I see this change is coming from upstream, but I'd like to understand what changed to make us change the decision we took in the comment above, cause all the raised points should still be valid.

Copy link
Author

Choose a reason for hiding this comment

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

The upstream commit doesn't have much information about why they changed it.
Do you think we should keep the version as it was?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yeah, let's keep it please

For context: dapr#12 (comment)

Signed-off-by: Albert Callarisa <[email protected]>
@acroca acroca requested a review from elena-kolevska June 30, 2025 06:01
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.

9 participants