-
Notifications
You must be signed in to change notification settings - Fork 1
notification unit test #3
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
base: main
Are you sure you want to change the base?
Changes from all commits
4a69e4a
23cc975
04af19e
ae2d599
05d64ef
0c0444f
4731e4a
c29d9e7
4e19c11
3516aea
f14cdea
3147656
ac6311d
b767945
59b71f6
2de7f7f
ab99eb6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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 | ||
|
|
@@ -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" | ||
|
|
||
|
|
||
|
|
@@ -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: | ||
|
|
@@ -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" | ||
|
|
||
|
|
||
| def _get_mcp_platform_base_url() -> str: | ||
|
|
@@ -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. | ||
|
Comment on lines
+79
to
81
|
||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| # Copyright (c) Microsoft. All rights reserved. | ||
|
||
|
|
||
| """ | ||
| Unit tests for Microsoft Agents A365 Notifications module. | ||
| """ | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| # Copyright (c) Microsoft. All rights reserved. | ||
|
||
|
|
||
| """ | ||
| Unit tests for Microsoft Agents A365 Notifications models. | ||
| """ | ||
There was a problem hiding this comment.
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_ENVIRONMENTandDOTNET_ENVIRONMENTare 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.