Skip to content

Nginx.NginxPlus 2025-11-01 changes#9678

Merged
necusjz merged 2 commits intoAzure:mainfrom
briantkim93:feature/2025_11_01
Mar 18, 2026
Merged

Nginx.NginxPlus 2025-11-01 changes#9678
necusjz merged 2 commits intoAzure:mainfrom
briantkim93:feature/2025_11_01

Conversation

@briantkim93
Copy link
Copy Markdown
Member


This checklist is used to make sure that common guidelines for a pull request are followed.

Related command

General Guidelines

  • Have you run azdev style <YOUR_EXT> locally? (pip install azdev required)
  • Have you run python scripts/ci/test_index.py -q locally? (pip install wheel==0.30.0 required)
  • My extension version conforms to the Extension version schema

For new extensions:

About Extension Publish

There is a pipeline to automatically build, upload and publish extension wheels.
Once your pull request is merged into main branch, a new pull request will be created to update src/index.json automatically.
You only need to update the version information in file setup.py and historical information in file HISTORY.rst in your PR but do not modify src/index.json.

Copilot AI review requested due to automatic review settings March 12, 2026 16:21
@azure-client-tools-bot-prd
Copy link
Copy Markdown

azure-client-tools-bot-prd bot commented Mar 12, 2026

⚠️Azure CLI Extensions Breaking Change Test
⚠️nginx
rule cmd_name rule_message suggest_message
⚠️ 1001 - CmdAdd nginx deployment waf-policy analyze-waf-policy cmd nginx deployment waf-policy analyze-waf-policy added

@yonzhan
Copy link
Copy Markdown
Collaborator

yonzhan commented Mar 12, 2026

Thank you for your contribution! We will review the pull request and get back to you soon.

@github-actions
Copy link
Copy Markdown
Contributor

The git hooks are available for azure-cli and azure-cli-extensions repos. They could help you run required checks before creating the PR.

Please sync the latest code with latest dev branch (for azure-cli) or main branch (for azure-cli-extensions).
After that please run the following commands to enable git hooks:

pip install azdev --upgrade
azdev setup -c <your azure-cli repo path> -r <your azure-cli-extensions repo path>

@github-actions
Copy link
Copy Markdown
Contributor

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR bumps the nginx extension version to 2.0.0b11 and introduces a new CLI command to analyze WAF v2 policies, with scenario-test updates to cover the new functionality.

Changes:

  • Bump extension version to 2.0.0b11 and add a corresponding HISTORY.rst entry.
  • Add nginx deployment waf-policy analyze-waf-policy (AAZ-generated command).
  • Update scenario test to use the new identity argument format and exercise the new WAF policy analysis command.

Reviewed changes

Copilot reviewed 5 out of 6 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/nginx/setup.py Version bump to 2.0.0b11.
src/nginx/HISTORY.rst Adds release notes for 2.0.0b11.
src/nginx/azext_nginx/tests/latest/test_nginx_scenario.py Updates deployment creation identity syntax; updates config analyze expectation; adds WAF policy analysis invocation.
src/nginx/azext_nginx/aaz/latest/nginx/deployment/waf_policy/_analyze_waf_policy.py New AAZ command implementation for WAF policy analysis.
src/nginx/azext_nginx/aaz/latest/nginx/deployment/waf_policy/init.py Exposes the new analyze command module.


# Nginx for Azure API key
create_api_key = 'nginx deployment api-key create -n "test-key" --deployment-name {deployment_name} --resource-group {rg} --end-date-time "2026-02-20T17:59:39.123Z" --secret-text "s5V/9~o^4TYCVwmNc2Y>Y1^64&T`0sXg-j9!Xy|8"'
create_api_key = 'nginx deployment api-key create -n "test-key" --deployment-name {deployment_name} --resource-group {rg} --end-date-time "2026-04-20T17:59:39.123Z" --secret-text "s5V/9~o^4TYCVwmNc2Y>Y1^64&T`0sXg-j9!Xy|8"'
Copy link

Copilot AI Mar 12, 2026

Choose a reason for hiding this comment

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

The test uses a hard-coded --end-date-time (2026-04-20). This will eventually become a past date and start failing in future runs. Prefer computing the end time relative to datetime.utcnow() (e.g., now + N days) or using a far-future timestamp that won’t expire.

Copilot uses AI. Check for mistakes.
])

analyze_result = self.cmd("nginx deployment waf-policy analyze-waf-policy --deployment-name {deployment_name} --resource-group {rg} --waf-policy-name default --filepath /etc/app_protect/conf/policy.json --content {create_waf2_file}").get_output_in_json()
assert len(analyze_result['status']) > 0
Copy link

Copilot AI Mar 12, 2026

Choose a reason for hiding this comment

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

assert len(analyze_result['status']) > 0 only checks that the status string is non-empty, so it would still pass for failure statuses (e.g., "FAILED"). Update the assertion to validate the expected successful status values (or at least assert it is not a failure) and, if applicable, assert on returned errors/diagnostics to make the test meaningful.

Suggested change
assert len(analyze_result['status']) > 0
status = analyze_result.get('status')
assert status, "Expected a non-empty status from waf-policy analyze-waf-policy"
assert status.upper() not in ('FAILED', 'ERROR'), f"Unexpected failure status from waf-policy analyze-waf-policy: {status}"

Copilot uses AI. Check for mistakes.
required=True,
)
_args_schema.waf_policy_name = AAZStrArg(
options=["--waf-policy-name"],
Copy link

Copilot AI Mar 12, 2026

Choose a reason for hiding this comment

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

The new command’s --waf-policy-name argument does not provide the standard -n/--name aliases that the other nginx deployment waf-policy commands use (e.g., create/show/update). For CLI consistency and usability, align the options list with the rest of the waf-policy commands.

Suggested change
options=["--waf-policy-name"],
options=["-n", "--name", "--waf-policy-name"],

Copilot uses AI. Check for mistakes.
@github-actions
Copy link
Copy Markdown
Contributor

CodeGen Tools Feedback Collection

Thank you for using our CodeGen tool. We value your feedback, and we would like to know how we can improve our product. Please take a few minutes to fill our codegen survey

@yonzhan yonzhan requested a review from necusjz March 12, 2026 23:50
@yonzhan yonzhan requested a review from jsntcy March 12, 2026 23:50
@necusjz
Copy link
Copy Markdown
Member

necusjz commented Mar 16, 2026

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 2 pipeline(s).

@necusjz
Copy link
Copy Markdown
Member

necusjz commented Mar 17, 2026

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 2 pipeline(s).

@briantkim93
Copy link
Copy Markdown
Member Author

/azp run

@azure-pipelines
Copy link
Copy Markdown

Commenter does not have sufficient privileges for PR 9678 in repo Azure/azure-cli-extensions

@yonzhan
Copy link
Copy Markdown
Collaborator

yonzhan commented Mar 18, 2026

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 2 pipeline(s).

@necusjz necusjz merged commit 00cfb24 into Azure:main Mar 18, 2026
24 checks passed
@azclibot
Copy link
Copy Markdown
Collaborator

[Release] Update index.json for extension [ nginx-2.0.0b11 ] : https://dev.azure.com/msazure/One/_build/results?buildId=157268590&view=results

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.

6 participants