Skip to content

Commit 0a03bd1

Browse files
authored
Merge branch 'main' into andystaples/add-functions-support
2 parents bf6d6f2 + a202731 commit 0a03bd1

15 files changed

+392
-8
lines changed
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: Durable Task Scheduler SDK (durabletask-azuremanaged) Dev Release
2+
3+
on:
4+
workflow_run:
5+
workflows: ["Durable Task Scheduler SDK (durabletask-azuremanaged)"]
6+
types:
7+
- completed
8+
branches:
9+
- main
10+
11+
jobs:
12+
publish-dev:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout code
16+
uses: actions/checkout@v4
17+
18+
- name: Extract version from tag
19+
run: echo "VERSION=${GITHUB_REF#refs/tags/azuremanaged-v}" >> $GITHUB_ENV # Extract version from the tag
20+
21+
- name: Set up Python
22+
uses: actions/setup-python@v5
23+
with:
24+
python-version: "3.14" # Adjust Python version as needed
25+
26+
- name: Install dependencies
27+
run: |
28+
python -m pip install --upgrade pip
29+
pip install build twine
30+
31+
- name: Append dev to version in pyproject.toml
32+
working-directory: durabletask-azuremanaged
33+
run: |
34+
sed -i 's/^version = "\(.*\)"/version = "\1.dev${{ github.run_number }}"/' pyproject.toml
35+
36+
- name: Build package from directory durabletask-azuremanaged
37+
working-directory: durabletask-azuremanaged
38+
run: |
39+
python -m build
40+
41+
- name: Check package
42+
working-directory: durabletask-azuremanaged
43+
run: |
44+
twine check dist/*
45+
46+
- name: Publish package to PyPI
47+
env:
48+
TWINE_USERNAME: __token__
49+
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN_AZUREMANAGED }} # Store your PyPI API token in GitHub Secrets
50+
working-directory: durabletask-azuremanaged
51+
run: |
52+
twine upload dist/*
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: Durable Task Scheduler SDK (durabletask-azuremanaged) Experimental Release
2+
3+
on:
4+
push:
5+
branches-ignore:
6+
- main
7+
- release/*
8+
9+
jobs:
10+
publish-experimental:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout code
14+
uses: actions/checkout@v4
15+
16+
- name: Extract version from tag
17+
run: echo "VERSION=${GITHUB_REF#refs/tags/azuremanaged-v}" >> $GITHUB_ENV # Extract version from the tag
18+
19+
- name: Set up Python
20+
uses: actions/setup-python@v5
21+
with:
22+
python-version: "3.14" # Adjust Python version as needed
23+
24+
- name: Install dependencies
25+
run: |
26+
python -m pip install --upgrade pip
27+
pip install build twine
28+
29+
- name: Change the version in pyproject.toml to 0.0.0dev{github.run_number}
30+
working-directory: durabletask-azuremanaged
31+
run: |
32+
sed -i 's/^version = ".*"/version = "0.0.0.dev${{ github.run_number }}"/' pyproject.toml
33+
34+
- name: Build package from directory durabletask-azuremanaged
35+
working-directory: durabletask-azuremanaged
36+
run: |
37+
python -m build
38+
39+
- name: Check package
40+
working-directory: durabletask-azuremanaged
41+
run: |
42+
twine check dist/*
43+
44+
- name: Publish package to PyPI
45+
env:
46+
TWINE_USERNAME: __token__
47+
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN_AZUREMANAGED }} # Store your PyPI API token in GitHub Secrets
48+
working-directory: durabletask-azuremanaged
49+
run: |
50+
twine upload dist/*

.github/workflows/durabletask-azuremanaged.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ jobs:
8686
run: |
8787
pytest -m "dts" --verbose
8888
89-
publish:
89+
publish-release:
9090
if: startsWith(github.ref, 'refs/tags/azuremanaged-v') # Only run if a matching tag is pushed
9191
needs: run-docker-tests
9292
runs-on: ubuntu-latest
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Durable Task SDK (durabletask) Dev Release
2+
3+
on:
4+
workflow_run:
5+
workflows: ["Durable Task SDK (durabletask)"]
6+
types:
7+
- completed
8+
branches:
9+
- main
10+
11+
jobs:
12+
publish-dev:
13+
# needs: run-tests
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Checkout code
17+
uses: actions/checkout@v4
18+
19+
- name: Extract version from tag
20+
run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_ENV # Extract version from the tag
21+
22+
- name: Set up Python
23+
uses: actions/setup-python@v5
24+
with:
25+
python-version: "3.14" # Adjust Python version as needed
26+
27+
- name: Install dependencies
28+
run: |
29+
python -m pip install --upgrade pip
30+
pip install build twine
31+
32+
- name: Append dev to version in pyproject.toml
33+
run: |
34+
sed -i 's/^version = "\(.*\)"/version = "\1.dev${{ github.run_number }}"/' pyproject.toml
35+
36+
- name: Build package from root directory
37+
run: |
38+
python -m build
39+
40+
- name: Check package
41+
run: |
42+
twine check dist/*
43+
44+
- name: Publish package to PyPI
45+
env:
46+
TWINE_USERNAME: __token__
47+
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }} # Store your PyPI API token in GitHub Secrets
48+
run: |
49+
twine upload dist/*
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Durable Task SDK (durabletask) Experimental Release
2+
3+
on:
4+
push:
5+
branches-ignore:
6+
- main
7+
- release/*
8+
9+
jobs:
10+
publish-experimental:
11+
# needs: run-tests
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Checkout code
15+
uses: actions/checkout@v4
16+
17+
- name: Extract version from tag
18+
run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_ENV # Extract version from the tag
19+
20+
- name: Set up Python
21+
uses: actions/setup-python@v5
22+
with:
23+
python-version: "3.14" # Adjust Python version as needed
24+
25+
- name: Install dependencies
26+
run: |
27+
python -m pip install --upgrade pip
28+
pip install build twine
29+
30+
- name: Change the version in pyproject.toml to 0.0.0dev{github.run_number}
31+
run: |
32+
sed -i 's/^version = ".*"/version = "0.0.0.dev${{ github.run_number }}"/' pyproject.toml
33+
34+
- name: Build package from root directory
35+
run: |
36+
python -m build
37+
38+
- name: Check package
39+
run: |
40+
twine check dist/*
41+
42+
- name: Publish package to PyPI
43+
env:
44+
TWINE_USERNAME: __token__
45+
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }} # Store your PyPI API token in GitHub Secrets
46+
run: |
47+
twine upload dist/*

.github/workflows/durabletask.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: Durable Task SDK (durabletask)
22

33
on:
44
push:
5-
branches:
5+
branches:
66
- "main"
77
tags:
88
- "v*" # Only run for tags starting with "v"
@@ -71,7 +71,7 @@ jobs:
7171
durabletask-go --port 4001 &
7272
pytest -m "e2e and not dts" --verbose
7373
74-
publish:
74+
publish-release:
7575
if: startsWith(github.ref, 'refs/tags/v') # Only run if a matching tag is pushed
7676
needs: run-tests
7777
runs-on: ubuntu-latest
@@ -105,4 +105,4 @@ jobs:
105105
TWINE_USERNAME: __token__
106106
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }} # Store your PyPI API token in GitHub Secrets
107107
run: |
108-
twine upload dist/*
108+
twine upload dist/*

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## v1.1.0
9+
10+
ADDED:
11+
12+
- Allow retrieving entity metadata from the client, with or without state
13+
814
## v1.0.0
915

1016
ADDED:

durabletask-azuremanaged/CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## v1.1.0
9+
10+
CHANGED:
11+
12+
- Updates base dependency to durabletask v1.1.0
13+
- See durabletask changelog for more details
14+
815
## v1.0.0
916

1017
CHANGED:

durabletask-azuremanaged/pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ build-backend = "setuptools.build_meta"
99

1010
[project]
1111
name = "durabletask.azuremanaged"
12-
version = "1.0.0"
12+
version = "1.1.0"
1313
description = "Durable Task Python SDK provider implementation for the Azure Durable Task Scheduler"
1414
keywords = [
1515
"durable",
@@ -26,7 +26,7 @@ requires-python = ">=3.10"
2626
license = {file = "LICENSE"}
2727
readme = "README.md"
2828
dependencies = [
29-
"durabletask>=1.0.0",
29+
"durabletask>=1.1.0",
3030
"azure-identity>=1.19.0"
3131
]
3232

durabletask/client.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
from google.protobuf import wrappers_pb2
1313

1414
from durabletask.entities import EntityInstanceId
15+
from durabletask.entities.entity_metadata import EntityMetadata
1516
import durabletask.internal.helpers as helpers
1617
import durabletask.internal.orchestrator_service_pb2 as pb
1718
import durabletask.internal.orchestrator_service_pb2_grpc as stubs
@@ -241,3 +242,15 @@ def signal_entity(self, entity_instance_id: EntityInstanceId, operation_name: st
241242
)
242243
self._logger.info(f"Signaling entity '{entity_instance_id}' operation '{operation_name}'.")
243244
self._stub.SignalEntity(req, None) # TODO: Cancellation timeout?
245+
246+
def get_entity(self,
247+
entity_instance_id: EntityInstanceId,
248+
include_state: bool = True
249+
) -> Optional[EntityMetadata]:
250+
req = pb.GetEntityRequest(instanceId=str(entity_instance_id), includeState=include_state)
251+
self._logger.info(f"Getting entity '{entity_instance_id}'.")
252+
res: pb.GetEntityResponse = self._stub.GetEntity(req)
253+
if not res.exists:
254+
return None
255+
256+
return EntityMetadata.from_entity_response(res, include_state)

0 commit comments

Comments
 (0)