Skip to content

[Containerapp] az containerapp job execution list: Fix incomplete paginated results - #34209

Merged
JaysonTaiMicrosoft merged 4 commits into
Azure:devfrom
kokelowo:kokelowo-microsoft-containerapp-execution-pagination
Oct 23, 2026
Merged

JaysonTaiMicrosoft merged 4 commits into
Azure:devfrom
kokelowo:kokelowo-microsoft-containerapp-execution-pagination

Conversation

@kokelowo

@kokelowo Korede (kokelowo) commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

🤖 PR Validation — ️✔️ All clear

Breaking Changes Tests
️✔️ None ️✔️ 130/130

Related command

az containerapp job execution list

Description

The command currently returns only the first page of execution history when ARM supplies a nextLink.

This change:

  • Follows every non-empty nextLink and aggregates executions in server-provided order, including when an intermediate page is empty.
  • Validates continuation URLs against the active cloud's ARM endpoint and preserves their query parameters.
  • Preserves the command's flat-array output and the client's dictionary response shape.
  • Propagates later-page failures rather than returning incomplete results.

No new flags or API-version changes are included.

Testing Guide

With repository source packages on PYTHONPATH, the following command passed all 12 tests, covering pagination, error propagation, existing unit tests, and two recorded execution scenarios:

.\.venv\Scripts\python.exe -m unittest `
  azure.cli.command_modules.containerapp.tests.latest.test_containerappjob_execution_pagination `
  azure.cli.command_modules.containerapp.tests.latest.test_containerapp_utils `
  azure.cli.command_modules.containerapp.tests.latest.test_containerapp_validators `
  azure.cli.command_modules.containerapp.tests.latest.test_containerappjob_executions.ContainerAppJobsExecutionsTest.test_containerapp_job_executionstest_e2e `
  azure.cli.command_modules.containerapp.tests.latest.test_containerappjob_executions.ContainerAppJobsExecutionsTest.test_containerapp_job_custom_executionstest_e2e -v

Additional checks passed:

.\.venv\Scripts\python.exe -m azure.cli containerapp job execution list -h
.\.venv\Scripts\python.exe -m azure.cli containerapp job execution show -h
.\.venv\Scripts\python.exe -m flake8 --append-config=.flake8 --statistics src\azure-cli\azure\cli\command_modules\containerapp
git diff --check

Both help commands omit the removed flag, and an argument-parsing check confirmed that the removed flag is rejected before an ARM request is made.

Reviewer usage example with placeholder resource names:

az containerapp job execution list \
  --resource-group MyResourceGroup \
  --name my-containerapp-job

On a job with multiple execution pages, the command should return all executions, not just one.

History Notes

[Containerapp] az containerapp job execution list: Follow ARM pagination to return all executions


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

Follow ARM continuation URLs and return complete execution history. Add an optional page-size argument with regression coverage.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 445d57df-fd66-4c9d-b6a0-ee9c14ca213d
Copilot AI balanced review requested due to automatic review settings October 9, 2026 20:38
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

@microsoft-github-policy-service microsoft-github-policy-service Bot added the customer-reported Issues that are reported by GitHub users external to the Azure organization. label Oct 9, 2026
@microsoft-github-policy-service

Copy link
Copy Markdown
Contributor

Thank you for your contribution Korede (@kokelowo)! We will review the pull request and get back to you soon.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

The introduced pageSize query parameter is absent from the selected ARM API contract.

1 open finding
What changed in this PR

Fixes Container App Job execution pagination while preserving output shape and continuation behavior.

Changes:

  • Aggregates all ARM execution pages securely.
  • Adds pagination tests and --page-size.
  • Updates command help.
File Description
_clients.py Implements pagination and continuation validation.
custom.py Forwards and validates page size.
_params.py Defines --page-size.
_help.py Documents pagination usage.
test_containerappjob_execution_pagination.py Tests pagination and failures.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/azure-cli/azure/cli/command_modules/containerapp/_clients.py Outdated
@a0x1ab

Copy link
Copy Markdown
Member

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 3 pipeline(s).

@yonzhan

Copy link
Copy Markdown
Collaborator

Please fix CI issues

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 445d57df-fd66-4c9d-b6a0-ee9c14ca213d
@kokelowo Korede (kokelowo) changed the title [Containerapp] az containerapp job execution list: Fix incomplete paginated results [Containerapp] az containerapp job execution list: Fix incomplete paginated results Oct 14, 2026
@a0x1ab

Copy link
Copy Markdown
Member

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 3 pipeline(s).

Keep automatic ARM continuation handling without exposing an undocumented query parameter.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 445d57df-fd66-4c9d-b6a0-ee9c14ca213d
@a0x1ab

Copy link
Copy Markdown
Member

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 3 pipeline(s).

@Greedygre

Greedygre (Greedygre) commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Hi @Azure/x-engineering-agent
The PR description seems not correct, AzureCLI-BreakingChangeTest that mention network is not relate to this PR
.
Maybe you can update the description.

@teresaritorto Teresa Ritorto (teresaritorto) added the Request X Engineering Agent Ask the agent to triage this issue or review this PR label Oct 20, 2026
@x-engineering-agent

x-engineering-agent Bot commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

X Engineering Agent Report

Review — Comments

Korede (@kokelowo)

No confirmed semantic findings at f45688e0d740428160125e04c4f29fb4011cce26. Upstream CI passed: 52 completed/passed, 0 failed. Scenario regression coverage remains unverified.

Copilot feedback 4234382161 is already addressed: the current command/client signatures contain no page-size parameter, and _clients.py:1046-1069 follows service-provided continuation URLs without introducing pageSize or changing the API version.

Test validation
  • Agent live test: Not run; this is a review-only PR. Check author-provided test evidence and upstream CI separately.
  • Regression coverage: For containerapp: 1 focused test file(s) changed. Scenario coverage is unverified; review the issue's required conditions, test setup, and assertions before approval. No linked issue was found in the PR timeline; inspect the source issue and its required scenario manually.
  • Coverage limitation / before merge: src/azure-cli/azure/cli/command_modules/containerapp/tests/latest/test_containerappjob_execution_pagination.py asserts ordered 45-item output across three mocked pages, continuation after empty pages, preserved encoded URLs, cloud-origin validation, and later-page failures. However, it mocks send_raw_request and calls the handler directly; it does not establish actual ARM continuation behavior or end-to-end CLI output. No recording files changed. Request a focused rerun of az containerapp job execution list -n <job> -g <resource-group> -o json against a job with multiple execution pages, verifying the complete flat array in server order. Confirm empty-intermediate-page handling and failure without partial success through focused transport-backed replay or equivalent controlled verification.
Risk assessment — 16/100 · Low

The Low rating is driven by public CLI behavior.

  • Change scope: 4 changed files, 212 changed lines (+209 / -3), including 3 production files.
  • Affected components: containerapp
  • Risk drivers: public CLI behavior (+18)
  • Regression evidence: Changed regression tests are included, reducing risk.
  • Confidence: High because changed-line patches were available for every production file.
  • Required review: Owning-squad review is recommended for containerapp before merge.

Posted by x-engineering-agent (Reviewer)

@x-engineering-agent x-engineering-agent Bot added the X Engineering Agent Reviewed Agent reviewed this PR label Oct 20, 2026
@JaysonTaiMicrosoft

Copy link
Copy Markdown
Contributor

Korede (@kokelowo) Can you sync the branch with dev. It should resolve the breaking change inconsistency.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 445d57df-fd66-4c9d-b6a0-ee9c14ca213d
@kokelowo

Copy link
Copy Markdown
Contributor Author

/azp run

@azure-pipelines

Copy link
Copy Markdown
Commenter does not have sufficient privileges for PR 34209 in repo Azure/azure-cli

@yonzhan

Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 3 pipeline(s).

@JaysonTaiMicrosoft
JaysonTaiMicrosoft merged commit 217d6a5 into Azure:dev Oct 23, 2026
52 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Auto-Assign Auto assign by bot customer-reported Issues that are reported by GitHub users external to the Azure organization. Request X Engineering Agent Ask the agent to triage this issue or review this PR X Engineering Agent Reviewed Agent reviewed this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants