Skip to content

Commit 815954b

Browse files
author
Simon Jakesch
committed
fix: Resolve CI linting failures
- Fix undefined variables (update_containerapp_from_compose, ContainerAppClient) - Remove 322 trailing whitespace errors across all Python files - Fix 4 unused variable warnings (models_app, models_list, gateway_url) - Convert f-strings without placeholders to regular strings - Fix PEP8 formatting (spacing, indentation, blank lines) Addresses CI test failures from PR #9422 review feedback.
1 parent 004c93f commit 815954b

File tree

45 files changed

+3882
-1963
lines changed

Some content is hidden

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

45 files changed

+3882
-1963
lines changed

src/containerapp/azext_containerapp/_compose_utils.py

Lines changed: 710 additions & 430 deletions
Large diffs are not rendered by default.

src/containerapp/azext_containerapp/_validators.py

Lines changed: 278 additions & 278 deletions
Large diffs are not rendered by default.

src/containerapp/azext_containerapp/custom.py

Lines changed: 2614 additions & 974 deletions
Large diffs are not rendered by default.
Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
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-
from flask import Flask
7-
from datetime import datetime
8-
from flask import current_app
9-
10-
app = Flask(__name__)
11-
12-
@app.route("/")
13-
def hello():
14-
return "Hello World! " + str(datetime.now())
15-
16-
@app.route("/applicationpath")
17-
def applicationPath():
18-
return current_app.root_path
19-
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+
from flask import Flask
7+
from datetime import datetime
8+
from flask import current_app
9+
10+
app = Flask(__name__)
11+
12+
@app.route("/")
13+
def hello():
14+
return "Hello World! " + str(datetime.now())
15+
16+
@app.route("/applicationpath")
17+
def applicationPath():
18+
return current_app.root_path
19+

src/containerapp/azext_containerapp/tests/latest/test_containerapp_auth_commands.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ def test_containerapp_blob_storage_token_store_msi(self, resource_group):
2929

3030
env = prepare_containerapp_env_for_app_e2e_tests(self, location)
3131
self.cmd('containerapp create -g {} -n {} --environment {} --image mcr.microsoft.com/k8se/quickstart:latest --ingress external --target-port 80 --system-assigned --user-assigned {}'.format(resource_group, app, env, user_identity_name))
32-
32+
3333
client_id = 'c0d23eb5-ea9f-4a4d-9519-bfa0a422c491'
3434
client_secret = 'c0d23eb5-ea9f-4a4d-9519-bfa0a422c491'
3535
issuer = 'https://sts.windows.net/54826b22-38d6-4fb2-bad9-b7983a3e9c5a/'
@@ -43,15 +43,15 @@ def test_containerapp_blob_storage_token_store_msi(self, resource_group):
4343
"microsoft-provider-authentication-secret"),
4444
JMESPathCheck('registration.openIdIssuer', issuer),
4545
])
46-
46+
4747
self.cmd(
4848
'containerapp auth update -g {} -n {} --token-store true --blob-container-uri {} --yes'
4949
.format(resource_group, app, blobContainerUri), checks=[
5050
JMESPathCheck('properties.login.tokenStore.enabled', True),
5151
JMESPathCheck('properties.login.tokenStore.azureBlobStorage.blobContainerUri', blobContainerUri),
5252
JMESPathCheckNotExists('properties.login.tokenStore.azureBlobStorage.managedIdentityResourceId'),
5353
])
54-
54+
5555
self.cmd(
5656
'containerapp auth update -g {} -n {} --token-store true --blob-container-uri {} --blob-container-identity {}'
5757
.format(resource_group, app, blobContainerUri, user_identity_id), checks=[

src/containerapp/azext_containerapp/tests/latest/test_containerapp_commands.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -325,13 +325,13 @@ def test_containerapp_ingress_traffic_labels_e2e(self, resource_group):
325325
self.cmd('containerapp update -g {} -n {} --cpu 1.0 --memory 2Gi --target-label label2'.format(resource_group, ca_name))
326326

327327
# it may take a minute for the new revision to be created and added to traffic.
328-
traffic = self.cmd('containerapp ingress traffic show -g {} -n {}'.format(resource_group, ca_name)).get_output_in_json()
328+
traffic = self.cmd('containerapp ingress traffic show -g {} -n {}'.format(resource_group, ca_name)).get_output_in_json()
329329
for _ in range(100):
330330
if len(traffic) >= 2:
331331
break
332332
time.sleep(5)
333333
traffic = self.cmd('containerapp ingress traffic show -g {} -n {}'.format(resource_group, ca_name)).get_output_in_json()
334-
334+
335335
self.assertEqual(len(traffic), 2)
336336

337337
revisions_list = self.cmd('containerapp revision list -g {} -n {}'.format(resource_group, ca_name)).get_output_in_json()
@@ -1636,7 +1636,7 @@ def test_containerapp_update_mode_e2e(self, resource_group):
16361636

16371637
self.cmd(f"containerapp create -g {resource_group} -n {ca_name} --environment {env} --image mcr.microsoft.com/k8se/quickstart:latest --ingress external --target-port 80",
16381638
checks=[
1639-
JMESPathCheck('properties.configuration.activeRevisionsMode', "Single"),
1639+
JMESPathCheck('properties.configuration.activeRevisionsMode', "Single"),
16401640
])
16411641

16421642
try:

src/containerapp/azext_containerapp/tests/latest/test_containerapp_compose_command.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ def test_containerapp_compose_with_command_list(self, resource_group):
7070
'environment': env_id,
7171
'compose': compose_file_name,
7272
})
73-
73+
7474
command_string = 'containerapp compose create'
7575
command_string += ' --compose-file-path {compose}'
7676
command_string += ' --resource-group {rg}'

src/containerapp/azext_containerapp/tests/latest/test_containerapp_compose_environment.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ def test_containerapp_compose_create_with_environment_prompt(self, resource_grou
7676
'environment': env_id,
7777
'compose': compose_file_name,
7878
})
79-
79+
8080
command_string = 'containerapp compose create'
8181
command_string += ' --compose-file-path {compose}'
8282
command_string += ' --resource-group {rg}'

src/containerapp/azext_containerapp/tests/latest/test_containerapp_compose_ingress.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ def test_containerapp_compose_create_with_ingress_prompt(self, resource_group):
139139
'environment': env_id,
140140
'compose': compose_file_name,
141141
})
142-
142+
143143
command_string = 'containerapp compose create'
144144
command_string += ' --compose-file-path {compose}'
145145
command_string += ' --resource-group {rg}'

src/containerapp/azext_containerapp/tests/latest/test_containerapp_compose_mcp_gateway.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ class ContainerAppComposeMCPGatewayScenarioTest(ScenarioTest):
2525
def test_mcp_gateway_deployment(self, resource_group):
2626
"""
2727
Test US2 Acceptance Scenario 1: Deploy compose file with MCP gateway.
28-
28+
2929
Expected: MCP gateway service is created without being assigned to GPU profile.
30-
30+
3131
This test MUST FAIL until T032-T043 are implemented.
3232
"""
3333
self.kwargs.update({
@@ -53,9 +53,9 @@ def test_mcp_gateway_deployment(self, resource_group):
5353
def test_managed_identity_enablement(self, resource_group):
5454
"""
5555
Test US2 Acceptance Scenario 2: System-assigned managed identity enabled for MCP gateway.
56-
56+
5757
Expected: MCP gateway container app has system-assigned managed identity enabled.
58-
58+
5959
This test MUST FAIL until T034-T037 are implemented.
6060
"""
6161
self.kwargs.update({
@@ -78,9 +78,9 @@ def test_managed_identity_enablement(self, resource_group):
7878
def test_role_assignment(self, resource_group):
7979
"""
8080
Test US2 Acceptance Scenario 3: Azure AI Developer role assigned to MCP gateway identity.
81-
81+
8282
Expected: MCP gateway managed identity has "Azure AI Developer" role on resource group.
83-
83+
8484
This test MUST FAIL until T038-T043 are implemented.
8585
"""
8686
self.kwargs.update({
@@ -105,9 +105,9 @@ def test_role_assignment(self, resource_group):
105105
def test_mcp_environment_injection(self, resource_group):
106106
"""
107107
Test US2 Acceptance Scenario 4: Environment variable injection for MCP gateway dependencies.
108-
108+
109109
Expected: Services that depend on MCP gateway receive MCP_ENDPOINT environment variable.
110-
110+
111111
This test MUST FAIL until T040-T043 are implemented.
112112
"""
113113
self.kwargs.update({
@@ -122,6 +122,6 @@ def test_mcp_environment_injection(self, resource_group):
122122
# Check web service has MCP_ENDPOINT
123123
web_app = self.cmd('containerapp show -g {rg} -n web').get_output_in_json()
124124
env_vars = {e['name']: e.get('value', '') for e in web_app['properties']['template']['containers'][0].get('env', [])}
125-
125+
126126
self.assertIn('MCP_ENDPOINT', env_vars)
127127
self.assertIn('mcp-gateway', env_vars['MCP_ENDPOINT'].lower())

0 commit comments

Comments
 (0)