From 68699f0bc010029f2eeac934cb4533e5378c88b8 Mon Sep 17 00:00:00 2001 From: rodrigobr-msft Date: Tue, 9 Sep 2025 14:21:03 -0700 Subject: [PATCH 1/2] Setting flow state to COMPLETE when retrieving cached token (#112) * Fixed reference to Activity.add_ai_metadata * Setting flow state to complete on get_token --- .../microsoft_agents/hosting/core/oauth/oauth_flow.py | 1 + .../microsoft-agents-hosting-core/tests/test_oauth_flow.py | 2 ++ 2 files changed, 3 insertions(+) diff --git a/libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/oauth/oauth_flow.py b/libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/oauth/oauth_flow.py index bab9d143..3a12b890 100644 --- a/libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/oauth/oauth_flow.py +++ b/libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/oauth/oauth_flow.py @@ -140,6 +140,7 @@ async def get_user_token(self, magic_code: str = None) -> TokenResponse: self._flow_state.expiration = ( datetime.now().timestamp() + self._default_flow_duration ) + self._flow_state.tag = FlowStateTag.COMPLETE return token_response diff --git a/libraries/microsoft-agents-hosting-core/tests/test_oauth_flow.py b/libraries/microsoft-agents-hosting-core/tests/test_oauth_flow.py index d01d69eb..d6b25d78 100644 --- a/libraries/microsoft-agents-hosting-core/tests/test_oauth_flow.py +++ b/libraries/microsoft-agents-hosting-core/tests/test_oauth_flow.py @@ -137,6 +137,7 @@ async def test_get_user_token_success(self, sample_flow_state, user_token_client flow = OAuthFlow(sample_flow_state, user_token_client) expected_final_flow_state = sample_flow_state expected_final_flow_state.user_token = RES_TOKEN + expected_final_flow_state.tag = FlowStateTag.COMPLETE # test token_response = await flow.get_user_token() @@ -201,6 +202,7 @@ async def test_begin_flow_easy_case( activity = mocker.Mock(spec=Activity) expected_flow_state = sample_flow_state expected_flow_state.user_token = RES_TOKEN + expected_flow_state.tag = FlowStateTag.COMPLETE # test response = await flow.begin_flow(activity) From 28ec80446b85dcbf5aa519b38cc3726cc64d8ef5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20Su=C3=A1rez?= Date: Tue, 9 Sep 2025 15:37:06 -0700 Subject: [PATCH 2/2] adding pipeline trigger to pr against release branch (#114) --- .azdo/ci-pr.yaml | 1 + .github/workflows/codeql.yml | 4 ++-- .github/workflows/python-package.yml | 4 ++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.azdo/ci-pr.yaml b/.azdo/ci-pr.yaml index a1bf1c4a..f0ccda57 100644 --- a/.azdo/ci-pr.yaml +++ b/.azdo/ci-pr.yaml @@ -1,6 +1,7 @@ pr: - main - dev +- release/* pool: vmImage: ubuntu-latest diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 14be16cc..a59c28f8 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -13,9 +13,9 @@ name: "CodeQL Advanced" on: push: - branches: [ "main" ] + branches: [ "main", "release/*" ] pull_request: - branches: [ "main" ] + branches: [ "main", "release/*" ] schedule: - cron: '22 7 * * 4' diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index ac26ed78..ad116932 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -8,9 +8,9 @@ permissions: on: push: - branches: [ "main" ] + branches: [ "main", "release/*" ] pull_request: - branches: [ "main" ] + branches: [ "main", "release/*" ] jobs: build: