Skip to content
Closed
Show file tree
Hide file tree
Changes from 17 commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
4a69e4a
notification unit test
abdulanu0 Oct 28, 2025
23cc975
Added unit tests for notification and tooling
abdulanu0 Nov 2, 2025
04af19e
Fix CI build errors by removing problematic test files with import is…
abdulanu0 Nov 2, 2025
ae2d599
Simplify test directory structure to fix CI import errors
abdulanu0 Nov 2, 2025
05d64ef
Update tests/microsoft-agents-a365-tooling-unittest/utils/test_utilit…
abdulanu0 Nov 2, 2025
0c0444f
fixed copilot comments
abdulanu0 Nov 2, 2025
4731e4a
Merge branch 'users/anabdul/Unittest_Notification_Py' of https://gith…
abdulanu0 Nov 2, 2025
c29d9e7
fixed ruff formatting issues
abdulanu0 Nov 2, 2025
4e19c11
fix infinite recursion bug and class naming issues
abdulanu0 Nov 2, 2025
3516aea
resolved comment
abdulanu0 Nov 2, 2025
f14cdea
Fix import issue
abdulanu0 Nov 2, 2025
3147656
Update copyright headers to Microsoft Corporation format
abdulanu0 Nov 2, 2025
ac6311d
Fix CI import issue by replacing mock MCPServerConfig with real model
abdulanu0 Nov 2, 2025
b767945
Fix CI issues and standardize copyright headers
abdulanu0 Nov 2, 2025
59b71f6
Resolving PR comments: Remove fallback imports, fix copyright headers…
abdulanu0 Nov 7, 2025
2de7f7f
Resolving PR review comments
abdulanu0 Nov 11, 2025
ab99eb6
Merge branch 'main' into users/anabdul/Unittest_Notification_Py
abdulanu0 Nov 11, 2025
6d484c8
Merge main branch - resolved utility.py conflicts
abdulanu0 Dec 2, 2025
2a453eb
Resolving comments
abdulanu0 Dec 2, 2025
53b0d99
Fixed formatting in test_utility.py
abdulanu0 Dec 2, 2025
f4dfb0f
Fixed entity parsing to use properties attribute
abdulanu0 Dec 2, 2025
0a81293
Fixed formatting in agent_notification_activity.py
abdulanu0 Dec 2, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,9 @@ build/
.eggs/
.pytest_cache/
_version.py
.coverage
.coverage.*
htmlcov/

# Virtual environments
.venv/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,13 @@
get_tooling_gateway_for_digital_worker,
get_mcp_base_url,
build_mcp_server_url,
get_tools_mode,
get_mcp_platform_authentication_scope,
get_ppapi_token_scope,
)

__all__ = [
"Constants",
"get_tooling_gateway_for_digital_worker",
"get_mcp_base_url",
"build_mcp_server_url",
"get_tools_mode",
"get_mcp_platform_authentication_scope",
"get_ppapi_token_scope",
]
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,6 @@
"""

import os
from enum import Enum


class ToolsMode(Enum):
"""Enumeration for different tools modes."""

MOCK_MCP_SERVER = "MockMCPServer"
MCP_PLATFORM = "MCPPlatform"


# Constants for base URLs
Expand Down Expand Up @@ -43,16 +35,6 @@ def get_mcp_base_url() -> str:
Returns:
str: The base URL for MCP servers.
"""
environment = _get_current_environment().lower()

if environment == "development":
tools_mode = get_tools_mode()
if tools_mode == ToolsMode.MOCK_MCP_SERVER:
return os.getenv("MOCK_MCP_SERVER_URL", "http://localhost:5309/mcp-mock/agents/servers")

if not get_use_environment_id():
return f"{_get_mcp_platform_base_url()}/agents/servers"

return f"{_get_mcp_platform_base_url()}/mcp/environments"


Expand All @@ -68,14 +50,7 @@ def build_mcp_server_url(environment_id: str, server_name: str) -> str:
str: The full MCP server URL.
"""
base_url = get_mcp_base_url()
environment = _get_current_environment().lower()

if not get_use_environment_id() or (
environment == "development" and base_url.endswith("servers")
):
return f"{base_url}/{server_name}"
else:
return f"{base_url}/{environment_id}/servers/{server_name}"
return f"{base_url}/{environment_id}/servers/{server_name}"


def _get_current_environment() -> str:
Expand All @@ -85,7 +60,7 @@ def _get_current_environment() -> str:
Returns:
str: The current environment name.
"""
return os.getenv("ASPNETCORE_ENVIRONMENT") or os.getenv("DOTNET_ENVIRONMENT") or "Development"
return os.getenv("ENVIRONMENT") or "Development"

Copilot AI Nov 7, 2025

Copy link

Choose a reason for hiding this comment

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

The removed environment variables ASPNETCORE_ENVIRONMENT and DOTNET_ENVIRONMENT are referenced by "Kairo" in existing code files. According to custom guideline 1000000, the keyword "Kairo" should be removed or replaced with appropriate terminology. Multiple files in the codebase contain "Kairo" references including comments like "Kairo Python SDK", "Kairo tracer", "KairoInstrumentorOpenAIAgents" class names, and module descriptions mentioning "Kairo SDK". These should be updated to use Microsoft-appropriate terminology.

Copilot generated this review using guidance from repository custom instructions.


def _get_mcp_platform_base_url() -> str:
Expand All @@ -101,33 +76,7 @@ def _get_mcp_platform_base_url() -> str:
return MCP_PLATFORM_PROD_BASE_URL


def get_use_environment_id() -> bool:
"""
Determines whether to use environment ID in MCP server URL construction.

Returns:
bool: True if environment ID should be used, False otherwise.
"""
use_environment = os.getenv("USE_ENVIRONMENT_ID", "true").lower()
return use_environment == "true"


def get_tools_mode() -> ToolsMode:
"""
Gets the tools mode for the application.

Returns:
ToolsMode: The tools mode enum value.
"""
tools_mode = os.getenv("TOOLS_MODE", "MCPPlatform").lower()

if tools_mode == "mockmcpserver":
return ToolsMode.MOCK_MCP_SERVER
else:
return ToolsMode.MCP_PLATFORM


def get_mcp_platform_authentication_scope():
def get_ppapi_token_scope():
"""
Gets the MCP platform authentication scope based on the current environment.

Copilot AI Nov 11, 2025

Copy link

Choose a reason for hiding this comment

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

The function name get_ppapi_token_scope doesn't match the docstring which refers to 'MCP platform authentication scope'. The docstring should be updated to reflect that this returns the Power Platform API token scope.

Copilot uses AI. Check for mistakes.

Expand Down
5 changes: 5 additions & 0 deletions tests/microsoft-agents-a365-notification/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Copyright (c) Microsoft. All rights reserved.
Comment thread
abdulanu0 marked this conversation as resolved.

Copilot AI Nov 7, 2025

Copy link

Choose a reason for hiding this comment

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

The copyright header format should be "# Copyright (c) Microsoft Corporation." with "Corporation" included, and "# Licensed under the MIT License." on the second line.

Copilot generated this review using guidance from repository custom instructions.

"""
Unit tests for Microsoft Agents A365 Notifications module.
"""
Comment on lines +1 to +5

Copilot AI Dec 2, 2025

Copy link

Choose a reason for hiding this comment

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

File is missing the standard Microsoft copyright header. Please update the header to:

Copyright (c) Microsoft Corporation.

Licensed under the MIT License.

Add a blank line after the header.

Copilot generated this review using guidance from repository custom instructions.
5 changes: 5 additions & 0 deletions tests/microsoft-agents-a365-notification/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Copyright (c) Microsoft. All rights reserved.
Comment thread
abdulanu0 marked this conversation as resolved.

Copilot AI Nov 7, 2025

Copy link

Choose a reason for hiding this comment

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

The copyright header format should be "# Copyright (c) Microsoft Corporation." with "Corporation" included, and "# Licensed under the MIT License." on the second line.

Copilot generated this review using guidance from repository custom instructions.

"""
Unit tests for Microsoft Agents A365 Notifications models.
"""
Comment on lines +1 to +5

Copilot AI Dec 2, 2025

Copy link

Choose a reason for hiding this comment

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

File is missing the standard Microsoft copyright header. Please update the header to:

Copyright (c) Microsoft Corporation.

Licensed under the MIT License.

Add a blank line after the header.

Copilot generated this review using guidance from repository custom instructions.
Loading
Loading