Skip to content

Conversation

@JennyPng JennyPng marked this pull request as ready for review October 27, 2025 22:28
Copilot AI review requested due to automatic review settings October 27, 2025 22:28
Copy link
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 modernizes the Pyright and VerifyTypes CI checks by transitioning from the tox-based approach to a new direct execution method using the run_venv_command abstraction. The changes improve code maintainability by consolidating shared functionality and updating the CI pipeline configuration to use the new dispatch_checks.py script with enhanced environment settings.

Key Changes:

  • Refactored verifytypes.py to use instance methods and run_venv_command abstraction
  • Updated pyright.py to use run_venv_command with improved error logging
  • Modified CI pipeline templates to use new dispatch script with updated environment variables

Reviewed Changes

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

File Description
eng/tools/azure-sdk-tools/azpysdk/verifytypes.py Converted standalone functions to class methods, integrated run_venv_command abstraction, and added create_package_and_install for package preparation
eng/tools/azure-sdk-tools/azpysdk/pyright.py Replaced direct check_call with run_venv_command and enhanced error logging
eng/pipelines/templates/steps/run_pyright.yml Updated to use new dispatch_checks.py script, simplified arguments, and added environment variable configuration

return 0

def get_type_complete_score(
self, executable, commands: typing.List[str], cwd: str, check_pytyped: bool = False
Copy link

Copilot AI Oct 27, 2025

Choose a reason for hiding this comment

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

The parameter name executable is ambiguous. Consider renaming it to python_executable to match the parameter name used in the install_from_main method and improve clarity about what executable is being referenced.

Copilot uses AI. Check for mistakes.
return 0

def get_type_complete_score(
self, executable, commands: typing.List[str], cwd: str, check_pytyped: bool = False
Copy link

Copilot AI Oct 27, 2025

Choose a reason for hiding this comment

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

This method lacks a docstring. Add a docstring that describes the purpose of the method, explains the parameters (especially executable, commands, cwd, and check_pytyped), documents the return value (the type completeness score), and explains when -1.0 is returned to indicate an error.

Copilot uses AI. Check for mistakes.
results.append(1)
return max(results) if results else 0

def install_from_main(self, setup_path: str, python_executable: Optional[str] = None) -> int:
Copy link

Copilot AI Oct 27, 2025

Choose a reason for hiding this comment

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

This method lacks a docstring. Add a docstring that describes the method's purpose (installing a package from the main branch), explains the parameters (setup_path and python_executable), documents the return value (0 for success, 1 for failure), and describes the cleanup behavior with the temporary directory.

Copilot uses AI. Check for mistakes.
@JennyPng JennyPng marked this pull request as draft October 28, 2025 02:59
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.

1 participant