Skip to content

Conversation

nilo19
Copy link
Member

@nilo19 nilo19 commented Oct 7, 2025


  • Fix stdin reading hang in CI/CD pipelines by using select with timeout for non-interactive mode.
  • Update pytest marker registration and fix datetime.utcnow() deprecation warning in tests.
  • Improve test framework with real-time stderr output visibility and subprocess timeout.

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

Related command

az aks agent

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 Copilot AI review requested due to automatic review settings October 7, 2025 15:49
Copy link

azure-client-tools-bot-prd bot commented Oct 7, 2025

️✔️Azure CLI Extensions Breaking Change Test
️✔️Non Breaking Changes

Copy link

Hi @nilo19,
Please write the description of changes which can be perceived by customers into HISTORY.rst.
If you want to release a new extension version, please update the version in setup.py as well.

@yonzhan
Copy link
Collaborator

yonzhan commented Oct 7, 2025

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

Copy link

github-actions bot commented Oct 7, 2025

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>

Copy link
Contributor

@Copilot 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 fixes stdin reading issues in CI/CD pipelines for the AKS agent by implementing timeout protection and proper non-interactive mode handling. It also updates the test framework with better debugging capabilities and addresses deprecation warnings.

  • Fixes stdin reading hang in non-interactive environments using select with timeout
  • Improves test framework with real-time output visibility and subprocess timeouts
  • Updates pytest configuration and addresses datetime deprecation warnings

Reviewed Changes

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

File Description
src/aks-agent/setup.cfg Adds pytest marker registration for AKS agent evaluation test categories
src/aks-agent/azext_aks_agent/tests/evals/test_ask_agent.py Enhances test framework with real-time logging, subprocess timeouts, and replaces deprecated datetime.utcnow()
src/aks-agent/azext_aks_agent/agent/agent.py Implements select-based timeout protection for stdin reading to prevent hangs in CI/CD

Copy link

github-actions bot commented Oct 7, 2025

Hi @nilo19

Release Suggestions

Module: aks-agent

  • Update VERSION to 1.0.0b7 in src/aks-agent/setup.py

Notes

@nilo19
Copy link
Member Author

nilo19 commented Oct 17, 2025

@yonzhan can I have an update?

# Check if data is available with 100ms timeout
if select.select([sys.stdin], [], [], 0.1)[0]:
piped_data = sys.stdin.read().strip()
console.print(
Copy link
Member

Choose a reason for hiding this comment

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

How will this impact the user?

Copy link
Member Author

Choose a reason for hiding this comment

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

I think it won't.

# as it may hang in CI/CD environments. Only read stdin if:
# 1. Not a TTY (indicating piped input)
# 2. Interactive mode is enabled (allows stdin reading)
should_check_stdin = not sys.stdin.isatty() and interactive
Copy link
Member

Choose a reason for hiding this comment

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

Is our eval pipeline failure related to this change?

Copy link
Member Author

Choose a reason for hiding this comment

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

related to another pipeline failure

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AKS Auto-Assign Auto assign by bot

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants