backstage / community-plugins

Community plugins for Backstage

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

PedroAlmondo opened this issue Β· comments

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

  • Request is properly formulated
  • 400: InputError is not returned in response
  • List of runs in Azure Pipelines is properly rendered for multiple build definitions

πŸ‘Ž Actual Behavior with Screenshots

  • Request with multiple entityRef params is send
  • 400: InputError is returned in response
  • List of runs in Azure Pipelines is not properly rendered for multiple build definitions
    image

πŸ‘Ÿ 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?

  • I checked and didn't find similar issue

🏒 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

Thanks for reporting this @PedroAlmondo πŸ‘

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.

Contributions welcome!

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

Closing as completed by #564