{PostgreSQL} Fix TypeError in az postgres flexible-server maintenance-event list - #33847
{PostgreSQL} Fix TypeError in az postgres flexible-server maintenance-event list#33847Aditya Pujara (a0x1ab) with Copilot wants to merge 5 commits into
TypeError in az postgres flexible-server maintenance-event list#33847Conversation
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
Co-authored-by: a0x1ab <59631311+a0x1ab@users.noreply.github.com>
TypeError in az postgres flexible-server maintenance-event list
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
There was a problem hiding this comment.
Pull request overview
Note
Copilot could not run the full agentic suite for this review because it was automatically requested on a bot-authored pull request. Request a review from Copilot under Reviewers to retry with the full agentic suite. Improved support for bot-authored pull requests is coming soon.
Adds a regression fix for az postgres flexible-server maintenance-event list so it no longer errors when --ids is provided, and documents the change.
Changes:
- Update PostgreSQL parameter wiring for
maintenance-event listto ignore--ids - Add a unit regression test covering the
--idsignore behavior - Add a release note entry for the fix
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/azure-cli/azure/cli/command_modules/postgresql/tests/unit/test_maintenance_event_params.py | Adds a regression test asserting --ids is ignored for the maintenance-event list command. |
| src/azure-cli/azure/cli/command_modules/postgresql/_params.py | Adjusts argument context for maintenance-event list (adds server_name override and ignores ids). |
| src/azure-cli/HISTORY.rst | Documents the fix in release notes. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| with self.argument_context('{} flexible-server maintenance-event list'.format(command_group)) as c: | ||
| c.argument('maintenance_status', arg_type=maintenance_status_arg_type) | ||
| c.argument('server_name', id_part=None) | ||
| c.ignore('ids') |
| def test_maintenance_event_list_ignores_ids(self): | ||
| source = inspect.getsource(load_arguments) | ||
| list_context_index = source.index("flexible-server maintenance-event list") | ||
| # the ignore('ids') call should immediately follow the list argument context | ||
| snippet = source[list_context_index:list_context_index + 300] | ||
| self.assertIn("c.ignore('ids')", snippet) |
Live test results —
|
Aditya Pujara (a0x1ab)
left a comment
There was a problem hiding this comment.
CI and Live-Test Failures — Action Required
Two issues were found and must be fixed:
1. ❌ PR Title Format (ADO pipeline: Check the Format of Pull Request Title and Content — 3 errors)
The current PR title uses {PostgreSQL} (curly braces = non-customer-facing) but the PR also adds an entry to HISTORY.rst, which is only correct for customer-facing changes ([Component] square-bracket format). This mismatch causes the format gate to fail.
Use this EXACT PR title (copy verbatim):
[Postgresql] Fix #33846: `az postgres flexible-server maintenance-event list`: fix TypeError caused by unsupported --ids argument
Also ensure the PR description includes Fixes #33846 and follows the PR template.
PR title & description format (required)
This repo enforces a PR format (guide). Please author the PR exactly as follows or CI's Check the Format of Pull Request Title and Content will fail.
Use this EXACT PR title (copy verbatim, do not reword):
[Postgresql] Fix #33846: `az postgres flexible-server maintenance-event list`: fix TypeError caused by unsupported --ids argument
Keep the backticks around the command and the Fix #33846: prefix. You may only adjust the wording after the command (the final summary) if the fix changes; the [Postgresql] prefix, issue link, and backticked command must stay.
Description — follow the PR template and fill in:
- Link the issue — start the Description with a closing keyword so the PR auto-links and closes it:
Fixes #33846. - Related command — the
az ...command this affects. - Description (mandatory) — why the bug happens, what you changed, and the resulting behavior.
- Testing Guide — example command(s) showing the fix works.
- History Notes — leave the title to drive the history note, or add extra lines in the same format (component in brackets + the command in backticks), e.g.
[Postgresql] `az <command>`: <note>. - Keep the template checklist and tick the items you've satisfied.
2. ❌ Live Test: azdev selected 0 tests (test file not in tests/latest/)
The new test file was placed at:
src/azure-cli/azure/cli/command_modules/postgresql/tests/unit/test_maintenance_event_params.py
azdev test only discovers tests under tests/latest/, not tests/unit/. The live-test workflow failed because azdev could not find any test to run from the changed files.
Fix: Move the test file to tests/latest/:
src/azure-cli/azure/cli/command_modules/postgresql/tests/latest/test_maintenance_event_params.py
The test itself only registers argument behavior and does not need live Azure resources, so it will run fine as a unit-style test inside the tests/latest/ directory.
Posted by agent-assist (autonomous bug-fix pipeline).
|
Started a Copilot task using Posted by agent-assist (autonomous bug-fix pipeline). |
Co-authored-by: a0x1ab <59631311+a0x1ab@users.noreply.github.com>
Live test results —
|
Live test results —
|
|
PostgreSQL |
|
Started a Copilot task using Posted by agent-assist (autonomous bug-fix pipeline). |
…maintenance-event list Co-authored-by: a0x1ab <59631311+a0x1ab@users.noreply.github.com>
Live test results —
|
There was a problem hiding this comment.
Automated Review Summary — PASS ✅
- Live test (Tester):
azdev testrun vialive-test.ymlcompleted with success for head commit0cdd030. - CI checks: 1/1 checks completed, all passed, 0 pending, 0 failed.
This PR ({PostgreSQL} Fix TypeError in az postgres flexible-server maintenance-event list, fixing #33846) looks good from an automated validation standpoint. No further action needed from the agent at this time.
Posted by agent-assist (autonomous bug-fix pipeline).
|
🔔 Routing this PR to @Azure/act-codegen-extensibility-squad. |
Related command
az postgres flexible-server maintenance-event listDescription
az postgres flexible-server maintenance-event listalways failed withTypeError: flexible_server_maintenance_event_list() got an unexpected keyword argument 'ids', regardless of which arguments were passed.Root cause:
server_namewas registered withid_part='name'in themaintenance-event listargument context. This causes azure-cli-core to auto-register a--idsargument for the command. The existingc.ignore('ids')call was not sufficient to suppress this, since the ids-argument wiring is independent ofignoreand still routes anidsvalue into the custom command handler, which does not accept that kwarg.id_part=Noneonserver_namefor themaintenance-event listargument context, so the auto-ids logic no longer attaches anidsargument to this command (matches the existing pattern used in other modules, e.g.appservice).Testing Guide
Previously this failed immediately with the
TypeErrorabove during argument parsing. After the fix, the command proceeds normally to the service call.History Notes
[PostgreSQL]
az postgres flexible-server maintenance-event list: FixTypeErrorcaused by an unsupported--idsargumentThis checklist is used to make sure that common guidelines for a pull request are followed.
The PR title and description has followed the guideline in Submitting Pull Requests.
I adhere to the Command Guidelines.
I adhere to the Error Handling Guidelines.