Skip to content

[AutoPR azure-communication-identity]-generated-from-SDK Generation - Python-6791810 - #48912

Closed
azure-sdk-automation[bot] wants to merge 1 commit into
mainfrom
sdkauto/azure-communication-identity-6791810
Closed

[AutoPR azure-communication-identity]-generated-from-SDK Generation - Python-6791810#48912
azure-sdk-automation[bot] wants to merge 1 commit into
mainfrom
sdkauto/azure-communication-identity-6791810

Conversation

@azure-sdk-automation

Copy link
Copy Markdown
Contributor

Configurations: 'specification/communication/data-plane/Identity/tspconfig.yaml', API Version: 2026-09-23, SDK Release Type: stable, and CommitSHA: '10109ec4697baa64cd987388d319dc6e8e8f1401' in SpecRepo: 'https://github.com/Azure/azure-rest-api-specs' Pipeline run: https://dev.azure.com/azure-sdk/internal/_build/results?buildId=6791810 Refer to https://eng.ms/docs/products/azure-developer-experience/develop/sdk-release/sdk-release-prerequisites to prepare for SDK release. Release plan link: https://azsdk-releaseplan-dashboard-hveph5aqhhcfhtgu.westus-01.azurewebsites.net/?releaseplan=36401 Submitted by: johnfraser@microsoft.com

…onfig.yaml', API Version: 2026-09-23, SDK Release Type: stable, and CommitSHA: '10109ec4697baa64cd987388d319dc6e8e8f1401' in SpecRepo: 'https://github.com/Azure/azure-rest-api-specs' Pipeline run: https://dev.azure.com/azure-sdk/internal/_build/results?buildId=6791810 Refer to https://eng.ms/docs/products/azure-developer-experience/develop/sdk-release/sdk-release-prerequisites to prepare for SDK release.
Copilot AI balanced review requested due to automatic review settings September 4, 2026 21:39
@azure-sdk-automation azure-sdk-automation Bot added the auto-release When merged to main, release pipelines for this PR's changed packages trigger automatically. label Sep 4, 2026
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
10 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

The regeneration removes the stable public API and authentication implementation, leaves tests and samples importing deleted symbols, and contains incorrect release metadata.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Regenerates azure-communication-identity from API version 2026-09-23, restructures generated code, and migrates packaging metadata to pyproject.toml.

Changes:

  • Replaces the existing customized client with newly generated clients, models, and operations.
  • Adds Teams Extension APIs and APIView metadata.
  • Migrates packaging configuration and reformats tests and samples.
File summaries
File Description
tsp-location.yaml Adds TypeSpec source metadata.
tests/test_utils.py Reformats utility tests.
tests/test_user_credential.py Reformats credential tests.
tests/test_user_credential_async.py Reformats async credential tests.
tests/test_token_utils.py Reformats token utility tests.
tests/test_token_exchange.py Reformats token exchange tests.
tests/test_token_exchange_async.py Reformats async exchange tests.
tests/test_identifier_raw_id.py Reformats identifier tests.
tests/test_entra_token_guard_policy.py Reformats policy tests.
tests/test_entra_token_guard_policy_async.py Reformats async policy tests.
tests/_shared/communication_service_preparer.py Adds pylint suppressions.
setup.py Removes legacy packaging configuration.
sdk_packaging.toml Removes standalone packaging metadata.
samples/identity_samples.py Reformats synchronous samples.
samples/identity_samples_async.py Reformats asynchronous samples.
pyproject.toml Adds build and packaging metadata.
MANIFEST.in Reorders package inclusions.
CHANGELOG.md Dates 1.6.0 and replaces its notes.
azure/communication/identity/types.py Adds generated request dictionaries.
azure/communication/identity/py.typed Adds the package typing marker.
azure/communication/identity/operations/_patch.py Adds operation customization hook.
azure/communication/identity/operations/__init__.py Exports generated operation groups.
azure/communication/identity/models/_patch.py Adds model customization hook.
azure/communication/identity/models/_models.py Adds generated models.
azure/communication/identity/models/_enums.py Renames scope enum and adds principal types.
azure/communication/identity/models/__init__.py Exports generated models.
azure/communication/identity/aio/operations/_patch.py Updates async operation customization hook.
azure/communication/identity/aio/operations/__init__.py Exports async operation groups.
azure/communication/identity/aio/_patch.py Updates async customization hook.
azure/communication/identity/aio/_configuration.py Regenerates async client configuration.
azure/communication/identity/aio/_communication_identity_client_async.py Removes the customized async client.
azure/communication/identity/aio/_client.py Adds the generated async client.
azure/communication/identity/aio/__init__.py Exports the generated async client.
azure/communication/identity/_version.py Regenerates version metadata.
azure/communication/identity/_utils/__init__.py Updates generated utility metadata.
azure/communication/identity/_utils.py Removes duration conversion helper.
azure/communication/identity/_shared/utils.py Removes shared token and connection helpers.
azure/communication/identity/_shared/utils_async.py Removes async timer helper.
azure/communication/identity/_shared/user_credential.py Removes synchronous communication credentials.
azure/communication/identity/_shared/user_credential_async.py Removes asynchronous communication credentials.
azure/communication/identity/_shared/token_utils.py Removes token exchange utilities.
azure/communication/identity/_shared/token_exchange.py Removes synchronous token exchange client.
azure/communication/identity/_shared/token_exchange_async.py Removes asynchronous token exchange client.
azure/communication/identity/_shared/policy.py Removes HMAC authentication policy.
azure/communication/identity/_shared/models.py Removes public identifier models.
azure/communication/identity/_shared/entra_token_guard_policy.py Removes synchronous token guard policy.
azure/communication/identity/_shared/entra_token_guard_policy_async.py Removes asynchronous token guard policy.
azure/communication/identity/_shared/auth_policy_utils.py Removes authentication policy selection.
azure/communication/identity/_patch.py Updates root customization hook.
azure/communication/identity/_generated/py.typed Removes obsolete generated typing marker.
azure/communication/identity/_generated/operations/_operations.py Removes old generated operations.
azure/communication/identity/_generated/operations/__init__.py Removes old operation exports.
azure/communication/identity/_generated/models/_models.py Removes old generated models.
azure/communication/identity/_generated/models/__init__.py Removes old model exports.
azure/communication/identity/_generated/aio/operations/_operations.py Removes old async operations.
azure/communication/identity/_generated/aio/operations/__init__.py Removes old async operation exports.
azure/communication/identity/_generated/aio/_patch.py Removes old async patch hook.
azure/communication/identity/_generated/aio/_client.py Removes old generated async client.
azure/communication/identity/_generated/aio/__init__.py Removes old async exports.
azure/communication/identity/_generated/_patch.py Removes old generated patch hook.
azure/communication/identity/_generated/_client.py Removes old generated client.
azure/communication/identity/_generated/__init__.py Removes old generated exports.
azure/communication/identity/_configuration.py Regenerates synchronous configuration.
azure/communication/identity/_communication_identity_client.py Removes customized synchronous client.
azure/communication/identity/_client.py Adds generated synchronous client.
azure/communication/identity/_api_versions.py Removes legacy API-version enumeration.
azure/communication/identity/__init__.py Replaces existing public exports.
azure/communication/__init__.py Adds a typing suppression.
azure/__init__.py Adds a typing suppression.
apiview-properties.json Adds cross-language API mappings.
api.metadata.yml Adds API snapshot metadata.
api.md Adds the generated API surface snapshot.
_metadata.json Adds generation metadata.
Review details
  • Files reviewed: 77/77 changed files
  • Comments generated: 6
  • Review effort level: Balanced

💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

TeamsExtensionUserIdentifier,
TeamsExtensionUserProperties,
)
from ._client import IdentityClient # type: ignore
Comment on lines +49 to +53
def __init__( # pylint: disable=missing-client-constructor-parameter-credential
self, endpoint: str, **kwargs: Any
) -> None:
_endpoint = "{endpoint}"
self._config = IdentityClientConfiguration(endpoint=endpoint, **kwargs)
if TYPE_CHECKING:
from ._patch import * # pylint: disable=unused-wildcard-import

from ._client import IdentityClient # type: ignore
Comment on lines +49 to +53
def __init__( # pylint: disable=missing-client-constructor-parameter-credential
self, endpoint: str, **kwargs: Any
) -> None:
_endpoint = "{endpoint}"
self._config = IdentityClientConfiguration(endpoint=endpoint, **kwargs)
package_name = "azure-communication-identity"
package_pprint_name = "Communication Identity Service"
package_doc_id = ""
is_stable = false
## 1.6.0 (2026-09-04)

### Features Added
skip changelog generation for data-plane package and please add changelog manually.
@JohnRFraser

Copy link
Copy Markdown
Member

Closing: this PR is superseded by SDK generation configuration that has since merged into the spec repo.

It was generated before azure-rest-api-specs#46186 (merged 2026-09-09, commit 18931710), which added generation-subdir: "_generated" under the @azure-tools/typespec-python emitter options for ACS Identity.

Without that option the emitter writes generated code to the package root. That is visible in this diff: it removes azure/communication/identity/_communication_identity_client.py (227 lines of hand-written convenience client) and the whole _generated/ tree, and adds _client.py, _configuration.py, models/ and operations/ at the package root. Merging it would delete the hand-written layer of a shipped package.

With the merged configuration the emitter now writes to _generated/ and leaves the hand-written layer intact. This was verified by regenerating from merged main with no --emitter-options override: generated modules are absent from the package root, both convenience clients and the supporting modules are present, and the existing 97 tests pass unchanged.

A fresh generation run will produce correct output, so this PR is not worth rebasing. Closing rather than leaving it open and mergeable.

@JohnRFraser

Copy link
Copy Markdown
Member

Correction to my closure comment above. One half of what I wrote is wrong, and I want that on the record here rather than only in internal notes.

I wrote that with the merged configuration "the emitter now writes to _generated/ and leaves the hand-written layer intact."

The first half is confirmed. The second half is false.

A fresh generation run against merged main (build 6802367, release plan 36401) produced #48938, and that PR still removes the hand-written layer — 18 files, including:

  • azure/communication/identity/_communication_identity_client.py and its async mirror
  • azure/communication/identity/_utils.py
  • the entire azure/communication/identity/_shared/ tree (12 files)
  • sdk_packaging.toml

generation-subdir is working — 24 files land correctly in _generated/. The deletions come from a separate pipeline step, visible in the generation log:

[automation_generate.sh] [INFO] delete all outdated generated SDK files successfully

That cleanup does not run during local tsp-client update, which is why local verification showed the convenience layer surviving. The measurement I cited was correct and correctly performed; it simply could not observe this, because the behaviour only exists in the pipeline.

This PR stays closed — its content is superseded regardless, and #48938 is the current generation. But the reason I gave was partly wrong, and anyone reading this thread to understand whether the configuration change is sufficient should know that it is not, on its own, for Python.

@JohnRFraser

Copy link
Copy Markdown
Member

Follow-up: my correction above was itself mis-scoped, and the root cause is now identified.

I wrote that the merged configuration does not leave the hand-written layer intact. That is true, but the framing implies generation-subdir failed. It did not, and the distinction matters for anyone reading this thread to decide whether the configuration change was sound.

There were always two independent defects presenting as one.

1. Layout collision — fixed. Without generation-subdir, generated code landed flat in the package root. With it, 24 files land correctly in _generated/. Confirmed in the pipeline, not just locally.

2. Wholesale deletion — pre-existing, untouched by that fix, still open. The hand-written files were never protected by generation-subdir in the first place.

The evidence is that both pipeline runs delete the same files:

#48912 (no generation-subdir) #48938 (with it)
hand-written files deleted 18 17
identical between the two 17 17

The only difference is setup.py. The hand-written loss is the same defect in both runs.

Root causeeng/tools/azure-sdk-tools/packaging_tools/generate_utils.py, del_outdated_generated_files(), called from sdk_generator.py:

generated_files_dir = Path(service_dir) / package_dir / package_dir.split("-")[0]
if generated_files_dir.exists():
    shutil.rmtree(generated_files_dir)
    _LOGGER.info("delete all outdated generated SDK files successfully")

For azure-communication-identity, package_dir.split("-")[0] is azure, so the target is sdk/communication/azure-communication-identity/azurethe entire namespace tree. It is removed unconditionally and the emitter then restores only what it owns. Anything the emitter does not emit is gone. There is no generated-versus-hand-written classification at any point; the code assumes the package is wholly generated.

This is why the deletion cannot be observed locally: tsp-client update does not run this step.

Scope. This is not specific to ACS or to this package. Any package with a tsp-location.yaml and hand-written code under azure/ resolves to rmtree(<package>/azure). That includes Key Vault, App Configuration, Storage and Data Tables, among others.

I am not proposing a fix here — the obvious one is to scope the removal to the emitter's own output directory, which generation-subdir already names, but that touches tooling shared by every Python SDK and needs an owner rather than a drive-by change. Raising it separately so it reaches the right people.

This PR stays closed; #48938 is the current generation and carries the same defect.

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

Labels

auto-release When merged to main, release pipelines for this PR's changed packages trigger automatically. Communication - Identity

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants