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.
Symptom
The
Releaseworkflow failed in thebuildjob for tags v0.4.0 andv0.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_rbacdoctor check (v0.4.0).
CI surfaced two flavors of the same root cause:
AttributeError: module 'azure' has no attribute 'mgmt'on the releasebuild (where another
azure-mgmt-*partial namespace was present).ModuleNotFoundError: No module named 'azure.mgmt'on PR CI (noazure-mgmt-*installed at all).Root cause
The test patches
azure.mgmt.authorization.AuthorizationManagementClientviathe string form of
unittest.mock.patch, which requires the package to beimportable in the test environment.
azure-mgmt-authorizationwas declaredonly in the
agentoptional-dependencies extra. Bothrelease/_build.ymland
ci.ymlrunuv sync --group dev, so the package was missing for tests.Fix
#311 (cherry-picked to
mainvia #312) addsazure-mgmt-authorization>=4.0,<5.0to thedevdependency group inpyproject.toml(and refreshesuv.lock). No runtime change.After cherry-picking the fix to
main, thev0.4.1tag was moved to thenew
mainHEAD and theReleaseworkflow re-triggered successfully(run #27570669567):
agentops-accelerator==0.4.1published.AgentOpsAccelerator.agentops-accelerator v0.4.1published.
v0.4.1recreated 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)
azure-mgmt-*dep that is exercised by tests inthe
devgroup (this PR did so forazure-mgmt-authorization).import azure.mgmt.authorizationat the topof the test module so the namespace package attribute quirk cannot bite
again if the dep is later dropped.
Closing as completed by #311 + #312.