Skip to content

Add support for list parameters in aci_param_set#129

Draft
Copilot wants to merge 2 commits intomainfrom
copilot/fix-128
Draft

Add support for list parameters in aci_param_set#129
Copilot wants to merge 2 commits intomainfrom
copilot/fix-128

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 22, 2025

Issue

The microsoft/confidential-sidecar-containers repository, which uses this package for testing, was failing with the following error when using version 1.2.2 (while it worked correctly with 1.0.6):

Traceback (most recent call last):
  File "/home/runner/work/confidential-sidecar-containers/confidential-sidecar-containers/tests/attestation/test.py", line 35, in test_attestation
    aci_param_set(
  File "/home/runner/.local/lib/python3.12/site-packages/c_aci_testing/tools/aci_param_set.py", line 28, in aci_param_set
    for key, value in parameters.items():
                      ^^^^^^^^^^^^^^^^
AttributeError: 'list' object has no attribute 'items'

Changes

  • Modified aci_param_set() to handle both dictionary and list parameters:
    • Updated type hints to include both formats: dict[str, str] | list[str]
    • Added logic to detect the parameter type and convert lists to dictionaries when needed
    • Maintained backward compatibility with code that passes dictionaries
  • Added tests to verify functionality with both parameter formats

Example

The function now works with both formats:

# Dictionary format (original)
aci_param_set(target_path, parameters={"location": "westus"})

# List format (new)
aci_param_set(target_path, parameters=["location=westus"])

Fixes #128.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Co-authored-by: DomAyre <8723193+DomAyre@users.noreply.github.com>
Copilot AI changed the title [WIP] Add support for sidecar testing bicep template Add support for list parameters in aci_param_set May 22, 2025
Copilot AI requested a review from DomAyre May 22, 2025 12:26
@DomAyre DomAyre requested a review from micromaomao May 22, 2025 12:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add support for sidecar testing bicep template

2 participants