Skip to content

Microsoft.CodeTransparency Python SDK #4

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1,558 commits into
base: main
Choose a base branch
from
Draft

Microsoft.CodeTransparency Python SDK #4

wants to merge 1,558 commits into from

Conversation

l0lawrence
Copy link
Owner

Generated Microsoft.CodeTransparency Python SDK

This PR introduces the initial version of the Microsoft.CodeTransparency Python SDK generated from the TypeSpec API specifications.

Changes Made

  • Generated SDK package structure and core functionality
  • Fixed MyPy type issues in sample files
  • Added proper error handling for environment variables
  • Fixed AzureKeyCredential parameter types
  • Created comprehensive CHANGELOG.md
  • All validation checks (pylint, mypy, verifytypes) passing

Validation Results

  • Pylint: 10/10
  • MyPy: No issues found
  • Verifytypes: 100% type completeness

Testing

The SDK has been generated and validated but needs integration testing with the actual service.

raych1 and others added 30 commits April 18, 2025 11:02
* Update .gitignore 

Ignoring files and folders created in the spec-gen-sdk pipeline scenario

only ignore package.json and package-lock.json under root folder
The class- and __init__-level docstrings for AutoLockRenewer both contained
identical parameter descriptions, causing eight parameter tables to appear
instead of the intended four. This commit removes the __init__ docstring
block and centralizes all documentation in the class-level docstring.

- Delete duplicate docstring in __init__.
- Retain summary and Attributes section in class-level docstring.
- Ensure Sphinx/AutoAPI generates only the correct four parameters.

This prevents erroneous “required” flags on defaulted parameters and keeps the
API reference clean and accurate.
* Updates on Cosmos Diagnostics

Adds the ability to use logging.Filters on diagnostics logs based on the same filterable parameters as the cosmos diagnostics handler. Also adds some optimizations to reduce time spent on logging diagnostics. Lastly improves the formatting of the diagnostics log to improve readabilty especially when errors are logged.

* Update CHANGELOG.md

* Update CHANGELOG.md

* updates to cosmos diagnostics

* update to logging policy and tests

* pylint updates

* Update README.md

* Remove diagnostics handler

This removes the custom diagnostics handler and instead allows the use of logging filters.

* Update CHANGELOG.md

* Update _cosmos_http_logging_policy.py

* update recommended changes

* updates
…aluation of document search (Azure#39929)

* Added new evaluator code for Azure AI Evaluation

* Added TypedDict for input validation and created json schema specs for input and output schemas

* Added a temporary hack to make the example runnable; updated schema

* Implementation improvements to align with applied science recommendations

* Added docstrings and cleaned up input schema file

* Updates based on in-person feedback

* Addressed comments from the PR and SDK review

* small fix for threshold dict update

* Updates to support complex object inputs in DocumentRetrievalEvaluator

* Silence cspell errors for metric names'

* Updates to cspell.json

* Some updates for style enforcement; removed json schema files

* Reformatted with black

* Added tests, addressed a few comments and handled some edge cases

* Updates to tests and a few code fixes

* Docstring updates and added samples

* PR comments

* A few small test updates

---------

Co-authored-by: Abby Hartman <[email protected]>
…0520)

* call evaluate_with_rai_service instead of evaluate

* clean up

* bug fixes

* add retry logic to service calls and send_prompt_async

* small fixes

* update retry to handle asyncio timeout

* fix attack success
…DK owner) (Azure#40114)

* code and test

* Update changelog and version to 9.2.0

---------

Co-authored-by: azure-sdk <PythonSdkPipelines>
Co-authored-by: ChenxiJiang333 <[email protected]>
…wner) (Azure#40358)

* code and test

* Update version to 22.2.0 and changelog

* Update CHANGELOG.md

---------

Co-authored-by: azure-sdk <PythonSdkPipelines>
Co-authored-by: ChenxiJiang333 <[email protected]>
… SDK owner) (Azure#40242)

* code and test

* Update CHANGELOG.md for new operation groups

---------

Co-authored-by: azure-sdk <PythonSdkPipelines>
Co-authored-by: ChenxiJiang333 <[email protected]>
…SDK owner) (Azure#40334)

* code and test

* update testcases

---------

Co-authored-by: azure-sdk <PythonSdkPipelines>
Co-authored-by: ChenxiJiang333 <[email protected]>
…ner) (Azure#40370)

* code and test

* tests

* tests assets

* import pytest

---------

Co-authored-by: azure-sdk <PythonSdkPipelines>
Co-authored-by: Audunn Baldvinsson <[email protected]>
…K owner) (Azure#40356)

* code and test

* update testcases

* Update CHANGELOG.md

* Update CHANGELOG.md

---------

Co-authored-by: azure-sdk <PythonSdkPipelines>
Co-authored-by: ChenxiJiang333 <[email protected]>
Co-authored-by: ChenxiJiang333 <[email protected]>
…y SDK owner) (Azure#40369)

* code and test

* update testcases

* update version

---------

Co-authored-by: azure-sdk <PythonSdkPipelines>
Co-authored-by: ChenxiJiang333 <[email protected]>
* Allow for alphanumeric in column mapping

* add unit test
…ub issues (Azure#40589)

* preliminary redteam tsg

* add column mapping bullet to evaluate tsg

* add storage permissions warning section
This credential is deprecated because the Azure Account extension
for Visual Studio Code, which this credential relies on, has been deprecated.

Signed-off-by: Paul Van Eck <[email protected]>
… SDK owner) (Azure#40210)

* code and test

* update testcases

---------

Co-authored-by: azure-sdk <PythonSdkPipelines>
Co-authored-by: ChenxiJiang333 <[email protected]>
* Pin major version of external dependencies

* Update sdk/ml/azure-ai-ml/setup.py

Co-authored-by: Copilot <[email protected]>

* Update CHANGELOG

* Remove constraint from azure-common as this is an internal dep

* Explicit constraints

---------

Co-authored-by: Amit Chauhan <[email protected]>
Co-authored-by: Copilot <[email protected]>
…DK owner) (Azure#40563)

* code and test

* Update CHANGELOG with new models and changes

---------

Co-authored-by: azure-sdk <PythonSdkPipelines>
Co-authored-by: ChenxiJiang333 <[email protected]>
… SDK owner) (Azure#40266)

* code and test

* update-testcase

---------

Co-authored-by: azure-sdk <PythonSdkPipelines>
Co-authored-by: ChenxiJiang333 <[email protected]>
…SDK owner) (Azure#40393)

* code and test

* update testcases

---------

Co-authored-by: azure-sdk <PythonSdkPipelines>
Co-authored-by: ChenxiJiang333 <[email protected]>
…by SDK owner) (Azure#40439)

* code and test

* update testcases

---------

Co-authored-by: azure-sdk <PythonSdkPipelines>
Co-authored-by: ChenxiJiang333 <[email protected]>
Co-authored-by: azure-sdk <PythonSdkPipelines>
…K owner) (Azure#40640)

* code and test

* update-testcase

---------

Co-authored-by: azure-sdk <PythonSdkPipelines>
Co-authored-by: ChenxiJiang333 <[email protected]>
* background call for get database account call

* only call get database account in health check for different endpoints

* Change health check logic in sync

* Revert removing timing

* update changelog

* fix tests

* use asyncio create_task

* fix tests

* fix pylint

* Renamed variables and added effective preferred locations

* update changelog

* Add test for effective preferred regions

* Add test for effective preferred regions

* sync test for preferred regions

* Renaming and add test for health check

* fix tests

* fix tests and add more health check tests

* fix tests

* add tests

* fix tests

* Move to breaking change

* Added scale workload scripts

* Scale testing upserts

* fix cspell and tests

* fix tests

* fix initial upserts

* fix tests

* revert preferred locations

* timeout mark unavailable

* moving health check to background

* only finish health check after 2 successes

* fix tests

* add tests

* fix and add timeout tests for marking endpoints unavailable

* Reacting to comments

* Reacting to comments

* Add cleanup of background task when cosmos client closes

* React to comments

* Remove consecutive failures code

* updated changelog

* Fix test

* Fix tests that weren't awaiting properly

* Add a sync workload and fix initial setup and separate client configs to separate file

* fix imports

* fix tests

* update proxy

* change unavailable time to 7 minutes

* remove marking unavailable, health check four regions, health check primary and alternate

* fix type hints

* logs to debug

* logs to debug

* fix startup scenario

* debug logs

* fix updating cache

* adding logs

* fix operation type check unavailable

* add logic to check by endpoint and not by regional routing context

* bash sript to run workloads

* adding more workloads

* fix tests

* fix tests

* lower write workloads to use

* fix read envoy workloads

* increase read concurrency

* fix test

* more read workloads

* more read workloads

* fix tests

* fix tests

* add smaller lag for some writes and reads

* debug multimaster test

* cleanup

* mark global endpoint available

* fix tests and only use endpoint from gateway for multimaster

* balance read and write workloads

* retry multi region writes same as reads

* react to comments

* multi write fix

* debug logs

* multiwrite config

* fix multimaster workloads

* cleanup / pylint

* refactor workloads

* fix read proxy workload

* swallow exceptions and add mocking

* fix import

* fix import

* fix mocking

* fix mocking

* fix mocking

* logging improvements for timeout and failover retry policy

* debugging logs

* fix mock

* fix mock

* improve mock and adding more logs

* service request instead of response

* more logs

* cleanup logs

* remove import

* more logs and fix mock

* fix logs

* more logs for debugging

* more logs for debugging

* fix mocking

* fix mocking

* fix mocking

* add envoy

* update envoy and remove mocking

* envoy changes

* fix workloads

* lower sleep time between concurrent operations

* remove sleeps

* increase concurrency

* increase default concurrency

* remove excessive logs

* change proxy workloads

* change proxy file

* change proxy file

* change proxy file

* change proxy file

* useful logs

* change envoy file

* change envoy file

* change envoy file

* change envoy file

* change envoy file

* change envoy file

* change envoy file

* Added envoy open ai simple file

* update simple

* Updated scale testing workloads for ycsb benchmark

* Added run workload script without proxy

* Added more workloads

* Fixed the run workloads script

* Fixed one more scriptp

* Reduced the clients to below 60

* Updated file handler to rotating file handler

* Logging headers for testing

* Skipping session token for writes

* Skipping session token for writes

* commented out request / response headers

* Updated file handler to rotating file handler with 10 mb max

* Updated file handler to rotating file handler with 10 mb max

* Fixed rotating file handler for every workload script

* Updated test directory to tests

* Updated test directory to tests and added all files

* Updated test directory to tests and added workloads

* Fixed envoy proxy code

* Container and Database is configurable now

* Container and Database is configurable fix

* ru change to create container and incorrect client workload

* add None etag and match_condition edge case

* Use process id for log files and refactor common methods across workloads

* fix initial-setup.py

* fix logger naming

* fix logger naming

* fix workloads and envoy file

* improve workload scripts

* improve workload scripts

* test improvements

* cleanup

* envoy changes

* envoy changes

* revert changes

* Update sdk/cosmos/azure-cosmos/tests/workloads/w_workload.py

Co-authored-by: Copilot <[email protected]>

* Update sdk/cosmos/azure-cosmos/tests/workloads/initial-setup.py

Co-authored-by: Copilot <[email protected]>

* Update sdk/cosmos/azure-cosmos/tests/workloads/get-database-account-call.py

Co-authored-by: Copilot <[email protected]>

* Update sdk/cosmos/azure-cosmos/tests/workloads/r_proxy_workload.py

Co-authored-by: Copilot <[email protected]>

* Update sdk/cosmos/azure-cosmos/tests/workloads/r_w_q_with_incorrect_client_workload.py

Co-authored-by: Copilot <[email protected]>

* Update sdk/cosmos/azure-cosmos/tests/workloads/r_workload.py

Co-authored-by: Copilot <[email protected]>

* Update sdk/cosmos/azure-cosmos/tests/workloads/r_w_q_workload.py

Co-authored-by: Copilot <[email protected]>

* Update sdk/cosmos/azure-cosmos/tests/workloads/w_proxy_workload.py

Co-authored-by: Copilot <[email protected]>

* fix analyze and add licensing

* fix analyze

* react to comments

* fix imports

* make shutdown executable

* fix import

* fix workloads

* fix imports

* fix shutdown

---------

Co-authored-by: Kushagra Thapar <[email protected]>
Co-authored-by: Tomas Varon <[email protected]>
Co-authored-by: Ubuntu <openai-test@openai-testing-vm1.q2mff55cv1bu1hrxqay0qbmh1g.cbnx.internal.cloudapp.net>
Co-authored-by: Simon Moreno <[email protected]>
Co-authored-by: Copilot <[email protected]>
weirongw23-msft and others added 24 commits May 13, 2025 13:56
* Upgraded alpha sdk version from 1.4.0-alpha to 1.5.0-alpha

* Fixed pylint error.
* Added `AZURE_TOKEN_CREDENTIALS` environment variable support

* add trimming

* update

* updates

* udpate tests

* fix typo

* Update sdk/identity/azure-identity/tests/test_token_credentials_env_async.py

Co-authored-by: Paul Van Eck <[email protected]>

* Update sdk/identity/azure-identity/tests/test_token_credentials_env.py

Co-authored-by: Paul Van Eck <[email protected]>

* Update sdk/identity/azure-identity/tests/test_token_credentials_env.py

Co-authored-by: Paul Van Eck <[email protected]>

* Update sdk/identity/azure-identity/tests/test_token_credentials_env_async.py

Co-authored-by: Paul Van Eck <[email protected]>

* Update sdk/identity/azure-identity/CHANGELOG.md

Co-authored-by: Paul Van Eck <[email protected]>

* add tests

---------

Co-authored-by: Paul Van Eck <[email protected]>
* Fix batch indexing.

* update changelog

* updates
* Adding data collection disclosure to readme

* fixing credential name

* updaing code samples

* incorporating pauls suggestion

* removing double import

Co-authored-by: Krista Pratico <[email protected]>

* correcting tabs

Co-authored-by: Krista Pratico <[email protected]>

* updating description and removing try catch

* added missing new instance

* updating import

Co-authored-by: Paul Van Eck <[email protected]>

* update typo

Co-authored-by: McCoy Patiño <[email protected]>

---------

Co-authored-by: Krista Pratico <[email protected]>
Co-authored-by: Paul Van Eck <[email protected]>
Co-authored-by: McCoy Patiño <[email protected]>
* add tsp commit

* initial auto gen

* Update sdk/ai/azure-ai-agents/tsp-location.yaml

Co-authored-by: Copilot <[email protected]>

* update latest typespec

* update AzureAISearchTool

---------

Co-authored-by: Copilot <[email protected]>
Co-authored-by: jhakulin <[email protected]>
* removing instrumentor call for azure monitor samples

* updating code snippet

* removing unused import from sample to restart build
Co-authored-by: Patrick Hallisey <[email protected]>
* update agent error details

* update ChangeLog
)

* cspell: Remove node version requirement, node is already on the agent

* Succeeded

---------

Co-authored-by: Daniel Jurek <[email protected]>
* wording

* wording of mcp server

* this?

* update tox

* stdin issue with tox

* try to do the same for tsp-client

* needs root dir
Generated from TypeSpec API specification with validation fixes:
- Fixed MyPy type issues in sample files
- Added proper error handling for environment variables
- Fixed AzureKeyCredential parameter types
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.