Skip to content

Conversation

catalinaperalta
Copy link
Member

@catalinaperalta catalinaperalta commented Jul 7, 2025

Regenerate and update the Confidential Ledger library based on the newly migrated typespec project.

Copy link

github-actions bot commented Jul 7, 2025

API Change Check

APIView identified API level changes in this PR and created the following API reviews

azure-confidentialledger

*,
collection_id: Optional[str] = None,
**kwargs: Any,
) -> LROPoller[JSON]:
) -> LROPoller[_models.TransactionStatus]:
Copy link
Member Author

@catalinaperalta catalinaperalta Jul 29, 2025

Choose a reason for hiding this comment

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

If this signature hasnt been shipped as stable, it needs some attention, the true return type here should be LROPoller[LedgerEntry] however due to the underlying usage of the begin_wait_for_commit() method the poller seems to return transactionstatus instead

@catalinaperalta catalinaperalta changed the title [wip] Regen confidential ledger Regenerate confidential ledger from typespec Jul 29, 2025
__all__: List[str] = [
"ConfidentialLedgerClientOperationsMixin"
] # Add all objects you want publicly available to users at this package level
__all__: List[str] = [] # Add all objects you want publicly available to users at this package level
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
__all__: List[str] = [] # Add all objects you want publicly available to users at this package level
__all__: List[str] = ["_ConfidentialLedgerClientOperationsMixin"] # Add all objects you want publicly available to users at this package level

One more suggestion: it is better put customized code before __all__


__all__: List[str] = [
"ConfidentialLedgerClientOperationsMixin"
] # Add all objects you want publicly available to users at this package level
Copy link
Member

Choose a reason for hiding this comment

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

@lmazuel lmazuel marked this pull request as ready for review August 15, 2025 19:14
@Copilot Copilot AI review requested due to automatic review settings August 15, 2025 19:15
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 regenerates the Azure Confidential Ledger SDK from the newly migrated TypeSpec project. The regeneration introduces significant changes to support TypeSpec-based code generation, including updated models, client configurations, and file formatting improvements.

Key changes:

  • Migration from AutoRest to TypeSpec-based code generation
  • Complete restructuring of the models and client architecture
  • Introduction of new model classes and updated method signatures
  • Comprehensive code formatting improvements across all test files and samples

Reviewed Changes

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

Show a summary per file
File Description
tsp-location.yaml New configuration file for TypeSpec-based SDK generation
pyproject.toml Complete rebuild with new project configuration and dependencies
setup.py Removed legacy setup.py file in favor of pyproject.toml
models/ Complete regeneration of all model classes with TypeSpec architecture
certificate/ Updated certificate client with new TypeSpec-generated structure
tests/ Comprehensive code formatting and minor structural improvements
samples/ Code formatting improvements and string concatenation fixes
receipt/ Minor formatting improvements to receipt verification components

@@ -0,0 +1,1376 @@
# pylint: disable=line-too-long,useless-suppression,too-many-lines
Copy link
Preview

Copilot AI Aug 15, 2025

Choose a reason for hiding this comment

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

The pylint disable comment should be more specific. Consider disabling only the specific pylint rules that are necessary rather than using broad suppressions like 'useless-suppression'.

Copilot uses AI. Check for mistakes.

@@ -607,17 +584,15 @@ def test_user_defined_role(self, confidentialledger_endpoint, confidentialledger

role_name = "modify"

client.create_user_defined_role([{"role_name": role_name, "role_actions": ["/content/read"]}])
client.create_user_defined_role([Role({"role_name": role_name, "role_actions": ["/content/read"]})])
Copy link
Preview

Copilot AI Aug 15, 2025

Choose a reason for hiding this comment

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

The Role model is being instantiated with a dictionary. Consider using keyword arguments instead for better type safety: Role(role_name=role_name, role_actions=["/content/read"])

Suggested change
client.create_user_defined_role([Role({"role_name": role_name, "role_actions": ["/content/read"]})])
client.create_user_defined_role([Role(role_name=role_name, role_actions=["/content/read"])])

Copilot uses AI. Check for mistakes.

[
{"role_name": role_name, "role_actions": ["/content/write", "/content/read"]}
]
[Role({"role_name": role_name, "role_actions": ["/content/write", "/content/read"]})]
Copy link
Preview

Copilot AI Aug 15, 2025

Choose a reason for hiding this comment

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

Same as above - consider using keyword arguments for Role instantiation: Role(role_name=role_name, role_actions=["/content/write", "/content/read"])

Suggested change
[Role({"role_name": role_name, "role_actions": ["/content/write", "/content/read"]})]
[Role(role_name=role_name, role_actions=["/content/write", "/content/read"])]

Copilot uses AI. Check for mistakes.

Copy link
Member

@benbp benbp left a comment

Choose a reason for hiding this comment

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

+1 for cspell.json

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.

4 participants