-
Notifications
You must be signed in to change notification settings - Fork 157
ADO: full https:// URL with sub-path rejected by parser (shorthand and object form work) #1128
Copy link
Copy link
Open
Labels
area/dependenciesarea/docs-sitedocs/src/content (Starlight), README, doc generation.docs/src/content (Starlight), README, doc generation.area/lockfileLockfile schema, per-file provenance, integrity hashes, drift detection.Lockfile schema, per-file provenance, integrity hashes, drift detection.bugDeprecated: use type/bug. Kept for issue history; will be removed in milestone 0.10.0.Deprecated: use type/bug. Kept for issue history; will be removed in milestone 0.10.0.priority/highShips in current or next milestoneShips in current or next milestonestatus/acceptedDirection approved, safe to start work.Direction approved, safe to start work.status/triagedInitial agentic triage complete; pending maintainer ratification (silence = approval).Initial agentic triage complete; pending maintainer ratification (silence = approval).theme/portabilityOne manifest, every target. Multi-target deploy, marketplace, packaging, install.One manifest, every target. Multi-target deploy, marketplace, packaging, install.type/bugSomething does not work as documented.Something does not work as documented.
Metadata
Metadata
Assignees
Labels
area/dependenciesarea/docs-sitedocs/src/content (Starlight), README, doc generation.docs/src/content (Starlight), README, doc generation.area/lockfileLockfile schema, per-file provenance, integrity hashes, drift detection.Lockfile schema, per-file provenance, integrity hashes, drift detection.bugDeprecated: use type/bug. Kept for issue history; will be removed in milestone 0.10.0.Deprecated: use type/bug. Kept for issue history; will be removed in milestone 0.10.0.priority/highShips in current or next milestoneShips in current or next milestonestatus/acceptedDirection approved, safe to start work.Direction approved, safe to start work.status/triagedInitial agentic triage complete; pending maintainer ratification (silence = approval).Initial agentic triage complete; pending maintainer ratification (silence = approval).theme/portabilityOne manifest, every target. Multi-target deploy, marketplace, packaging, install.One manifest, every target. Multi-target deploy, marketplace, packaging, install.type/bugSomething does not work as documented.Something does not work as documented.
Type
Projects
Status
Todo
Summary
DependencyReference.parse()rejects the natural full-URL form for an Azure DevOps repository with a sub-path:This is the URL ADO's browser shows. Users paste it straight into
apm.ymland hitValueError: Invalid Azure DevOps repository path. The shorthand form (dev.azure.com/<org>/<project>/_git/<repo>/<sub-path>) and the object form (git: <url>+path: <sub-path>) both work for the same dependency, so the failure mode is "the most natural URL is the only one that doesn't work."Reproduction
Full matrix exercised locally on
main:dev.azure.com/<o>/<p>/_git/<r>dev.azure.com/.../<r>#v2.0dev.azure.com/.../<r>/<sub>dev.azure.com/.../<r>/<sub>#v2.0https://dev.azure.com/<o>/<p>/_git/<r>https://dev.azure.com/.../<r>#v2.0https://dev.azure.com/.../<r>/<sub>https://dev.azure.com/.../<r>/<sub>#v2.0Root cause (likely)
src/apm_cli/models/dependency/reference.py:602-610strips the_gitsegment for ADO and then asserts a 3-segment path (org/project/repo). When the path includes a sub-path, the post-strip segment list is longer than 3 and the strict check fires before the virtual-path detection that handles the same case in the shorthand branch.The shorthand branch handles this correctly (the OK rows above). The full-URL branch needs to either (a) defer the 3-segment check until after virtual-path detection, or (b) reuse whatever logic the shorthand branch already has.
Acceptance criteria
tests/unit/test_ado_path_structure.pycovering all 8 shapes plus the 3 object-form variants exercised above.*.visualstudio.comlegacy URLs.docs/src/content/docs/guides/dependencies.mdto drop the "URL form not yet accepted" warning added in docs: clarify APM's role for skills, unify plugins-as-packages, add ADO sub-path examples, state stability #1127 once the fix lands.Failing test (repro, ready to add to the suite)
The first 6 rows pass on
main. The last 2 rows fail withValueError: Invalid Azure DevOps repository path.User impact
Surfaced via user feedback on agent-asset distribution. They reported the dependency "could not get it to work (failed)" - this URL form is the most likely cause given how ADO's UI presents repo URLs. Workarounds exist (shorthand, object form) and are now documented in #1127, but the natural pasted URL should also work.
Related