Skip to content

Release workflow blocked by missing azure-mgmt-authorization in dev deps #314

@placerda

Description

@placerda

Symptom

The Release workflow failed in the build job for tags v0.4.0 and
v0.4.1, blocking publish to PyPI and the VS Code Marketplace.

The single failing test was
tests/unit/test_agent_checks_rbac_openai_data_plane.py::test_list_role_definition_ids_extracts_guid_suffix,
introduced in #307 along with the new security.missing_openai_data_plane_rbac
doctor check (v0.4.0).

CI surfaced two flavors of the same root cause:

  • AttributeError: module 'azure' has no attribute 'mgmt' on the release
    build (where another azure-mgmt-* partial namespace was present).
  • ModuleNotFoundError: No module named 'azure.mgmt' on PR CI (no
    azure-mgmt-* installed at all).

Root cause

The test patches azure.mgmt.authorization.AuthorizationManagementClient via
the string form of unittest.mock.patch, which requires the package to be
importable in the test environment. azure-mgmt-authorization was declared
only in the agent optional-dependencies extra. Both release/_build.yml
and ci.yml run uv sync --group dev, so the package was missing for tests.

Fix

#311 (cherry-picked to main via #312) adds
azure-mgmt-authorization>=4.0,<5.0 to the dev dependency group in
pyproject.toml (and refreshes uv.lock). No runtime change.

After cherry-picking the fix to main, the v0.4.1 tag was moved to the
new main HEAD and the Release workflow re-triggered successfully
(run #27570669567):

  • PyPI: agentops-accelerator==0.4.1 published.
  • VS Code Marketplace: AgentOpsAccelerator.agentops-accelerator v0.4.1
    published.
  • GitHub Release v0.4.1 recreated with dist + VSIX artifacts.

v0.4.0 was not republished because PyPI does not accept re-uploads of a
version that was already attempted; v0.4.1 supersedes v0.4.0 (see release
notes on the v0.4.1 GitHub Release).

Future-proofing ideas (out of scope)

  • Consider keeping every azure-mgmt-* dep that is exercised by tests in
    the dev group (this PR did so for azure-mgmt-authorization).
  • Optionally add an explicit import azure.mgmt.authorization at the top
    of the test module so the namespace package attribute quirk cannot bite
    again if the dep is later dropped.

Closing as completed by #311 + #312.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions