backstage / community-plugins

Community plugins for Backstage
Apache License 2.0
148 stars 163 forks source link

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

Closed slobodnic closed 1 month ago

slobodnic commented 3 months ago

📜 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?

🏢 Have you read the Code of Conduct?

Are you willing to submit PR?

Yes I am willing to submit a PR!

awanlin commented 3 months ago

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

awanlin commented 3 months ago

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 commented 3 months ago

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 🤔

slobodnic commented 3 months ago

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.

awanlin commented 3 months ago

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