community-plugins icon indicating copy to clipboard operation
community-plugins copied to clipboard

🐛 Bug Report: Azure build definition fails when multiple builds are in the annotation

Open slobodnic opened this issue 1 year ago • 5 comments

📜 Description

When specifying multiple build definitions with the dev.azure.com/build-definition, I'm getting and error message:

Error 400: InputError

Message Invalid entityRef, not a string

👍 Expected behavior

According to the documentation, the plugin supports multiple build definitions separated by comma. I would expect the plugin to retrieve the builds for all the definitions.

👎 Actual Behavior with Screenshots

Returns an error 400 on the second build definition. The first build definition is retrieved correctly, but it looks like on the request for the second build definition, the entityRef is duplicated:

http://localhost:7007/api/azure-devops/builds/{Org}?definitionName={build-definition}&top=25&entityRef=component%3Adefault%2F{component-name}&entityRef=component%3Adefault%2F{component-name}

👟 Reproduction steps

On cataolg-info.yaml add

dev.azure.com/build-definition: build-definition1,build-definition2. Navigate to the CI/CD tab for the given component

📃 Provide the context for the Bug.

No response

🖥️ Your Environment

No response

👀 Have you spent some time to check if this bug has been raised before?

  • [X] I checked and didn't find similar issue

🏢 Have you read the Code of Conduct?

Are you willing to submit PR?

Yes I am willing to submit a PR!

slobodnic avatar Jun 28 '24 19:06 slobodnic

The Azure DevOps plugin has been moved to the Community Plugins repo, I'll move this issue there. 👍

awanlin avatar Jun 28 '24 20:06 awanlin

Alright, now that we have this in the right place I wanted to follow up that this has been fixed by https://github.com/backstage/community-plugins/pull/564 and is just pending release. Plan to do that soon, by the end of next week ideally.

awanlin avatar Jun 28 '24 20:06 awanlin

I am curious, you found the documentation about this plugin in the Community Plugins repo but you logged the Issue in the main Backstage repo, why did you do that? I'm wondering if maybe we need to update our docs somewhere 🤔

awanlin avatar Jun 28 '24 20:06 awanlin

I was looking at the code in https://github.com/backstage/backstage/blob/dbde3fa79fdc7bd57ee456c222b320ee39d871b0/plugins/azure-devops/src/api/AzureDevOpsClient.ts to try to understand where the bug is. This was a miss on my side.

slobodnic avatar Jun 28 '24 20:06 slobodnic

No worries, I hadn't considered that you might have looked up the historical code from when it was in the main repo 👍

awanlin avatar Jun 28 '24 20:06 awanlin