backstage / community-plugins

Community plugins for Backstage
Apache License 2.0
132 stars 130 forks source link

šŸ› azure-devops: 400 Bad Request on Azure Pipelines with multiple build definitions #544

Closed PedroAlmondo closed 2 months ago

PedroAlmondo commented 2 months ago

Plugin Name

azure-devops

šŸ“œ Description

When there is single dev.azure.com/build-definition defined in an entity, everything works fine, however when there are more build definitions, 400 Bad Request error is thrown. It's 400: InputError with message "Invalid entityRef, not a string".

I've done a little investigation on this and it's probably because in getBuildRuns() entityRef query parameter is appended for each of the build definitions, so the request params look like definitionName=xyz&entityRef=xyz&entityRef=xyz and it cannot be properly processed. Fix seems to be pretty straightforward.

šŸ‘ Expected behavior

šŸ‘Ž Actual Behavior with Screenshots

šŸ‘Ÿ Reproduction steps

  1. Go to Azure Pipelines tab of an Entity with multiple build definitions

šŸ“ƒ Provide the context for the Bug.

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?

No, I don't have time to work on this right now

awanlin commented 2 months ago

Thanks for reporting this @PedroAlmondo šŸ‘

awanlin commented 2 months ago

Something about this block needs to be adjusted:

https://github.com/backstage/community-plugins/blob/d03a500d5dcbab25672b3748abe94155736fbcea/workspaces/azure-devops/plugins/azure-devops/src/api/AzureDevOpsClient.ts#L176C5-L195C6

I'm just not sure exactly the right change to make right now but that's the area of focus for this bug.

awanlin commented 2 months ago

Contributions welcome!

PedroAlmondo commented 2 months ago

I am going to provide a PR with a fix today šŸ”§

awanlin commented 2 months ago

Closing as completed by #564