Skip to content

Commit b9ba5f5

Browse files
committed
Neon Code Cleanup as part of Service Deprecation
1 parent ddb8148 commit b9ba5f5

File tree

291 files changed

+29315
-20869
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

291 files changed

+29315
-20869
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
variables:
22
ubuntu_pool: 'pool-ubuntu-2204'
3-
windows_pool: 'pool-windows-2019'
3+
windows_pool: 'pool-windows-2022'
44
ubuntu_arm64_pool: 'pool-ubuntu-latest-arm64'

.github/policies/resourceManagement.yml

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2365,17 +2365,6 @@ configuration:
23652365
- coffeemug
23662366
replyTemplate: Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc ${mentionees}.
23672367
assignMentionees: False
2368-
- if:
2369-
- hasLabel:
2370-
label: Service Attention
2371-
- hasLabel:
2372-
label: Neon Postgre
2373-
then:
2374-
- mentionUsers:
2375-
mentionees:
2376-
- alluri02
2377-
replyTemplate: Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc ${mentionees}.
2378-
assignMentionees: False
23792368
- if:
23802369
- hasLabel:
23812370
label: Service Attention

linter_exclusions.yml

Lines changed: 84 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,12 @@ aks create:
124124
cluster_service_load_balancer_health_probe_mode:
125125
rule_exclusions:
126126
- option_length_too_long
127+
enable_service_account_image_pull:
128+
rule_exclusions:
129+
- option_length_too_long
130+
service_account_image_pull_default_managed_identity_id:
131+
rule_exclusions:
132+
- option_length_too_long
127133
aks update:
128134
parameters:
129135
aad_admin_group_object_ids:
@@ -207,6 +213,15 @@ aks update:
207213
disable_application_load_balancer:
208214
rule_exclusions:
209215
- option_length_too_long
216+
enable_service_account_image_pull:
217+
rule_exclusions:
218+
- option_length_too_long
219+
disable_service_account_image_pull:
220+
rule_exclusions:
221+
- option_length_too_long
222+
service_account_image_pull_default_managed_identity_id:
223+
rule_exclusions:
224+
- option_length_too_long
210225
aks agent:
211226
parameters:
212227
prompt:
@@ -401,6 +416,75 @@ codespace plan create:
401416
confidentialledger managedccfs update:
402417
rule_exclusions:
403418
- missing_command_test_coverage
419+
confluent organization environment:
420+
rule_exclusions:
421+
- require_wait_command_if_no_wait
422+
confluent organization environment cluster:
423+
rule_exclusions:
424+
- require_wait_command_if_no_wait
425+
confluent organization environment cluster connector:
426+
rule_exclusions:
427+
- require_wait_command_if_no_wait
428+
confluent organization environment cluster topic:
429+
rule_exclusions:
430+
- require_wait_command_if_no_wait
431+
confluent agreement default create:
432+
rule_exclusions:
433+
- missing_command_example
434+
confluent organization environment create:
435+
rule_exclusions:
436+
- missing_command_example
437+
parameters:
438+
stream_governance_config:
439+
rule_exclusions:
440+
- option_length_too_long
441+
confluent organization environment update:
442+
rule_exclusions:
443+
- missing_command_example
444+
parameters:
445+
stream_governance_config:
446+
rule_exclusions:
447+
- option_length_too_long
448+
confluent organization environment cluster create:
449+
rule_exclusions:
450+
- missing_command_example
451+
confluent organization environment cluster update:
452+
rule_exclusions:
453+
- missing_command_example
454+
confluent organization environment cluster connector create:
455+
rule_exclusions:
456+
- missing_command_example
457+
parameters:
458+
connector_service_type_info:
459+
rule_exclusions:
460+
- option_length_too_long
461+
confluent organization environment cluster connector update:
462+
rule_exclusions:
463+
- missing_command_example
464+
parameters:
465+
connector_service_type_info:
466+
rule_exclusions:
467+
- option_length_too_long
468+
confluent organization environment cluster topic create:
469+
rule_exclusions:
470+
- missing_command_example
471+
parameters:
472+
partitions_reassignments:
473+
rule_exclusions:
474+
- option_length_too_long
475+
confluent organization environment cluster topic update:
476+
rule_exclusions:
477+
- missing_command_example
478+
parameters:
479+
partitions_reassignments:
480+
rule_exclusions:
481+
- option_length_too_long
482+
confluent validation orgvalidate:
483+
rule_exclusions:
484+
- missing_command_example
485+
confluent validation orgvalidate-v2:
486+
rule_exclusions:
487+
- missing_command_example
404488
containerapp env create:
405489
parameters:
406490
infrastructure_subnet_resource_id:
@@ -3504,46 +3588,6 @@ eventgrid namespace topic update:
35043588
rule_exclusions:
35053589
- option_length_too_long
35063590

3507-
neon postgres endpoint create:
3508-
rule_exclusions:
3509-
- missing_command_example
3510-
3511-
neon postgres neon-role create:
3512-
rule_exclusions:
3513-
- missing_command_example
3514-
3515-
neon postgres neon-database create:
3516-
rule_exclusions:
3517-
- missing_command_example
3518-
3519-
neon postgres get-postgres-version:
3520-
rule_exclusions:
3521-
- missing_command_example
3522-
3523-
neon postgres branch:
3524-
rule_exclusions:
3525-
- require_wait_command_if_no_wait
3526-
3527-
neon postgres endpoint:
3528-
rule_exclusions:
3529-
- require_wait_command_if_no_wait
3530-
3531-
neon postgres neon-database:
3532-
rule_exclusions:
3533-
- require_wait_command_if_no_wait
3534-
3535-
neon postgres neon-role:
3536-
rule_exclusions:
3537-
- require_wait_command_if_no_wait
3538-
3539-
neon postgres organization:
3540-
rule_exclusions:
3541-
- require_wait_command_if_no_wait
3542-
3543-
neon postgres project:
3544-
rule_exclusions:
3545-
- require_wait_command_if_no_wait
3546-
35473591
confcom containers from_vn2:
35483592
parameters:
35493593
template:

src/aks-agent/HISTORY.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,13 @@ To release a new version, please select a new version number (usually plus 1 to
1212
Pending
1313
+++++++
1414

15+
1.0.0b22
16+
++++++++
17+
* Bump aks-agent to v0.7.1
18+
* Suppress litellm debug logs
19+
* Feature: Separate Azure OpenAI provider into API Key and Microsoft Entra ID (keyless) providers
20+
* Feature: Add --yes/-y flag to agent-cleanup command to skip confirmation prompt
21+
1522
1.0.0b21
1623
++++++++
1724
* Bump aks-agent to v0.6.0

src/aks-agent/azext_aks_agent/_consts.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
AKS_MCP_LABEL_SELECTOR = "app.kubernetes.io/name=aks-mcp"
5353

5454
# AKS Agent Version (shared by helm chart and docker image)
55-
AKS_AGENT_VERSION = "0.6.0"
55+
AKS_AGENT_VERSION = "0.7.1"
5656

5757
# Helm Configuration
5858
HELM_VERSION = "3.16.0"

src/aks-agent/azext_aks_agent/_params.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,3 +111,9 @@ def load_arguments(self, _):
111111
help="The mode decides how the agent is deployed.",
112112
default="cluster",
113113
)
114+
c.argument(
115+
"yes",
116+
options_list=["--yes", "-y"],
117+
action="store_true",
118+
help="Do not prompt for confirmation.",
119+
)

src/aks-agent/azext_aks_agent/agent/k8s/aks_agent_manager.py

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ def _populate_api_keys_from_secret(self):
232232
)
233233

234234
if not secret.data:
235-
logger.warning("Secret '%s' exists but has no data", self.llm_secret_name)
235+
logger.debug("Secret '%s' exists but has no data", self.llm_secret_name)
236236
return
237237

238238
# Decode secret data (base64 encoded)
@@ -927,6 +927,22 @@ def _create_helm_values(self):
927927
"create": False,
928928
}
929929

930+
# Configure aks-agent pod to use the same service account as aks-mcp for workload identity
931+
helm_values["workloadIdentity"] = {
932+
"enabled": True,
933+
}
934+
helm_values["serviceAccount"] = {
935+
"create": False,
936+
"name": self.aks_mcp_service_account_name,
937+
}
938+
939+
has_empty_api_key = any(
940+
not model_config.get("api_key") or not model_config.get("api_key").strip()
941+
for model_config in self.llm_config_manager.model_list.values()
942+
)
943+
if has_empty_api_key:
944+
helm_values["azureADTokenAuth"] = True
945+
930946
return helm_values
931947

932948
def save_llm_config(self, provider: LLMProvider, params: dict) -> None:

src/aks-agent/azext_aks_agent/agent/llm_config_manager.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,10 @@ def get_env_vars(self, secret_name: str) -> List[Dict[str, str]]:
5050
"""
5151
env_vars_list = []
5252
for _, model_config in self.model_list.items():
53-
env_var = LLMProvider.to_env_vars(secret_name, model_config)
54-
env_vars_list.append(env_var)
53+
api_key = model_config.get("api_key")
54+
if api_key and api_key.strip():
55+
env_var = LLMProvider.to_env_vars(secret_name, model_config)
56+
env_vars_list.append(env_var)
5557
return env_vars_list
5658

5759

src/aks-agent/azext_aks_agent/agent/llm_providers/__init__.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
from .anthropic_provider import AnthropicProvider
1212
from .azure_provider import AzureProvider
13+
from .azure_entraid_provider import AzureEntraIDProvider
1314
from .base import LLMProvider
1415
from .gemini_provider import GeminiProvider
1516
from .openai_compatible_provider import OpenAICompatibleProvider
@@ -19,11 +20,11 @@
1920

2021
_PROVIDER_CLASSES: List[LLMProvider] = [
2122
AzureProvider,
23+
AzureEntraIDProvider,
2224
OpenAIProvider,
2325
AnthropicProvider,
2426
GeminiProvider,
2527
OpenAICompatibleProvider,
26-
# Add new providers here
2728
]
2829

2930
PROVIDER_REGISTRY = {}
@@ -49,8 +50,9 @@ def _get_provider_by_index(idx: int) -> LLMProvider:
4950
Raises ValueError if index is out of range.
5051
"""
5152
if 1 <= idx <= len(_PROVIDER_CLASSES):
52-
console.print("You selected provider:", _PROVIDER_CLASSES[idx - 1]().readable_name, style=f"bold {HELP_COLOR}")
53-
return _PROVIDER_CLASSES[idx - 1]()
53+
provider = _PROVIDER_CLASSES[idx - 1]()
54+
console.print("You selected provider:", provider.readable_name, style=f"bold {HELP_COLOR}")
55+
return provider
5456
raise ValueError(f"Invalid provider index: {idx}")
5557

5658

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
# --------------------------------------------------------------------------------------------
2+
# Copyright (c) Microsoft Corporation. All rights reserved.
3+
# Licensed under the MIT License. See License.txt in the project root for license information.
4+
# --------------------------------------------------------------------------------------------
5+
6+
7+
from typing import Tuple
8+
9+
from .base import LLMProvider, is_valid_url, non_empty
10+
11+
12+
def is_valid_api_base(v: str) -> bool:
13+
if not v.startswith("https://"):
14+
return False
15+
return is_valid_url(v)
16+
17+
18+
class AzureEntraIDProvider(LLMProvider):
19+
@property
20+
def readable_name(self) -> str:
21+
return "Azure OpenAI (Microsoft Entra ID)"
22+
23+
@property
24+
def model_route(self) -> str:
25+
return "azure"
26+
27+
@property
28+
def parameter_schema(self):
29+
return {
30+
"model": {
31+
"secret": False,
32+
"default": None,
33+
"hint": "ensure your deployment name is the same as the model name, e.g., gpt-5",
34+
"validator": non_empty,
35+
"alias": "deployment_name"
36+
},
37+
"api_base": {
38+
"secret": False,
39+
"default": None,
40+
"validator": is_valid_api_base
41+
},
42+
"api_version": {
43+
"secret": False,
44+
"default": "2025-04-01-preview",
45+
"hint": None,
46+
"validator": non_empty
47+
}
48+
}
49+
50+
def validate_connection(self, params: dict) -> Tuple[str, str]:
51+
api_base = params.get("api_base")
52+
api_version = params.get("api_version")
53+
deployment_name = params.get("model")
54+
55+
if not all([api_base, api_version, deployment_name]):
56+
return "Missing required Azure parameters.", "retry_input"
57+
58+
return None, "save"

0 commit comments

Comments
 (0)