Skip to content

fix(tests): install azure-mgmt-authorization in dev to unblock Release#311

Merged
placerda merged 1 commit into
developfrom
fix/rbac-test-patch-path
Jun 15, 2026
Merged

fix(tests): install azure-mgmt-authorization in dev to unblock Release#311
placerda merged 1 commit into
developfrom
fix/rbac-test-patch-path

Conversation

@placerda

@placerda placerda commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

Summary

The Release workflow for v0.4.0 and v0.4.1 failed in the build job because the
unit test test_list_role_definition_ids_extracts_guid_suffix patches
azure.mgmt.authorization.AuthorizationManagementClient via the string form of
unittest.mock.patch. That requires the package to be importable in the test
environment, but azure-mgmt-authorization was only declared under the
agent optional-dependencies extra. Release / _build.yml and CI / ci.yml
both run uv sync --group dev, so the package was not installed for the tests.

CI surfaced two flavors of the same root cause:

  • AttributeError: module 'azure' has no attribute 'mgmt' on the release build,
    where some other azure-mgmt-* dep partially populates the azure.mgmt
    namespace package.
  • ModuleNotFoundError: No module named 'azure.mgmt' on PR CI, where no
    azure-mgmt-* is installed at all.

Fix

Add azure-mgmt-authorization>=4.0,<5.0 to the dev group in
pyproject.toml (and refresh uv.lock). This mirrors the agent extra
where the package is already a runtime dependency, and makes the test suite
deterministic on every CI runner. No change to src/ runtime code.

uv lock also picks up develop's already-merged dependabot bumps
(azure-mgmt-cognitiveservices<15, azure-monitor-query<3, pandas<4).

Validation

  • uv sync --group dev -> installs azure-mgmt-authorization==4.0.0
  • uv run pytest tests/ -> 943 passed, 6 skipped
  • uv run ruff check src/ tests/ -> all checks passed

Releases unblocked

This unblocks the Release workflow for v0.4.0 (already tagged but never
published to PyPI/Marketplace) and v0.4.1.

The unit test `test_list_role_definition_ids_extracts_guid_suffix`
patches `azure.mgmt.authorization.AuthorizationManagementClient` via
`unittest.mock.patch` (string form), which requires the package to be
importable in the test environment. The `Release` workflow's reusable
`_build.yml` and `ci.yml` both run `uv sync --group dev`, but
`azure-mgmt-authorization` was only declared under the `agent`
optional-dependencies extra, not under the `dev` group. CI therefore
hit `AttributeError: module 'azure' has no attribute 'mgmt'` (release
build, where `azure.mgmt` namespace is partially populated by other
`azure-mgmt-*` deps) or `ModuleNotFoundError: No module named
'azure.mgmt'` (PR CI, where no `azure-mgmt-*` is installed at all),
breaking the `Release` workflow for v0.4.0 and v0.4.1.

Adding `azure-mgmt-authorization` to the `dev` group makes the
package available wherever the test suite runs, mirroring the
`agent` extra where it is already a runtime dependency. No change to
`src/` runtime code.

`uv lock` also picks up develop's already-merged dependabot bumps
(`azure-mgmt-cognitiveservices<15`, `azure-monitor-query<3`,
`pandas<4`).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@placerda placerda force-pushed the fix/rbac-test-patch-path branch from e5df639 to d32a56d Compare June 15, 2026 19:08
@placerda placerda changed the title fix(tests): correct patch path for AuthorizationManagementClient fix(tests): install azure-mgmt-authorization in dev to unblock Release Jun 15, 2026
@placerda placerda merged commit 4175247 into develop Jun 15, 2026
12 checks passed
@placerda placerda deleted the fix/rbac-test-patch-path branch June 15, 2026 19:14
placerda added a commit that referenced this pull request Jun 15, 2026
#311) (#312)

The unit test `test_list_role_definition_ids_extracts_guid_suffix`
patches `azure.mgmt.authorization.AuthorizationManagementClient` via
`unittest.mock.patch` (string form), which requires the package to be
importable in the test environment. The `Release` workflow's reusable
`_build.yml` and `ci.yml` both run `uv sync --group dev`, but
`azure-mgmt-authorization` was only declared under the `agent`
optional-dependencies extra, not under the `dev` group. CI therefore
hit `AttributeError: module 'azure' has no attribute 'mgmt'` (release
build, where `azure.mgmt` namespace is partially populated by other
`azure-mgmt-*` deps) or `ModuleNotFoundError: No module named
'azure.mgmt'` (PR CI, where no `azure-mgmt-*` is installed at all),
breaking the `Release` workflow for v0.4.0 and v0.4.1.

Adding `azure-mgmt-authorization` to the `dev` group makes the
package available wherever the test suite runs, mirroring the
`agent` extra where it is already a runtime dependency. No change to
`src/` runtime code.

`uv lock` also picks up develop's already-merged dependabot bumps
(`azure-mgmt-cognitiveservices<15`, `azure-monitor-query<3`,
`pandas<4`).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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