Skip to content

ci: add Python version matrix to test workflows#570

Merged
imran-siddique merged 3 commits intomicrosoft:mainfrom
rinadavidyuk826-sudo:ci/python-version-matrix
Mar 30, 2026
Merged

ci: add Python version matrix to test workflows#570
imran-siddique merged 3 commits intomicrosoft:mainfrom
rinadavidyuk826-sudo:ci/python-version-matrix

Conversation

@rinadavidyuk826-sudo
Copy link
Copy Markdown
Contributor

Summary

  • Extends the test job matrix to cover Python 3.10, 3.11, 3.12, and 3.13 for all five core packages
  • Replaces the previous partial include workaround (which only added 3.10 for agent-os and agent-sre) with a uniform 5 × 4 matrix

Fixes #541

Changes

.github/workflows/ci.ymltest job:

Before After
python-version: ["3.11", "3.12"] + 2 ad-hoc includes for 3.10 python-version: ["3.10", "3.11", "3.12", "3.13"] (no includes needed)

Matrix size: 12 jobs → 20 jobs (5 packages × 4 Python versions)

Fixes microsoft#541

Extends the test job matrix to cover Python 3.10, 3.11, 3.12, and 3.13
for all five core packages (agent-os, agent-mesh, agent-hypervisor,
agent-sre, agent-compliance).

The previous setup used 3.11 and 3.12 as the base matrix with ad-hoc
includes for 3.10 on agent-os and agent-sre only. This replaces that
with a uniform 5×4 matrix so every package is validated against the full
supported range.
@github-actions
Copy link
Copy Markdown

Welcome to the Agent Governance Toolkit! Thanks for your first pull request.
Please ensure tests pass, code follows style (ruff check), and you have signed the CLA.
See our Contributing Guide.

@github-actions github-actions bot added ci/cd CI/CD and workflows size/XS Extra small PR (< 10 lines) labels Mar 29, 2026
Copy link
Copy Markdown

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

🤖 AI Agent: code-reviewer

Review of PR: ci: add Python version matrix to test workflows

This PR introduces a change to the CI configuration by expanding the Python version matrix for testing across all core packages. Below is the review of the changes:


🔴 CRITICAL

No critical issues were found in this PR.


🟡 WARNING

  1. Potential Backward Compatibility Issue with Python 3.13:
    • Python 3.13 is included in the matrix, but as of now, Python 3.13 is not officially released (as of my knowledge cutoff in October 2023). Including it in the matrix may cause CI failures if the Python version is not yet available in GitHub Actions runners. This could disrupt the CI pipeline unnecessarily.
    • Action: Verify that Python 3.13 is officially supported and available in GitHub Actions runners. If not, consider removing it until it is officially released.

💡 SUGGESTIONS

  1. Test Coverage for Edge Cases:

    • While this PR ensures broader Python version coverage, it does not address whether the tests themselves cover edge cases for compatibility across versions. Ensure that the test suite includes cases for:
      • Changes in Python's standard library between versions.
      • Deprecations or new features introduced in Python 3.12 and 3.13.
    • Action: Review the test suite to ensure it adequately tests for version-specific behavior.
  2. Matrix Size and CI Runtime:

    • Expanding the matrix from 12 jobs to 20 jobs will increase CI runtime. If runtime becomes a bottleneck, consider:
      • Running the full matrix only on main branch or release builds.
      • Using a reduced matrix (e.g., only Python 3.11 and 3.12) for PRs and running the full matrix on a nightly schedule.
    • Action: Monitor CI runtime after merging this PR and optimize if necessary.
  3. Documentation Update:

    • If Python 3.13 is officially supported, update the documentation (e.g., README.md or CONTRIBUTING.md) to reflect the expanded Python version support.
    • Action: Ensure the documentation is consistent with the supported Python versions.
  4. Pinning Action Versions:

    • The actions/checkout and actions/setup-python steps use pinned versions via commit hashes. While this ensures stability, it can lead to outdated versions being used over time.
    • Action: Periodically update the pinned versions to ensure the latest features and security updates are applied.

Summary

This PR improves the CI pipeline by ensuring broader Python version coverage, which is essential for maintaining compatibility across supported Python versions. However, the inclusion of Python 3.13 may introduce unnecessary CI failures if the version is not yet officially supported. Additionally, the increase in matrix size may impact CI runtime, so monitoring and optimization may be required. Addressing these points will ensure a smooth integration of this change.

@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 29, 2026

🤖 AI Agent: security-scanner — Security Review of PR: `ci: add Python version matrix to test workflows`

Security Review of PR: ci: add Python version matrix to test workflows

This PR modifies the CI workflow to expand the Python version matrix for testing. While the changes are primarily related to CI/CD configuration, it is critical to ensure that no security vulnerabilities are introduced, especially in a security-focused library like microsoft/agent-governance-toolkit.


Findings:

1. Supply Chain Risk: Dependency Pinning in CI/CD

Severity: 🟠 HIGH
Issue:
The actions/checkout and actions/setup-python dependencies are pinned to specific commit SHAs (11bd71901bbe5b1630ceea73d27597364c9af683 and a309ff8b426b58ec0e2a45f0f869d46889d02405, respectively). While this is better than using floating tags (e.g., @v4 or @v6), it does not guarantee immutability. If the repository owners force-push changes to these SHAs, malicious code could be introduced.

Attack Vector:
A compromised or malicious update to these GitHub Actions could execute arbitrary code during the CI pipeline, potentially exposing secrets or modifying the build artifacts.

Recommendation:

  • Use a tool like actions-lock to verify the integrity of GitHub Actions dependencies. This tool generates a lock file for actions, ensuring that only trusted versions are used.
  • Regularly audit and update these dependencies to ensure they include the latest security patches.

2. Credential Exposure in CI Logs

Severity: 🔵 LOW
Issue:
The workflow does not explicitly mask secrets or sensitive environment variables in the logs. While this is not directly related to the changes in this PR, it is a good practice to ensure that secrets (e.g., GITHUB_TOKEN, API keys) are not inadvertently exposed in logs.

Attack Vector:
If a secret is accidentally logged (e.g., via a debug statement or error message), an attacker with access to the CI logs could exfiltrate sensitive information.

Recommendation:

  • Use the ::add-mask:: command in GitHub Actions to mask sensitive output.
  • Review all steps in the workflow to ensure that no secrets are logged.

3. Backward Compatibility Testing

Severity: 🟡 MEDIUM
Issue:
The expanded matrix now includes Python 3.13, which is a future version (as of the knowledge cutoff in October 2023). While this is a proactive step, there is a risk that the library may not yet be compatible with this version, leading to false negatives in the CI pipeline.

Attack Vector:
If the library is not fully tested or compatible with Python 3.13, users may unknowingly deploy it in environments where it behaves unpredictably, potentially leading to security vulnerabilities (e.g., policy engine circumvention or prompt injection).

Recommendation:

  • Ensure that all dependencies used by the library are also compatible with Python 3.13.
  • Add a note in the documentation or release notes to clarify the level of support for Python 3.13 (e.g., "experimental").

Summary of Findings:

  1. 🟠 HIGH: Supply chain risk due to lack of action integrity verification.
  2. 🔵 LOW: Potential for credential exposure in CI logs.
  3. 🟡 MEDIUM: Backward compatibility concerns with Python 3.13.

Final Assessment:

The changes in this PR are primarily related to CI/CD configuration and do not directly impact the runtime security of the microsoft/agent-governance-toolkit library. However, the identified issues (especially the supply chain risk) should be addressed to ensure the integrity and security of the CI pipeline.

Suggested Next Steps:

  1. Implement action integrity verification using a tool like actions-lock.
  2. Review the workflow for potential credential exposure and mask sensitive data in logs.
  3. Test the library and its dependencies for compatibility with Python 3.13, and document the support level for this version.

Let me know if you need further clarification or assistance!

@imran-siddique imran-siddique enabled auto-merge (squash) March 29, 2026 20:34
Copy link
Copy Markdown

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

🤖 AI Agent: code-reviewer

Review of PR: ci: add Python version matrix to test workflows

This PR updates the GitHub Actions CI workflow to expand the Python version matrix for testing across all core packages. Below is a detailed review of the changes:


🔴 CRITICAL

No critical issues were identified in this PR. The changes are limited to CI configuration and do not directly impact runtime code or security-sensitive areas.


🟡 WARNING

  1. Potential Compatibility Issues with Python 3.13:
    • Python 3.13 is included in the matrix, but as of this review, Python 3.13 is not officially released. Testing against a pre-release version may lead to false positives or false negatives due to potential instability or incomplete support in dependencies.
    • Action: Ensure that Python 3.13 is explicitly marked as an "allow-failure" job in the matrix until it is officially released and supported by all dependencies.

💡 SUGGESTIONS

  1. Optimize Matrix Size:

    • The matrix size has increased from 12 to 20 jobs. While this ensures comprehensive testing, it may lead to longer CI execution times. Consider using a strategy to prioritize critical combinations (e.g., latest Python version with all packages) while running the full matrix less frequently (e.g., nightly or on release branches).
    • Action: Add a conditional to run the full matrix only on main or release/* branches, and a reduced matrix for PRs.
  2. Document Python Version Support:

    • The addition of Python 3.13 to the matrix suggests that the library intends to support it. Ensure that this is reflected in the documentation (e.g., README.md or setup.py/pyproject.toml).
    • Action: Update the documentation to explicitly list supported Python versions.
  3. Backward Compatibility Testing:

    • While this PR does not directly modify the codebase, adding Python 3.10 to the matrix for all packages may reveal compatibility issues with older Python versions. Ensure that any such issues are addressed promptly.
    • Action: Monitor test results for Python 3.10 and resolve any compatibility issues.
  4. Pin Actions Versions:

    • The actions/checkout and actions/setup-python steps use specific commit SHAs instead of version tags. While this ensures stability, it may lead to outdated dependencies over time.
    • Action: Periodically review and update the pinned versions of GitHub Actions to ensure compatibility and security.

Summary

This PR improves the CI pipeline by expanding the Python version matrix, ensuring broader compatibility testing across all core packages. However, the inclusion of Python 3.13 (pre-release) should be handled with caution, and the matrix size increase may impact CI performance. Addressing the suggestions above will further enhance the robustness and maintainability of the CI workflow.

  • Mark Python 3.13 as "allow-failure" until officially released.
  • Consider optimizing the matrix size for PRs to reduce CI runtime.
  • Update documentation to reflect supported Python versions.
  • Monitor test results for backward compatibility issues with Python 3.10.
  • Periodically review and update pinned GitHub Actions versions.

Let me know if you need further assistance!

Copy link
Copy Markdown
Member

@imran-siddique imran-siddique left a comment

Choose a reason for hiding this comment

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

Reviewed: all mandatory checks pass per copilot-instructions.md.

Copy link
Copy Markdown

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

🤖 AI Agent: code-reviewer

Review of PR: ci: add Python version matrix to test workflows

Summary

This PR updates the GitHub Actions CI workflow to expand the Python version matrix for testing, ensuring compatibility with Python 3.10, 3.11, 3.12, and 3.13 across all five core packages. The previous ad-hoc inclusion of Python 3.10 for specific packages has been replaced with a uniform matrix.


Feedback

🔴 CRITICAL

No critical issues were identified in this PR. The changes are limited to the CI configuration and do not directly impact runtime behavior or security-sensitive areas of the codebase.


🟡 WARNING

  1. Python 3.13 Compatibility
    Python 3.13 is currently in development and has not been officially released as of the time of this review. Including it in the matrix may lead to false positives or failures due to incomplete support in dependencies or the Python ecosystem.
    • Action: Consider adding Python 3.13 as an allow-failure entry in the matrix until it is officially released and stable.

💡 SUGGESTIONS

  1. Matrix Size and CI Runtime
    Expanding the matrix from 12 jobs to 20 jobs will increase CI runtime. While this ensures broader compatibility, it may slow down development workflows.

    • Action: Evaluate whether all five packages need to be tested against all Python versions in every CI run. For example, consider running the full matrix only on main branch merges or nightly builds, while PRs could test against a smaller subset (e.g., the latest stable Python version and one older version).
  2. Explicit Python Version Pinning
    The python-version values in the matrix are specified as strings (e.g., "3.10"). While this is valid, it may be beneficial to explicitly pin to specific patch versions (e.g., "3.10.12") to ensure consistency across runs.

    • Action: Pin Python versions to the latest stable patch releases for each minor version.
  3. Documentation Update
    The README or CONTRIBUTING.md file should be updated to reflect the expanded Python version support. This ensures that contributors are aware of the supported Python versions and can test their changes locally before submitting PRs.

    • Action: Add a note about Python 3.10–3.13 compatibility in the relevant documentation.
  4. Dependency Compatibility Check
    While this PR focuses on CI configuration, it is important to verify that all dependencies used in the project are compatible with Python 3.13.

    • Action: Run a dependency compatibility check (e.g., using pip check or pipdeptree) to identify any potential issues with Python 3.13.

Final Assessment

This PR improves the CI pipeline by ensuring broader Python version coverage, which is critical for maintaining compatibility across different Python environments. However, the inclusion of Python 3.13 (pre-release) and the increased matrix size warrant careful consideration.

  • Merge Readiness: 🟢 Ready to merge with minor adjustments (e.g., marking Python 3.13 as allow-failure).
  • Priority Follow-Ups: Address potential runtime and dependency compatibility issues with Python 3.13 before its official release.

@imran-siddique imran-siddique merged commit fa4176d into microsoft:main Mar 30, 2026
57 of 60 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci/cd CI/CD and workflows size/XS Extra small PR (< 10 lines)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ci: add Python version matrix to test workflows

2 participants