chore(deps): pin Azure SDK majors and stamp AgentOps version into generated workflows#218
Merged
Conversation
…erated workflows Two complementary changes that make CI runs reproducible and prevent the class of failure that produced the v0.3.2 stage regression (azure-ai-projects 1.x -> 2.x silently broke prompt-agent staging during a live tutorial recording). pyproject.toml - Add <X.0 upper bounds to every Azure SDK dependency (azure-ai-projects, azure-ai-evaluation, azure-identity, azure-monitor-*, azure-mgmt-*) plus pandas, fastapi, uvicorn, httpx, markdown. cryptography is intentionally left unbounded so security patches flow through. services/cicd.py + 20 template files - New helper _agentops_install_spec() maps the installed agentops version to a pip spec: clean public release -> "==X.Y.Z"; editable/dev install -> the existing " @ git+...@main" fallback. PEP 440 aware via packaging.Version. - New __AGENTOPS_INSTALL_SPEC__ template substitution wired into generate_cicd_workflows. - All 10 GitHub Actions workflow templates AND all 10 Azure DevOps pipeline templates rewritten to use __AGENTOPS_INSTALL_SPEC__ in place of the hardcoded "@ git+https://github.com/Azure/agentops.git@main" suffix. - Stale "NOTE: pinned to GitHub main until the next package release" comments removed from 5 templates (the note no longer applies once the install line carries a real version pin). tests/unit/test_cicd.py - 5 new tests cover: clean release -> ==X.Y.Z; PEP 440 post/rc releases -> pin; dev/local segments -> @main fallback; rendered workflows pin to the substituted version end-to-end; dev installs still write the @main fallback into the rendered template. Net effect: a user who runs `agentops workflow generate` against AgentOps 0.3.3 gets workflow files that always install `agentops-accelerator==0.3.3` on every CI run, and `agentops-accelerator` pins the right Azure SDK majors via the new upper bounds. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Use an explicit esolved: str local instead of shadowing the parameter via rom agentops import __version__ as version. mypy 1.x couldn't narrow str | None -> str through the import-rebind, producing 'Argument 1 to `Version` has incompatible type `str | None`'. No behavior change; tests/unit/test_cicd.py still 66/66 green. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
mypy 1.x cannot narrow the type of a kwargs spread built from a single-field dict literal — it eagerly assumes the value matches the *first* WizardAnswers field's type (Path | None), producing 'Argument 1 to `WizardAnswers` has incompatible type `**dict[str, str]`'. Materialize the partial dict as `dict[str, Any]` so the spread satisfies every field type. Pre-existing failure on develop — unblocking lint for this PR. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Two layers of version fragility just bit us live during PO's tutorial recording:
pyproject.tomldeclares every Azure SDK with only a lower bound (e.g.azure-ai-projects>=2.0.1). Whenazure-ai-projectsmajor-bumped to 2.x, the agent-definition serialization shape changed (_copy_definitionstarted returning{"_data": {...}}instead of a flat dict), which producedinvalid_payload — Required properties ["kind"] are not presentin the middle of PO's video recording. The runtime fix shipped in v0.3.2 (fix(prompt_deploy): normalize Foundry definition to dict for SDK 2.x compatibility #216), but the underlying dependency-pinning gap remains: nothing stopsazure-ai-projects 3.xfrom doing the exact same thing tomorrow.Generated CI/CD templates install
agentops-accelerator[...] @ git+https://github.com/Azure/agentops.git@mainwith no version pin. Two users who runagentops workflow generatesix months apart get workflow files that pull different agentops snapshots on every CI run — non-reproducible by construction. The templates even carry stale# NOTE: pinned to GitHub main until the next package releasecomments from when the feature first landed.Solution
pyproject.toml— pin runtime dependencies to current majorEvery Azure SDK dependency now caps at the next major. Same for the other ecosystem deps that have a history of breaking changes (pandas, fastapi, uvicorn, httpx, markdown).
cryptographyis intentionally left unbounded so security patches flow through without an AgentOps release.The
devdependency-group declaration ofazure-ai-evaluationwas bumped to match.agentops workflow generate— pin generated workflows to the installed agentops versionNew helper in
services/cicd.py:A new template substitution
__AGENTOPS_INSTALL_SPEC__is wired intogenerate_cicd_workflowsand applied to every GitHub Actions + Azure DevOps template install line (26 install lines across 20 template files). Per the rubber-duck pass, this uses PEP 440 parsing viapackaging.version.Version(transitive of pip), not a hand-rolled\d+\.\d+\.\d+regex — so legitimate.postN/rcNreleases also pin correctly.End-to-end effect:
0.3.3)pip install "agentops-accelerator[...]==0.3.3"0.3.4.dev1+gabcdef)pip install "agentops-accelerator[...] @ git+...@main"(unchanged dev fallback)Stale
# NOTE: pinned to GitHub main until the next package releasecomments were removed from 5 templates — they no longer apply.Scope of changes
pyproject.toml— upper bounds.src/agentops/services/cicd.py— helper + substitution wiring.src/agentops/templates/workflows/*.yml.src/agentops/templates/pipelines/azuredevops/*.yml.tests/unit/test_cicd.py— 5 new regression tests.CHANGELOG.md—[Unreleased] → Changed.Skill files /
agent.yaml/ Dockerfile / agent-server README are not touched — they are human-facing install guidance (not generated workflow files), and@mainis intentional for "install latest dev" guidance there.Tests
Net delta: +5 tests vs the v0.3.2 baseline (808).
New tests:
test_agentops_install_spec_pins_clean_release—0.3.2→==0.3.2.test_agentops_install_spec_pins_post_and_rc_releases—0.3.2.post1,0.4.0rc1→ pin.test_agentops_install_spec_falls_back_for_dev_or_local_installs—0.3.3.dev1,0.3.2+gabcdef,0.0.0-dev→@main.test_workflow_install_lines_pin_to_release_version— end-to-end render under a forced clean version asserts nogit+...@mainand no orphan__AGENTOPS_INSTALL_SPEC__in any of 8 generated files (GitHub + Azure DevOps).test_workflow_install_lines_fall_back_to_main_for_dev_installs— end-to-end render under the dev fallback asserts the@maininstall spec is present.Migration notes
Existing user workflows (already-generated files in user repos like
placerda/agentops-prompt-quickstart) are not retroactively rewritten by this PR. Users opt in by re-runningagentops workflow generate --forceagainst any AgentOps release ≥ this one. Per rubber-duck guidance, noagentops workflow update-pinsCLI command is added — the manual re-run is enough for now.Not in scope
Set aside per rubber-duck (revisit if real demand emerges):
constraints.txtfor transitive-dep reproducibility.agentops workflow update-pinsCLI command.Rubber-duck
Plan critiqued before implementation. All blocking findings adopted:
f"=={version}"typo from the original sketch →f"=={version}".packaging.version.Versioninstead of a\d+\.\d+\.\d+regex so.postN/rcNreleases pin.cryptographyleft unbounded (security-patch sensitive).