Skip to content

[Bug] az devops invoke --area build contains two resources named "changes" #1012

@bryanbcook

Description

@bryanbcook

Describe the bug
When I use az devops invoke for Builds - Get Build Changes it fails and prompts for parameters for Builds - Get Changes Between Builds

My investigation suggests there are 2 endpoints with the same area and resourceName.

az devops invoke --query "[?area=='build' && resourceName=='changes']"

produces the following:

[
  {
    "area": "build",
    "id": "f10f0ea5-18a1-43ec-a8fb-2042c7be9b43",
    "maxVersion": 6.0,
    "minVersion": 2.1,
    "releasedVersion": "0.0",
    "resourceName": "changes",
    "resourceVersion": 3,
    "routeTemplate": "{project}/_apis/{area}/{resource}"
  },
  {
    "area": "build",
    "id": "54572c7b-bbd3-45d4-80dc-28be08941620",
    "maxVersion": 6.0,
    "minVersion": 2.0,
    "releasedVersion": "5.1",
    "resourceName": "changes",
    "resourceVersion": 2,
    "routeTemplate": "{project}/_apis/{area}/builds/{buildId}/{resource}"
  }
]

To Reproduce
Azure Cli Version: 2.7.0
Azure-Devops extension version: 0.18.0

Steps to reproduce the behavior:

  1. login using az login
  2. setup defaults for organization
  3. Run the following (with proper values for project and buildId)
az devops invoke --area build --resource changes --route-parameters project=myProject buildId=1234 --api-version 5.1-preview
  1. Fails with the following error: fromBuildId or toBuildId is null. Supply a valid value and try again.

The debug logs confirm that the 1st resource template is being used:

3108 : 2020-06-07 18:11:38,681 : DEBUG : azext_devops.devops_sdk.client : Route template: {project}/_apis/{area}/{resource}
3108 : 2020-06-07 18:11:38,682 : DEBUG : azext_devops.devops_sdk.client : Api version '5.1-preview'
3108 : 2020-06-07 18:11:38,683 : DEBUG : azext_devops.devops_sdk.client : GET https://dev.azure.com/my-org/my-projectname/_apis/build/changes

Expected behavior
Given that there are two endpoints with the same area and resource, it appears to be using the first one instead of the second. Is there a way to provide more information to the command-line to ensure the 2nd one is used?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions